Skip to content

onInput()

Set up a function to call for a particular kind of MIDI event.

midiin.onInput(eventType, action)

Call this again with different event types to handle each kind separately (one function per event type). Using ALL_EVENTS catches every event not already handled.

Parameters

midiin.onInput(eventType, action)
Parameter Type Default Description
eventType int required The MIDI event type to handle, or ALL_EVENTS for anything not handled.
action function required The function to call; it receives four parameters: eventType, channel, data1, and data2.