SndBuf buffy; // delay DelayL delay => dac; delay => Gain g => delay; // max 1::second => delay.max; // load "special:dope.wav" => buffy.read; // silence it 0 => buffy.gain; while( true ) { // play it! play( buffy, delay, .5, 60, .8, .25::second ); play( buffy, delay, .5, 62, .8, .25::second ); play( buffy, delay, .5, 64, .8, .25::second ); play( buffy, delay, .5, 67, .75, .25::second ); // advance time .25::second => now; } fun void play( SndBuf buf, DelayL delay, float gain, float pitch, float attenuation, dur T ) { // connect buf => delay; // attenuation attenuation => g.gain; // freq pitch => Std.mtof => float freq; // sample rate second / samp => float SRATE; // delay in samples (SRATE / freq)::samp => delay.delay; // set the playhead 0 => buf.pos; // set the gain gain => buf.gain; // advance T => now; // disconnect buf =< delay; }