Module midi

midi devices

Functions

Midi.new (id, name, dev) constructor
Midi.add (dev) static callback when any midi device is added.
Midi.remove (dev) static callback when any midi device is removed.
Midi:send (data) send midi event to 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) create device, returns object with handler and send.
Midi.cleanup () clear handlers.
Midi.to_data (msg) convert msg to data (midi bytes).
Midi.to_msg (data) convert data (midi bytes) to msg.


Functions

Midi.new (id, name, dev)
constructor

Parameters:

  • id integer : arbitrary numeric identifier
  • name string : name
  • dev userdata : opaque pointer to device
Midi.add (dev)
static callback when any midi device is added. user scripts can redefine.

Parameters:

  • dev : a Midi table
Midi.remove (dev)
static callback when any midi device is removed. user scripts can redefine.

Parameters:

  • dev : a Midi table
Midi:send (data)
send midi event to device.

Parameters:

  • data
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)
create device, returns object with handler and send.

Parameters:

  • n integer : vport index
Midi.cleanup ()
clear handlers.
Midi.to_data (msg)
convert msg to data (midi bytes).

Parameters:

Returns:

    table data : table of midi status and data bytes
Midi.to_msg (data)
convert data (midi bytes) to msg.

Parameters:

Returns:

    table msg : midi message table, contents vary depending on message
generated by LDoc 1.4.6 Last updated 2021-01-11 12:10:11