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.
The UGens trackable by Done are:
src |
The UGen to monitor |
The 'done' flag can be used to trigger other things in the same synth:
The 'done' flag can be used to trigger a delayed freeing of the current synth, which is not possible by using doneActions alone:
A number of UGens implement doneActions. These allow one to optionally free or pause the enclosing synth and other related nodes when the UGen is finished. You can use the constants in this class to name doneActions, which can be clearer than using the number codes alone. The available doneActions are as follows:
name | value | description |
none | 0 | do nothing when the UGen is finished |
pauseSelf | 1 | pause the enclosing synth, but do not free it |
freeSelf | 2 | free the enclosing synth |
freeSelfAndPrev | 3 | free both this synth and the preceding node |
freeSelfAndNext | 4 | free both this synth and the following node |
freeSelfAndFreeAllInPrev | 5 | free this synth; if the preceding node is a group then do g_freeAll on it, else free it |
freeSelfAndFreeAllInNext | 6 | free this synth; if the following node is a group then do g_freeAll on it, else free it |
freeSelfToHead | 7 | free this synth and all preceding nodes in this group |
freeSelfToTail | 8 | free this synth and all following nodes in this group |
freeSelfPausePrev | 9 | free this synth and pause the preceding node |
freeSelfPauseNext | 10 | free this synth and pause the following node |
freeSelfAndDeepFreePrev | 11 | free this synth and if the preceding node is a group then do g_deepFree on it, else free it |
freeSelfAndDeepFreeNext | 12 | free this synth and if the following node is a group then do g_deepFree on it, else free it |
freeAllInGroup | 13 | free this synth and all other nodes in this group (before and after) |
freeGroup | 14 | free the enclosing group and all nodes within it (including this synth) |
freeSelfResumeNext | 15 | free this synth and resume the following node |
For information on freeAll
and deepFree
, see Group and Server Command Reference.
Another way to free a synth when some UGen is done playing is to use FreeSelfWhenDone, or FreeSelf in combination with Done. For example, this can be used to delay the freeing to let reverb tails fade out, etc.