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

Cleaned up abjad.on_beat_grace_container(). #1527

Closed trevorbaca closed 1 year ago

trevorbaca commented 1 year ago

CHANGED. Changed abjad.on_beat_grace_container() parameter names:

OLD: abjad.on_beat_grace_container(..., anchor_voice_number=2)
NEW: abjad.on_beat_grace_container(..., nongrace_polyphony_command=r"\voiceTwo")

OLD: abjad.on_beat_grace_container(..., grace_voice_number=1)
NEW: abjad.on_beat_grace_container(..., grace_polyphony_command=r"\voiceOne")

OLD: abjad.on_beat_grace_container(..., font_size=-3)
NEW: abjad.on_beat_grace_container(..., grace_font_size=-3)

OLD: abjad.on_beat_grace_container(..., leaf_duration=None)
NEW: abjad.on_beat_grace_container(..., grace_leaf_duration=None)

CHANGED. Changed abjad.activate(), abjad.deactivate() return types:

OLD:
    * both functions returned (text, count) pair when skipped=False
    * both functions returned (text, count, skipped) triple when skipped=True

NEW:
    * both functions return (text, count, skipped) triple

NEW. Added abjad.parse(..., tag=None) keyword.

NEW. Added abjad.wf.check_overlapping_beams().

NEW. Added abjad.wf.check_beamed_lone_notes().

BUGFIX. Taught abjad.ForbidUpdate to update indicators on entrance.

REGRESSION. Indicators need to be updated after swap; context
manager updates indicators before forbidding further updates:

>>> staff = abjad.Staff(r"\times 1/1 { c'4 d' }")
>>> abjad.attach(abjad.Clef("alto"), staff[0][0])
>>> container = abjad.Container()
>>> abjad.mutate.swap(staff[0], container)
>>> with abjad.ForbidUpdate(staff):
...     for note in staff[0]:
...         print(note)
...         print(abjad.get.effective(note, abjad.Clef))
...
Note("c'4")
Clef(name='alto', hide=False)
Note("d'4")
Clef(name='alto', hide=False)

Users encountered this bug (up to Abjad 3.16) only if using abjad.ForbidContext
immediately after some type of score mutatation, like in the example
above.