midiout_i — Sends a generic MIDI message to the MIDI OUT port.


Sends a generic MIDI message to the MIDI OUT port.


midiout_i istatus, ichan, idata1, idata2


istatus -- the type of MIDI message. Can be:

  • 128 (note off)

  • 144 (note on)

  • 160 (polyphonic aftertouch)

  • 176 (control change)

  • 192 (program change)

  • 208 (channel aftertouch)

  • 224 (pitch bend)

  • 0 when no MIDI messages must be sent to the MIDI OUT port

ichan -- MIDI channel (1-16)

idata1, idata2 -- message-dependent data values

midiout_i has no output arguments, because it sends a message to the MIDI OUT port implicitly. It works at i-time. It sends a MIDI message only when istatus is non-zero.


Here is an example of the midiout_i opcode. It uses the file midiout_i.csd.

Example 624. Example of the midiout_i opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac -Ma -Q1 ;;;realtime audio out and midi out and midi in (all midi inputs)

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

midiout_i	192, 1, 21, 0	;program change to instr. 21
inum notnum
ivel veloc
midion 1, inum, ivel


i 1 0 3  80 100		;play note for 3 seconds


See also

MIDI Message Output

Generic Input and Output


Author: Gabriel Maldonado

New in Csound version 6.10