Shift left/right command in note input create corrupt timing if durations do not match

• Nov 22, 2015 - 05:28
Type
Functional
Severity
S3 - Major
Status
closed
Project

Ubuntu 14.04, GIT commit: 648340f

Reported in https://musescore.org/en/node/86901

1) My First Score
2) Note input
5) 5 C 6 D 5 E (quarter, half, quarter)
6) Left Left (move cursor back to the half)
7) Shift+Left

Result: the first two notes are exchanged, yielding half quarter quarter, but the layout makes it clear something is wrong. The half note is allocated only enough space for a quarter, and the quarter is allocated space for a half.

Before:

move-note-1.png

After:

move-note-2.png

If you play the score, you hear quarter half quarter.

The object debugger reveals the segments are still at 0, 480, and 1440 - just as they were before the exchange. Looking at the code, I don't see any attempt to do anything like that; it seems the code is only going to work if the durations match. As short term fixes, we should probably either disallow the operation if the durations don't match, or exchange the durations.


Comments

Status (old) active patch (code needs review)

https://github.com/musescore/MuseScore/pull/2297

This PR prevents the corruption by disabling the operation in the cases where it does not work. I considered adding code to handle the cases of different durations by keeping the original durations and only swapping the pitches. But I think that is unlikely be to be what anyone would actually want to see happen, so I decided to just disable it and maybe some day we can see about handling this correctly.