Shakers m => JCRev r => dac; PRC perry; // substring parser Skot skot; // stdin line grabber // defined out here to alleviate broken garbage collector 1 => int running; string out[6]; int i; int which; float cnum,cval; float strike; // infinite event loop while( running ) { skot.prompt( "" ) => now; // prompt for line while( skot.more() ) // loop over lines { skot.getLine() => perry.set; // set the line 0 => i; while( perry.more() ) // process line { perry.next( out[i] ); // get all fields i + 1 => i; } } if (out[0]=="ExitProgram") 0 => running; // check for Exit else if (out[0]=="NoteOn") { std.atoi(out[3]) => which; which % 22 => cval; (1071, cval) => m.controlChange;// instrument change std.atof(out[3]) / 128.0 => m.noteOn; } else if (out[0]=="NoteOff") 1 => m.noteOff; // noteOff else if (out[0]=="AfterTouch") { // strike vigor std.atof(out[3]) / 127.0 => m.energy;; } else if (out[0]=="PitchBend") { std.mtof(std.atof(out[3])) => m.freq; } else if (out[0]=="ControlChange") { std.atoi(out[3]) => cnum; // control number std.atof(out[4]) / 128.0 => cval; // control value if (cnum==7) cval => r.gain; // master volume if (cnum==1) { (1, cval*128.0) => m.controlChange; // reson. freq. } if (cnum==2) cval => m.energy; // shake it baby! if (cnum==11) cval => m.decay; // system damping if (cnum==4) (cval * 128.0) => m.objects; // number of "beans" if (cnum==44) cval => r.mix; // reverb mix } }