Search Syntax
TL;DR
You can replace most parts with the wildcards * or ? to search for analyses containing what you're looking for.
You can also add NOT (!) and OR (||) conditions.
It's hard to explain in a couple of sentences, but the syntax follows MStruct itself: keep the parts you want to specify and replace the rest with *—most of the time.
A few examples will probably make it easier to follow.
Each query below has concrete matching sources, counterexamples and reasons. A match means that the whole query finds at least one source window. Unless a row supplies other settings, its source begins with {BN:1}{TS:4/4}{D:1}{TC:C}; semicolons separate source measures. A {GLOBAL_TAGS} line belongs in metadata.
One event and an ordered sequence
Syntax / fields:
C|I / C|I,G|VA query event describes one source event to be matched.
A harmonic query event supplies both a chord field and a Roman field, separated by |.
A whole-field * leaves that side unconstrained.
The equivalent explicit form uses [C:chord|R:roman].
C| is valid in MAIN but requires C|* in a search.
Top-level commas request a sequence of adjacent events in the stated order.
Queries use these commas across source measure boundaries and do not accept measure-ending semicolons.
All conditions attached to one query event must hold together.
A result window identifies the source events that satisfy the sequence.
Repeated visits to those same events can share one result window.
Query example 1
C|I,G|VSource example | Result and explanation |
|---|---|
| Match: C|I is followed by G|V across the barline, so the two events satisfy the query in order. |
| No match: The ordinary F|IV event intervenes between C|I and G|V and breaks the requested adjacency. |
Query example 2
[C:C|R:I]Source example | Result and explanation |
|---|---|
| Match: The event C|I has exact chord C and exact Roman I, so it satisfies both query fields. |
Complete fields and equivalent chord notation
Syntax / fields:
Cm6|* / *|V7Complete concrete chord queries match the same final bass pitch class and complete pitch-class set by default.
The final bass is the root of the structure after slash and on operations.
Cm6 and Am7b5/C both have bass C and notes C, Eb, G, A.
G/C and CM9no3 both have bass C and notes C, D, G, B.
A different final bass gives a different match even if the absolute pitch-class set is unchanged.
Matching ignores enharmonic spelling, octave doubling and note order.
Add --notallowdifferentnotation after the query to compare chord notation; each query permits this option at most once.
Notation comparison still normalizes formal and legacy altered-note lists.
Configured special chords use their interpreted sets; unknown historical exact special tokens remain searchable by source identity.
Exact Roman queries retain their written identities.
The main symbol or a same-domain alternative can satisfy a positive query.
Either eligible layer of a dual Roman analysis can match, and a Roman sequence follows a continuous tonal path.
Query example 1
C7|*Source | Result and explanation |
|---|---|
| Match C7 matches the exact chord field, and * accepts the Roman IDM7. |
| No match The chord CM7 has a major seventh, so its complete symbol differs from the required C7. |
Query example 2
*|V7Source | Result and explanation |
|---|---|
| Match The Roman field is exactly V7, and * accepts the chord G7. |
| No match The Roman field V65 specifies a different inversion from the exact query V7. |
Query example 3
Cm6|*Source | Result and explanation |
|---|---|
| Match Am7b5/C has final bass C and the same complete set C, Eb, G, A as Cm6. |
| No match Both chords have a different final bass from C, so neither is equivalent to Cm6. |
Query example 4
Cm6|* --notallowdifferentnotationSource | Result and explanation |
|---|---|
| Match The option requests notation matching, and the source is written Cm6. |
| No match Am7b5/C has an equivalent final set and bass but uses a different notation. |
Query example 5
G/C|*Source | Result and explanation |
|---|---|
| Match Both chords have final bass C and complete set C, D, G, B. |
| No match The complete absolute set is unchanged, but the final bass is G. |
Compiler-atom wildcards
Syntax / fields:
* / ?A wildcard stands for part of a valid chord or Roman symbol.
Chord fields containing * or ? match notation, including when equivalent chord notation is enabled by default.
Outside lists, ? matches exactly one compiler atom and * matches zero or more atoms.
A compiler atom is one meaningful unit produced by symbol parsing.
A root and its accidental form one note atom, so ? can match F# as a unit.
Fixed keywords and figure groups have their own atom boundaries.
Every pattern must allow at least one valid concrete symbol.
A whole-field * accepts an omitted field and excludes an explicit field placeholder X or continuation -.
Query example 1
C*|*Source | Result and explanation |
|---|---|
| Match Each chord has root C. The suffix * matches the empty suffix, m7 and 7/E, producing three single-event windows. |
| No match C# is one complete root atom, so the fixed root C fails before the suffix wildcard is applied. |
Query example 2
?m7|*Source | Result and explanation |
|---|---|
| Match The ? matches the complete root atom C, F# or Bb. All three chords then match the fixed m7 suffix. |
| No match Cm has suffix m, while the query requires the complete suffix m7. |
Query example 3
*|V*Source | Result and explanation |
|---|---|
| Match All three Roman symbols begin with V. The suffix * matches the empty suffix, 6 and 7. |
| No match The source Roman v is lowercase, while the query requires uppercase V. |
List-item wildcards
Syntax / fields:
C13(b5,*)|* / Cadd(?)|*In altered, add, sus, no, q4, q5 and nf lists, wildcards match complete list items.
A ? matches exactly one item, and a * matches one or more items.
The complete list must match in its written order.
For example, C13(b5,*) requires b5 followed by at least one further item.
A[q4:*], D[q5:*] and C[nf:*] abbreviate wildcard queries for those complete nonempty lists.
Query example 1
C13(b5,*)|*Source example | Result and explanation |
|---|---|
| Match: Both lists begin with the required b5. The * matches b9 in the first chord and b9,#9 in the second. |
| No match: The list ends after b5, leaving no item for the required nonempty *. |
Query example 2
Cadd(?)|*Source example | Result and explanation |
|---|---|
| Match: Each add list contains exactly one item. The ? matches the whole item 9 or #11. |
| No match: The source add list contains two items, while ? requires exactly one. |
Query example 3
A[q4:*]|*Source example | Result and explanation |
|---|---|
| Match: Both chords have root A and a nonempty q4 list. The * matches the complete list 4,b7 or #4,7,10. |
Query example 4
C[nf:*]|*Source example | Result and explanation |
|---|---|
| Match: Both chords have root C and a nonempty nf list. The * matches the complete list 0,4,7 or 0,3,7,10. |
Figured-bass chain inheritance
When a query includes a figured-bass list, an intermediate event can match using the chain head's complete Roman token together with that event's list. The token retains its case, quality, special symbols and applied target. Results still point to the actual intermediate event; notation and source text are unchanged.
For example, in V[5,3-],V[6,4-],V[5,3], each of V[6,4], V[6,4-], *[6,4-], [6,4-] and [6,4] matches the second event; vi[6,4] does not.
A search list is validated independently and does not need the chain-start marker required by composition syntax. Its item count, range, order, accidentals and applied-target syntax are still validated.
If a query omits the ending marker or writes -, it places no restriction on the source ending: continuing, natural-ending and explicit -x events can match. An explicit -x query matches only a source event that actually has -x. Complete-field OR and NOT use the same rules.
Actual adjacency and transparent events
Syntax / fields:
C|*,G|*Adjacent query positions follow the actual playback route, including repeat jumps and selected endings.
Events in mutually exclusive endings therefore cannot form one adjacent sequence.
A transparent event is skipped while the matcher searches for the next requested event.
Bare continuations (-), unrequested rests (0) and, by default, secondary events are transparent.
An explicitly requested rest occupies one query position.
An intervening ordinary harmonic event that fails the next condition breaks the window.
Repeated traversals through the same source event IDs produce one visual result window.
Query example 1
C|*,G|*Source example | Result and explanation |
|---|---|
| Match: The query skips the unrequested rest 0, so C and G satisfy its two consecutive positions. |
| Match: The query skips the single-quoted secondary F|IV by default, so C and G satisfy its two positions. |
| No match: The ordinary F|IV event participates in matching and interrupts the requested C-to-G sequence. |
Query example 2
C|*,0,G|*Source example | Result and explanation |
|---|---|
| Match: The three source events satisfy the requested chord C, rest 0 and chord G in order. |
| No match: The source has no rest between C and G, so it fails the middle query position 0. |
Including secondary events
Syntax / fields:
--notignore2ndThe --notignore2nd option includes secondary events marked by single quotes in sequence matching.
They can satisfy a requested position or interrupt adjacency as ordinary events do.
The option follows the event query with intervening whitespace.
Each query permits this option at most once.
Query example 1
C|*,G|* --notignore2ndSource example | Result and explanation |
|---|---|
| Match: C and G are adjacent source events and satisfy both query positions. |
| No match: The --notignore2nd option makes the secondary F|IV participate in matching, so it interrupts the C-to-G sequence. |
TC constraints: ordinary, Ambi and None
Syntax / fields:
{TC:C} / {TC:M} / {TC:"M"} / {TC:None}A TC condition tests the tonal reference in effect at an event, including an inherited reference.
An unquoted concrete center such as C selects an ordinary reference.
Unquoted M, m and * select any ordinary major reference, any ordinary minor reference and any ordinary reference, respectively.
Quoted values "C", "M", "m" and "*" apply the corresponding tests to ambiguous references (Ambi).
None selects an explicitly cleared reference and excludes an initially undefined reference.
A query without a TC condition allows Roman matches under ordinary or ambiguous references.
Consecutive Roman matches must follow one underlying note-and-mode path.
Changing only the certainty from C to "C" preserves that path.
Query example 1
{TC:M}*|VSource example | Result and explanation |
|---|---|
| Match: G|V inherits ordinary TC C, and A|V uses ordinary TC D. Both events have Roman V under a major reference, as required by M. |
| No match: The event has Roman V, but its quoted TC "C" is an ambiguous reference. The unquoted M condition requires an ordinary major reference. |
Query example 2
{TC:"M"}*|IV7Source example | Result and explanation |
|---|---|
| Match: The event has exact Roman IV7 under ambiguous major TC "C", satisfying the quoted "M" condition. |
| No match: Roman IV7 matches, but ordinary TC C fails the condition for an ambiguous major reference. |
Query example 3
{TC:None}C|*Source example | Result and explanation |
|---|---|
| Match: The event has exact chord C under explicitly cleared TC None. The whole-field * accepts the omitted Roman field. |
| No match: The chord C matches, but the active TC C fails the required None state. |
TS constraints
Syntax / fields:
{TS:3/4} / {TS:*/4} / {TS:adlib}A TS condition tests the meter in effect at an event, including an inherited meter.
The complete value, numerator or denominator can use *.
For example, */4 accepts both 3/4 and 4/4.
The value adlib matches free meter exactly.
Each numeric component must be a positive integer no greater than 2147483647.
Event searches do not accept D or BN conditions.
Query example 1
{TS:3/4}*|*Source example | Result and explanation |
|---|---|
| Match: Both C|I and G|V inherit TS 3/4, so each satisfies one single-event query window. |
| No match: C|I uses TS 4/4, while the query requires exact TS 3/4. |
Query example 2
{TS:*/4}*|*Source example | Result and explanation |
|---|---|
| Match: C|I uses TS 4/4, and G|V uses TS 3/4. Both denominators equal the required 4. |
| No match: C|I uses TS 6/8, whose denominator 8 fails the required denominator 4. |
Local and global active tags
Syntax / fields:
<PAC> / <Mode_Dorian:*>A tag condition selects events carrying the requested active tag.
It uses the tag name in angle brackets and omits the MAIN closing slash.
The active set combines local ranges, applicable one-shot or end tags and global tags (GLOBAL_TAGS).
A complete exact tag identity can remain searchable independently of the current default vocabulary.
Parameterized cadence, pedal, Centricity and configured Mode or Scale tags accept * or ? in the complete parameter position.
Each wildcard selects any one permitted parameter.
A fixed name containing a colon, such as IAC:not_tonic, is matched as a name rather than a parameterized family.
Query example 1
<PAC>Source example | Result and explanation |
|---|---|
| Match: The end tag </PAC> labels the C|I arrival, so only that event satisfies <PAC>. |
Query example 2
<Mode_Dorian:*>Source example | Result and explanation |
|---|---|
| Match: Both events lie in the active Mode_Dorian:D range. The * accepts its complete parameter D. |
| No match: The source tag belongs to Mode_Phrygian, while the query fixes the family to Mode_Dorian. |
Query example 3
<PC:?>Source example | Result and explanation |
|---|---|
| Match: The C|I event carries the end tag PC:IV. The ? matches the complete permitted parameter IV. |
| Match: The C|I event carries the end tag PC:iv. The ? also accepts the complete permitted parameter iv. |
Metadata-only global-tag condition
Syntax / fields:
--globaltag:<Tonality>The --globaltag option filters documents by items in metadata GLOBAL_TAGS.
A tag written only in MAIN fails this metadata condition.
Every distinct --globaltag condition in a query must be satisfied.
The option can be used alone or combined with an event query.
The option accepts DTC conditions, including unordered pairs and major/minor wildcards, but excludes Seq and SeqInv.
Form admission follows the allow_global column of the bound configuration.
Query example 1
--globaltag:<Tonality>Source example | Result and explanation |
|---|---|
| Match: The metadata GLOBAL_TAGS contains </Tonality>, satisfying the document-level condition. |
| No match: Tonality appears only in MAIN, while --globaltag requires it in metadata GLOBAL_TAGS. |
Query example 2
*|I --globaltag:<Sonata_Form>Source example | Result and explanation |
|---|---|
| Match: GLOBAL_TAGS contains Sonata_Form, satisfying the document filter. Only C|I has the required Roman I. |
| No match: C|I satisfies the Roman condition, but Sonata_Form appears only in MAIN and fails the global-tag condition. |
Query example 3
--globaltag:<DTC:C,a>Source example | Result and explanation |
|---|---|
| Match: The global pair a,C is the same unordered pair as C,a. |
| No match: A local DTC satisfies an event condition but not this metadata-only filter. |
Form and DTC state
Syntax / fields:
<Pop_Form:Verse> / <DTC:M,m>A form condition tests the implicit or explicit form state on the actual traversal.
The termination marker FORM_END is excluded from active search targets.
A double-tonic complex condition (DTC) tests an unordered pair of tonal references.
For example, C,a and a,C select the same pair.
Each member can use an exact reference, M, m, * or ?.
M,m selects one major and one minor reference in any key relationship.
TC and Roman conditions must be specified separately when required.
A global form classification or global DTC also supplies the active state for event queries.
Use --globaltag to require that it originates in metadata.
Query example 1
<Pop_Form:Verse>Source example | Result and explanation |
|---|---|
| Match: The implicit Verse marker establishes an active state for C|I and the following G|V, so both events match. |
Query example 2
<DTC:C,a>Source example | Result and explanation |
|---|---|
| Match: The active pair a,C contains the same references as C,a. Both events inherit this unordered pair and match. |
| Match: Both events inherit the global DTC pair a,C. |
Query example 3
<DTC:M,m>Source example | Result and explanation |
|---|---|
| Match: The active pair D,b contains one ordinary major reference and one ordinary minor reference, satisfying M,m. |
| No match: The active pair C,G contains two major references and lacks the minor reference required by M,m. |
Query example 4
<DTC:*,*>Source example | Result and explanation |
|---|---|
| Match: The two wildcards accept the two members C and G of the active DTC pair. |
| No match: The source event has no active DTC pair, so neither wildcard has a pair member to match. |
Seq/SeqInv list query
Syntax / fields:
<Seq:A2,*> / <SeqInv:?> / <Seq:A2*> / <Seq:A2?>A Seq or SeqInv condition matches the complete active type list in its written order.
Seq and SeqInv select their respective tag families.
Exact items use the literal spellings in the rule configuration.
A ? matches one type, and a * matches one or more types.
An exact base-type item such as A2 matches only that literal type; a derived type requires its complete literal name.
Appending * or ? to a configured base type instead selects one member of its type family.
For example, A2* and A2? each match either A2 or one of its configured derived types, such as A2(+5/-4).
Both family forms consume exactly one list item.
These conditions apply to active event tags and cannot be used as GLOBAL_TAGS filters.
Query example 1
<Seq:A2,*>Source example | Result and explanation |
|---|---|
| Match: The active Seq list begins with A2, and the nonempty * matches the remaining D2. Both events lie in that tagged range. |
| No match: The Seq list ends after A2, leaving no further type for the required nonempty *. |
Query example 2
<SeqInv:?>Source example | Result and explanation |
|---|---|
| Match: The active SeqInv list contains exactly one type A2, satisfying ?. Both events lie in that tagged range. |
| No match: The SeqInv list contains A2 and D2, while ? requires exactly one type in the complete list. |
Query example 3
<Seq:A2>Source example | Result and explanation |
|---|---|
| Match: The complete active Seq list is the single exact type A2. |
| No match: The derived type A2(+5/-4) has a different literal name from exact A2. |
Query example 4
<Seq:A2*>Source example | Result and explanation |
|---|---|
| Match: A2* selects one member of the configured A2 family, which includes the derived type A2(+5/-4). |
| No match: A3 belongs to a different type family and fails the A2* item. |
Query example 5
<Seq:A2?>Source example | Result and explanation |
|---|---|
| Match: A2? selects one member of the A2 family, including the base type A2 itself. |
| Match: The derived type A2(+4/-3) is one configured member of the A2 family and satisfies A2?. |
| No match: The family item A2? consumes exactly one type; it cannot match the complete two-item list A2,D2. |
Visible and hidden BPM settings
Syntax / fields:
{BPM:1/4=[90~120]}A BPM condition selects an explicit BPM or BPMhidden setting attached to an event.
Inherited tempo and tempo derived from MM are outside this condition.
The beat numerator, beat denominator and tempo count each accept *.
An exact tempo may use a decimal value.
A tempo range [lo~hi] includes both integer endpoints and requires lo<=hi.
Both visible and hidden settings use BPM in the query.
The query setting name BPMhidden is unsupported.
Query example 1
{BPM:1/4=[90~120]}Source example | Result and explanation |
|---|---|
| Match: C|I carries BPM 1/4=90, and G|V carries BPMhidden 1/4=120. Both use the required beat unit and lie at included endpoints of 90~120. |
| No match: The explicit tempo 121 exceeds the query range upper endpoint 120. |
Query example 2
{BPM:*/*=*}Source example | Result and explanation |
|---|---|
| Match: The query accepts explicit BPM and BPMhidden settings. Its three wildcards accept both 1/4=120 and 3/8=80. |
| No match: C|I has no attached explicit BPM or BPMhidden setting, which this query requires. |
Explicit metric modulation
Syntax / fields:
{MM:1/4=1/8} / {MM:*}An MM condition selects the event carrying an explicit metric modulation setting.
The condition applies once at that event.
Later events inheriting the resulting tempo do not satisfy it through inheritance.
The components of the conversion can use *.
A complete value * selects any explicit MM.
Query example 1
{MM:1/4=1/8}Source example | Result and explanation |
|---|---|
| Match: G|V carries the exact explicit MM 1/4=1/8. The preceding C|I carries BPM only, so only G|V matches. |
| Match: The explicit MM matches without any preceding numeric BPM. |
Query example 2
{MM:*}Source example | Result and explanation |
|---|---|
| Match: The wildcard accepts MM 1/4=1/8 on G|V and MM 1/8=1/2 on the final C|I. The first C|I carries BPM only and falls outside the MM condition. |
| No match: The event carries BPM 1/4=120 but has no explicit MM setting. |
NR sequences
Syntax / fields:
[NR:P?] / [NR:*]An NR condition selects an explicit transformation annotation bound to an event.
Literal P, L and R strings and single N, S or H use the source grammar.
Within the transformation pattern, ? matches one step and * matches one or more steps.
For example, P? accepts PL but excludes a lone P.
Query example 1
[NR:P?]Source example | Result and explanation |
|---|---|
| Match: The Cm|i event carries NR PL. The fixed P matches its first step, and ? matches its second step L. |
| No match: The annotation P contains one step, while P? requires P followed by one more step. |
Query example 2
[NR:*]Source example | Result and explanation |
|---|---|
| Match: The Cm|i and Db|bII events carry explicit NR annotations PLR and N. The * accepts each complete nonempty annotation. |
| No match: Neither event carries an NR annotation, so the required explicit transformation is absent. |
M/MH constraints
Syntax / fields:
{M:G|V} / {MH:*|*}An M or MH condition selects the corresponding explicit modulation event.
The target accepts a concrete ordinary or quoted reference, an ordinary-reference wildcard * or an ambiguous-reference wildcard "*".
Bare M and m mode wildcards are excluded from the target.
The relation accepts a basic Roman symbol or *.
An OR group can choose between complete M and MH query events.
These two settings exclude OR groups inside their values.
Query example 1
{M:G|V}Source example | Result and explanation |
|---|---|
| Match: The D|ii&V event carries explicit pivot modulation M with target G and relation V, satisfying both exact values. |
Query example 2
{MH:*|*}Source example | Result and explanation |
|---|---|
| Match: The G|I event carries explicit MH with target G and relation V. The two * values accept that target and relation. |
| No match: The G|I event changes TC to G but carries no MH setting, so the required modulation type is absent. |
Query example 3
({M:G|V}||{MH:G|V})Source example | Result and explanation |
|---|---|
| Match: The D|ii&V event satisfies the first OR branch {M:G|V}. |
| Match: The G|I event satisfies the second OR branch {MH:G|V}. |
Relative chord notes
Syntax / fields:
(0)m|*,(2)m|*,(4)|*A relative note uses a parenthesized integer from -24 to 24 in place of an absolute chord note.
It can occupy a chord root, slash bass or the corresponding positions on either side of a polychord.
All relative notes in the query share one unknown offset modulo 12.
The integer gives a semitone position relative to that offset.
For example, roots (0), (2) and (4) request successive positions two semitones apart under one transposition.
Complete relative chords use the same final-bass and pitch-set equivalence as complete absolute chords.
For example, (0)m6|*,(2)m6|* matches Am7b5/C followed by Bm7b5/D, preserving the final-bass interval C to D.
Concrete and relative notes can be combined; concrete notes keep their fixed pitches.
The --notallowdifferentnotation option restores notation matching while retaining one shared relative offset.
Relative-note notation is available only in queries.
Query example 1
(0)m|*,(2)m|*,(4)|*Source | Result and explanation |
|---|---|
| Match With C as the shared offset, roots C, D and E occupy relative positions 0, 2 and 4. The first two chords also have the required minor quality, and E has the required major quality. |
| Match With D as the shared offset, roots D, E and F# occupy relative positions 0, 2 and 4. Their minor, minor and major qualities also satisfy the three query fields. |
| No match The first two roots establish C as the shared offset. The last root F is 5 semitones above C, while the final query requires position 4. |
Query example 2
(0)/(7)on(2)/(9)|*Source | Result and explanation |
|---|---|
| Match With C as the shared offset, the written notes C, G, D and A occupy positions 0, 7, 2 and 9 in the required root and bass roles. |
| No match C, G and D fit positions 0, 7 and 2 with offset C. The final F# occupies position 6 and fails the required position 9. |
Query example 3
(0)m6|*,(2)m6|*Source | Result and explanation |
|---|---|
| Match The two sets match minor-sixth chords with final basses C and D under one shared offset. |
| No match The final basses C and Eb are three semitones apart, while the query requires two. |
Final pitch-class set
Syntax / fields:
C[notes:0,4,7]|*A [notes:...] query compares the complete final pitch-class set of a chord.
Each number is a semitone interval modulo 12 from the final root after slash and on operations.
The root can be a concrete note, a relative note or *.
A concrete root retains its specified note spelling; the set itself ignores constituent-note spelling and octave doubling.
For example, a C# root selector does not select a final root spelled Db.
The set contains at least one distinct integer from 0 to 11 in strictly increasing order.
Matching requires equality of the complete sets.
For example, C/E has final root E and set 0,3,8.
The [notes:...] form ends the chord field and cannot be followed by slash, add or on syntax.
The set excludes wildcards and OR, while an OR group may choose complete [notes:...] forms.
The --notallowdifferentnotation option leaves this explicit set query unchanged.
Query example 1
C[notes:0,4,7]|*Source | Result and explanation |
|---|---|
| Match The chord C has final root C and complete relative pitch-class set 0,4,7, satisfying both parts of the chord query. |
| No match C7 has complete relative pitch-class set 0,4,7,10. The extra 10 makes it differ from the required complete set 0,4,7. |
Query example 2
E[notes:0,3,8]|*Source | Result and explanation |
|---|---|
| Match The slash operation makes E the final root of C/E. The notes E, G and C then give the required complete set 0,3,8. |
| No match The chord C has final root C and relative set 0,4,7, while the query requires root E and set 0,3,8. |
Query example 3
*([notes:0,3,7]||[notes:0,4,7])|*Source | Result and explanation |
|---|---|
| Match The root * accepts C and D. C has complete set 0,4,7, and Dm has complete set 0,3,7, so each satisfies one OR branch. |
| No match G7 has complete relative set 0,4,7,10, which equals neither listed three-note set. |
Query example 4
C#[notes:0,3,7,9]|*Source | Result and explanation |
|---|---|
| Match The final root is spelled C# and the complete relative set is 0,3,7,9. |
| No match The relative set is equal, but the final root is spelled Db rather than the requested C#. |
Finite OR
Syntax / fields:
(A||B)An OR group uses parentheses around alternatives separated by ||.
A match can satisfy any one alternative.
The enclosing grammar determines whether alternatives are field fragments, complete query events, permitted complete setting values or complete tag parameters.
Each event-level alternative occupies exactly one query position.
Groups contain nonempty alternatives and cannot nest.
A query with several groups satisfies one permitted alternative in each group.
One OR group within a chord field uses pitch-set equivalence when every resulting chord is concrete and contains no * or ?.
For example, (Cm6||G/C)|* accepts Am7b5/C and CM9no3 with final bass C.
A chord field containing wildcards or multiple independent OR groups matches notation.
Cm(7||9||11||13)*|* accepts the listed tension spellings and any valid later suffix, including no5.
Query example 1
(C||G)|*Source | Result and explanation |
|---|---|
| Match C|I satisfies the exact chord branch C, and G|V satisfies the exact chord branch G. |
| No match The complete chord Cm equals neither exact alternative C nor exact alternative G. |
Query example 2
(*|I||*|V)Source | Result and explanation |
|---|---|
| Match C|I satisfies the single-event branch *|I, and G|V satisfies the single-event branch *|V. The query produces two separate windows. |
| No match The exact Roman V7 equals neither required alternative I nor V. |
Query example 3
{TC:(C||"C")}*|ISource | Result and explanation |
|---|---|
| Match The first C|I uses ordinary TC C, and the second uses ambiguous TC "C". The setting OR accepts both references, and both Roman fields are I. |
| No match Roman I matches, but active TC D equals neither allowed reference C nor "C". |
Query example 4
(Cm6||G/C)|*Source | Result and explanation |
|---|---|
| Match Each event has bass C and the complete set of one concrete OR branch. |
| No match The final bass of each event differs from C. |
Query example 5
Cm(7||9||11||13)*|*Source | Result and explanation |
|---|---|
| Match The OR chooses a written tension and the suffix wildcard also accepts no5. |
| No match Neither 6 nor M7 begins with one of the listed tension spellings. |
Complete-field NOT
Syntax / fields:
P!(N1||N2)A NOT suffix !(N1||N2) excludes complete patterns from a positive chord or Roman field P.
Each field permits one suffix after the complete positive pattern, on the same side of |.
A chord exclusion appears before |, while a Roman exclusion appears after it.
Each exclusion is a complete concrete or wildcard pattern.
Concrete chord exclusions use the default final-bass and pitch-set equivalence unless --notallowdifferentnotation is present; wildcard exclusions match notation.
The positive pattern matches, and every main or alternative interpretation must avoid every exclusion.
Roman exclusions inspect all analysis layers.
The positive pattern determines shared relative offsets and tonal-path continuity.
Cm(7||9||11||13)*!(*no*)|* selects those written tension families and excludes every notation containing no, including Cm9no5.
NOT requires an actual harmonic field and cannot negate X.
Exclusions cannot contain relative notes or [notes:...] sets.
NOT groups cannot nest or appear inside an OR branch.
Query example 1
Cm*!(*/*||*on*)|*Source | Result and explanation |
|---|---|
| Match Both Cm and Cm7 satisfy the positive Cm* pattern. Both avoid the excluded slash pattern */* and polychord pattern *on*. |
| No match Both chords satisfy Cm*. Cm/Eb matches the exclusion */*, and CmonAm matches the exclusion *on*, so both are rejected. |
Query example 2
*|V*!(V7)Source | Result and explanation |
|---|---|
| Match Roman V and V6 both satisfy V*. Neither equals the exact exclusion V7. |
| No match Roman V7 satisfies the positive V* pattern but also equals the exclusion V7, so the field is rejected. |
Query example 3
Cm(7||9||11||13)*!(*no*)|*Source | Result and explanation |
|---|---|
| Match All five notations satisfy the positive pattern and contain no no keyword. |
| No match The chord-side NOT excludes both no5 suffixes. |
Query example 4
*!(Cm6)|*Source | Result and explanation |
|---|---|
| Match The final bass A differs from C, so this chord is not excluded as an equivalent Cm6. |
| No match The concrete exclusion uses the same final bass and complete set as Cm6. |
Special events and unsupported controls
Syntax / fields:
X / 0 / N.C. / Clus / ClusWK / ClusBKComplete-event queries accept X, 0, N.C., Clus, ClusWK and ClusBK.
A bare Clus, ClusWK or ClusBK query matches the corresponding standalone cluster event. Use a harmonic query for a cluster in a chord field. For example, ClusWK|* matches ClusWK|I, while ClusWK|I also constrains the Roman numeral.
An X inside a harmonic query field selects that field's placeholder.
For example, X|V requires a chord-field placeholder and an exact Roman V.
Bare - and field-level - cannot be queried directly.
Sequence matching skips continuations as transparent events.
Event queries exclude BN, D, T, TEMPO and LB settings, along with COMMENT and F annotations.
Query example 1
XSource example | Result and explanation |
|---|---|
| Match: The source contains a complete placeholder event X, satisfying the complete-event query X. |
Query example 2
ClusWKSource example | Result and explanation |
|---|---|
| Match: The complete source event ClusWK exactly matches the requested white-key cluster. |
| No match. ClusWK occupies a chord field, while this query requires a standalone cluster event. |
Query example 3
X|VSource example | Result and explanation |
|---|---|
| Match: The chord field contains the required placeholder X, and the Roman field equals the required V. |
| No match: Roman V matches, but the actual chord G fails the required chord-field placeholder X. |
Query example 4
ClusWK|*Source example | Result and explanation |
|---|---|
| Match. The chord field is ClusWK, and * accepts any Roman numeral. |
| No match. The source is a standalone cluster event, while the query requires a chord field. |
Hard limits
A query permits at most 4096 source characters, 32 query events and 16 global-tag options.
Each harmonic field permits at most 256 characters and 16 wildcards.
OR permits at most 8 alternatives per group, 8 groups per query and 32 alternatives in total.
A query permits at most 32 NOT groups, with at most one per field.
OR groups inside NOT count toward the same OR limits.
The positive and exclusion patterns share the field-length and wildcard limits.
The parser's deterministic work score must be at most 512.
These limits govern query admission, while result-window counts depend on the matched source.