3.5

Table Of Contents
201MainStage Effects
Create and store a Scripter plug-in
1. In MainStage, open the Scripter plug-in.
2. Click the Open Script In Editor button.
3. Type (or copy and paste existing) JavaScript code in the Code Editor.
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.
MainStage Scripter MIDI plug-in API overview
You can create your own MIDI processing plug-ins using the JavaScript API described in
these sections.
MainStage Scripter MIDI plug-in MIDI processing functions
JavaScript objects overview
Create MainStage Scripter MIDI plug-in controls
View the supplied Tutorial 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 MainStage Scripter MIDI plug-in Script Editor.
Note: The supplied Tutorial scripts may vary slightly from the code examples shown in
this documentation, due to post-publication changes in the JavaScriptCore framework or
the Scripter plug-in. Please always use and refer to comments shown in the most recent
Tutorial scripts and JavaScriptCore framework.
MainStage Scripter MIDI plug-in MIDI processing functions
The Scripter plug-in exposes a set of JavaScript functions that you can implement in your
script to communicate with MainStage. See these sections for details about different
JavaScript function types and how to use them to create MIDI plug-ins.
MainStage Scripter MIDI plug-in HandleMIDI function
MainStage Scripter MIDI plug-in ProcessMIDI function
MainStage Scripter MIDI plug-in GetParameter function
MainStage Scripter MIDI plug-in SetParameter function
MainStage Scripter MIDI plug-in ParameterChanged function
MainStage Scripter MIDI plug-in Reset function
MainStage Scripter MIDI plug-in 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 in
order to process incoming MIDI events. If you don’t implement the HandleMIDI function,
events pass through the plug-in unaffected.