-
Notifications
You must be signed in to change notification settings - Fork 406
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
Accidentals never and if-absolutely-necessary #1148
Conversation
@jacobtylerwalls would you have a chance to review this? Thanks! |
music21/pitch.py
Outdated
# nope, no previous pitches in this octave and register, now more complex things... | ||
# but first handle 'if-absolutely-necessary' case. | ||
if acc and acc.displayType == 'if-absolutely-necessary': | ||
acc.displayStatus = False | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too early to short-circuit, if if-absolutely-necessary
also needs to show a necessary natural contradicting the ks. If it's not what it's supposed to do, then maybe reword only-for-cancelling-in-register
? (not that I love that phrasing). Just that cancelling a ks seems absolutely necessary.
pr:
>>> m = stream.Measure([key.Key('C-'), note.Note('G#'), note.Note('Cn')])
>>> p = stream.Part(m)
>>> m.notes[-1].pitch.accidental.displayType = 'if-absolutely-necessary'
>>> p.show()
Maybe this means organizing the cases differently so we can short-circuit somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah -- you are absolutely right. Okay, that will take a bit more time to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THANKS!
Add more logic for makeAccidentals for displayType "never"
Add "if-absolutely-necessary" displayType
Simplify some parts of the accidental making.
Do not merge until I have a chance to write tests.
(Ignore branch name -- did not get to it in this PR)