Tie Going the Wrong Way with 2 Voices Over Bar line

• Sep 23, 2017 - 19:51
Type
Functional
Severity
S3 - Major
Status
fixed
Regression
No
Workaround
No
Project

Steps to Reproduce
1. Have one measure with one voice.
2. Have the next measure contain two voices.
3. Have a tie that goes over the bar line.

Note that the tie's direction is down when it should be up.


Comments

Looking at the code for Tie::calculateDirection(), we are checking if either the start or end notes are in measures with multiple voices (and here the answer is yes). If so, the comment in the code says "in polyphonic passage, ties go on the stem side", which sounds good. However, we are always choosing the stem side of thefirst note, not the stem side for the note that is actually in a polyphonic passage. In the case at hand, it's the second note whose stem side we should be honoring.

We could fix this by changing this from a single clause "if m1 hasVoices or m2 hasVoices, set tie to same direction as chord 1" into separate clauses "if m1 hasVoices, set tie to same direction as chord 1, else if m2 hasVoices, set tie to same direction as chord 2". But maybe it would actually be better to just use the voice to determine stem direction - always up for voices 1 & 3, always down for 2 or 4, regardless of the stem direction of the notes themselves. Need to think about this a little and whether there would be any other side effects to consider. But in any case, seems a pretty easy fix.

Fix version
4.0.0