Lyrics: select all and "X" causes program to freeze

• Jan 8, 2019 - 10:11
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.0.1.4922, revision: 598057d

Open the attached file. Take the reset or not, the issue is still the same. Right-click on a lyric, chose "Select > All similar elements." Then press Ctrl + R to reset.

Result: The program freezes.

Attachment Size
piano_song.mscz 31.78 KB

Comments

Title Lyrics: select all and reset causes program to freeze Lyrics: select all and reset causes program to freeze for a particular score
Priority P0 - Critical

I can confirm using the provided score and another random one I tried that was not a 2.x import, but I could not reproduce in a new score I created from scratch. Not sure what the trigger is.

Title Lyrics: select all and reset causes program to freeze for a particular score Reset lyrics via Ctrl + R shortcut crashes the program depending number to lyrics

The trigger is the shortcut (how?) combinated to the number of lyrics to reset.

From scratch:

1) Default score
2) Enter notes and lyrics on first system (with eg custom X offset, but not necessary in fact)
The test file at this step (here default 0 offset): lyrics 1 system.mscz
3) Right-click syllable -> All similar elements
4) Ctrl + R

First result: you note the lyrics remain highlighted a few seconds, before the program becomes again available.

5) Add notes and lyrics on another system.
The test file in this case: lyrics 2' systems.mscz

6) Repeat steps #3 and #4
Result: the program freezes and shuts down after some seconds.

  • You note, by testing and adding lyrics progressively (one measure on second system -> Ctrl + R, then on two measures, ditto, and three etc. ), and more and more the program suffers to recover its availability. And so, about two systems is enough, and the program gives up.

  • Note also: by resetting lyrics via the appropriate button in Inspector (automatic placement checked or not): no problem.

Title Reset lyrics via Ctrl + R shortcut crashes the program depending number to lyrics Reset lyrics via Ctrl + R shortcut crashes the program depending lyrics number
Title Reset lyrics via Ctrl + R shortcut crashes the program depending lyrics number Lyrics: select all and reset causes program to freeze
Status active PR created

I liked the original title better.

Adding these lines at the beginning of ScoreElement::undoChangeProperty() seems to solve the problem

      if ((getProperty(id) == v) && (propertyFlags(id) == ps))
            return;

The idea is that if there is nothing to change, then there is nothing to do. Part of the problem is that changing the placement for a single lyric will change the placement for all lyrics on that line. So by the time we move on to the next selected lyric, we have already called ScoreElement::undoChangeProperty() on that lyric, and all other lyrics on the line, and we are about to do it again. And again. And again, and so on. And updating the Inspector is expensive.

PR is here: https://github.com/musescore/MuseScore/pull/4553.

The operation takes several seconds to complete, during which time the application appears to have hung. But unless you kill the program, the operation does complete.

Same here. Changing the placement directly via the Inspector does succeed after several seconds, and so does Ctrl+R actually, but the reset button in the Inspector and the "X" command both freeze.

1) load the All of Me score referenced above
2) right click a lyric
3) Select / All Similar Elements
4) "X" or click reset button on placement field in Inspector

Result: freeze. I waited several minutes as well.

So, I propose fixing this by simply removing the code that flips all elements when only a single element is selected. I can see why that might have seemed a clever helpful thing to do, but it's not really needed, and it makes it impossible to flip just a single lyric when you want - see #282629: Lyrics can not be be placed above/below staff individally, only the whole verse. We already provide ways of selecting all lyrics for a given verse / voice, just use that and press "X".

Fix version
3.0.3