// our UGen patch ModalBar bar => JCRev r => dac; // set reverb params .1 => r.mix; // sequence of pitches, velocities, durations // each of these arrays must contain same number of elements [ 0, 2, 3, 5, 7 ] @=> int notes[]; [ .9, .6, .7, .8, .9 ] @=> float vels[]; [ .5, .5, .5, .5, 1.0 ] @=> float durs[]; // transpose 48 => int offset; // infinite time loop while( true ) { // loop over sequence for( int i; i < notes.cap(); i++ ) { // play next note playNote( notes[i] + offset, vels[i], durs[i]::second ); } } // function encapsulating note playing fun void playNote( float pitch, float velocity, dur duration ) { // choose pitch pitch => Std.mtof => bar.freq; // sound the note, passing in velocity velocity => bar.noteOn; // advance time duration => now; }