Key signatures displayed incorrectly after clef change
P1 - High
S3 - Major
This is an issue on both 3.0.5 and master:
1) default score, or a new score from treble template with enough measures for at least two systems
2) add key signature to first measure
3) add bass clef to second measure
Result: key signature displayed incorrectly on second & subsequent systems, as if the clef change didn't happen Fixes itself on next relayout, but then Undo then leaves the new keysig in place on the old clef.
Sorry, didn't mean to change status of this one.
Came up again in #287827: Key signature on wrong lines after changing clef.
The problem seems to be that in KeySig::layout(), we are looking to see if we can find a clef at the same tick, and we find the clef just to the left of us, which hasn't been updated yet - keysigs are laid out before clefs in addSystemHeader().
We could consider changing that order, but that could have unknown consequences. Better might be to not do this "check same tick" thing at all, and just fall through to the next chunk of code that uses the cleflist instead. That too might fail in some case I'm not thinking of offhand - either way, thorough testing would be required.
Here's the PR where the check for clefs was added, some discussion in the threads there that should give some good insight into things to watch out for: https://github.com/musescore/MuseScore/pull/3694
Marc's idea of laying out clefs before keysigs in addSystemHeader() seems like the way to go, since the header clef comes before the key signature anyway, and the display of the key signature depends on the header clef being correct. I just tested it and it solves the issue. I can't think of any problems that would be caused by correcting the layout order of these two elements.
PR is here: https://github.com/musescore/MuseScore/pull/4942.
Fixed in branch master, commit 981650f99b
fix #287423: Key signatures displayed incorrectly after clef change
Fixed in branch master, commit 222dfa40fc
_Merge pull request #4942 from mattmcclinch/287423-keysig-after-clef-change
fix #287423: Key signatures displayed incorrectly after clef change_
Automatically closed -- issue fixed for 2 weeks with no activity.
https://musescore.org/de/node/287811#comment-926481 claims it to be back in 3.1
In reply to missunderstanding by Jojo-Schmitz
I am using MuseScore 3.2.3, but the problem is still there, see the screenshot attached. I have also attached the MuseScore file which demonstrates the problem.
UPDATE: Sorry, I think I understand what is happening. That flat in measure 11 actually refers to the note Bflat4 and should be entered as such and NOT as the key signature of the treble clef. When I got to entering measure 14 where one switches to the bass clef and noticed that it has no key signature I realised that the key signatures are not entered after the clef sign, but rather as an "accidental" on the first note that is affected by it and is encountered in the same measure. Please forgive my confusion --- this is the very first time in my life I am entering music score :)
I'm having that issue right here, it's supposed to shift position when the Clef changes. Hopefully we can get that fixed.
If so that'd be a new and different issue
Indeed, sounds like you are talking about something entirely unrelated; the bug discussed here was fixed years ago. If you're having some sort of problem that you believe to be a bug, please open a new issue and be sure to attach your score and precise steps to reproduce the problem.
That's on the Scrolling Page View which I saw
Again, whatever you are seeing is completely unrelated to this bug that was fixed years ago. Please open a new issue and describe your new issue in detail, with score and steps to reproduce. Do not change the settings for this long-resolved issue.
I switched to continuous view & I saw the issue, the key signature is supposed to change position on the Continuous view (you can actually see it on the far left).
Please, again, open a new issue for that, it is unrelated to the issue at hand here