Wandering hairpin in score with mmrest & invisible staves
Another trigger for a "wandering hairpin", still present in 2.1. To reproduce:
1) load attached score
2) change vertical offset of hairpin
3) save
4) close
5) reload
Result: horizontal offset has changed as well
Depending on the content of the score, it can be a very big discrepancy - like half way across the page.
The trigger seems to be a combination of mmrests and invisible staves, but it also seems to be somewhat dependent on the order in which things happen, because I wasn't always able to reproduce this from scratch. But whatever has infected this particular score appears to be permanent. And same for the score posted in the forum that led to this issue being filed: https://musescore.org/en/node/88321#comment-780041. In my response there, I indicated the hairpin was actually attached to the wrong staff, and this is true - unhide the piano staff and check out the hairpins again. But it does't seem to be the case with my test score. Still, the presence of the invisible staff seems necessary to reproduce the problem, so it's somehow relevant.
Attachment | Size |
---|---|
hairpin-wrong-staff - saved.mscx | 12.15 KB |
Comments
This issue goes back more than three years, ie on July 28, 2014
Tested with always the same sequence of steps, ie :
1) New score for a piano (one staff) and another (two staves), 5 measures
2) Enter two half notes: measure 3 top staff, and second staff
3) Add a hairpin: top staff on half note
4) « M »
5) « I » → Untick « Visible » for second piano
6) Hairpin : set Vertical offset to 1,00
7) Save/Close
After reload, I get this result with this nigthly, so, as expected : 69923ea
I receive an unexpected/wrong result - for horizontal offset - with the next nigthly : cca0251
So, I guess it’s a side effect of this last mentioned nightly/commit : cca0251
To fix : #27861: Saving score with some instruments suppressed and multimeasure rests messes up score
Brilliant, thanks as always for the investigation!
If I understand the code correctly, it appears that when saving a score with mmrests and invisible staves, we actually temporarily set the staves to visible before writing the file, in order to be sure all necessary layout information is present. I have my doubts about whether that was the best solution to the original problem in #27861: Saving score with some instruments suppressed and multimeasure rests messes up score. But in any case, the problem appears to be that when we read the file back in, we are getting the hairpin position based on where it would be if the invisible staves were visible, because that's how it was saved. I suspect that how we are saving the file is OK but we need to be more clever on reading it, to adjust the position. But maybe not - maybe we need to look more closely at how we are saving it. Anyhow, knowing the root cause will help greatly, so thanks again!
Came in again in #263279: crescendo hairpins placed (saved) erratically after last MS update
Came up again in https://musescore.org/nl/node/270058
Restored position indeed matches the one for when the hidden instruments are not hidden.
Cannot reproduce this one on master, but created #278122: Offset values are not saved instead.
Hmm, I have my doubts as to whether this is really fixed or whether that other problem was just masking it, but will test...
Well, I can confirm I can't reproduce the same way as before, so maybe it is fixed, I guess time will tell. I will say that #277821: Multimeasure rests extend when editing an element later in the score gets in the way of testing this, annoyingly so.
Automatically closed -- issue fixed for 2 weeks with no activity.