Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up abjad.on_beat_grace_container(). #1527

Merged
merged 1 commit into from Apr 6, 2023
Merged

Conversation

trevorbaca
Copy link
Member

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.

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.
@trevorbaca trevorbaca added this to the 3.17 milestone Apr 6, 2023
@trevorbaca trevorbaca self-assigned this Apr 6, 2023
@trevorbaca trevorbaca merged commit 669bfd9 into main Apr 6, 2023
2 checks passed
@trevorbaca trevorbaca deleted the trevor/clean-up-obgc branch April 6, 2023 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant