Corruption upon lengthening a previously shortened measure

• Mar 12, 2015 - 23:11
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Ubuntu 14.04, GIT commit: bf1ec31

1) new score, two instruments, 4/4
2) measure 2, measure properties, shorten to 2/4 (measures now have half rests)
3) enter notes into measure 2 for one of the two staves
4) measure 2, measure properties, lengthen back to 4/4

Result: the measure in the staff the note is lengthened correctly, but the measure in the staff with the rest is not - it still shows just the haf rest


Comments

You don't need multiple staves to see the bug, nor do you need to enter notes - it just helps show the nature of the problem - only measures containing rests have a problem. Furthermore, it's only measure containing just a *single* rest that have the problem. Follow the same steps using 3/4, and the shortened measures now have a half and quarter rest, and these lengthen fine. Unless you turn one into a dotted half rest.

The problem is here:

https://github.com/musescore/MuseScore/blob/master/libmscore/measure.cp…

We are trying to set the duration of the rest to V_MEASURE, but I think what we really need to do is set the duration *type* to V_MEASURE, and the duration to the actual length of the measure. I don't know all the intricacies of this part of the code, but it seems to work, and I'll submit a PR for review so you guys can check it out in the morning and see if it's worth rolling into the release candidate. I think so; this is going to be a pretty easy way to create corruption.

I see the emergence of this issue between February 15, but more likely at the beginning of February 16 (test following the initial message with two staves)

Between this Nightly, correct:02a3710
And result:

February 15.jpg
February 15 2.jpg

And this one: 91a2d01

With result:
february 16.jpg
february 16 2.jpg