Pilcrow Records

Scripter Javascript Tutorial

javascriptmusiclogicscripterbookexcerpttutorial

57 MIDI Events are Objects

Working with MIDI Events lies at the core of Scripter and all MIDI Events are handled as Objects. All Events, regardless of type, share the properties and methods listed in Table 1.

Common Event Object Properties
Property Arguments Returned Value Notes
beatPos N/A Float The beat position where the event will trigger its send() function.
articulationID N/A Integer The articulation ID of the event. The specifics of the returned value depends on the instrument being used in the track. Logic Pro will usually handle articulations as Strings via Pulldown and Target Menus in the UI, but in Scripter these are always handles as Integer.
channel N/A Integer The MIDI channel for the Event.
Function Arguments Returned Value Notes
send() N/A N/A Sends the event to the next step in the data chain.
sendAfterMilliseconds() N/A Milliseconds as Integer or Float Sends the event after the specified value has elapsed.
sendAtBeat() Beats as Float N/A Sends the event when the specified value elapses.
trace() N/A N/A Writes the string returned by toString() directly to the Console.
toString() N/A String Returns a human-readable summary of the event, which is different than looking at the JSON directly.
channel() Integer between 1–16 N/A Sets the MIDI channel for the Event.