// probability // uniform distribution fun float uniform() { return Std.rand2f(0,1); } // linear low pass fun float llp() { return Math.min( uniform(), uniform() ); } // linear high pass fun float lhp() { return Math.max( uniform(), uniform() ); } // mean fun float mean() { return (uniform() + uniform()) / 2; } // exponential fun float expo( float lambda ) { return -Math.log(1-uniform()) / lambda; } // synthesis Rhodey foo => NRev r => dac; // reverb .1 => r.mix; // time loop while( true ) { // set the frequency 20 + uniform()*100 => Std.mtof => foo.freq; // note on 1 => foo.noteOn; // advance time 120::ms => now; } // approximation for gaussian fun float gauss() { float sum; repeat( 12 ) uniform() +=> sum; return (sum / 12); }