Proper use of accidentals after octave change loco.

• Mar 3, 2015 - 01:05
S4 - Minor

See the attachment.

The linked discussion was as to whether or not the 2nd note, being on the same line/space as an octave transposition followed by a loco requires a 2nd accidental.

Attachment Size
8vb.pdf 13.04 KB


I have code to "mostly" deal with this, but it still doesn't cover all cases, and it seems slightly risky. See for what my code does.

Here's a link to the branch:

Basically, I manage the accidental state separately for the displayed and sounding pitches, and use both states to decide whether or not to display an accidental.

The case I miss is where the display pitch says we don't need the accidental but the sounding pitch says we do. Unfortunately, if I change the logic to display the accidental if either says we need it, then you end up with a bunch of unnecessary accidentals for repeated notes under an ottava where there should be one only under the first. We don't really have enough context to get the answer right, at least by what I might think of as the definition of right.

Given that my code here doesn't really quite work, and introduces some amount of risk, I am not submitting a PR for it at this time. Even though the current situation is not right, it does have the advantage of being more predictable than my partial fix, and of course it is easy enough to add the missing accidentals manually. A more complete fix than mine would require some re-architecting of the code, which in my view is probably not appropriate right now given the schedule, the frequency of this, and the ease of the workaround.

If someone else wants to take the ball and run with it though, you are more than welcome to use my code as a starting point if it helps!