Selectors
Selectors narrow the current editor selection to elements matching a criterion. They can be composed: apply one selector to establish a scope, then apply another to refine the result within that scope.
For example, selecting a region of measures and then applying selectChords will select only the chords within those measures.
Type selectors
Section titled “Type selectors”These selectors filter the current scope by node type.
selectNotes
Section titled “selectNotes”Selects all note nodes within the current scope.
|: C D E F | G A B c :| ^ ^Applying selectNotes to the first measure selects C, D, E, F.
selectChords
Section titled “selectChords”Selects all chord nodes (square-bracket groups) within the current scope.
[CEG] A [FAc] B^ ^selectRests
Section titled “selectRests”Selects all rest nodes within the current scope.
C z D z2 E ^ ^selectNonChordNotes
Section titled “selectNonChordNotes”Selects notes that are not children of a chord. Given a mix of chords and standalone notes, this picks only the standalone ones.
C [CEG] D [FAc] E^ ^ ^selectChordNotes
Section titled “selectChordNotes”Selects notes that are direct children of a chord. This is the inverse of selectNonChordNotes.
[CEG] D [FAc] ^^^ ^^^selectNotesOrChords
Section titled “selectNotesOrChords”Selects all notes and chords within the current scope. Unlike selectNotes (which only selects individual notes), this selector includes both standalone notes and chord groups.
C [CEG] D [FAc] E^ ^ ^ ^ ^selectRhythm
Section titled “selectRhythm”Selects all rhythm nodes within the current scope. Useful for inspecting or modifying durations without affecting pitch.
selectRhythmParent
Section titled “selectRhythmParent”Selects all nodes that have a rhythm child — i.e. notes, chords, and rests that carry a duration value.
Chord note selectors
Section titled “Chord note selectors”These selectors operate on the notes inside chord brackets.
selectTop
Section titled “selectTop”From each chord in scope, selects only the topmost (highest-pitched) note.
[CEG] -> G selected[FAc] -> c selectedselectBottom
Section titled “selectBottom”From each chord in scope, selects only the bottommost (lowest-pitched) note.
[CEG] -> C selected[FAc] -> F selectedselectNthFromTop
Section titled “selectNthFromTop”From each chord in scope, selects the Nth note from the top. Takes n as an argument (1-indexed, where 1 is the top).
[CEGB] with n=2 -> G selectedselectAllButTop
Section titled “selectAllButTop”From each chord in scope, selects all notes except the topmost.
[CEG] -> C, E selectedselectAllButBottom
Section titled “selectAllButBottom”From each chord in scope, selects all notes except the bottommost.
[CEG] -> E, G selectedDelimiter selectors
Section titled “Delimiter selectors”These selectors work like text objects in vim: “inside” selects the content between delimiters, “around” selects the delimiters as well.
selectInsideChord / selectAroundChord
Section titled “selectInsideChord / selectAroundChord”selectInsideChord selects the notes between the chord brackets. selectAroundChord expands the selection to include the brackets themselves.
[CEG] ^^^ <- inside^^^^^ <- aroundselectInsideGraceGroup / selectAroundGraceGroup
Section titled “selectInsideGraceGroup / selectAroundGraceGroup”Same pattern for grace note groups delimited by braces.
{abc} ^^^ <- inside^^^^^ <- aroundselectInsideInlineField / selectAroundInlineField
Section titled “selectInsideInlineField / selectAroundInlineField”Same pattern for inline fields delimited by [ and ].
[K:Dm] ^^^^ <- inside^^^^^^ <- aroundselectInsideGrouping / selectAroundGrouping
Section titled “selectInsideGrouping / selectAroundGrouping”Same pattern for groupings delimited by parentheses.
Structure selectors
Section titled “Structure selectors”These selectors expand the scope to larger structural units.
selectMeasures
Section titled “selectMeasures”Splits the selection by barlines, returning one selection per measure.
C D E F | G A B c | d e f g |^^^^^^^ ^^^^^^^ ^^^^^^^selectSystem
Section titled “selectSystem”Expands the selection to cover the entire system (line) that the selection touches.
selectVoices
Section titled “selectVoices”Selects all tune-body elements belonging to one or more voice IDs. Takes a voice ID string as an argument.
selectTune
Section titled “selectTune”Expands the selection to cover the enclosing tune. If no scope is set, selects all tunes in the file.