2 summary:: Monitors another UGen to see when it is finished
3 related:: Classes/FreeSelfWhenDone, Classes/PauseSelfWhenDone
4 categories:: UGens>Synth control
8 Some UGens, such as link::Classes/PlayBuf::, link::Classes/RecordBuf::, link::Classes/Line::, link::Classes/XLine::, link::Classes/EnvGen::, link::Classes/Linen::, link::Classes/BufRd::, link::Classes/BufWr::, link::Classes/Dbufrd::, and the Buffer delay UGens set a 'done' flag when they are finished playing. This UGen echoes that flag when it is set to track a particular UGen.
22 SynthDef("Done-help", { arg out, t_trig;
27 a= SinOsc.ar(440,0,0.1*line); //sound fading out
28 b= WhiteNoise.ar(Done.kr(line)*0.1); //noise starts at end of line
30 Out.ar(out, Pan2.ar(a+b));
34 Synth("Done-help"); //note that this synth doesn't have it's own doneAction, so you'll need to manually deallocate it