Skip to content

Honor displayType='always' on first pitch too - #326

Merged
mscuthbert merged 2 commits into
masterfrom
explicit-naturals
Aug 6, 2026
Merged

Honor displayType='always' on first pitch too#326
mscuthbert merged 2 commits into
masterfrom
explicit-naturals

Conversation

@mscuthbert

@mscuthbert mscuthbert commented Aug 6, 2026

Copy link
Copy Markdown
Member

First note in piece/part w/ explicit natural set with displayType='always', like tinyNotation Cn was being ignored. Fixed

updateAccidentalDisplay 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)

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)
@mscuthbert mscuthbert added the bug label Aug 6, 2026
@mscuthbert mscuthbert closed this Aug 6, 2026
@mscuthbert mscuthbert reopened this Aug 6, 2026
@mscuthbert
mscuthbert merged commit 12524f6 into master Aug 6, 2026
7 of 8 checks passed
@mscuthbert
mscuthbert deleted the explicit-naturals branch August 7, 2026 00:22
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.

TinyNotation -- some explicit naturals ignored

1 participant