title:: UGen done-actions
summary:: Actions to take when an UGen has finished
categories:: UGens, Server>Nodes
related:: Classes/UGen, Classes/Done, Classes/FreeSelfWhenDone
keyword:: doneAction
keyword:: done action
keyword:: done actions
keyword:: doneactions


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.

list::
## link::Classes/PlayBuf::
## link::Classes/RecordBuf::
## link::Classes/EnvGen::
## link::Classes/Line::
## link::Classes/XLine::
## link::Classes/Linen::
## link::Classes/LFGauss::
## link::Classes/DemandEnvGen::
## link::Classes/DetectSilence::
## link::Classes/PlayBuf::
## link::Classes/Duty::
## link::Classes/TDuty::
::

section:: Actions
The available done actions are as follows:
table::
## 0 || do nothing when the UGen is finished
## 1 || pause the enclosing synth, but do not free it
## 2 || free the enclosing synth
## 3 || free both this synth and the preceding node
## 4 || free both this synth and the following node
## 5 || free this synth; if the preceding node is a group then do g_freeAll on it, else free it
## 6 || free this synth; if the following node is a group then do g_freeAll on it, else free it
## 7 || free this synth and all preceding nodes in this group
## 8 || free this synth and all following nodes in this group
## 9 || free this synth and pause the preceding node
## 10 || free this synth and pause the following node
## 11 || free this synth and if the preceding node is a group then do g_deepFree on it, else free it
## 12 || free this synth and if the following node is a group then do g_deepFree on it, else free it
## 13 || free this synth and all other nodes in this group (before and after)
## 14 || free the enclosing group and all nodes within it (including this synth)
::

For information on code::freeAll:: and code::deepFree::, see link::Classes/Group:: and link::Reference/Server-Command-Reference::.

section:: Alternatives
Another way to free a synth when some UGen is done playing is to use link::Classes/FreeSelfWhenDone::, or link::Classes/FreeSelf:: in combination with link::Classes/Done::. For example, this can be used to delay the freeing to let reverb tails fade out, etc.

