Score unreadable, reports negative measure length
Reported version
3.6
Type
Functional
Frequency
Many
Severity
S2 - Critical
Reproducibility
Once
Status
needs info
Regression
Yes
Workaround
Yes
Project
Bonjour,
Lors de la saisie, le programme a planté et la partition est devenue illisible.
Merci pour toute aide me permettant de la récupérer
Attachment | Size |
---|---|
Donald Covay - Chain Of Fools.mscz | 28.59 KB |
Comments
Translation:
When typing, the program crashed and the score became unreadable.
Thank you for any help allowing me to recover it
When loading the file MuseScore shows this error:
MSCX Error in line 2349: Invalid measure length: -8/16
First fix, extracting the mscx from the msxz (it is a ZIP archive in disguise), opening it with a plain text editor, searching and deleting all negative measure durations (just the - sign), moving it back into the mscz.
Opening that now does reports corruptions:
Measure 48, Staff 1 incomplete. Expected: 4/4; Found: 6/4
Measure 48, Staff 2 incomplete. Expected: 4/4; Found: 6/4
Measure 48, Staff 3 incomplete. Expected: 4/4; Found: 6/4
Measure 50, Staff 1 incomplete. Expected: 8/16; Found: 0/1
Measure 50, Staff 3 incomplete. Expected: 8/16; Found: 0/1
but allows to open it anyway, by using the "Ignore" button.
Now see How to fix a score that contains corruptions
This is not the first report with these symptoms, I can't find the others though currently, but there were at least 3 more, possible in the forum rather than the issue tracker?
Any idea how you managed to get the score into that condition?
uncorrupted score attached (the corrupted measures were entirely empty, so deleting and inserting new ones helped).
Still the last 2 measures look... strange?
Unpacking the saved score to retrieve the mscx file, reveals an measure length of -8/16. Possibly an underlying bug; saving a negative measure length?
Oh, sorry! You beat me to it! :D
Possibly, even surely a bug, but we'd need steps to reproduce
What means exactly "len" in Measure len="-8/16" ?
It is supposed to be a true (and positive) "fraction", the actual measure duration, like
len="8/16"
, and only gets written for measures that have a different duration than what the time signature asks for (measure.cpp):Maybe we'd better just report that error as a corruption and on "Ignore" remove the -, rather than denying to read the score entirely.
Maybe we should make sure on writing a score that the numerator never gets (written as) negative. Actually as per the code this shouldn't happen for fractions (fraction.h):
but might for the numerator (also fraction.h):
No idea why
setNumerator()
doesn't use the same mechanism assetDenominator()
?!? Or is that the place where it goes horribly wrong?The error on read is reported here (measure.cpp):
So in addition to not allow for negative values, 0 is not allowed either.
So it should never get written in the first place!
Much better though would be to prevent this from happening at all. But as mentioned: for that we'd need steps to reproduce.
Thanks to you !
I was able to recover 4 pages of my work.
Thanks again for your help ;)
That error exit got implemented (and released with 3.5.0) to prevent a crash, see #282492: Musescore crashes on reading MSCX files with invalid measure length
In reply to (No subject) by Jojo-Schmitz
One more in: https://musescore.org/fr/node/323955
Seems a 3.5 regression (see above)
Albeit better than a crash...
The workaround is pretty cumbersome, hand-editing the mscx, but it is a workaround ;-)
That score does have an
originalFormat
tag, but it is empty, I wonder whether it was xml and the file stems from a PDF conversion?The scores from https://musescore.org/en/node/317632 and #323200: Corrupted don't have that though