Option to convert transposed instrument key signatures into enharmonic equivalent when number of accidentals exceeds limit

• Nov 15, 2014 - 15:22
P1 - High
S5 - Suggestion

Ubuntu 14.04, GIT commit: d477e58

1) new score for alto sax, key of C major
2) make sure Concert Pitch is off
2) change key to E major

Result: key displays as C# major, but what is user wishes it to be simplified to Db major? Right now, I don't think there is a way to get Db - there is no corresponding Fb key signature to use in concert pitch.

I would propose either a style or staff properties option to control the simplification of key signatures. It could perhaps be a "maximum number of accidentals" rather than a simple on/off toggle (after all, we definitely need to simplify when going from B major to G# major, since there *is* no G# major - max number of accidentals can't be more than 7).


Besides this, Musescore always calculate the key signatures for transposing instruments, adding sharps or substracting flats. It would nice if one could turn off this feature temporarily (by a combination of keys). So it would possible control how the key signatures are displayed.

I´ve found a workaround. (musescore 2.0 Beta 2)


1) Create a score with flute and Alto Saxophone in the key of E major. (The alto staff will show 7 sharps.
2) right-click the alto sfaff and choose staff properties.
3) Change Play Transposition to "0 - Perfect Unisson". Press "OK
4) Change Alto key signature to Db individuallly (by pressing control while dragging key signature to staff).
5) Restore the original "Play transposition" (9 - Major sixth - down).

It works. When you copy and paste music from other instruments, musescore writes notes with sharps instead of flats. You can correct it by pressing "j" for enharmonics.

Attachment Size
Simplifying_Key_Signatures.mscz 6.86 KB

In 2.0 the workaround I described above does not work anymore. So It is currently impossible to write Eb instrument parts in the key of Db (transposed signature). Ok, you may write C# (7 sharps) instead of Db, but sometimes the score you are copying shows E key signature (4 sharps) for concert instruments and Eb instruments playing their music with 5 flats. (In fact most wind musicians prefered that).

I sugest two things for development team:

1) In inspector, adding an option for simplifying key signatures, or

2) Creating a F flat signature (8 flats) for local use.

Or a style option, or staff property to set the default, as I suggested originally. But even so, there an Inspector option to override on a per-key-signature basis makes sense, and maybe that's enough.

Meanwhile, if you want this effect, transposing the part manually would be the way to go. I'm pretty sure that most saxophonists I know would actually rather see five flats than seven sharps - due to the nature of the transposition, they are far more accustomed to seeing sharps than flats anyhow. But I assume you are a saxophonist and know your own preference, and if you are sure the others who will read the part will also prefer flats, then this is the workaround for now. Export to a separate part if ou don't want to lose the original.

I'm working on #22687: Concert Pitch switching does not preserve key spelling if the transposition crosses between sharp and flat keys and seems to make sense to do a basic minimal implementation of this feature at the same time. I'm tentatively adding the following two styles with defaults to 7 sharps or flats (since that is already the current behavior):

      { StyleIdx::keySigTransposedMaxSharps,     "keySigTransposedMaxSharps",    QVariant(7) },
      { StyleIdx::keySigTransposedMaxFlats,      "keySigTransposedMaxFlats",     QVariant(7) },

I'll make the transpose code obey the value set here.

Well as it is I seem to have that issue working correctly for basic cases based on the above keySigTransposedMaxSharps/Flats Style. But that is just a global style. Should I go ahead one or both of the following:

  • a per-staff property override editable in Staff Properties
  • a per-key-signature property override editable via inspector

Or is that too redundant?

Also for my global keySigTransposedMaxSharps/Flats property, should I add that to the Edit->Styles .ui?

This has been discussed some in forums. I don't recall anyone having a really strong opinion. Most people wanting this would be happy with the global style for now I suspect. Ultimately both of overrides could make sense.

In the Styel .ui, I have a QSpinBox for max sharps and max flats.

Here is an example of setting a reasonable limit of 6 sharps & 6 flats, and I have a concert key sig of 6 sharp and a concert key sig of 6 flats, and then having horn in F & Horn in G, which go over the limit when transposed, and are flipping sides as desired:

Screenshot (111).png

I've limited the range of values for each QSpinBox's to 4-7. I'm basing that decision on the fact that the traditional key sigs in circle of 5ths:

that it is not possible to convert an Ab (4 flats) into G# (8 sharps) or to convert E (4 sharps) into Fb (8 flats) without so-called "Theoretical Keys".

But note that I am allowing the limit to be set as low as 4 sharps and 4 flats, in which case Db "simplifies" to C#, and B "simplifies" to Cb, whereby the resulting "simplified" transposed key signature ends up having more accidentals than before "simplification"! But I'm leaving this option open to user discretion, because some musicians may actually prefer to have their transposed key signature represented in a manner that has more accidentals. (Who knows, maybe they "prefer" to read that way, so I'll leave that option open to prevent such "feature requests"). Here is an example of this unusual case of "simplification":


Note that I am interpreting the limit as a "triggering threshold" for simplification. So in the above case with a limit of 4 flats and 4 sharps, that for a concert Emaj, the Horn in F adds a sharp (which would be over the limit of 4 sharps), and will thus be converted to 7 flats instead of 5 sharps. And similarly for a Horn in G transposing from concert Ab (4 flats), the code will add a flat, which is over the 4 flat limit, and thus convert it to 7 sharps. I don't know if I should change the text label to make that interpretation more clear, e.g. "Trigger simplification of key signature when the transposed instrument key signature exceeds _ sharps/flats", but I think the concise "Maximum Number of Sharps/Flats" suffices.

I should also raise the question of whether I should set the "default" value of this style to 6 sharps and 6 flats, which is arguably the most "reasonable" setting. That setting would automatically perform simplification of Cb (7 flats) to B (5 sharps) and simplification of C# (7 sharps) to Db (5 flats), but nothing else.

Title Option to control simplification of key in instrument transposition Option to convert transposed instrument key signatures into enharmonic equivalent when number of accidentals exceeds limit

Well, to reduce confusion on the interpretation, I'm changing the text of the QLabel on the Edit Styles .ui to read:

"Convert transposed instrument key signatures into enharmonic equivalent when number of accidentals in transposition exceeds the following limits:"

A little wordy, but avoiding the word "Simplification" means this feature can allow for increasing the number of accidentals. I'm also changing this issue text accordingly.

I'm also making an executive decision to set the default limit at 6 sharps and 6 flats. So people who don't bother changing the setting will automatically have the basic simplification as described in comment #9.

In reply to by Laercio Ariel Macedo

Deleting an item from the master palette does not make MuseScore forget it ever existed. If you applied it to a score it will remain there. FYI, to delete an item from the master palette, right click it and select clear. To delete it from the score, select the key signature and press the delete button.

It is best if you create a new thread in the forum and explain what you are trying to do. I have a suspicion of what you need to do. Help with the program does not belong in the issue tracker.

Priority P1 - High

Actually, you can, set the interval to diminished seventh. So, a reasonable workaround for scores that don't change key. But you won't want this in passages where you don't need it.

Testing with a concert pitch of Cb major. When I change the tranposition on a Bb trumpet to Augmented second, the the key is moved up a half step. When I use the diminished third, the key is not changed unless I first change the transposition to something with sharp (like the Augmented second). It's very similar in function to my workaround.