public class FluteSweep { Flute f; int sweeping; public void connect(UGen ugen) { f => ugen; } // connection public void blow(float freq) { // blow with float argument freq => f.freq; 1 => f.noteOn => f.pressure; spork ~ sweepUp(); } public void blow(int note) { // overload/polymorph function blow(Std.mtof(note)); } // use existing mechanics public void shaddap() { 1 => f.noteOff; // noteOff 0 => sweeping; } private void sweepUp() { 0.5 :: second => now; // let the note establish f.freq() => float temp; temp * 8.0 => float temp2; 1.0 => float bl; 1 => sweeping; while ((temp < temp2) & sweeping) { temp * 1.02 => temp => f.freq; // sweep freq up 0.93 * bl => bl => f.noteOn; // ramp down blowing 0.01 :: second => now; } } }