Undoing a time signature change with tremolos causes crash

• Jan 25, 2019 - 08:13
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:

Video_2019-01-25_090428.gif


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.

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.