lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What to do wanting a 4th order Bézier?


From: Urs Liska
Subject: Re: What to do wanting a 4th order Bézier?
Date: Tue, 20 Sep 2016 00:40:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0



Am 19.09.2016 um 22:49 schrieb Urs Liska:
Am 19.09.2016 um 20:50 schrieb David Kastrup:
Urs Liska <address@hidden> writes:

[...]

You are working with slopes here.  Don't.  They don't support vertical
lines.

Yes, that's what I realized ...

Please take a look at the recently added functions

   ly:length ly:angle ly:directed

They will usually make it easy to do the operations you want.  In
particular ly:directed can also use a vector as a direction without ever
calculating its angle.
Thanks! From looking at the docs it seems they'll do exactly what I want
(and had partially implemented in Scheme). Can't wait to return to my
LilyPond computer :-)


I think I now have it in a state where we can work from. The angle of the inflection is now given as an angle relative to the line connecting the end points of the whole slur. While an angle relative to the horizontal line would be somewhat more straightforward I think this approach is more robust against changes (for example when the slur is cross-staff and the staff-staff distance changes).

TODO:
  • support more than two segments
    (shouldn't be *that* difficult, just tedious and slightly complex)
  • support broken slurs
    (each sibling should be togglable between multi-segment or not, and it should be \shape-able)
  • support Slur, PhrasingSlur and Tie (like \shape)
  • specify shapes as polar coordinates (or all options that \shapeII has)

The code is now at https://github.com/openlilylib/snippets/tree/compound-slur/notation-snippets/shaping-bezier-curves

Best
Urs

Attachment: compound-slur-example-sorabij.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]