Module midi
midi
Class midi
midi:add (midi) | callback executed when midi device is added |
midi:remove (midi) | callback executed when midi device is removed |
midi:send (self, data) | send midi out an output device |
midi:note_on (note, vel, ch) | send midi note on event. |
midi:note_off (note, vel, ch) | send midi note off event. |
midi:cc (cc, val, ch) | send midi continuous controller event. |
midi:pitchbend (val, ch) | send midi pitchbend event. |
midi:key_pressure (note, val, ch) | send midi key pressure event. |
midi:channel_pressure (val, ch) | send midi channel pressure event. |
midi:program_change (val, ch) | send midi program change event. |
midi:start () | send midi start event. |
midi:stop () | send midi stop event. |
midi:continue () | send midi continue event. |
midi:clock () | send midi clock event. |
midi:song_position (lsb, msb) | send midi song position event. |
midi:song_select (val) | send midi song select event. |
midi:connect ([n]) | connects to a device |
Midi.to_data (msg) | convert msg to data (midi bytes). |
Midi.to_msg (data) | convert data (midi bytes) to msg. |
Class midi
midi device (input or output)
- midi:add (midi)
-
callback executed when midi device is added
Parameters:
- midi dev midi device
- midi:remove (midi)
-
callback executed when midi device is removed
Parameters:
- midi dev midi device
- midi:send (self, data)
-
send midi out an output device
Parameters:
- midi:note_on (note, vel, ch)
-
send midi note on event.
Parameters:
- note integer : note number
- vel integer : velocity
- ch integer : midi channel
- midi:note_off (note, vel, ch)
-
send midi note off event.
Parameters:
- note integer : note number
- vel integer : velocity
- ch integer : midi channel
- midi:cc (cc, val, ch)
-
send midi continuous controller event.
Parameters:
- cc integer : cc number
- val integer : value
- ch integer : midi channel
- midi:pitchbend (val, ch)
-
send midi pitchbend event.
Parameters:
- val integer : value
- ch integer : midi channel
- midi:key_pressure (note, val, ch)
-
send midi key pressure event.
Parameters:
- note integer : note number
- val integer : value
- ch integer : midi channel
- midi:channel_pressure (val, ch)
-
send midi channel pressure event.
Parameters:
- val integer : value
- ch integer : midi channel
- midi:program_change (val, ch)
-
send midi program change event.
Parameters:
- val integer : value
- ch integer : midi channel
- midi:start ()
- send midi start event.
- midi:stop ()
- send midi stop event.
- midi:continue ()
- send midi continue event.
- midi:clock ()
- send midi clock event.
- midi:song_position (lsb, msb)
-
send midi song position event.
Parameters:
- lsb integer :
- msb integer :
- midi:song_select (val)
-
send midi song select event.
Parameters:
- val integer : value
- midi:connect ([n])
-
connects to a device
Parameters:
- n integer (1-32) (optional)
- Midi.to_data (msg)
-
convert msg to data (midi bytes).
Parameters:
- msg table :
Returns:
-
table
data : table of midi status and data bytes
- Midi.to_msg (data)
-
convert data (midi bytes) to msg.
Parameters:
- data table :
Returns:
-
table
msg : midi message table, contents vary depending on message