Skip to main content

best_time_signature

Function best_time_signature 

Source
pub fn best_time_signature(measure: &Stream) -> Result<TimeSignature>
Expand description

The time signature that fits what a measure holds: music21’s bestTimeSignature.

The shortest note value in the measure that is not a tuplet is the denominator, halved until it divides the measure’s length evenly, and the count of it in the measure is the numerator, reduced to lowest terms with the whole and half taken up to quarters. A measure that reads as 3/4 is 6/8 instead when that weighs its notes at least as strongly, and one that reads as 6/4 is whichever of 6/4, 12/8 and 3/2 weighs them most. A measure whose length is no binary fraction — tuplets — takes the fraction itself.