Tie thinkness depends on direction
Tina Petzel <[email protected]>
| Newsgroups | gmane.comp.gnu.lilypond.devel |
|---|---|
| Message-ID | <2339624.iZASKD2KPV@archbox> |
Hey all,
Investigating this MusicSE question https://music.stackexchange.com/questions/142868/how-to-change-thickness-of-individual-ties-in-a-chord-in-lilypond[1] has shown that setting
`TieColumn.positioning-done` to `#t` messes up the thickness property.
The reason for this is that `Tie.direction` is only set by `TieColumn.positioning-done`, and in
tie.cc:252 in `ly:tie::print` the thickness is multiplied by direction for sign:
```
a = Lookup::slur (b, get_grob_direction (me) * base_thick, line_thick,
dash_definition);
```
This has the effect of changing the sign of the thickness depending on direction.
What `Lookup::slur` is doing is basically just to clone the original control points giving us two
curves and offset the middle two points of each by `thickness / 2` perpendicular to the slur
direction, up for the clone and down for the original. Then`Lookup::bezier_sandwich` which
creates a closed path along both curves.
So as far as I can see the sign of the thickness will only change the order in which the sandwich is
done (top curve there and bottom curve back vs. bottom curve there, top curve back). So this
should actually not have any visible effect, as we can also see here:
```
{
\override Tie.after-line-breaking =
#(lambda (grob)
(display (ly:stencil-expr (ly:grob-property grob 'stencil)))
(newline))
g'1-\tweak thickness 1.2 ~
g'
g'1-\tweak thickness -1.2 ~
g'
}
```
So I want to ask you guys if you A) know why this is done in the first place and B) if you think it is
reasonable to get rid of the multiplication with direction to make to code more robust.
Alternative would of course be to add a fallback for the direction (which should be DOWN), but
considering this not actually doing anything of course the simplest solution would be to not
multiply by the thickness in the first place.
Cheers,
Tina
--------
[1] https://music.stackexchange.com/questions/142868/how-to-change-thickness-of-individual-ties-in-a-chord-in-lilypond/142869?noredirect=1#comment272491_142869
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEET9lQp3Sisy/pK6sBnDUJWyIflYEFAmlCevQACgkQnDUJWyIf lYFI6Q//ZI3pZo4YBaN04bOjrjdP1q31HOcpdoLKAbX8SK5hJBXN7E7+R12Dbbse XHuhtztbYKMd7+eOYG9nJ2AnDhXsCMJRVmQOB7/L+QD/l2op1jnIdv3fj6Cm2Uck lMYsrlKatcoIQTRPjVVQ4A1xwyKIl1bTSJ9ilzwtAFbRb/9CKdXz1X/YK82SAzo6 A6wdvQ5n0qXyoMRAo3lTXmYwyhL6UoGE7cbxQ/bflzgpf4OPZTWqeqk5RckscdOL VMFUtqWjsIf3usNPCuch38hXov6SsEJFVtSlPaPxBODH2S1e3Ndy5hkYELMpRYf5 Ip9PET7OX4bmFmdJkkIWEAakYHb1leQrHl6dc8lzhr9wYkihIFFPlh5E4aeBHj8X Op+ehg0V8ruw86YVJme/bJGyDdO+4FUEAy0bX4MxVL3h+yhIxQFx+640vwKt0GDF oEFwPRULSC0y6Jrz8ouoOvgG8KzeF3N5JIwYqpuec4w/qGeGxa3puMEoypQShKex f8AiiBdI3les7Vp2laq5z6+i2MdYVcnpMZalV4pfHOc5HBcEQUDvVSSOf7csxuMC I6h688BFuPrUKVvHLiPzfMY1dt0zCfsNHqMJzXtigpEoQHGrjUeNx6UenisUfqZ2 vY2a7kEM7JRnDvDRculhoAAQuuGbV3j7e/MRb0lAftOtETCTRoQ= =u3n9 -----END PGP SIGNATURE-----