Allow clef change after barline (for repeats)

• Sep 14, 2015 - 06:45
P1 - High
S5 - Suggestion

I agree with what Elaine Gould has to say on p. 235, chapter "Placing changes of clef, key signature and time signature":

A change that affects the music only after a repeat goes after the repeat barline

Finale has an option "Place clef after barline", which would be handy here. As there can both be situations where the clef is more sensible before and after the ending repeat barline, I think this choice should be left to the user.

Attached is the example from Gould, but with the clef change before the barline rather than after it.


Just for completeness, the current code displays the clef change after the bar line, (and without a courtesy clef), if the start repeat is at a new system.

You can get a clef change after the barline by simply adding to the first note of the measure (eg, click first note, double click clef). There are some quirks where occasionally this does not work exactly as expected, see #46036: Clef on first note of system becomes header clef after save and reload.

Aside from that, though, as far as I can tell, this is already possible, so this feature request can be closed unless there is some aspect to it I am missing.

Marc, your method indeed works if there are no key or time signature changes, but if there's either of those (as in the original example), the order is wrong. Only clef and barline should be swapped. The correct order (also found at the mentioned page in Gould) would be as follows:


But MuseScore does this:


Ah, yes, good point. One possible solution would be to allow you to add a clef to the key or time signature that same way. I suspect this would not be hard to implement. It would allow for either order of appearance in case you do for some reason want the clef last as it is now. But it would also probably just as straightforweard to modify the code so that adding the clef added it before a key signature if present. It could probably even be made so that they appear in the order you actually add them (well, probably reverse order) so again, you can get either order if you want.

FWIW, I have verified that if you edit the score by hand (save as MSCX and open in text editor) and move the clef before the key signature, things don't immediately go haywite. Not saying there wouldn't be somewhere that things might go wrong because the code isn't expecting this, but at first glance, it does work, it survives save/reload, courtesy signatures work normally as far as I can tell, etc.

Amazing! I didn't consider that might be possible. So right now, one can either edit the XML or possibly write a plugin that supports this via the GUI. But I think it would be good to make this a core feature as well.

Well, it's *possible* to edit the MSCX file in this way, but not a real solution of course, and definitely not "supported" in that I can't guarantee nothing will go wrong. I was mostly just musing aloud for the benefit of whomever ends up imlementing a solution to this, that there is at least *some* change that it could be relatively simple to support. We'd have to do a lot more testing.

I guess one practical take-home here is, feel free to try this yourself but keep a copy of the original, then keep playing around with the hand-edited version and let us know if you see anything go wrong.

Fix version