Multi-voice grace notes collide with bar line

• Jan 26, 2015 - 02:52
Type
Functional
Severity
S4 - Minor
Status
closed
Project

1. Open attached score (produced in 1.3).

Result: Multi-voice grace note collides with the bar line.
Multi-voice grace notes collide with bar line.png

Note: This is also reproducible in a 2.0 score.

Using MuseScore 2.0 Nightly Build 8c2401f - Mac 10.7.5.


Comments

FWIW, it doesn't have to do with voices. Similar results with single voice; it's just that the issue is more apparent if the stem is down because the slash extends to the left of the note origin. But the distance to the barline is the same either way.

For measures that start with a grace note, we use the style setting "Barline to accidental distance" - I guess on the theory that a grace note can occupy the space between the barline and first main note as easily as an accidental can. But it can't, really. "Barline to note distance" ends up leaving too much space, I think, but "Barline to accidental distance" is too little. Although we could perhaps improve things if we accounted for the slash. Then at least it would be no tighter than the upstem version.

You are right in that if the semibreve is flipped, the grace note problem is reproducible in Voice 1.

Should the semibreve move though? I seem to remember a discussion.

Why should the main note move? I guess because it "looks" like the grace note is closer when flipped? But that's an optical illusion. The spacing is determined by the distance between the grace note and the right most point of the main note, and that hasn't changed. The fact that these points may or may not actually be in danger of touching because they are at different vertical positions does not come into play, here are anywhere else. It would be a nice enhancement some day to be sure, but it falls more in that cateogry of things we can't do without a pretty major revamp of how we do layout.

BTW, I see that the stem slash is not accounted for in the spacing for the note; that is why the slash was allowed to cross the barline. Adding more space after the barline prevents that problem from occuring, but we could consider including the slash in the calculation. Note sure it really buys us much though, and might not even be the right answer in general. I did try accounting for the slash in layoutPitch(), but found it hasn't been laid out yet. I tried going ahead and laying it out then, and nothing obviously broke, but I'm reluctant to mess with the order of layout of the parts of a note - that's pretty delicate stuff.

Regarding the space betwene barline and grace note - style parameter is great. I was otherwise going to suggest we go with "Barline to note distance" but scale it by grace note size.