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
239 stars 39 forks source link

Clean up instrument name, short instrument name #1459

Closed trevorbaca closed 2 years ago

trevorbaca commented 2 years ago

LilyPond uses \instrumentName to print markup to the left of the first system of a score. It makes no sense to change \instrumentName after it is first set because the value of \instrumentName is printed only once.

LilyPond uses \shortInstrumentName to print markup to left the of nonfirst systems of a score. Changing \shortInstrumentName is necessary whenever instrument changes (for example, from flute to piccolo) should be reflected to the left of each system. (Whether, and how, scores use left-positioned directives to reflective instrument changes seems to vary over time, and by publisher.)

Abjad 3.9 (and earlier) implemented abjad.StartMarkup and abjad.MarginMarkup classes to handle these two types of markup. Abjad 3.10 replaces these with abjad.InstrumentName and abjad.ShortInstrumentName classes that match LilyPond's \instrumentName and \shortInstrumentName commands.

OLD: abjad.StartMarkup(markup=abjad.Markup(r"\markup Cello"))
NEW: abjad.InstrumentName(r"\markup Cello")

OLD: abjad.MarginMarkup(markup=abjad.Markup(r"\markup Vc."))
NEW: abjad.ShortInstrumentName(r"\markup Vc.")