ChucK + JS => ChucKScript

// HID 1: keyboard organ global Event buttonDown; global Event buttonUp; global int whichButton; // patch BeeThree organ => JCRev r => Echo e => Echo e2 => dac; r => dac; // set delays 240::ms => e.max => e.delay; 480::ms => e2.max => e2.delay; // set gains .6 => e.gain; .3 => e2.gain; .05 => r.mix; 0 => organ.gain; fun void RespondToButtonDown() { while( true ) { buttonDown => now; chout <= IO.newline(); <<< whichButton, "down" >>>; Std.mtof( whichButton - 25 ) => float freq; if( freq > 20000 ) continue; freq => organ.freq; .5 => organ.gain; 1 => organ.noteOn; 80::ms => now; } } spork ~ RespondToButtonDown(); fun void RespondToButtonUp() { while( true ) { buttonUp => now; <<< whichButton, "up" >>>; 0 => organ.noteOff; } } spork ~ RespondToButtonUp(); while( true ) { 1::second => now; }

File name to use in ChucK:

Local file to upload:

Type below in the output to play the keyboard organ!

shred | code | time | remove
--- | --- | --- | ---