Abjad / abjad

Abjad is a Python API for building LilyPond files. Use Abjad to make PDFs of music notation.
https://abjad.github.io
GNU General Public License v3.0
234 stars 41 forks source link

Replace abjad.NoteMaker, abjad.LeafMaker with abjad.makers.make_notes(), -make_leaves() #1478

Closed trevorbaca closed 1 year ago

trevorbaca commented 1 year ago

The two classes will be replaced by functions:

OLD: abjad.NoteMaker
NEW: abjad.makers.make_notes()

OLD: abjad.LeafMaker
NEW: abjad.makers.make_leaves()

In Abjad 3.11, only the old classes exist:

pitches = [0, 2, 4]
durations = [(1, 8), (1, 16)]
maker = abjad.NoteMaker()
notes = maker(pitches, durations)

pitches = [0, 2, None]
durations = [(1, 8), (1, 16)]
maker = abjad.LeafMaker(skips_instead_of_rests=True)
leaves = maker(pitches, durations)

In Abjad 3.12, both the old classes and their replacement functions will be allowed:

DEPRECATED:

pitches = [0, 2, 4]
durations = [(1, 8), (1, 16)]
maker = abjad.NoteMaker()
notes = maker(pitches, durations)

pitches = [0, 2, None]
durations = [(1, 8), (1, 16)]
maker = abjad.LeafMaker(skips_instead_of_rests=True)
leaves = maker(pitches, durations)

RECOMMENDED:

notes = abjad.makers.make_notes(pitches, durations)

leaves = abjad.makers.make_leaves(pitches, durations, skips_instead_of_rests=True)

In Abjad 3.14, the old classes will be removed; only the new functions will be allowed:

notes = abjad.makers.make_notes(pitches, durations)

leaves = abjad.makers.make_leaves(pitches, durations, skips_instead_of_rests=True)

These class-to-function replacements parallel similar changes happening in the rhythm-makers in Abjad 3.12 and 3.13.