Chord symbols deleted on paste
Chord symbols are supposed to be preserved when pasting notes, but this is not happening anymore. I believe it probably broke with https://github.com/musescore/MuseScore/pull/4855, despite an attempt to preserve them. To reproduce the issue:
1) enter four quarter notes into bar 1, chord symbols on each
2) enter four quarter notes into bar 2, no chord symbols
3) copy bar 2 to bar 1
Result: chord symbols are deleted
The intent is that the chord symbols are preserved, unless the source contains a chord symbol at the same place. If the source has a chord symbol in the same place, it is supposed to replace the chord symbol in the destination, but other chord symbols are supposed to remain in place. This was implemented for MuseScore 2 and as far I know worked correctly until recently.
I discovered this working on #297883: Multiple chord symbols attached to same note do not copy as part of range. The fix for that issue be to track which chords we just added, so we don't keep replacing them. This fix works, but in testing I realized that all destination chords were being deleted before we even get started. So actually, the code to replace chords individually isn't even needed right now, but it will be once the bug of deleting all chords is fixed.
Comments
I had a quick look at this issue and after a few changes, this is what I get now.
Original situation:
After copy-paste measure 1 into measure 2:
As you see, the first note keeps its Dm, the C7 on the second note is replaced by Bsus4. The third note had not chord ad won't get one. And the Em on the last note is just copied.
Is this what is expected?
I will do some other tests with hairpins, system and staff texts to see nothing else is broken.
In reply to [inline:298541-before-paste… by njvdberg
Yes this is the expected behaviour.
In reply to Yes this is the expected… by Howard-C
Fine, then I will finish the tests and the PR.
See https://github.com/musescore/MuseScore/pull/5674
According to the code, the workaround should be to deselect "Chord symbols" in selection filter.
In reply to According to the code, the… by dmitrio95
How is this a workaround ?? You are then keeping only original chords instead of the merge possibility
The full workaround in this case:
1) Copy a range
2) Deselect "Chord symbols" in selection filter
3) Paste a range
This would merge chord symbols from both locations.
Fixed in branch master, commit 66099812d8
_fix #298541 - Chord symbols deleted on paste
Was partial fixed in Score::makeGap() by defining a filter for deleteAnnotationsFromRange()
and deleteSpannersFromRange(). However, a simiar filter was missing in Score::makeGap1()._
Fixed in branch master, commit 7a134d281d
_Merge pull request #5674 from njvdberg/issue-298541-copy-harmony
fix #298541 - Chord symbols deleted on paste_
Automatically closed -- issue fixed for 2 weeks with no activity.