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

Clean up instrument classes #1460

Closed trevorbaca closed 2 years ago

trevorbaca commented 2 years ago

Abjad 3.10 reimplements Abjad's instrument classes as frozen data classes, removes four properties from all instrument classes, and changes the name of one property.

REMOVED:

    * abjad.Instrument.markup
    * abjad.Instrument.name
    * abjad.Instrument.short_markup
    * abjad.Instrument.short_name

CHANGED:

    OLD: abjad.Instrument.allowable_clefs=("treble", "bass")
    NEW: abjad.Instrument.clefs==("treble", "bass")

This means that instrument classes are left with four basic properties:

 >>> abjad.Flute()
Flute(clefs=('treble',), context='Staff', middle_c_sounding_pitch=NamedPitch("c'"), pitch_range=PitchRange(range_string='[C4, D7]'))

Use abjad.InstrumentName and abjad.ShortInstrumentName to handle those properties independently.