Browsing StarfallEx's section
โ† Back to ACE
Back to StarfallEx

Part of StarfallEx namespace

๐Ÿ”— External
hook.add("MIDI", "name", function(time, command, param1, param2) end)
View on GitHub|lua/starfall/libs_cl/midi.lua:27
๐Ÿ“‹ Has LDoc๐Ÿ‘๏ธ 0 viewsUpdated 2 months ago

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

NameTypeDescription
timenumberthe exact systime at which the event occurred
commandnumberthe command code of the event. First 4 bits are the command code and last 4 are the channel
param1numberEach command has their own set of parameters, see above
param2numberEach 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.