0 => int deviceNum; Hid hi; HidMsg msg; if( !hi.openKeyboard( deviceNum ) ) me.exit(); 8 => int Snds;// 8 is pushing it... you need to find the number of sounds that //best suits your needs and your hardware -- this stuff is expensive adc => JCRev rev => blackhole; 0.04 => rev.mix; Step s[Snds*4]; Dyno dynamics; dynamics.limit(); for (0 => int i; i < (Snds*4); i++) { s[i] => dynamics; 0 => s[i].next; } dynamics => dac; int fs; int j; 3 => int sec; (1::second/1::samp) $ int => fs; sec * fs => int length; float recording[Snds][length]; float stepstore[Snds*4]; int playNum[Snds]; [20, 26, 8, 21, 23, 28, 24, 12] @=> playNum;//, 18] @=> playNum;//q - o int playLowNum[Snds]; [4, 22, 7, 9, 10, 11, 13, 14] @=> playLowNum;//, 15] @=> playLowNum;//a - l int playHighNum[Snds]; [29, 27, 6, 25, 5, 17, 16, 54] @=> playHighNum;//123455, 55] @=> playHighNum;//z - . 0 => int count; 1. => float normalizer; //{ //************************************************************** fun void recordIt( int which ) //************************************************************** { for (0 => int i; i < length; i++) { rev.last() => recording[which][i];// => s[which].next;//stepstore[which]; 1::samp => now; } } //************************************************************** fun void playIt( int which ) //************************************************************** { for (0 => int i; i < length; i++) { recording[which][i] => s[which + Snds].next;//stepstore[which + 4]; 1::samp => now; } } //************************************************************** fun void playItLow( int which ) //************************************************************** { for (0 => int i; i < (length - 1); i++) { recording[which][i] => s[which + (Snds * 2)].next;//stepstore[which + 18]; 1::samp => now; (recording[which][i+1] + recording[which][i]) / 2. => s[which + (Snds * 2)].next;//stepstore[which + 8];//linear interp 1::samp => now; } } //************************************************************** fun void playItHigh( int which ) //************************************************************** { for (0 => int i; i < (length / 2); i++) { recording[which][i*2] => s[which + (Snds * 3)].next;//stepstore[which + 12]; 1::samp => now; } } //************************************************************** //MAIN BLOCK //************************************************************** while( true ) { hi => now; while( hi.recv( msg ) ) { if( msg.isButtonDown() ) { if((msg.which >= 30) && (msg.which <= (30 + Snds))) { spork ~ recordIt(msg.which - 30); <<< msg.which - 30, "" >>>; } for (0 => int i; i < Snds; i++) { if( msg.which == playNum[i] ) spork ~ playIt(i); } for (0 => int i; i < Snds; i++) { if( msg.which == playLowNum[i] ) spork ~ playItLow(i); } for (0 => int i; i < Snds; i++) { if( msg.which == playHighNum[i] ) spork ~ playItHigh(i); } } } }