ModalBar 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; 0.5 => 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 // <<< out[i] >>>; 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.strike; // noteOn } else if (out[0]=="AfterTouch") { // strike vigor Std.atof(out[3]) / 127.0 => strike; } else if (out[0]=="PitchChange") { Std.mtof(Std.atoi(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) cval => m.directGain; // stick mix if (cnum==2) cval => m.stickHardness; // stick hardness if (cnum==4) cval => m.strikePosition; // strike position if (cnum==44) cval => r.mix; // reverb mix if (cnum==16) Std.atoi(out[4])=>m.preset; // which instrument } }