Class midi

midi devices

Functions

midi.add (dev) static callback when any midi device is added.
midi.remove (dev) static callback when any midi device is removed.
_norns.midi.add (id, name, dev) add a device.
_norns.midi.remove (id) remove a device.
_norns.midi.event (id, data) handle a midi event.

Methods

midi:new (id, name, dev) constructor
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.
midi:update_devices () update devices.


Functions

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
_norns.midi.add (id, name, dev)
add a device.

Parameters:

  • id
  • name
  • dev
_norns.midi.remove (id)
remove a device.

Parameters:

  • id
_norns.midi.event (id, data)
handle a midi event.

Parameters:

  • id
  • data

Methods

midi:new (id, name, dev)
constructor

Parameters:

  • id integer : arbitrary numeric identifier
  • name string : name
  • dev userdata : opaque pointer to device
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
midi:update_devices ()
update devices.
generated by LDoc 1.4.6 Last updated 2020-03-28 23:45:19