Stem direction of cross-staff notes incorrect
P2 - Medium
S5 - Suggestion
1. Open attached score (produced in 1.3).
This is 1.3 - the cross-staff notes are correct, whilst those in the bass stave aren't:
It is also reproducible in a new score.
Using MuseScore 2.0 Nightly Build c547bb7 - Mac 10.7.5.
I suppose for cross-staff notes, stems should simply be in opposing directions?
Maybe it's more complex?
I suspect there would be situations where it's not so simple. Consider, what if the destination staff doesn't just have one voice? Like if the bass clef staff in your example had notes in voice 1 & 2? Then you'd probably still want 1 up, 2 down. But for the notes that are actually being moved, it probably does make sense for notes moved down to have stems up, notes moved up to have stems down. At least, that's my initial reaction.
I did wonder about multi-voice in the destination stave - seeing actual examples of this would help determine its validity and whether algorithms can be implemented to accommodate.
I still think we should change to the proposed default and let the user make adjustments, should it arise.
The problem is, the part of the code that decides stem directions doesn't necessarily know if there is also any cross staff notation in this staff. So we could change the direction for the cross staff notes themselves - notes moved down would point up, notes moved up would point down - but the regular notes in the destination staff would not be able to react. So in your example, we'd basically have all stems up. Looks like that might be what 1.3 did, so that's a good reason to consider it here as well.
But I still worry that this would be the wrong thing pretty often. Consider a single line - not notes in other voices on either staff - moving between staves. Right now we get this "right" - the stem direction of each note depends on whether it is above or below the middle line, just as if this were not cross staff notation. The change we are discussion would break this. I'm not convinced it is worth it. Either way, some cases end up being what you want by default, others require flipping stems manually. That's just going to be unavoidable.
Relates to #285233: [EPIC] Cross-staff notation issues