Lengthening note before a line produces incorrect results

• Aug 2, 2014 - 11:08
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

Nightly, 31 July (4e426c4) / Windows 7

1) New score for Flute, 4/4, four measures
2) Enter four quarter notes in the first measure
3) Drag and drop a trill line
Now, there are several aspects

a) The trill line is anchored on the first quarter note: all ok, you can change the note values ​​of the measure: half note, dotted half note, whole note.

The troubles begin it now!

b) The trill line is anchored on the second quarter note -> Select the first quarter note and replace it with a whole note. Result: Crash

c) The trill line is anchored on the third quarter note -> Select the second quarter note and replaced by a dotted half note. Result: Crash

Same result by selecting the first quarter note and replacing it with a whole note.

d) The trill line is anchored on the fourth quarter note-> Select the first quarter note and replace it with a whole note (and other declensions ...). Result: crash

- Note that there are other problems with the trills lines, of unequal importance and consequence.
In particular, when the trill is anchored on the last quarter note: the line is not editable (or only to the left, so back only!), and therefore can not extend on the next measure (:

I will elaborate on these points accurately if the fix of the crash has nothing changed in these behaviors.

crash trill.jpg
trill last note.jpg

Attachment Size
crash trill.jpg 16.51 KB
trill last note.jpg 12.63 KB

Comments

Additional clarification: the behavior (leading to crash) is the same with Upprall Line, Downprall Line, Prallprall Line, and Wavy Line.

So, with the following steps (this is one of scenario, the more simplest, mentioned above)

- Four quarter notes in the first measure
- Exit to note entry mode
- Add a trill (or others lines mentioned) which the anchor is on the second quarter note
- Select the first quarter note, and replace it by a whole note
Result: crash

Looks like the crashes are due to the fact that lengthening a note earlier in the measure removes the note with the trill, but does not remove the trill from the spanner map. The same bug also affects slurs and other lines. But for slurs, there is no crash - you are just left with a a slur floating above the measure. For hairpins, ottava, and pedal lines, the whole note "adopts" the line. Which is is to say, even though the line originally starts on beat 2, after turning the note on beat 1 into a whole note, the line will now start there. However, in the case of ottava at least, the line is ineffective - it appears over the whole note but the note still plays at the original octave.

I guess I'd be OK with this behavior of hairpins, ottava, and pedal if they actually worked. But really, I think it makes more sense to delete the marking if the note it was originally anchored to is deleted. Or maybe better, move the start position of the line to the first note *after* the new whole note (it it is earlier than the end point).

Title Crash in changing the notes values ​​ in a measure with a trill Lengthening note before a line produces incorrect results
Status (old) fixed active

The crash is gone, but the other behaviors describe above in my response #2 are still present. Also, the line does not survive a save/reload.

Behavior for trills is now the same as for hairpins, ottavas, and pedals - if you lengthen a note before the start of a line, the start point of the line moves backwards to start at the lengthened note. I could live with this if it worked correctly, but it does not. Save and reload, and the line is gone. Also, while the pedal works correctly for playback, the ottava does not. If you try the same thing but with a slur instead of another line, it is left hanging in its original local on the page.

To be clear:

1) four quarter notes
2) add ottava from second to last note
3) change first note to half note
4) play

Result: although the ottava now shows as applying to the whole measure, it doesn't actually apply to the first note on playback.

5) save, close, reload

Result: ottava is gone

Rather than make this work, I still think I'd be just as happy seeing the line deleted in the first place, but best would be to move the start element to just *after* the lengthened note.

I'm agree.

For the trill lines (and prall and wave lines), with the line that can not span the next measure if its anchor point is located on the last note of the original measure: I have noted this in a comment (second attachment of the message first)

Also note that the trill lines (and prall, etc.) anchored on the last note are aligned incorrectly in comparison with the others previous (they climb a step!) Example for the trill line only in attachment.

The case is similar with the lines: simple lines or text lines. Which leads by a faulty display (for the text line), if the line, always, is anchored on the last note.

lines.jpg

Ditto for the Pedal line.

Pedal Line.jpg

Attachment Size
lines.jpg 40.34 KB
Pedal Line.jpg 7.87 KB
Status (old) fixed active

Sorry, I reopen the issue because I do not see any change on some points mentioned in the comment #5.

- It concerns the text lines and pedals lines (maybe others, I do not have all looked) that appear false, depending on where they are anchored. That's correct, on the first note, this is not on the third, and worse, on the fourth.
1length.jpg
- It also relates to the alignment lines trills and pralls. The first three are aligned correctly, the fourth made ​​an unexpected jump.
2trills line.jpg
Can I afford to suggest to find a behavior such as that of some Nightlies in the end of July, where lines had kept a constant length (like a measure, so as attachment below) Or another solution, I do not know, but that avoids this wrong display mentionned above. Thanks.
3length.jpg

