scale_measure_denominator_and_adjust_measure_contents

scoretools.scale_measure_denominator_and_adjust_measure_contents(measure, factor)

Scales power-of-two measure to non-power-of-two measure with new denominator factor:

>>> measure = Measure((2, 8), "c'8 d'8")
>>> measure.implicit_scaling = True
>>> beam = spannertools.Beam()
>>> attach(beam, measure[:])
>>> show(measure) 
>>> scoretools.scale_measure_denominator_and_adjust_measure_contents(
...     measure, 3)
Measure((3, 12), "c'8. d'8.", implicit_scaling=True)
>>> show(measure) 

Treats new denominator factor like clever form of 1: 3/3 or 5/5 or 7/7, etc.

Preserves measure duration.

Derives new measure multiplier.

Scales measure contents.

Picks best new time signature.