Inserting a C/Am key "signature" to a C/Am score causes inconsistent behaviour

• Dec 14, 2014 - 14:00
Type
Functional
Severity
S4 - Minor
Status
closed
Project
Tags

This is a minor issue indeed, as it isn't likely to happen, but may have some side effects which are currently undetected. Reproduce:
1. Open MuseScore with "My First Score".
2. Drag an empty key signature (Cmaj/Amin) to the 2nd measure
expected: there is no visual change
result: an empty space is added at the beginning of a measure (which obviously cannot be selected).
3. Drag any other key signature to the 1st measure - let's say it's Gmaj
expected: the (2) is ignored OR it is not ignored and a natural appears in the 2nd bar and a key is reverted to Cmaj after that.
result: a natural appears in 2nd bar but the key isn't changed to Cmaj/Amin (as shown in an attached screenshot)

Win7, 76d6063

Attachment Size
Capture.GIF 45.34 KB

Comments

Title Inserting a C/Am key "signature" to a C/Am score causes incosistent behaviour Inserting a C/Am key "signature" to a C/Am score causes inconsistent behaviour
Title Inserting a C/Am key "signature" to a C/Am score causes inconsistent behaviour Inserting a C/Am key "signature" to a C/Am score causes incosistent behaviour

...or saving the score and opening it again.

Title Inserting a C/Am key "signature" to a C/Am score causes incosistent behaviour Inserting a C/Am key "signature" to a C/Am score causes inconsistent behaviour

which hints at a missing re-layout in the code?

which somehow makes it easier to fix, but isn't relevant to the point (2) of the description. Maybe it should be moved to a separate issue.

If it were just a missing layout, the score would fix itself as soon as you pressed Ctrl+A, or edited it in any way.

I think the actual culprit will turn out to be an incorrect keysig "map" - a data structure built internally to track key sig changes. That would explain why it fixes itself on reload. This might also explain a few other keysig-related issues that have cropped up since the recent change to support custom keysigs.