Multimeasure rests corrupts multi staves instruments

• Apr 4, 2014 - 19:58
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

Windows 7, GIT commit: 6c5b016

I suspect it will turn out the score is already corrupt, but if I knew what specifically was corrupt about it, that might help me figure out how to reproduce whatever caused it. This is a score I created from scratch yesterday, but I build by copying and pasting content from a score original created in 1.3.

1) open attached score
2) file / parts
3) new, select piano
4) ok
5) view piano part
6) save
7) close
8) reload
8) view piano part

Result: first section of the piece has changed from three nice multiple measure rests separated by double bars into a mess of shorter mmrests, individual measures, and an extra time and key signature in bar 2.

I can't prove it, but I *think* what got me into this state had something to do with adding and deleting barlines (double bars and open repeats) at rehearsal letter "C".

Attachment Size
Different_Worlds 2.mscz 57.09 KB

Comments

I just had this same thing happen to another score, which I am attaching. In both cases, it is the piano part with the problem. A few things unique about the piano part are - last staff of system, contains two staves, uses lots of chord symbols, uses slash notation (just ordinary notes set to stemless and with slash heads), Hide Empty Staves turned on. Any of these could turn out to be the trigger.

Attachment Size
As_I_Do.mscz 125.5 KB
Status (old) needs info active

OK, I can reproduce this now in a simple score.

1) open attached score (just a mostly-empty score for flute & piano with a few notes here and there)
2) file / parts
3) new all, OK
4) view piano part
5) save
6) close
7) load
8) view piano part

Result: mmrests are broken randomly

Continued editing and saving leads to further corruption and/or crashes upon reloading again.

Attachment Size
corrupt-part-before.mscz 1.91 KB
Title Part becomes corrupt on save / reload Multimeasure rests corrupts multi staves instruments

More investigation. It's not linked with parts at all. To reproduce the problem.

  • Create a *piano* score
  • Add notes in the first measure on both clefs
  • Go to Style -> general -> score -> create multimeasure rests
  • Save
  • Reopen

Result: the score is corrupted.

One part of the bug is probably around here
https://github.com/musescore/MuseScore/blob/master/libmscore/scorefile…
We got messages Score::readStaff(): missing measure!, because when reading the second staff we don't get the mmRest measures.

Even if fixing this with the following, problems remains. Some rests are created in the first measure of the mmRest.

 measure = (Measure*)mb;
if(measure->isMMRest())
      mb      = measure->mmRestFirst()->next();
else if (measure->hasMMRest())
      mb = measure->mmRest();
else
      mb = mb->next();
break;