// adding SqrOsc, a filter, and a shred to sweep the filter // concurrently with playing the notes // patch SqrOsc s => LPF f => ADSR e => JCRev r => dac; Envelope e2 => blackhole; // set env params e.set( 5::ms, 5::ms, .5, 10::ms ); // close the env e.keyOff(); // ketchup .025 => r.mix; .5 => r.gain; // quarter note 200::ms => dur quarter; // time float t; // spork sweep spork ~ sweep(); // go while( true ) { // play play( 60, .8, quarter ); play( 74, .8, quarter ); play( 67, .8, quarter ); play( 65, .8, quarter ); play( 64, .8, quarter*2 ); // rest quarter => now; play( 76, .8, quarter ); play( 72, .8, quarter ); play( 71, .8, quarter ); } // play fun void play( float pitch, float velocity, dur T ) { // open the env pitch => Std.mtof => s.freq; // start the attack e.keyOn(); // reset t 0 => t; // wait T-e.releaseTime() => now; // close the env e.keyOff(); // let it release e.releaseTime() => now; } // sweep fun void sweep() { 10 => f.Q; // go! while( true ) { // sweep 500 + (Math.sin(t)+1)/2*2000 => f.freq; // increment .15 +=> t; // advance time 10::ms => now; } }