The base note value, from the whole note down to the sixty-fourth.
Augmentation dots, 0 when the value carries none.
A copy of the tuplet ratio, or undefined outside a tuplet.
A copy of the written value, with the dot count always stated: the shape the duration module spells a length as.
A copy of the underlying plain duration, the same value as Duration.spelled.
StaticofStaticofSpell a length in beats as the note value a score would show.
The spelling is the conventional one: 1.5 beats is a dotted quarter rather than a quarter tied to an eighth, and a third of a beat is an eighth triplet rather than a twenty-fourth note.
The length in beats.
beatUnit sets what one beat is; a quarter note by
default.
The duration that spells the length.
If the length is not positive, or — as a NoSolutionError — if no
single note value spells it, as for 5 beats. Use
Duration.tieChain for those.
StatictieSpell a length in beats as a chain of tied durations.
A length with a single spelling comes back as a one-element chain. Anything else is broken into plain and dotted values, longest first. The chain knows nothing of barlines or beat grouping — an engraver splits further at those — and it uses no tuplets.
The length in beats.
beatUnit sets what one beat is; a quarter note by
default.
The tied durations, longest first, summing to the length.
StaticfromWrap a plain duration, or a bare base value as shorthand for an undotted one.
The plain duration.
The wrapped duration.
StaticfromRebuild a duration from its Duration.toJSON output.
The serialized duration.
The wrapped duration.
The length of the written value in beats.
beatUnit sets what one beat is; a quarter note by
default, so a dotted quarter reads as 1.5. Pass
{ base: 'quarter', dots: 1 } to count in the felt beats of a compound
meter.
The length in beats.
Whether another duration is written identically.
Two values of the same length are not equal unless they are written the same way: a dotted quarter and a quarter in the time of a triplet half both last 1.5 beats and are different notations.
The duration to compare with.
True when base, dots, and tuplet all match.
The plain duration, for JSON serialization.
Private class fields do not serialize, so an explicit toJSON keeps
JSON.stringify(duration) from collapsing to {}. The tuplet appears
only on a value that carries one, which is the shape the duration module
produces.
A copy of the base value, dot count, and tuplet.
The written value, so a template literal or a log line reads as the duration.
The base value, a dot per augmentation dot, and the tuplet ratio
when it has one, e.g. 'quarter.' or 'eighth 3:2'.
An immutable written duration: the note value a score shows — a base value, its augmentation dots, and an optional tuplet ratio — and the beats it lasts. A thin convenience wrapper over the duration module's plain value.
Example