turnoff2Instrument Control:Duration Controlturnoff2turnoff2
Turn off instance(s) of other instruments at performance time.
Description
Turn off instance(s) of other instruments at performance time.
Syntaxturnoff2 kinsno, kmode, krelease
turnoff2_i insno, imode, irelease
Initializationinsno
-- instrument to be turned off (can be fractional) if zero or
negative, no instrument is turned off
imode
-- sum of the following values:
0, 1, or 2: turn off all instances (0), oldest only
(1), or newest only (2)
4: only turn off notes with exactly matching
(fractional) instrument number, rather than ignoring
fractional part
8: only turn off notes with indefinite duration (p3
< 0 or MIDI)
irelease
-- if non-zero, the turned off instances are allowed to release,
otherwise are deactivated immediately (possibly resulting in
clicks)
Performancekinsno
-- instrument to be turned off (can be fractional) if zero or
negative, no instrument is turned off
kmode
-- sum of the following values:
0, 1, or 2: turn off all instances (0), oldest only
(1), or newest only (2)
4: only turn off notes with exactly matching
(fractional) instrument number, rather than ignoring
fractional part
8: only turn off notes with indefinite duration (p3
< 0 or MIDI)
krelease
-- if non-zero, the turned off instances are allowed to release,
otherwise are deactivated immediately (possibly resulting in
clicks)
As a rule of thumb, you should turn off instruments with a higher instrument number than the one where turnoff is called, as doing otherwise might cause initialization issues.
Examples
Here is an example of the turnoff2 opcode. It uses the file turnoff2.csd.
Example of the turnoff2 opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.See alsoDuration Control StatementsCreditsAuthor: Istvan Varga2005New in Csound 5.00