Wrong key signature for new instruments

• Jun 3, 2010 - 16:51
S5 - Suggestion

Windows XP pro
Nightly R 3121

Create a new score with a concert instrument, e.g. flute. Finish with only that one instrument.

Now choose Create - instruments - add a Bb clarinet - OK.

The clarinet does not come with two sharps. Same problem with Eb-instruments.

(if you choose all instruments from the beginning, there is no problem.)


Corrolary bug:

  1. Create an Eb flute score
  2. Go to Create Instrument
  3. Add a staff for the Eb flute instrument

Actual result : The key signature is different for both staves
Expected result : The key signature should be the same

Playing with this bug, I often got a crash when closing musescore. I put in on critical. Will try to find step to reproduce the crash.

The variant in #1 is fixed by duplicating the key signature of the existing staff to the new staff (r3131).
I would like to see the original report more of an feature request. In the new wizard you can explicitly specify a global key signature for the score. This information is not available anymore when you later add a new instrument. The score key must be reconstructed/guessed from existing instruments taking into acount any transposition. I would like to postpone this to the next version after 0.9.6.

After some thoughts (and testing in sibelius), I'm not even sure the feature request is worth. Somebody else would like this behaviour?

I would expect that the new instrument had the same (concert pitch) key as the all the other instruments.

I still get different key signatures when I follow lasconic's instruments in comment #1 above. (Tested using r. 3137 nightly build, Windows 7)

This is going to come up in the next tutorial video I'm making, in which I add a bass guitar to the vocal parts in the score. At this stage it seems as though I need to add the key signature in manually into the bass guitar part when it gets added to the score. Is that correct?

That's OK - I'll just plan to include an extra step in the video (ie. manually add in the key signature for the new instrument). Thanks.

It's not just about initial key signatures, either. I would prefer newly added instruments to inherit the inital key signature as well as all changes. I don't see why key signatures are treated differently than time signatures in this respect. I mean, I gather they are implemented differently, but from a user perspective, there is no reason I can see for a difference.

In order to implement this, since there is no global key signatures the way there is time signature, I guess we'd be copying the key signature from some other existing staff, and the question would be, which staff? Top staff seems the most natural choice to me. That or the staff immediately above the added staff. In the vast majority of cases, I expect all staves would share the same key signatures (except for transposition when not in Concert Pitch mode, but the copy should account for that) so it really wouldn't matter which staff was chosen. And sure, some staves might be key-signature-less (like percussion) and not make good sources. But that doesn't mean it wouldn't be worthwhile to implement this for the general case.

When inserting a new instrument, I would go through all pitched staves. If for a given measure, there is a consensus on the current key signature (without considering the transposition of course), I would add the key signature in the newly created instrument. If there is not, then I would go for C major / A minor.

In 2eeb3de920 I implemented the following.

- Search the first non drum staff
- Store the key signature list for it
- If this staff is a transposing instrument and we are not in concert pitch, adjust the key list accordingly
- for any new part or staff added, insert key signature according to previous list. Transpose the key signatures if the inserted part/staff is a transposing instrument and we are not in concert pitch mode.

Feedback and tests are very welcome!

Of course, this approach is known to "fail" if the the key signature changes are different on each staff. Next one in the queue #18463: Wrong key signatures created for other instruments when adding to transposing instrument with concert pitch off