massign — Assigns a MIDI channel number to a Csound instrument.
ichnl -- MIDI channel number (1-16).
insnum -- Csound orchestra instrument number. If zero or negative, the channel is muted (i.e. it doesn't trigger a csound instrument, though information will still be received by opcodes like midiin).
“insname” -- A string (in double-quotes) representing a named instrument.
ireset -- If non-zero resets the controllers; default is to reset.
Assigns a MIDI channel number to a Csound instrument. Also useful to make sure a certain instrument (if its number is from 1 to 16) will not be triggered by midi noteon messages (if using something midiin to interpret midi information). In this case set insnum to 0 or a negative number.
If ichan is set to 0, the value of insnum is used for all channels. This way you can route all MIDI channels to a single Csound instrument. You can also disable triggering of instruments from MIDI note events from all channels with the following line:
massign 0,0
This can be useful if you are doing all MIDI evaluation within Csound with an always on instrument(e.g. using midiin and turnon) to avoid doubling the instrument when a note is played.