X

Table Of Contents
Chapter 9 MIDI plug-ins 18 9
GetParameter function
The GetParameter() function retrieves information from parameters dened with
var PluginParameters.
The GetParameter name argument must match the dened PluginParameters name value.
Code use example
Text following “//” describes the argument function. Open the Mod Wheel Glissando JavaScript in
the Script Editor to see how the GetParameter function is used.
note.velocity = GetParameter("Note Velocity"); // used within a HandleMIDI
function, retrieves "Note Velocity" information from the defined "Note
Velocity" parameter
var PluginParameters = [{name:"name:"Note Velocity", type:"lin", minValue:1,
maxValue:127, numberOfSteps:126, defaultValue:80"}]; // create a linear
parameter called "Note Velocity" with a range of 1 to 127, and a default
value of 80
ParameterChanged function
The ParameterChanged() function lets you perform tasks triggered by changes to plug-in
parameters. ParameterChanged is called each time one of the plug-ins parameters is set to a
new value. ParameterChanged is also called once for each parameter when you load a plug-in
setting.
ParameterChanged is called with two arguments, rst the parameter index (an integer number
starting from 0), then the parameter value (a number).
Code example
Print parameter changes to the plug-in console. This example also creates a slider in the plug-in
window and assigns the ParameterChanged function to it.
Text following “//” describes the argument function.
var PluginParameters = [{name:"Slider"}]; // create a slider (default range 0.0
- 1.0)
function ParameterChanged(param, value) {
if (param == 0) // if it's the slider you just
created
Event.trace(value); // print the value to the console
}
Reset function
Reset() is called when the plugin is reset.