Beats in a bar, counted in denominator units: the 6 of 6/8.
The note value one unit is written as: the 8 of 6/8.
A copy of the felt-beat grouping, or undefined when the bar is ungrouped.
A copy of the underlying plain time signature.
Whether the meter is compound: its main pulses each divide into three, as in 6/8, 9/8, or 12/8. A simple triple such as 3/4 is not compound, and neither is a signature whose grouping selects the additive reading.
Length of a bar in quarter-note beats.
Main pulses (felt beats) in a bar: 2 in 6/8, 4 in 4/4.
Length of one felt beat in quarter-note beats: a quarter note in simple meters, a dotted quarter in compound ones.
StaticofBuild a meter from its parts.
Beats in a bar, counted in denominator units.
The note value one unit is written as, e.g. 8 for an eighth note.
Optionalgrouping: number[]
Optional grouping of the bar into felt beats, as positive
integers summing to the pulse count or to the numerator — [2, 2, 3]
for a 2+2+3 reading of 7/8.
The meter.
StaticparseParse a time signature such as '4/4', '6/8', or the additive '2+2+3/8'.
The signature text.
The meter that text names.
If the text is not n/d with positive integers, or names a
signature the library rejects. Use Meter.tryParse where failure
is ordinary, such as a meter field read on every keystroke.
StatictryParse a time signature, reporting failure instead of throwing it.
The same reading as Meter.parse — that method is this one with its error thrown — for the callers where text that does not parse yet is the normal state of the input rather than a fault.
The signature text.
The meter, or the error explaining why the text is not one.
StaticfromWrap a plain time signature, as the meter module produces it.
The plain time signature.
The wrapped meter.
StaticfromRebuild a meter from its Meter.toJSON output.
The serialized time signature.
The wrapped meter.
Render the signature as 'n/d', or as 'a+b+c/d' when it carries an
additive grouping and one is asked for.
Set grouping: true to render an additive grouping. A
grouping counted in main pulses has no additive spelling: one whose
groups are all the same length states the division the bare signature
already has and falls back to the plain form, and one whose groups differ
is refused rather than printed as a bar that weighs its pulses otherwise.
The formatted signature.
Metric weight of a position within its bar, on a 0–3 scale: 3 the downbeat, 2 a secondary strong pulse, 1 any other main pulse, and 0 an off-pulse subdivision.
Position in quarter-note beats; a position past the end of a bar is read in the bar it falls in.
The metric weight (0–3).
Convert a position in quarter-note beats to a bar index and in-bar offset.
Position in quarter-note beats.
The 0-based bar and the quarter-note offset within it.
Render a position as the bar.beat a DAW or a score shows: 1-based bar,
1-based felt beat.
Position in quarter-note beats.
Digits of the fractional beat to keep.
The formatted position in one of two forms: bar.beat on a felt
beat, e.g. '3.2' for bar 3, felt beat 2; and bar.beat+fraction
between felt beats, e.g. '3.2+0.5' halfway from the second felt beat to
the third. A reader of these strings has to take both, since most onsets
of an ordinary piece fall between pulses.
Subdivide a span into equal tuplet durations — an eighth-note triplet is
tuplet(1, 3).
Total span in quarter-note beats.
Number of equal parts.
count equal durations summing to totalBeats.
Whether another meter is the same signature, grouping included.
6/8 and 3/4 fill a bar with the same six eighth notes and are not equal: they group them differently, and every weight this class reports follows the grouping.
The meter to compare with.
True when numerator, denominator, and grouping all match.
The plain time signature, for JSON serialization.
Private class fields do not serialize, so an explicit toJSON keeps
JSON.stringify(meter) from collapsing to {}. The grouping appears only
on a meter that carries one, which is the shape the meter module's own
parser produces.
A copy of the numerator, denominator, and grouping.
The signature, so a template literal or a log line reads as the meter.
The plain form, e.g. '6/8'; ask Meter.format for the
additive one.
An immutable time signature: a numerator over a note-value denominator, with the optional grouping that gives an additive metre its felt beats. A thin convenience wrapper over the meter module's plain time signature.
One signature, not a piece's meter over time: a piece that changes meter is described by a meter map, which the meter module's own functions read.
Example