Grace after notes wrongly aligned

• Feb 18, 2012 - 15:07
S4 - Minor

This feature was implemented in the nightly of 20th January.
However, it has several bugs that make it quite unusable.

Bad alignment. Just compare what you get and what you should get.



Attachment Size
Trills2.JPG 36.16 KB


Title [trunk] Grace notes after notes: Always wrong alignment [trunk] Grace notes after normal notes are wrongly aligned


Title [trunk] Grace notes after normal notes are wrongly aligned Grace after notes wrongly aligned

I forgot about this issue, but I posted this .

Our expected results differ a little, but maybe something can be worked out.

That's the problem with expected results... :-)

Right now the positioning is set by some magic numbers chosen by looking at some specific cases and eyeballing it, I think. Some sort of ratio that depends on length of main note. I haven't looked at that code so I don't much insight yet.

Looking at the algorithm for layout of grace notes after, it's a bit of a fragile hack in that it really has no idea what else is going on in other voices or elsewhere in the measure. It picks a value for how far from the main note will look good (based on the duration of the main note) and just uses that no matter what. So grace notes after a whole note are always the same distance from that whole note regardless. It's only likely to look good in measures with nothing else happening in other voices or other staves to cause the measure to be wider than a measure with nothing but a whole note would otherwise normally be. Also won't work so well in systems where you've placed a breaks to limit the system to fewer measures than would otherwise fit, or have increased stretch, etc.

Unfortunately, I suspect it's not going to be easy at all to do better than that (or else they would have done so in the first place). As with other aspects of layout, it's just difficult to impossible for layout of one element to depend on layout of other elements much. There might be some hacks that could help, and I'll see if I can take a look, but don't get your hopes up.