active
Returns the number of active instances of an instrument with options to ignore releasing instances.
Syntax
Initialization
insnum -- number or string name of the instrument to be reported
Sinsname -- instrument name
iopt -- select currently active (zero, default), or all every active (non zero)
inorel -- if non-zero ignore instruments in release phase (zero, default), only valid if iopts is zero.
Performance
kinsnum -- number or string name of the instrument to be reported
active returns the number of active instances of instrument number insnum/kinsnum (or named instrument Sinsname). As of Csound 4.17 the output is updated at k-rate (if input arg is k-rate), to allow running count of instr instances.
As of Csound 5.17 if the instrument number is given as zero then all instruments are counted.
Examples
Here is a simple example of the active opcode. It uses the file active-modern.csd.
Here is a simple example of the active opcode. It uses the file active.csd.
Its output should include lines like this:
Here is a more advanced example of the active opcode. It displays the results of the active opcode at k-rate instead of i-rate. It uses the file active_k-modern.csd.
Here is a more advanced example of the active opcode. It displays the results of the active opcode at k-rate instead of i-rate. It uses the file active_k.csd.
Its output should include lines like:
Here is another example of the active opcode, using the number of instances to calculate gain. It uses the file active_scale-modern.csd.
Here is another example of the active opcode, using the number of instances to calculate gain. It uses the file active_scale.csd.
See also
Credits
Author: John ffitch
University of Bath/Codemist Ltd.
Bath, UK
July, 1999
Examples written by Kevin Conder.
New in Csound version 3.57; named instruments added version 5.13
Option for all ever active new in 5.13
Count of all instruments new in 5.17
No release option new in 5.19