midifilein
Returns a generic MIDI message from a MIDI file.
Syntax
Initialization
index -- zero-based MIDI event index, from 0 to midifilevents minus 1.
id (optional, default=0) -- MIDI file id, defaults to 0, the id of any file passed to the -F flag.
status -- 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 if the file ID or event index is invalid. In this case, all five outputs are zero.
chan -- MIDI channel (1-16 if only one input port is used, higher if channel is port mapped.)
data1, data2 -- message-dependent data values
time -- event time in seconds from the start of the MIDI file.
Performance
Same as above, but operational only at performance time. Users should select the appropriate overload for init or perf-time.
Examples
Here is an example of the midifilein opcode. It uses the file midifilein.csd.
See also
Sensing and Control: Tempo and Sequencing
Credits
Author: Victor Lazzarini
May 2025
New in Csound 7