Wrong key when changing instrument

• Aug 27, 2014 - 11:05
S4 - Minor

I used Tchaikovsky, Chanson Triste for Piano and Cello (by shutterfreak) in Bb

1. Change "Schlüssel" to Violinschlüssel -> Notation/Tonart/Key Change is ok
2. Change Instrument from Cello to Tenor Sax, key stays in Bb -> should go to C
3. Press "Kingende Notation" - key goes to Ab, should go to Bb

Same effect with other transposing instrument like Baritone Sax.

Musescore 2.0.0


For the the benefit of the non-German speaking population :-)
Schlüssel -> clef
Violinschlüssel -> treble clef
Tonart -> key signature
Klingende Notation -> concert pitch

I have had a problem that I think is related to this.

If there is a score with only non transposing instruments and you add a transposing instrument, alto sax for example, key signatures will not change when switching between concert view and transposed view. However chord symbols will switch correctly.

If the non transposing instrument is deleted, so the the first instrument is a transposing instrument, adding new instruments work correctly.

When a new score is created, key signatures seem to work correctly.

Concert view or transposed view does not seem to have any influence, see below.

In Musescore 1.3 there is a somewhat different but also incorrect behavior. Adding a transposing instrument in concert view works correctly, adding a transposing instrument in transpose view is erroneous, as key signatures who should have sharps get flats, i.e transposes in the wrong direction, or as it would have done if the view had been concert view.

Hmm, I see what you mean - but only if the score was originally in C, correct? That is, if your score had a key signature, then this *is* properly transposed when adding instruments.

I think this is separate, so I will file it as such. Please do respond to make sure we are seeing the same thing.

Here is the new issue:

#31571: Adding transposing instrument to a score in C yields no key signature

Note the workaround - add an explicit C major key signature after adding the transposing instrument(s).

This just came up for me again...
in 1.3 it was so easy to convert a, say, soprano voice into a Bb clarinet, just right-click, staff properties, change instrument, Bb clarinet and voila, not only the right sound and the right notes, but also the right keysig. Not in 2.0 though... it doesn't change the keysig, so you end up with a bunch of accidentals and would have to know which keysig to drag into that staff and not forget to hold Shift pressed while doing it, pretty messy, I think.

It seems it would be easy to fix this in Score::transpositionChanged() by just transposing the keys as well as the chords as we loop through the segments (we can probably improve the spelling of the pitches too, to spell pitches in the new key the same as they were in the old, relatively speaking).

I'm assuming there is no good reason *not* to transpose the keys, and this was just unfinished business, not a deliberate choice? On that assumption, I will look at this.

BTW, I see there is a TODO in the code code here for grace notes, and sure enough, they don't transpose when changing instrument. That should be simple to get too.

BTW, as a better workaround for now, it *should* work if you turn concert pitch on, do the change instrument, then turn concert pitch off. But I can't try that right now to verify...