Module midi
midi devices
The norns script reference has examples for this module.
Functions
new (id, name, dev) | constructor |
add (dev) | static callback when any midi device is added. |
remove (dev) | static callback when any midi device is removed. |
send (data) | send midi event to device. |
note_on (note, vel, ch) | send midi note on event. |
note_off (note, vel, ch) | send midi note off event. |
cc (cc, val, ch) | send midi continuous controller event. |
pitchbend (val, ch) | send midi pitchbend event. |
key_pressure (note, val, ch) | send midi key pressure event. |
channel_pressure (val, ch) | send midi channel pressure event. |
program_change (val, ch) | send midi program change event. |
start () | send midi start event. |
stop () | send midi stop event. |
continue () | send midi continue event. |
clock () | send midi clock event. |
song_position (lsb, msb) | send midi song position event. |
song_select (val) | send midi song select event. |
clock_receive (enabled) | enable/disable clock reception from this device |
connect (n) | create device, returns object with handler and send. |
cleanup () | clear handlers. |
to_data (msg) | convert msg to data (midi bytes). |
to_msg (data) | convert data (midi bytes) to msg. |
Functions
- new (id, name, dev)
-
constructor
Parameters:
- id integer : arbitrary numeric identifier
- name string : name
- dev userdata : opaque pointer to device
- add (dev)
-
static callback when any midi device is added.
user scripts can redefine.
Parameters:
- dev : a Midi table
- remove (dev)
-
static callback when any midi device is removed.
user scripts can redefine.
Parameters:
- dev : a Midi table
- send (data)
-
send midi event to device.
Parameters:
- data
- note_on (note, vel, ch)
-
send midi note on event.
Parameters:
- note integer : note number
- vel integer : velocity
- ch integer : midi channel
- note_off (note, vel, ch)
-
send midi note off event.
Parameters:
- note integer : note number
- vel integer : velocity
- ch integer : midi channel
- cc (cc, val, ch)
-
send midi continuous controller event.
Parameters:
- cc integer : cc number
- val integer : value
- ch integer : midi channel
- pitchbend (val, ch)
-
send midi pitchbend event.
Parameters:
- val integer : value
- ch integer : midi channel
- key_pressure (note, val, ch)
-
send midi key pressure event.
Parameters:
- note integer : note number
- val integer : value
- ch integer : midi channel
- channel_pressure (val, ch)
-
send midi channel pressure event.
Parameters:
- val integer : value
- ch integer : midi channel
- program_change (val, ch)
-
send midi program change event.
Parameters:
- val integer : value
- ch integer : midi channel
- start ()
- send midi start event.
- stop ()
- send midi stop event.
- continue ()
- send midi continue event.
- clock ()
- send midi clock event.
- song_position (lsb, msb)
-
send midi song position event.
Parameters:
- lsb integer :
- msb integer :
- song_select (val)
-
send midi song select event.
Parameters:
- val integer : value
- clock_receive (enabled)
-
enable/disable clock reception from this device
Parameters:
- enabled boolean
- connect (n)
-
create device, returns object with handler and send.
Parameters:
- n integer : vport index
- cleanup ()
- clear handlers.
- to_data (msg)
-
convert msg to data (midi bytes).
Parameters:
- msg table :
Returns:
-
table
data : table of midi status and data bytes
- to_msg (data)
-
convert data (midi bytes) to msg.
Parameters:
- data table :
Returns:
-
table
msg : midi message table, contents vary depending on message