2 summary:: Monitors another UGen to see when it is finished
3 related:: Classes/FreeSelfWhenDone, Classes/PauseSelfWhenDone, Reference/UGen-doneActions
4 categories:: UGens>Synth control
8 Some UGens set a 'done' flag when they are finished playing. This UGen echoes that flag when it is set to track a particular UGen.
10 The UGens trackable by Done are:
12 ## link::Classes/PlayBuf::
13 ## link::Classes/RecordBuf::
14 ## link::Classes/Line::
15 ## link::Classes/XLine::
16 ## link::Classes/EnvGen::
17 ## link::Classes/Linen::
18 ## link::Classes/BufRd::
19 ## link::Classes/BufWr::
20 ## link::Classes/Dbufrd::
21 ## link::Classes/Dbufwr::
22 ## link::Classes/DiskIn::
23 ## link::Classes/VDiskIn::
24 ## link::Classes/Demand::
37 The 'done' flag can be used to trigger other things in the same synth:
40 SynthDef("Done-help", { arg out, t_trig;
45 a= SinOsc.ar(440,0,0.1*line); //sound fading out
46 b= WhiteNoise.ar(Done.kr(line)*0.1); //noise starts at end of line
48 Out.ar(out, Pan2.ar(a+b));
52 Synth("Done-help"); //note that this synth doesn't have it's own doneAction, so you'll need to manually deallocate it
54 The 'done' flag can be used to trigger a delayed freeing of the current synth, which is not possible by using link::Reference/UGen-doneActions:: :
57 var env = Line.kr(1,0,2);
58 var sig = PinkNoise.ar(env);
59 FreeSelf.kr(TDelay.kr(Done.kr(env),3));