The length in beats.
beatUnit sets what one beat is; a quarter note by default.
The base value, its dot count, and its tuplet when it has one.
If beats is not positive, or — as a NoSolutionError — if no single
note value spells it, as for 5 beats in 4/4. Use
beatsToTiedDurations for those.
Spell a length in beats as the note value a score would show.
The spelling is the conventional one, not merely an arithmetically valid 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. Plain values are preferred to dotted ones and both to tuplets, and within the tuplets triplets come before quintuplets and septuplets.
Lengths are matched within 1e-6 quarter notes, so a rounded decimal such as 0.3333333 still reads as a triplet. The tolerance is measured in quarter notes whatever
beatUnitnames, so a longer beat unit narrows it in proportion: under{ beatUnit: 'whole' }it is 2.5e-7 of a beat.