Part of StarfallEx namespace
hook.add("MIDI", "name", function(time, command, param1, param2) end)Description
Event hook for midi devices. Everytime a midi device outputs a signal, the callback function on the hook is called. Read up on the MIDI protocol to make better sense of everything -> https://ccrma.stanford.edu/~craig/articles/linuxmidi/misc/essenmidi.html Commands and their parameters: 0x80 NOTE_OFF : param1 = key; param2 = velocity 0x90 NOTE_ON : param1 = key; param2 = velocity 0xA0 AFTERTOUCH : param1 = key; param2 = touch 0xB0 CONTINUOUS_CONTROLLER : param1 = button_number; param2 = button_value 0xC0 PATCH_CHANGE : param1 = patch number; 0xD0 CHANNEL_PRESSURE : param1 = pressure; 0xE0 PITCH_BEND : param1 = lsb(least signifigant bit); param2 = msb(most signifigant bit)
Parameters
| Name | Type | Description |
|---|---|---|
time | number | the exact systime at which the event occurred |
command | number | the command code of the event. First 4 bits are the command code and last 4 are the channel |
param1 | number | Each command has their own set of parameters, see above |
param2 | number | Each command has their own set of parameters, see above |
Returns
No return values documented.
Examples
No examples available.
Used In
No usages found in the codebase.