Attachment Size
1length.jpg 35.35 KB
2trills line.jpg 26.61 KB
3length.jpg 37.14 KB
Status (old) active fixed

I think those are unrelated layout issues, though. That is, these have nothing to do with lengthening a note before a line: what you say is true about those elements no matter what.

I will file the separate issue for the layout.

Ok, I misunderstand the meaning of your report certainly, " with lengthening a note before a line". It is not always easy sometimes to understand the subtleties of meaning (or meaning of the bug exposed by others) when the language it is not yours!
But as its seemed that the comment # 5 was explicit, I asked the question again.
Thanks for opening new specific reports.

Status (old) fixed active

In any case, this appears to have broken again with the fix for #29511: Voltas (and other lines) disappear upon entering notes. That is, following the steps from #4 now fails in the same ways. Here they are again:

To be clear:
1) four quarter notes
2) add ottava from second to last note
3) change first note to half note
4) play

Result: although the ottava now shows as applying to the whole measure, it doesn't actually apply to the first note on playback.

5) save, close, reload
Result: ottava is gone

Rather than make this work, I still think I'd be just as happy seeing the line deleted in the first place, but best would be to move the start element to just *after* the lengthened note.

Definitiely appears to be some delicate interaction between this, #29511: Voltas (and other lines) disappear upon entering notes, and #29541: Enter note deletes slurs in note entry mode with linked staves!

In a3b185b32d the ottava (or other spanners) is removed if the first anchor is removed.

The layout issues in #7 is something completely different. For practical reasons its best to move them into a separate bug report.

I can confirm this issue is fixed, but now #29511: Voltas (and other lines) disappear upon entering notes is broken again. And of course, it's obvious that getting both of these cases working as expected would be tricky. What we're talking about is removing the spanner is the anchor is removed in some cases but not others.

Here's what I *think* the most desired behavior is:

Spanner is deleted if the chord/rest the spanner is attached to is completely removed - not replaced with anything. That covers the case here: lengthening a note before the start. But it would allow the spanner to remain if you simple typed a new note on top of the old.

A different but equally acceptable behavior would be: voltas, hairpins, and pedals always stay where they are until you remove them, since conceptually they are attached to ticks, not specific notes (at least, that's how I think of them). That includes the case of this issue: lengthening a previous note. Trills and slurs would be deleted when you removed their starting point, whether that's a result of lengthening the previous note or typing a new one. Up/down needs to keep the existing trills & slurs, though. Ottavas could work either way - like hairpins or like slurs.

Status (old) fixed active

Sorry, this is actually broken again in the exact same way as described in #4. Again, those steps:

1) four quarter notes
2) add ottava from second to last note
3) change first note to half note
4) play

Result: although the ottava now shows as applying to the whole measure, it doesn't actually apply to the first note on playback.

5) save, close, reload

Result: ottava is gone

As I mentioned before, I think it would be fine to delete the spanner in these cases. If it is be kept, though, I think it should start with the note *after* the lengthened note. In other words, in the above example, the ottava originally affected the notes on beats 2, 3, and 4. Now that the note on beat is gone, the ottava should affect only the notes on beats 3 and 4. The note on beat 1 wasn't included in the ottava before it was lengthened, so it shouldn't be included after lengthening, either.

there is now a central point were spanners are checked for valid anchors: Score::checkSpanner(). Spanners with lost start anchor must be removed as they cannot be saved. Slurs need to have a start and end anchor.

Seems to work as expected for me now, thanks! Voltas continue to work fine. Lengthening a note in a way that removes the start note for a note-attached spanner (including slur, hairpin, and ottava) removes the spanner, which is fine. Merely replacing the start note - even by "deleting" the start note by replacing it with a rest - preserves the spanner. Works beautifully as far as I can tell.

Any loose ends anyone else sees? Any reason we can't close this?

So close! I tested voltas, slurs, hairpins, and ottava, but I forgot pedal. MuseScore crashes if you lengthen a note before a pedal marking!

I *think* this is an easy fix. I see the call to the new checkSpanner function here:

https://github.com/musescore/MuseScore/blob/980195a1b24281bc2314233214e…

The crash however has already happened, because of the layout call a few lines above:

https://github.com/musescore/MuseScore/blob/980195a1b24281bc2314233214e…

Pedals apparently don't like being laid out if they have no start element. I could fix that, but there's probably no reason to be laying out spanners any more up there now that we're doing it a few lines below. In fact, there's probably no reason to be doing anything in that loop before the call to checkSpanners. But I don't know this code well enough to mess with it.