Adding Chord Symbol with Part containing linked Staffs causes overabundance of linkedTo and Harmony elements

• Dec 21, 2015 - 18:22
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

I've been seeing a lot of crashes when trying to add or edit chord symbols and fretboard diagrams, including strange layering behavior where there are many (thousands) of the same chord symbol or fret diagram layered on top of each other. After some experimentation, I was finally able to reproduce this behavior. Here's the repro:

[note: see comment #10 for a repro with a much simpler, from-scratch score]

1) Open attached file "DCD before adding chord symbol at measure 40.mscx"
2) Go to measure 40
3) Click on the "2" at the top of the tablature staff to select the note
4) Press Ctrl+K to add a chord symbol
5) Type "Gmaj"
6) Click anywhere else to move focus outside the chord symbol text entry box
7) Save the file to a different name.

The result (for me, at least) was 100% repeatable and is shown in attached "DCD after adding chord symbol at measure 40.mscx". I was not able to reproduce this effect with a trivial score, so I'm not certain of the base conditions to reproduce.

What's wrong with the "after" case?
a) Instead of 7 linkedTo elements, there are now 6145.
b) Instead 25 (26 including the new one) Harmony elements, there are now 2072.

Adding further chord symbols or moving chord symbols or fret diagrams will eventually result in a crash. The only way I've found to prevent this is to edit the file in notepad++ and remove the duplicated linkedTo and Harmony elements, which is obviously not practicable.

This may be the root cause of https://musescore.org/en/node/89106.

(edited to avoid the element names being eaten--removed brackets)


Comments

Correct, though I just confirmed that it also repros in the latest nightly: MuseScoreNightly-2015-12-02-1810-77e980d

The "before" version doesn't have those hundreds of linkedTo elements; only the "after" one does, though I agree this is likely related to the issues you referenced.

Is there something else obviously wrong in the "before" file? I'd be happy to help recreating this situation if possible.

Ach, I'm wrong. The "before" file does have a mess of linkedTos. Let me get the clean starting file posted.

Okay, new clean starting point updated.

Note that the number of linkedTo elements that get incorrectly generated is not always the same. On my most recent repro (confirming that it happens with this score that appears to have the right number of linkedTo elements), I only got a few extra linkedTo and harmony elements. Subsequent editing seems to explode the number, though.

It's possible that the linkedTo elements are already hosed, but the 7 of these that I see in this score match the 7 in a freshly-made score with two parts where one has two linked staffs.

Okay, finally got a repro with a much simpler score, but it is still a reliable repro.

1) Open attached score "linkedtTo7.mscx". This file has 7 linkedTo elements.
2) Select the entire first measure on the ukulele (2nd and 3rd) staffs. Do not select the first staff.
3) Ctrl+C to copy the contents of the measure.
4) Click on the rest in the second measure on the second (pitched) staff.
5) Ctrl+V to paste. Note that if the gretboard diagrams and chord symbols don't paste along with the notes, you probably won't get the repro. Go back to 1 and try again, being sure to select the whole measure content, and to paste it onto the rest in the second staff.
6) Save the score to a different name. You'll have the equivalent of the attached linkedTo13.mscx.

Result: The score now has 13 linkedTo elements.

Attachment Size
linkedTo7.mscx 60.14 KB
linkedTo13.mscx 78.04 KB

Note that the simpler repro score was created from scratch with a violin staff and linked uke and uke tab staffs, then some simple note entry and editing, and the addition of the two fretboard diagrams and then the chord symbols. The first fretboard diagram was the default guitar one, which I then reduced to four strings in the property editor. The second fretboard was a copy/paste/modify of the first.

The following steps continued the linkedTo expansion:

6) Select the highest C in the second measure (pitch 72)
7) Use arrow keys to lower the note to middle C.
8) Save the score

The result was 25 linkedTo elements, as shown in attached linkedTo25.mscx.

That should be enough to help you repro, but don't hesitate to let me know if you need anything more. Thanks for all the work you do to make musescore great.

Attachment Size
linkedTo25.mscx 78.34 KB

And one final update: Removing the Part for the linked staffs (ukulele in this case) appears to prevent the excess linkedTo and Harmony elements from regenerating once they've been manually cleaned up. So that's my workaround while I work on my piece. I'll just generate the uke part when the piece is done.

And one final update: Removing the Part for the linked staffs (ukulele in this case) appears to prevent the excess linkedTo and Harmony elements from regenerating once they've been manually cleaned up. So that's my workaround while I work on my piece. I'll just generate the uke part when the piece is done.

Further experimentation appears to confirm that this issue only occurs if there is a Part that contains mutually-linked Staffs (such as a pitched staff and a tablature staff). Of course this is quite common for guitar and other plucked string instruments.

Title Adding Chord Symbol causes overabundance of linkedTo and Harmony elements Adding Chord Symbol with Part containing linked Staffs causes overabundance of linkedTo and Harmony elements

Making title more informative by inserting "with Part containing linked Staffs".

Status (old) patch (ready to commit) fixed

Fixed in branch master, commit 8bf08c2328

fix #89636 fix #94911 fix #70226 fix #91351: unlink the right staves when deleting a part, or deleting a linked staff. Do not store several times the same staves in linkedStaves

second take

Fixed in branch master, commit c6ccf18398

Merge pull request #2397 from lasconic/fix-89636-and-more

fix #89636 fix #94911 fix #70226 fix #91351: unlink the right staves when deleting a part, or deleting a linked staff. Do not store several times the same staves in linkedStaves