Module midi

midi devices

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.
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.
update_devices () update devices.
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.


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
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:

Returns:

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

Parameters:

Returns:

    table msg : midi message table, contents vary depending on message
update_devices ()
update devices.
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
generated by LDoc 1.4.6 Last updated 2019-11-14 23:40:48