turnoff2 Instrument Control:Duration Control turnoff2 turnoff2 Turn off instance(s) of other instruments at performance time. Description Turn off instance(s) of other instruments at performance time. Syntax turnoff2 kinsno, kmode, krelease turnoff2_i insno, imode, irelease Initialization insno -- 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) Performance kinsno -- 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 also Duration Control Statements Credits Author: Istvan Varga 2005 New in Csound 5.00