// me patch of uJens BandedWG b => Envelope e => JCRev r => Gain g => Pan2 p => dac; // some parameters 0.7 => g.gain; 0.1 => r.mix; // take care of the panning p.left => dac.chan(0); p.right => dac.chan(1); 0.0 => p.pan; // slewers 0.0 => float p_target; 0.0 => float p_inc; // BandedWG parameters // presets (found from the ChucK demos) - dese is sweet 0.324 => b.bowPressure; 0.98 => b.bowRate; 0.9 => b.strikePosition; 1 => b.preset; // notes to play with [1, 3, 5, 8, 10, 12] @=> int notes[ ]; // set the envelope duration so it doesn't end with some // hard clicky sound e.keyOff( ); 1::second => e.duration; // spork our panning interpolation spork ~ interp_pan( ); while( true ) { // get the frequencies from notes // change the number after the '+' to 34, 46, 58, or 70 // and things as such (for diff octaves) Std.mtof(notes[Std.rand2(0, 5)] + 58) => b.freq; // randomize the panning Std.rand2f( -1.0, 1.0 ) => p_target; // randomize the gain Std.rand2f( 0.3, 0.9 ) => b.gain; // start the bowing and note 0.8 => b.startBowing; e.keyOn( ); // randomize the time Std.rand2f(3.0, 5.0)::second => now; // trigger envelope off e.keyOff( ); 1::second => now; // stop the bowage 0.1 => b.stopBowing; 1::second => now; } // interpolate panning // interpolate r fun void interp_pan( ) { 0.02 => float slew; while (1) { (p_target - p_inc) * slew + p_inc => p_inc => p.pan; 10 :: ms => now; } }