Example Queries

Ready-to-adapt query templates for common analytical questions.

A collection of complete, working queries for common analytical questions. Copy one, swap out the figures/degrees that matter for your own question, and run it across the corpus.

Cadential soprano descent, quarter notes only, landing on a fermata

A stepwise scale-degree descent restricted to the cantus firmus into the first scale degree, where the cantizans may be evaded to the 3rd scale degree, restricted to quarter notes and requiring a fermata on the final note:

{
    "feature": "deg",
    "voices": "soprano",
    "pattern": [
        { "deg": "3", "duration": "4" },
        { "deg": "2", "duration": "4" },
        { "deg": ["1", "3"], "duration": "*", "fermata": true }
    ]
}

Cadential soprano descent, but only where the bass has its own 3-4-5-1 line underneath

The same soprano descent as above, now also requiring the bass to walk scale degrees 3-4-5-1 at the same time, landing on its own fermata-marked tonic exactly when the soprano lands on its cadence note. See Simultaneous:

{
    "feature": "deg",
    "voices": "soprano",
    "pattern": [
        { "deg": "3", "duration": "4" },
        { "deg": "2", "duration": "4" },
        { "deg": ["1", "3"], "duration": "*", "fermata": true }
    ],
    "simultaneousWith": [
        {
            "feature": "deg",
            "voices": "bass",
            "pattern": [
                { "deg": "3", "duration": "8" },
                { "deg": "4", "duration": "8" },
                { "deg": "5", "duration": "4" },
                { "deg": "1", "duration": "*", "fermata": true }
            ]
        }
    ],
    "simultaneousAlignment": "start-end"
}

A falling-fifths sequence in the bass, however it's voiced

Two root motions by a 5th in a row. Written literally as -P5 twice, this only finds the cases where the bass really does descend twice, which misses every sequence that takes the octave transposition to stay in range and rises a 4th instead. mintAllowIntervalComplementation covers both spellings of the same harmonic move:

{
    "feature": "mint",
    "voices": "bass",
    "pattern": [
        { "mint": "-P5" },
        { "mint": "-P5" }
    ],
    "mintAllowIntervalComplementation": ["5"],
    "mintStartAtPreviousToken": true
}

mintStartAtPreviousToken makes each match start on the first note of the sequence rather than on the note the first 5th lands on (see Options). Add more { "mint": "-P5" } positions for longer circle-of-fifths runs, or drop the P to let diminished 5ths count too.

Hidden octaves between soprano and bass

The soprano leaps into an octave above the bass that the two were not already in, while the bass moves in that same direction into the same chord. Driven by hint-14, whose token on every line is the sonority of the outer voices: the first position is a sonority that is not an octave, the second one is. See hint and hintReduceCompound.

Since there's no way to ask "the bass moves in whatever direction the soprano does" within one query, the ascending and descending case each need their own query; combining them into a single request (see Combining several queries) returns both at once, distinguishable by queryId:

[
    {
        "id": "descending",
        "feature": "hint-14",
        "voices": "soprano",
        "hintReduceCompound": true,
        "pattern": [
            { "!hint-14": ["P8", "P1"], "fermata": false },
            { "hint-14": ["P8", "P1"] }
        ],
        "simultaneousWith": [
            {
                "feature": "mint",
                "voices": "bass",
                "pattern": [ { "!kern": "r" }, { "mint": "-" } ],
                "simultaneousAlignment": "end"
            },
            {
                "feature": "mint",
                "voices": "soprano",
                "pattern": [ { "!kern": "r" }, { "mint": "-", "!mint": "-2" } ],
                "simultaneousAlignment": "end"
            }
        ]
    },
    {
        "id": "ascending",
        "feature": "hint-14",
        "voices": "soprano",
        "hintReduceCompound": true,
        "pattern": [
            { "!hint-14": ["P8", "P1"], "fermata": false },
            { "hint-14": ["P8", "P1"] }
        ],
        "simultaneousWith": [
            {
                "feature": "mint",
                "voices": "bass",
                "pattern": [ { "!kern": "r" }, { "mint": "+" } ],
                "simultaneousAlignment": "end"
            },
            {
                "feature": "mint",
                "voices": "soprano",
                "pattern": [ { "!kern": "r" }, { "mint": "+", "!mint": "+2" } ],
                "simultaneousAlignment": "end"
            }
        ]
    }
]

