metweight
**metweight is Humdrum's metric-weight tool run once per chorale: it
classifies every note/rest attack in a **kern voice by how strong its beat
position is within the current meter.
Token format
| Weight class | Meaning |
|---|---|
| strong | the beat itself (e.g. beat 1 of the measure) |
| half-strong | a secondary strong position (e.g. beat 3 of a 4/4 measure) |
| weak | a week position (e.g. beat 2 and 4 of a 4/4 measure) |
| unclassified | any other position |
Three ways to write a weight class
A pattern value can spell out a weight class as an abbreviation, a full word, or
a numeric rank. All three are equivalent, since metweight always normalizes
down to the abbreviation before comparing (the actual **metweight data is
written in abbreviated form):
| Weight class | Abbreviation | Full word | Number |
|---|---|---|---|
| strong | "s" | "strong" | "1" |
| half-strong | "hs" | "half-strong" | "2" |
| weak | "w" | "weak" | "3" |
| unclassified | "u" | "unclassified" | "4" |
{
"feature": "metweight",
"pattern": [
{ "metweight": "strong" },
{ "metweight": "strong" }
]
}
finds two strong onsets in a row. Writing a position as { "metweight": "s" }
or { "metweight": "1" } instead matches the same onsets.
Using it in a pattern
metweight is most useful either as the driving feature (walking beat-to-beat
through the metric structure) or as a secondary constraint alongside
kern/deg/mint/fb (checking "does this melodic thing land on a strong
beat"):
{
"feature": "kern",
"voices": "bass",
"pattern": [
{ "fb": ["7", "4", "2", "9"], "metweight": ["s", "hs"], "fermata": true }
]
}
matches every dissonance that lands on a strong or half-strong beat and carries a fermata. See
Patterns for OR-lists, wildcards, multi-feature positions, and
negation, all of which work the same way for metweight as for any other
feature.
Leaving the unclassified positions out entirely
Unclassified is where a chorale puts most of its diminution, so the other way to
use the weight class is to ask not to see it:
metweightSkipUnclassified takes
those onsets out of the search altogether, treating each as an ornament of the
note in front of it rather than as a note of its own. A pattern spelling out the
plain skeleton of a phrase then finds the decorated versions of it too.