isactive
Reports whether an instrument instance is active.
Syntax
Initialization and performance
voice is an Instr reference to an initialized instance.
The b output checks the state once at initialization. The B output checks it on every control cycle. Both return a boolean that you can use in an if statement.
An active instance returns true. Pausing it makes this result false. A note can remain active during its release tail, so use isreleasing to check for that stage.
isactive reads the state of an existing instance. It cannot tell whether an uninitialized or deleted reference is safe to use. In particular, do not query a reference returned by schedule before the scheduled note has started.
Examples
The example prints 1 while the voice runs, 0 while it is paused, then 1 when it resumes. The if statement converts the boolean to a number for printk2. It uses instance-controls.csd.
See also
getinstance, isreleasing, pause, Instrument definitions, instances and opcode objects
Credits
Author Victor Lazzarini.
New in Csound 7.