changing note value can lead to missing accidentals

• Jan 27, 2015 - 03:37
Type
Functional
Severity
S3 - Major
Status
closed
Project

1. Create a 3/4 measure with the following notes:
missing sharp 01.png
2. Click on the first note, and change it to a half-note.

Result:
missing sharp 02.png
The sharp is missing on the beat 3 F#.

I am using MuseScore nightly ff2b92c on Kubuntu 14.04 64-bit.

Attachment Size
missing sharp 01.png 5.23 KB
missing sharp 02.png 4.69 KB

Comments

It is simple to fix this by adding a call to cmdUpdateNotes() at the end of changeCRlen(). In case of ties (insert baseball joke about the runn being safe), it's only necessary for the first measure, as the tie code does cmdUpdateNotes as well.

However, there is another problem with the tie code that I don't see how to fix.

Enter a whole note G in one measure, four quarter note F#'s in the next. Then click the G and press ".". It extends the G into the next measure, taking the time of the first two F#'s, and a sharp sign appears on beat 3 - all good so far. Now undo. The deleted F#'s return, but the sharp sign on beat 3 doesn't go away.

As near as I can tell, it actually *is* deleted over the course of the operation, but then added back when restoring the deleted notes.

This is, I suppose, less severe, but it still bothers me. Meanwhile, I'll look at other things, because this issue appears to be deep in the undo code.

After checking, the issue described in the first message is always present in the time since May 19. See this image (produced with 56177c3)
result May 19.jpg

However, the scenario (comment #2) is slightly different, and I can locate it: on November 13 or between November12 and November13.

The steps (recall)

1) Enter a whole note G in one measure, and four quarter note F#'s in the next.
2) Then click the G and press "."
Result: it extends the G into the next measure, taking the time of the first two F#'s, and a sharp sign appears on beat 3 - all good so far.
3) Undo.
Result: the deleted F#'s return, but the sharp sign on beat 3 doesn't go away.

- On this Nightly, on November 12: bbe146b
I get (as expected):
after undo on bbe146b November 12.jpg

- On this one, on November 13: 3486e76
I receive (as described above):
after undo on 348e76 November 13.jpg

. After seeing, this commit might be the closest to the issue ("undo.cpp" or other) ? https://github.com/musescore/MuseScore/commit/4196bd1ca96239d251e26554f…

The first part of this is definitely major, but easily fixed with a call to cmdUpdateNotes() as I mention in comment #2. The second part seems possibly unrelated (as far as root cause is concerned) and not as significant I think, as the user is more likely to notice and remove an extra sharp than notice and add a missing one. So I may submit a PR for just the first part and call it good enough for now.

Still, it's possible the fix for the second part would fix the first as well, so I'm in no hurry, if someone wants to look at that.