X
Table Of Contents
- Logic Pro X Effects
- Contents
- Chapter 1: Amps and pedals
- Chapter 2: Delay effects
- Chapter 3: Distortion effects
- Chapter 4: Dynamics processors
- Chapter 5: Equalizers
- Chapter 6: Filter effects
- Filter effects overview
- AutoFilter
- EVOC 20 Filterbank
- EVOC 20 TrackOscillator
- EVOC 20 TrackOscillator overview
- Vocoder overview
- EVOC 20 TrackOscillator interface
- EVOC 20 TrackOscillator analysis in parameters
- Use EVOC 20 TrackOscillator analysis in
- EVOC 20 TrackOscillator U/V detection parameters
- EVOC 20 TrackOscillator synthesis in parameters
- EVOC 20 TrackOscillator oscillators
- EVOC 20 TrackOscillator formant filter
- EVOC 20 TrackOscillator modulation
- EVOC 20 TrackOscillator output parameters
- Fuzz-Wah
- Spectral Gate
- Chapter 7: Imaging processors
- Chapter 8: Metering tools
- Chapter 9: MIDI plug-ins
- Chapter 10: Modulation effects
- Chapter 11: Pitch effects
- Chapter 12: Reverb effects
- Chapter 13: Space Designer convolution reverb
- Chapter 14: Specialized effects and utilities
- Chapter 15: Utilities and tools
- Appendix: Legacy effects
Chapter 9 MIDI plug-ins 18 8
Code example 3
Repeat notes up one octave with 100ms delay and pass all other events through.
Text following “//” are comments.
function HandleMIDI(event) {
event.send(); // send original event
if (event instanceof Note) { // if it's a note
event.pitch += 12; // transpose up one octave
event.sendAfterMilliseconds(100); // send after delay
}
}
ProcessMIDI function
The ProcessMIDI() function lets you perform periodic (generally timing-related) tasks. This
can be used when scripting a sequencer, an arpeggiator, or another tempo-driven MIDI eect.
ProcessMIDI is generally not required for applications that do not make use of musical timing
information from the host. ProcessMIDI is called once per “process block,” which is determined by
the host’s audio settings (sample rate and buer size).
This function is often used in combination with the "JavaScript TimingInfo object" to make use of
timing information from the host application. The use of ProcessMIDI and the TimingInfo object
is shown in the example. Also see Use the JavaScript TimingInfo object.
Note: To enable the GetTimingInfo feature, you need to add NeedsTimingInfo = true; at the
global script level (outside of any functions).
Code example
// Define NeedsTimingInfo as true at the global scope to enable GetHostInfo()
NeedsTimingInfo = true;
function ProcessMIDI() {
var info = GetTimingInfo(); // get a TimingInfo object from the host
if (info.playing) { // if the transport is running
Trace(info.tempo); // print the tempo in the plugin console
}
}