Key signatures transposed incorrectly in parts
Ubuntu 14.04, GIT commit: 48f066c
There seem to be a few facets to this. Here is one way to see a problem:
1) new score, treble clef template, C major
2) add notes
3) generate parts
4) select all
5) notes / transpose
6) key of D
7) OK
8) view part
Resukt: notes are transposed, key signature is not.
This happens because there was no actual C major key signature in the score to transpose. A "D" key signature is generated at the end of Score::transpose(), but it is not applied to the parts.
It's worse than this, actually. The score and part are now out of sync such that if you then add a key signature to the score, it gets added to both score and parts and everything *appears* to be in sync, but somehow it is not. The next transposition will not work either, even though no "C" key signatures are involved. The parts seem permanently out of sync with respect to key signatures as far as I can tell; not sure why. Maybe it's because the key signatures are not actually linked, although it seems in other situations this is not a problem.
However, I am also pretty sure I have been able to reproduce a case where some sequence of key changes and flipping the concert pitch button creates a similar situation where the key signatrues become out of sync even without using Notes / Transpose. I just can't find the steps right now.
Comments
From what I see in the time for this issue, there is two steps in the change.
The start point (the test notes in C) is this one:
- With this Nightly on August 25: 8fb3b5b, all is correct and as expected:
In main score after transposition in D:
In part:
- With this Nightly on August 25 always: 534c918
Uncorrect in main score (two unexpected accidentals)
Uncorrect in part (no keysig)
So, the cause is probably here: https://github.com/musescore/MuseScore/commit/f8feaf7c6bfa2e28f8502f3e7…
- The second change (but partial) occurs on December 22:
With this Nigthly: 4a78d5c
In main score, the result is again correct (accidentals have disappeared)
But not in the part (no keysig always).
These two previous images reflect the current result (of 2.0.2 eg)
For the cause (of the good, but partial change in december), it's less obvious (many commits: it was the day of the Beta2 release!) but after checking, I "vote" for this one:
https://github.com/musescore/MuseScore/commit/df7ff007e8ff8536d6ea258b8…
To fix: #39901: Undo of concert pitch produces incorrect transposition
I have a local build with this issue fixed. After more testing and familiarizing with git, I will send a pull request.
Partially fixed... Seems this is a bit more complicated and transposition has more problems than what I originally thought.
With nightly b9aa72f:
1. new score with Bb clarinet (concert c key sig.)
2. generate parts
3. flip concert pitch button (now in concert pitch)
4. transpose to G major
- Part incorrect.
1. Repeat steps 1 - 3 above
2. flip concert pitch button again
3. transpose to G major
- Part also incorrect.
https://github.com/musescore/MuseScore/pull/2465
Looking at this again. I haven't built yet, but I think the current PR can only fix part of the problem - the last set of steps shown will continue to be a problem. I think that's because when the score is moved into concert pitch and the keysig is removed, the link is broken and nothing will bring it back. So, turning concert pitch back off will make the keysig appear again, but it won't be linked to the part. And now the transpose will fail, and perhaps other operations will too.
I think that we probably need to re-establish link any time we create a new keysig as a result of any transposition. So if a keysig gets created a a result of either notes / transpose or toggling concert pitch or the transpose semitone commands (formerly tied to F2 key), these all need to look for keysigs in linked staves and connect to them. Ideally, we can do this in one place.
Still the case with current master.
The PR closed https://github.com/musescore/MuseScore/pull/2465
Right now keysigs added after part creation are never linked, and there are now many thousands of scores out there created this way, so it's kind of too late to start adding links now. I think the better solution will be to follow staff links. See also #286058: Changing Key Signature in Main Score (Via Transposition) Does Not Result in Changed Key Signature in Part.
This is an old report, I'm closing in favor of #286058: Changing Key Signature in Main Score (Via Transposition) Does Not Result in Changed Key Signature in Part