Hiding time signature corrupts score

• Jan 21, 2012 - 18:50
S2 - Critical

The enclosed score has a few hidden elements, so please switch on "Show Invisible".
Select the 5/4 time signature at the end of the end of the second system. Set it to invisible in both treble and bass.
Save the score. Exit. Open the score. Da da: The hidden time signature reappeared, being preceded by a hidden one.
The score is now corrupt. If you delete one of the two at the end of the second system, the third system is cut to 4/4 although it's still marked 5/4.

I didn't find any way to fix that other than delete bars and recreate them. Very annoying.

Attachment Size
bug.mscx 84.47 KB


I enclose a score that is also corrupt.

Although changing back to 4/4 time at the end of the first system, the program insists that it wants to continue with 6/4 time. The 4/4 also can't be deleted.

I don't know anymore how I got here, it corrupted itself in the course of changing time signatures, hiding them, etc.

If would be nice to give the user an option to correct situations where the system has gotten itself into a knot like this.

Attachment Size
Blues intro-corrupt 2.mscx 85.4 KB

I can reproduce at least the first part of this. Not sure about the corruption, but you definitely get a newly-generated courtesy time signature change in addition to the invisible one, and weird things happen if you deleting one.


I noticed that the example in the original post ("bugs.mscx") is not a sane score: at the end of the second system there is a courtesy time sig, (5/4) but there is no primary 5/4 time sig. at the beginning of the next system. So, it might be a bad example to work on. Also it is an 1.1 score and since 1.1 time sigs have changed a good deal.

Then, I started afresh with a new 2.0 score and noticed that:

1) yes, if a courtesy time sig, is hidden, another one is created when the score is re-open
2) deleting the hidden courtesy time sig causes 'funny' things to the previous measure(s?).

I tend to reduce the seriousness of this bug if the idea was to hide a courtesy time signature, as now there are at least two ways to hide courtesy time sigs: the score-wide setting in "Style | General | Page" and the individual time sig. setting "Hide courtesy".

Anyway, as the process shows a weakness in the code base, I'll try to have a look at it.


Status (old) active patch (ready to commit)

Pull request with fix pushed to gibhub: //github.com/musescore/MuseScore/pull/840 .

The patch probably does not fix the sample score in the original post: this is a 1.1 score probably already corrupted.

However, it fixes the behaviour of edited courtesy time (and key!) sigs for 2.0 scores (and potentially 1.3 uncorrupted scores).