// synchronize to perid 500::ms => dur T; T - (now % T) => now; // % does a modulo // our UGen patch ModalBar bar => JCRev r => dac; // set reverb params .05 => r.mix; //sequence of notes [60, 62, 63, 65, 67] @=> int notes[]; // infinite time loop while( true ) { // equivalent pitches for (int i; i < notes.cap(); i++) { playNote( notes[i], .9, 500::ms); } } // 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; }