Changing staff space causes numerous courtesy clefs to appear that I cannot get rid of (automatically)

• Apr 17, 2022 - 02:54

If I go into Format -> Page Settings and change the Scaling -> staff space (to make the part fill an entire page so it looks nice), numerous "courtesy clefs" appear all over the place. I can hide them one by one but it's ridiculous that I would have to do this. I have tried unselecting "Show courtesy clefs" but that doesn't help. I'm at a loss to figure this out.

I've searched a bunch of similar reports but nothing that is exactly the same as these steps for reproducing the "bug".

I'm at the latest version

Attachment Size
snippet 1.PNG 28.29 KB


In reply to by Jojo-Schmitz

Original XML is from Komp on iPad (see attached). A few clarifications:
a) right-click -> Hide courtesy doesn't do anything
b) these extra clefs only showed up when I resized the spacing
c) right-click -> select all similar highlights the clefs at the beginning of the staff as well (which I don't want to delete) but interestingly enough, when you hit Del, it only removes the courtesy ones (that's a weird situation).

So, your suggestion worked. Thanks very much. It would be interesting to figure out why it was occurring in the first place.


Attachment Size
920 Special.xml 171.46 KB

The MusicXML file indeed contains many superfluous regular barlines left and right. No superfluous clefs are present in the file, nor are they generated by the MusicMXL import. I do not know what causes the issue and it seems to depend on the exact staff space selected. The issue does not seem to reproduce when either the superfluous barlines are removed from the MusicXML file, or the importer is changed to prevent them from being added to the score.

It does seem adding superfluous regular barlines causes the layout engine to get confused about where the systems start, leading to extra clefs and key signatures being added.

In reply to by Leon Vinken

That is my guess as well. MuseScore doesn't normally use left barlines for anything except the first measure of each system, and start repeats. I know there is code that is used to determine if a measure should contain a header or not, and managing that as the layout changes can be tricky. Also for things like, allowing you to set the properties of that system barline independently of the end barline of the previous measure, or properties on the generated clef - what should happen to those if the layout changes and the measure is no longer the first of a system? There have been plenty of bugs in the past having to do with management of all that, this seems like more or the same.

Probably this case is mostly fixable by simply ignoring the spurious barline tags on import. Problems would presumably remain when legitimate left barline tags are used, like to specify a double barline at the start of a system. I suspect the deeper fix has to do with setting the "generated" flag on the barline or something like that.

Do you still have an unanswered question? Please log in first to post your question.