Swapping notes in a two-note tremolo causes corrupt tremolo (and crash)

• Jan 2, 2021 - 17:08
Reported version
3.5
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

See https://musescore.org/en/node/315002 for sample score, stack trace and steps to repdoduce
See https://github.com/musescore/MuseScore/pull/7201 for a band aid fix to prevent the crash


Comments

Title Swapping notes in a two-note tremolo cause corrupt tremolo and crash Swapping notes in a two-note tremolo causes corrupt tremolo (and crash)
Severity S2 - Critical S3 - Major

My 'band aid' fix got merged, that'd "cure" the crash, so I'll reduce the Severity

The cause: the tremolo should still be a child of the first chord, but due to the swap, it is now a child of the second chord, which will definitely not generate the correct result when loading the score again.

Status PR created fixed

Fixed in branch 3.x, commit 0bc6e16beb

_fix #315067: swapping notes in a two-note tremolo causes corrupt tremolo (and crash)

This is because the two-note tremolo has not been properly updated and still thinks it is the child of the now second chord (with chord1() being the now second chord and chord2() being the now first chord). Properly updating these fixes the issue. Meanwhile, if the two chords belong to different two-note tremolos, the swap is disabled, because there's no way of determining the expected behaviour._

Fixed in branch master, commit 86a8ac6f63

_fix #315067: swapping notes in a two-note tremolo causes corrupt tremolo (and crash)

This is because the two-note tremolo has not been properly updated and still thinks it is the child of the now second chord (with chord1() being the now second chord and chord2() being the now first chord). Properly updating these fixes the issue. Meanwhile, if the two chords belong to different two-note tremolos, the swap is disabled, because there's no way of determining the expected behaviour.

IMPORTANT: Remember to add this change (https://github.com/musescore/MuseScore/pull/7273/files#diff-3e7cf0f7e03…) when moving ScoreView::cmdMoveCR() to master!_

Fix version
3.6.1