Cross-staff note offset to align with note in original staff

• Dec 9, 2018 - 18:00
Reported version
3.0
Priority
P2 - Medium
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
Yes
Project
Tags

Initially reported in https://musescore.org/en/node/279663.

When there is a whole note in the bass in voice 2 or 4 and you use cross staff notation to move a note from the bass to treble, the first note is offset for no reason. When the note is not a whole note, the offset doesn't happen.

To test this using the score in the link above do the following:

In measure 3, change the G to a whole note and notice the E in the treble moves

or

In measures 1 & 2 exchange voices 1 & 2 notice the problem is fixed.
Then select only voice 1 in measures 1 & 2 using the inspector and exchange voices 1 & 4 and see the offset returns.

This seems to only happen if the first note is a whole note. I tried with 3/4 time using a dotted half note and this didn't happen and in 2/4 with a half note and nothing happened. When I put it in 6/4 and tried it with the whole note, the offset occurred. Dotting the whole note did not affect the results.


Comments

Title Unexplained offset of cross-staff note Cross-staff note offset to align with note in origin staff
Priority P2 - Medium

It's a bit more complicated that, but yeah, this could be improved.

Ignore the cross-staff note for a moment. In the score attached to the forum thread linked above, the bottom note is a whole note. Whole notes are wider than half notes, so that whole note is offset to keep the centers of all notes aligned. Now think about the cross-staff note again, but return it to the bottom staff where it "belongs". You can see it is nicely left-aligned with the whole note, which is the proper behavior in this particular case - otherwise the stem would cut through the whole note. Flip the stem up and it now centers, putting it in alignment with the other half notes on the top staff. Which is to say, the different isn't about voice per se, but about stem direction.

So, the bug here is that we are continuing to offset the cross-staff note to avoid cutting through the whole note on the other staff. The code that handles this offsetting needs to account for cross-staff displacement correctly. There are, however, more fundamental problems with horizontal position and cross-staff displacement that would need to be dealt with first. Try, for instance, raising the pitch of the cross-staff note to Ab - you'll see it collides with the Bb. That's a known issue, see #114141: Notes collide between cross-staff. Most likely we'd need to look at these cases together.

Title Cross-staff note offset to align with note in origin staff Cross-staff note offset to align with note in original staff

As you said, it needs to work correct, and I did comment that there is no collision avoidance being considered with the notes. I mostly wrote this to make the title better.