Mandolin m => JCRev r => dac; StringTokenizer perry; // substring parser ConsoleInput skot; // stdin line grabber // defined out here to alleviate broken garbage collector 1 => int running; string out[6]; int i; 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.mtof(Std.atof(out[3]))=>m.freq; Std.atof(out[4])/128.0 => strike; strike => m.pluck; // noteOn } else if (out[0]=="NoteOff") 1 => m.noteOff; // noteOff else if (out[0]=="AfterTouch") { // strike vigor Std.atof(out[3]) / 127.0 => strike; } 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; // detune if (cnum==2) cval => m.bodySize; // body size if (cnum==4) cval => m.pluckPos; // pluck position if (cnum==11) cval => m.stringDamping; // string damping if (cnum==44) cval => r.mix; // reverb mix // if (cnum==128) { // Std.atoi(out[4])=>m.controlChange; // which mic position // } } }