Undoing a time signature change with tremolos causes crash
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
3.0.1 / Windows7
1) Default score
2) Enter a few notes and tremolo in measure 2
3) Change time signature (eg drag and drop in first measure 3/4 time sig): note the tremolo becomes weird ("broken")
4) Undo
Result: crash
(discovered also by working around the attachment in this thread:
https://musescore.org/en/node/282055)
See:
Comments
Seems we handle tremolos horribly at the moment for time sig changes. I suggest we get rid of all tremolos when changing the time signature to something that isn't essentially the same (e.g. not 4/4 -> 2/2).
I suggest, that you remove them to change the time signature, then put them back on the notes that had them before the time sig change. I realize this will not be easy, because you need to adjust and insert notes to make it right. So a 4/4 whole note's worth of tremolo before becomes a dotted half followed by a quarter note for example when you change the time sig to 3/4.
Agreed, this would be the ideal solution. However, we don't allow tremolos across barlines at the moment. This means that the ideal solution would probably be to remove the tremolo, and then check if the two chords are within one measure. If they are, then it should be added back. I'll see if I can implement this.
Well, it wasn't easy, but I think I've managed it: https://github.com/musescore/MuseScore/pull/4752
By the way, this doesn't do what you suggested, Mike. Instead, the length of the tremolo is kept the same, since that's what we do with everything else when the time sig is changed. So, a tremolo between crotchets remains a tremolo between crotchets. And, each tremolo is checked and removed if it crosses a barline in its new position.
What made the fix so tricky was, because we effectively rewrite all the measures when the time sig is changed, the chords also change to different objects. So, what was needed was to find the new chords in the positions that the previously tremolo'd chords would be. Doing that, and making it undoable , was the difficult part.
Fixed in branch master, commit 9b6bdd7a7f
fix #282698: undoing timesig change with tremolo causes crash
Fixed in branch master, commit ccd527af20
_Merge pull request #4752 from jthistle/282698-tremolo-timesig
fix #282698: undoing timesig change with tremolo causes crash_
Automatically closed -- issue fixed for 2 weeks with no activity.