midion2
Sends noteon and noteoff messages to the MIDI OUT port when triggered by a value different than zero.
Syntax
Initialisation
iport -- MIDI output port, optional set to 0.
Performance
kchn -- MIDI channel (1-16)
knum -- MIDI note number (0-127)
kvel -- note velocity (0-127)
ktrig -- trigger input signal (normally 0)
Similar to midion, this opcode sends noteon and noteoff messages to the MIDI out port, but only when ktrig is non-zero. This opcode is can work together with the output of the trigger opcode.
midion2 turns off only notes it sent. Each trigger turns off the last note before sending the new one, and the release turns it off, on the port the note went to. A note still sounding at a tie or a reinit pass is turned off by the next trigger or the release, and when the instrument ends without a release, for instance through turnoff2 with krelease 0, or the performance stops, it is turned off then. A channel above 16 is sent on channel 16.
Csound 7.0.0 and earlier sent a noteoff for channel 1, note 0 before the first note, sent a channel above 16 on channel 1, and left a note sounding when its instrument ended without a release.
Examples
Here is an example of the midion2 opcode. It uses the file midion2.csd.
See also
Credits
Author: Gabriel Maldonado
Italy
1998
New in Csound version 3.492
Thanks goes to Rasmus Ekman for pointing out the correct MIDI channel and controller number ranges.