Honor displayType='always' on first pitch too - #326
Merged
Conversation
Fixes #325. updateAccidentalDisplay checked cautionaryAll and displayType 'always'/'even-tied' only after the "no pitches in past" early return, so the first pitch of a part fell through to the key signature test instead. For an explicit natural that test asks _stepInKeySignature(), which is false with no key signature, leaving displayStatus false on the first note of every part: `AAn2 Fn` marked only the F, and each part after a `partBreak` lost its opening natural. Hoisting the block above the empty-past branch is a no-op when the past is non-empty -- a conflicting past pitch and 'always' both set displayStatus true -- so only the first-pitch case changes. Vexflow output already fell back to displayType, so the naturals still drew there; MusicXML export gates on displayStatus and was dropping them. music21 python has the same ordering and the same bug. AI-assisted (Claude)
…sisted) The empty-past branch suppressed any explicit accidental whose name was already in the key signature, not just naturals: F# marked 'always' in G major came back displayStatus false. AI-assisted (Claude)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First note in piece/part w/ explicit natural set with displayType='always', like tinyNotation
Cnwas being ignored. FixedupdateAccidentalDisplay was short circuiting early if there was no pitchPastAll -- so first note had no way of having its "always" or "even-tied" status read.
Fixes #325
AI-Assisted (Claude)