v3.16
Abjad 3.16 works with Python 3.10 (and 3.11) and LilyPond 2.23.6 (and later).
BREAKING CHANGES. Abjad 3.16 will break existing code. But the changes should be easy to follow. Removed abjad.Multiplier
, abjad.Ratio
, abjad.NonreducedFraction
, abjad.NonreducedRatio
in favor of built-in fractions.Fraction
and (int, int)
pairs. Also the types of abjad.Tuplet.multiplier
, abjad.Leaf.multiplier
and preprolated durations in the rhtyhmtrees
module are all now more tightly constrained.
This release contains primarily #1515
OLD: abjad.Multiplier
NEW: use built-in fractions.Fraction instead
OLD: abjad.NonreducedFraction
NEW: use (int, int) pair instead
OLD: abjad.NonreducedRatio
NEW: use (int, ...) tuple instead
OLD: abjad.Ratio
NEW: use (int, ...) tuple instead
BREAKING CHANGE. Leaf multiplier now returns a nonreduced fraction.
OLD: Leaf.multiplier could be either multiplier or nonreduced multiplier.
NEW: Leaf.multiplier is always an (int, int) pair.
BREAKING CHANGE. abjad.Tuplet.multiplier has changed:
OLD: abjad.Tuplet.multiplier accepted the following:
string, pair, duration, fraction, multiplier, nonreduced fraction
NEW: abjad.Tuplet.multiplier accepts only string and pair
OLD: abjad.Tuplet.multiplier returned nonreduced fraction (or none)
NEW: abjad.Tuplet.multiplier returns pair (or none)
OLD:
>>> abjad.Tuplet("3:2", "c'4 d' e'")
>>> abjad.Tuplet((2, 3), "c'4 d' e'")
>>> abjad.Tuplet(abjad.Multiplier(2, 3), "c'4 d' e'")
>>> abjad.Tuplet(abjad.Fraction(2, 3), "c'4 d' e'")
>>> abjad.Tuplet(abjad.NonreducedFraction(2, 3), "c'4 d' e'")
NEW:
>>> abjad.Tuplet("3:2", "c'4 d' e'")
>>> abjad.Tuplet((2, 3), "c'4 d' e'")
OLD: tuplet.multplier == 1
NEW: tuplet.multplier == (1, 1)
NEW: abjad.Fraction(*tuplet.multplier) == 1
CHANGED. Replaced abjad.Duration.with_denominator().
OLD:
>>> abjad.Duration(1, 4).with_denominator(16)
NonreducedFraction(4, 16)
NEW:
>>> duration = abjad.Duration(1, 4)
>>> pair = abjad.duration.with_denominator(duration, 16)
>>> pair
(4, 16)
>>> abjad.NonreducedFraction(pair)
NonreducedFraction(4, 16)
CHANGED. Constrained rhythmtree preprolated duration.
OLD: int, pair, duration, nonreduced fraction
NEW: pair, duration, nonreduced fraction
CHANGED. Set several sequence.py parameters keyword-only.
NEW. Added abjad.duration.pair():
>>> abjad.duration.pair((3, 6))
(3, 6)
>>> abjad.duration.pair(abjad.Fraction(3, 6))
(1, 2)
>>> abjad.duration.pair(abjad.Duration(3, 6))
(1, 2)
>>> abjad.duration.pair(abjad.Offset((3, 6)))
(1, 2)
>>> abjad.duration.pair(abjad.TimeSignature((3, 6)))
(3, 6)
NEW. Added abjad.duration.add_pairs().