You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
context.editor exposes the active editor surface, model, cursor state, quantize helper, and selection object.
Properties
Property
Type
Writable
Example
Description
activeRegion
object
no
—
Active region surface. Only available when editing a region/part.
cursorInfo
object
no
—
Cursor position data.
environment
object
no
—
Editor environment surface.
model
object
no
—
Editor model surface.
selection
object
no
—
Selection control surface.
quantize
object
no
—
Quantize grid helper.
Methods
Method
Returns
Parameters
Description
canSelect(note)
number
note (object, req)
Checks if a note can be selected. Returns 1 if selectable.
createSelectFunctions(functions)
object
functions (object, req): context.functions.
Builds a selection helper surface.
deleteItem(note)
—
note (object, req)
Deletes a note from the editor.
editItem(note)
number
note (object, req)
Starts editing a note in place. Returns 1 on success.
isSameItem(n1, n2)
number
n1, n2 (object, req)
Checks if two references point to the same item. Returns 1 if same, 0 if different.
showSelection(show)
—
show (boolean, req): Show or hide.
Shows or hides the current selection.
sizeAdjacent()
—
(none)
Resizes adjacent items to fill gaps.
sizeLeft(event, size)
object
event (object, req), size (number, req)
Resize left edge of an event by the given amount.
sizeRight(event, size)
object
event (object, req), size (number, req)
Resize right edge of an event by the given amount.
suspendFollowEvents()
—
(none)
Suspends follow-event mode.
SelectFunctions
Returned by editor.createSelectFunctions(functions). The journal methods (beginMultiple, endMultiple, setJournalEnabled, isJournalEnabled) are the same as context.functions — see functions.md.
Properties
Property
Type
Writable
Example
Description
executeImmediately
number
yes
1
0 = defer operations, 1 = execute immediately.
Methods
Method
Returns
Parameters
Description
selectMultiple(events)
—
events (array, req): Array of event objects.
Selects multiple events.
Active Region
context.editor.activeRegion exposes the active region surface.
Method
Returns
Parameters
Description
createSequenceIterator()
object
(none)
Creates an iterator over the sequence's note events.
getSoundVariationForNote(note)
number
note (note event, req): A note event from the iterator.
Returns the sound variation index.
getLyricsForNote(note)
object
note (note event, req): A note event from the iterator.
context.editor.cursorInfo exposes cursor position data. The cursorTime, loopStart, and loopEnd properties return time objects — see Time Object for their full surface.
The arranger event object shares the same properties as other event types — see Event Object — Arranger Events for the full surface (name, startTime, endTime, length, lengthTime, color).
Working Pattern:
vararranger=context.editor.model.arranger;vartrack=arranger.getArrangerTrack();varstart=fn.newMediaTime();varend=fn.newMediaTime();start.musical=1;// Start at beat 1end.musical=9;// End at beat 9 (8 beats long)varevent=arranger.addArrangerEvent(track,start,end);fn.renameEvent(event,"Section Name");fn.colorizeEvent(event,colorIntValue);arranger.showArrangerTrack();
Quantize
context.editor.quantize provides a quantize grid helper. Time objects passed to these methods are modified in-place.