Instrument change undo, transposes twice
Steps to reproduce bug
1. Create new score for Bb Trumpet. Notice the initial key signature is D major (2 sharps)
2. Add a quarter note D to the first measure
3. Right-click on an empty measure and choose "Staff Properties"
4. Click "Change Instrument" and choose flute. Notice the key signature is now in C major (no sharps) as expected
5. Edit > Undo
Expected behavior: Score should return to Bb Trumpet with a D major key signature and a quarter note D in the first measure
Actual behavior: Score changes to E major key signature (4 sharps) and a quarter note E in the first measure.
Discussion: Marked as critical since Undo should always restore the previous data. However it is on the lower border of "critical" since users can transpose back to D major using Notes > Transposition to workaround the bug.
MuseScore version: r. 3235 nightly build. Bug also present in 0.9.6
(Operating System: Windows 7)
Comments
It's a different behaviour now:
After step 4, there are two sharps. The position of the note remains the same and sounds D.
Step 5 seems to undo fine.
Using MuseScore 2.0 Nightly Build (2b0d24d) - Mac 10.7.5.
The original bug is fixed. Key signatures are currently not changed if you switch the instrument.
But Key signatures should get changed when switching the instrument, just like in 1.x, shouldn't they?
https://github.com/musescore/MuseScore/pull/1662
As Werner mentioned, the origina bug was fixed. But the fix left a different issue, where the change instrument doesn't transpose key signatures. That was file separately as #31001: Wrong key when changing instrument, so this one could probably have been clsoed at that time. But in any case, my PR above fixes the key signature issue.
Fixed in b82d19e2c8
Automatically closed -- issue fixed for 2 weeks with no activity.