Changing a clef over a section break is handled incorrectly

• Aug 14, 2019 - 02:56
Reported version
3.2
Priority
P1 - High
Type
Graphical (UI)
Frequency
Many
Severity
S4 - Minor
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

https://musescore.org/en/node/293323#comment-939452

Add two measures. Change the barline of the first measure to an end repeat. Add a section break. To the next bar, change the clef. A courtesy clef is invisibly added on the measure with the section break but the clef in the next measure is not changed.

Attachment Size
Scale_Exercises.mscz 35.64 KB

Comments

There is an explicit treble clef in your score after the last section break. To correct this, simply select the incorrect clef and press delete.

Usually, the steps that you listed will not cause this to happen, as long as the clef you want to change still has its generated flag set. Changing any of the clef's properties will cause the generated flag to be unset, even if the property is later changed back to the default value.

I was able to reproduce this scratch quite a few different ways, though. I think the key is the end repeat, and the code I added have to swap the order of the repeat and clef segments. My guess was that adding a check for isEnabled() on the clef segment might fix it. OP indicated in forum he might want o try his hand at development...

@Marc Sabatella, are you referring to OP's main problem of a clef that won't change? Or are you referring to the fact that the courtesy clef switches places with the repeat barline even though the courtesy clef is hidden? I think the two matters are entirely unrelated. I do not know what OP did that resulted in the header clef losing its generated status, since the steps provided do not cause this to happen. But, as I said earlier, I know how to make it happen, and I know how to correct it.

@kyleshores44, did you try to delete the clef like I suggested? Did it work? Do you remember anything else you may have done that could have resulted in the header clef losing its generated status?

I'm referring to the empty space after the section break. And I was assuming this was related to whatever caused the generate flag to get messed up. In other words, I was assuming the bogus extra clef was the result of attempts to fix this. I was able to reproduce that from scratch through similar experimentation, but I don't recall the steps.