This is the "hidden" octave: both outer voices approach the same octave by similar motion rather than contrary or oblique motion. Both voices move into the second sonority from a note, not from a rest. The first sonority has no fermata, so a match across a fermata does not count, and the soprano has to leap (a step into the octave is left out; drop the "!mint" entry to find those too). P8 and P1 both count, since a unison is an octave the voices sing on the same note. Use "P5" instead of ["P8", "P1"] in all four places to find hidden 5ths.

A cadence and its ornamented versions in one query

The plain cadential formula in whichever voice: a note held for a half note's worth, then the step down onto the fermata. Written literally this only finds the voices that really do hold that note, which misses every version the chorale decorates: a neighbour note, an anticipation, a passing note on the way. metweightSkipUnclassified folds those ornaments away, so the same pattern reaches the diminished readings too:

{
    "feature": "kern",
    "voices": "all",
    "pattern": [
        { "mint": "*", "duration": "2" },
        { "mint": "-M2", "duration": "*", "fermata": true, "hint-14": "8" }
    ],
    "metweightSkipUnclassified": true,
    "durationAllowSplitNotes": true,
    "hintReduceCompound": true
}

durationAllowSplitNotes is what lets the half note also be a note the score re-attacks (see Options); with the ornament already out of the way, a re-attack the chorale separated by a neighbour note counts as one too. Drop it, and spell the half note out as { "duration": "4" }, { "mint": "P1", "duration": "4" } instead, to see the two halves of that note as their own positions.

The same idea applied to a bass cadence, where the ornament is a leap away and back rather than a step:

{
    "feature": "kern",
    "voices": "bass",
    "pattern": [
        { "mint": "*", "duration": "4" },
        { "mint": "+2", "duration": "4" },
        { "mint": "-P5", "duration": "*", "fermata": true }
    ],
    "mintAllowIntervalComplementation": "5",
    "metweightSkipUnclassified": true
}

Scale degrees 4–5–1, found both where the bass steps straight up to the 5 and where it takes an offbeat detour down a 3rd and back up a 4th on the way. What the ornament is shaped like never enters into it, only where it falls.

An upward leap in the soprano that is not answered by a step back

A rise of more than a fourth in the soprano, followed by anything but a step down or a repeated note. The first position is any note that does not end a phrase, so the leap does not start across a fermata. See comparisons for the operator:

{
    "feature": "mint",
    "voices": "soprano",
    "pattern": [
        { "mint": "*", "!phrase": "end" },
        { "mint": { "operator": "gt", "value": "+4" } },
        { "!mint": ["-2", "1"] }
    ]
}

Parallel fifths downwards between any two voices

Two voices form a fifth, and both move down into the next fifth. Driven by hint-**, the query is searched for each of the six voice pairs, and hint-@pair is the interval of the pair being searched, @lower and @upper its two voices. See Searching several pairs at once and hintReduceCompound:

{
    "feature": "hint-**",
    "voices": "@lower",
    "hintReduceCompound": true,
    "pattern": [
        { "hint-@pair": "P5" },
        { "hint-@pair": "P5" }
    ],
    "simultaneousWith": [
        {
            "feature": "mint",
            "voices": "@lower",
            "pattern": [ { "!kern": "r" }, { "mint": "-" } ],
            "simultaneousAlignment": "end"
        },
        {
            "feature": "mint",
            "voices": "@upper",
            "pattern": [ { "!kern": "r" }, { "mint": "-" } ],
            "simultaneousAlignment": "end"
        }
    ]
}

The two positions are two consecutive sonorities of the pair, whether the voices attack them together or one of them holds its note into the second one, and both voices move down into the second sonority from a note, not from a rest. Every result has its pair as feature, e.g. hint-24. Use "mint": "+" in both entries for parallel fifths upwards, and P8 for parallel octaves. Without hint-**, this takes one query for each of the six pairs.