Shift left/right command in note input create corrupt timing if durations do not match
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:
After:
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
Try it with tulets and things get messier still. We'd have to fix those up - or disallow the operation.
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.
Fixed in branch master, commit 3317556e1f
cheap fix #88291: disable shift+left/right in cases where it fails
Fixed in branch master, commit dfa4d350a0
Merge pull request #2297 from MarcSabatella/88291-moveCR-duration
cheap fix #88291: disable shift+left/right in cases where it fails
Fixed in branch 2.0.3, commit 932b902ba1
cheap fix #88291: disable shift+left/right in cases where it fails
Automatically closed -- issue fixed for 2 weeks with no activity.