MainStage User Guide
- Welcome
-
- Overview of Edit mode
-
- Select patches and sets in the Patch List
- Copy, paste, and delete patches
- Reorder and move patches in the Patch List
- Add and rename patches
- Create a patch from several patches
-
- Overview of the Patch Settings Inspector
- Select patch settings in the Patch Library
- Set the time signature for patches
- Change the tempo when you select a patch
- Set program change and bank numbers
- Defer patch changes
- Instantly silence the previous patch
- Change patch icons
- Transpose the pitch of incoming notes for a patch
- Change the tuning for a patch
- Add text notes to a patch
-
- Overview of channel strips
- Add a channel strip
- Change a channel strip setting
- Configure channel strip components
- Show signal flow channel strips
- Hide the metronome channel strip
- Create an alias of a channel strip
- Add a patch bus
- Set channel strip pan or balance positions
- Set channel strip volume levels
- Mute and solo channel strips
- Use multiple instrument outputs
- Use external MIDI instruments
- Reorganize channel strips
- Delete channel strips
-
- Overview of the Channel Strip Inspector
- Choose channel strip settings
- Rename channel strips
- Change channel strip colors
- Change channel strip icons
- Use feedback protection with channel strips
- Set keyboard input for a software instrument channel strip
- Transpose individual software instruments
- Filter MIDI messages
- Scale channel strip velocity
- Set channel strips to ignore Hermode tuning
- Override concert- and set-level key ranges
- Add text notes to a channel strip in the Channel Strip Inspector
- Route audio via send effects
-
- Screen Control Inspector overview
- Replace parameter labels
- Choose custom colors for screen controls
- Change background or grouped screen control appearance
- Set screen controls to show the hardware value
- Set parameter change behavior for screen controls
- Set hardware matching behavior for screen controls
- Reset and compare changes to a patch
- Override concert- and set-level mappings
-
- Overview of mapping screen controls
- Map to channel strip and plug-in parameters
- Map screen controls to actions
- Map a screen control to multiple parameters
- Use screen controls to display PDF document pages
- Edit the saved value for a mapped parameter
- Set drum pads or buttons to use note velocity
- Map screen controls to all channel strips in a patch
- Undo screen control parameter mappings
- Remove screen control mappings
- Work with graphs
- Create controller transforms
- Share patches and sets between concerts
- Record the audio output of a concert
-
- Overview of concerts
- Create a concert
- Open and close concerts
- Save concerts
- How saving affects parameter values
- Clean up concerts
- Consolidate assets in a concert
- Rename the current concert
-
- Overview of the Concert Settings Inspector
- Set MIDI Routing to channel strips
- Transpose incoming note pitch for a concert
- Define the program change message source
- Send unused program changes to channel strips
- Set the time signature for a concert
- Change the tuning for a concert
- Set the pan law for a concert
- Add text notes to a concert
- Control the metronome
- Silence MIDI notes
- Mute audio output
-
- Layout mode overview
-
- Screen control parameter editing overview
- Lift and stamp screen control parameters
- Reset screen control parameters
- Common screen control parameters
- Keyboard screen control parameters
- MIDI activity screen control parameters
- Drum pad screen control parameters
- Waveform screen control parameters
- Selector screen control parameters
- Text screen control parameters
- Background screen control parameters
- How MainStage passes through MIDI messages
- Export and import layouts
- Change the aspect ratio of a layout
-
- Before performing live
- Use Perform mode
- Screen controls in performance
- Tempo changes during performance
- Tips for performing with keyboard controllers
- Tips for performing with guitars and other instruments
- Tune guitars and other instruments with the Tuner
- The Playback plug-in in performance
- Record your performances
- After the performance
- Tips for complex hardware setups
-
- Overview of keyboard shortcuts and command sets
-
- Concerts and layouts keyboard shortcuts
- Patches and sets (Edit mode) keyboard shortcuts
- Editing keyboard shortcuts
- Actions keyboard shortcuts
- Parameter mapping (Edit mode) keyboard shortcuts
- Channel strips (Edit mode) keyboard shortcuts
- Screen controls (Layout mode) keyboard shortcuts
- Perform in Full Screen keyboard shortcuts
- Window and view keyboard shortcuts
- Help and support keyboard shortcuts
-
-
- Use MIDI plug-ins
-
- Arpeggiator overview
- Arpeggiator control parameters
- Note order parameters overview
- Note order variations
- Note order inversions
- Arpeggiator pattern parameters overview
- Use Live mode
- Use Grid mode
- Arpeggiator options parameters
- Arpeggiator keyboard parameters
- Use keyboard parameters
- Assign controllers
- Modifier controls
- Note Repeater controls
- Randomizer controls
-
- Use Scripter
- Use the Script Editor
- Scripter API overview
- MIDI processing functions overview
- HandleMIDI function
- ProcessMIDI function
- GetParameter function
- SetParameter function
- ParameterChanged function
- Reset function
- JavaScript objects overview
- Use the JavaScript Event object
- Use the JavaScript TimingInfo object
- Use the Trace object
- Use the MIDI event beatPos property
- Use the JavaScript MIDI object
- Create Scripter controls
- Transposer controls
-
-
- Alchemy overview
- Alchemy interface overview
- Alchemy Name bar
- Alchemy file locations
-
- Alchemy source overview
- Source master controls
- Import browser
- Source subpage controls
- Source filter controls
- Source filter use tips
- Source elements overview
- Additive element controls
- Additive element effects
- Spectral element controls
- Spectral element effects
- Pitch correction controls
- Formant filter controls
- Granular element controls
- Sampler element controls
- VA element controls
- Source modulations
- Morph controls
- Alchemy master voice section
- Alchemy Extended parameters
-
- Playback plug-in overview
- Add a Playback plug-in
- Playback interface
- Use the Playback waveform display
- Playback transport and function buttons
- Playback information display
- Playback Sync, Snap To, and Play From parameters
- Use the Playback group functions
- Use the Playback Action menu and File field
- Use markers with the Playback plug-in
-
- Sample Alchemy overview
- Interface overview
- Add source material
- Edit mode
- Play modes
- Source overview
- Synthesis modes
- Granular controls
- Additive effects
- Additive effect controls
- Spectral effect
- Spectral effect controls
- Filter module
- Low and highpass filter
- Comb PM filter
- Downsampler filter
- FM filter
- Envelope generators
- Mod Matrix
- Modulation routing
- Motion mode
- Trim mode
- More menu
-
- Sculpture overview
- Sculpture interface
- Global parameters
- Amplitude envelope parameters
- Use the Waveshaper
- Filter parameters
- Output parameters
- Define MIDI controllers
- Extended parameters
-
- Copyright
Use the JavaScript Event object in MainStage
When the HandleMIDI function is called, an Event object represents one MIDI event and implements several methods you can call in your script.
The Event object is not instantiated directly, but is a prototype for the following event-specific methods, properties, and types.
Tip: You can use the JavaScript “new” keyword to generate a new instance of an Event object of any type.
Event methods
Event.send(): Send the event.
Event.sendAfterMilliseconds(number ms): Send the event after the specified value has elapsed (can be an integer or a floating point number).
Event.sendAtBeat(number beat): Send the event at a specific beat (floating point number) in the host timeline.
Event.sendAfterBeats(number beat): As above, but uses the beat value as a delay in beats from the current position.
Event.trace(): Print the event to the plug-in console. See Use the Trace object.
Event.toString(): Returns a String representation of the event.
Event properties
Event.toarticulationID(integer number): Sets the articulation ID from 0–254.
Event.channel(number): Set MIDI channel 1 to 16.
Event.beatPos: Retrieves the event’s exact beat position.
Event types
The Event object is a prototype for the following event types. All event types inherit the methods and channel properties described above.
The event types and their properties are passed to HandleMIDI as follows:
NoteOn.pitch(integer number): Pitch from 1–127.
NoteOn.velocity(integer number): Velocity from 0–127. A velocity value of 0 is interpreted as a note off event, not a note on.
NoteOff.pitch(integer number): Pitch from 1–127.
NoteOff.velocity(integer number): Velocity from 0–127.
PolyPressure.pitch(integer number): Pitch from 1–127.
PolyPressure.value(integer number): Define a pressure value from 0–127.
ControlChange.number(integer number): Controller number from 0–127.
ControlChange.value(integer number): Controller value from 0–127.
ProgramChange.number(integer number): Program change number from 0–127.
ChannelPressure.value(integer number): Aftertouch value from 0–127.
PitchBend.value(integer number): 14-bit pitch bend value from -8192–8191. A value of 0 is center.
TargetEvent.target(string): Create user definable MIDI CC messages or control plug-in parameters.
TargetEvent.value(float): Sets the target value.
Load the corresponding Tutorial setting to view the script in the Script Editor. This will help you to understand the syntax structure and layout of code and comments. See Use the Script Editor.
Tutorial script 7: Event Creation
In MainStage, this example replaces every received MIDI event with a modulation control change message.
Text following /* shows comments that explain the JavaScript code.
Tip: You can use the JavaScript “new” keyword to generate a new instance of an Event object of any type.
function HandleMIDI() {
var cc = new ControlChange; /* make a new control change message */
cc.number = 1; /* set it to controller 1 (modulation) */
cc.value = 100; /* set the value */
cc.send(); /* send the event */
cc.trace(); /* print the event to the console */
}
Tutorial script 8: Event Modification
In MainStage, this example replaces every received MIDI event with a C3 note on/off. The example also uses the NeedsTimingInfo variable. See Use the JavaScript TimingInfo object.
Text following /* shows comments that explain the JavaScript code.
Tip: You can use the JavaScript “new” keyword to generate a new instance of an Event object of any type.
var NeedsTimingInfo = true; /* needed for .sendAfterBeats() to work */
function HandleMIDI() {
var on = new NoteOn; /* make a new note on */
on.pitch = 60; /* set its pitch to C3 */
on.send(); /* send the note */
var off = new NoteOff(on); /* make a note off using the note on to initialize its pitch value (to C3) */
off.sendAfterBeats(1); /* send a note off one beat later */
}
Tutorial script 15: Control Plug-ins
In MainStage, you can create user-definable MIDI CC messages, or you can control plug-in parameters. TargetEvent reads the parameter to be modified from a menu where the user can select a destination MIDI CC. Alternately, you can use the Learn Plug-in Parameter feature to assign any plug-in parameter inserted after (below) Scripter in the same channel strip. The chosen destination is saved with the plug-in setting.
Text following /* shows comments that explain the JavaScript code.
Tip: You can use the JavaScript “new” keyword to generate a new instance of an Event object of any type.
TargetEvent properties:
TargetEvent.target(string) /* Name of target menu entry */
TargetEvent.value(float) /* Value of set Target from 0.0 to 1.0 */
The code shown below controls any plug-in parameter with the modwheel. To test the function in Tutorial script 15, insert any plug-in or software instrument on the same channel and run the script. Choose Learn plug-in parameter in the menu, then click any plug-in parameter to control it with the modwheel.
To create a menu for the modwheel target, name the menu entry and set it to a “target” type.
var PluginParameters = [
/* parameter 0 */
{
name:"Modwheel Target",
type:"target"
}];
HandleMIDI is called every time Scripter receives a MIDI event in Tutorial script 15. The code shown below remaps the modulation wheel to the target chosen in the menu.
function HandleMIDI(incomingEvent)
{
/* remap modulation to target selected in menu and
check for incoming CC event with number 1 (Modwheel) */
if ((incomingEvent instanceof ControlChange) && (incomingEvent.number == 1))
{
var newEvent = new TargetEvent(); /* create new Target event */
newEvent.target = "Modwheel Target"; /* name the menu entry to be used by this event */
newEvent.value = incomingEvent.value / 127; /* rescale from 0..127 to 0.0...1.0 */
newEvent.send(); /* send the event */
} else
{
/* send all other events */
incomingEvent.send();
};
};