Use the JavaScript Event object

When the HandleMIDI function is called, an Event object represents one MIDI event and implements the following methods you can call in your script:

Event methods

Event types

The event types and their properties are passed to HandleMIDI as follows:

Replace every MIDI event received with a modulation control change message

Replace every MIDI event received with a C3 note on/off