X

Table Of Contents
Chapter 9 MIDI plug-ins 187
4 Click the Run Script button.
5 Test your plug-in to verify it behaves as intended.
6 Assuming no errors are shown in the Interactive Console, save the host document, setting, or
patch containing the script.
Scripter API overview
You can create your own MIDI processing plug-ins using the JavaScript API described in these
sections.
MIDI processing functions overview
JavaScript objects overview
Create Scripter controls
Tip: View the supplied scripts in the Script Editor to see how they are constructed. You can
modify and re-use the code to change functions or to create new processors. See Use the
Script Editor.
MIDI processing functions
MIDI processing functions overview
The Scripter plug-in exposes a set of JavaScript functions that you can implement in your script
to communicate with the host application. See the linked sections for details about dierent
JavaScript function types and how to use them to create MIDI plug-ins:
HandleMIDI function
ProcessMIDI function
ParameterChanged function
Reset function
HandleMIDI function
The HandleMIDI() function lets you process MIDI events that the plug-in receives. HandleMIDI
is called each time a MIDI event is received by the plug-in and is required to process incoming
MIDI events. If you do not implement the HandleMIDI function, events pass through the plug-in
unaected.
HandleMIDI is called with one argument, which is a JavaScript object that represents the
incoming MIDI event. HandleMIDI and JavaScript Event object use is shown in the examples.
Code example 1
Pass MIDI events through the plug-in.
function HandleMIDI(event) {
event.send(); }
Code example 2
Log events to the plug-in console and do not send them anywhere.
function HandleMIDI(event) {
event.trace();
}