Hi Jean,

It worked! I managed to move from a Nunjucks macro to a LilyPond music
function for creating custom shaped slurs. Thank you very much for your
substantial support! It would be much more difficult if ever possible for
me without your help!

Thank you,
Vlad

On Sun, Jul 2, 2023 at 9:44 PM Jean Abou Samra <j...@abou-samra.fr> wrote:

> Le dimanche 02 juillet 2023 à 18:47 +0200, Volodymyr Prokopyuk a écrit :
>
> Thank you very much for multiple options! I've decided to try the first
> one. I still have two difficulties
>
>    - How to create alist from the components ax, ay, ... (see comment in
>    the code below)?
>
>
>
>
> The control-points property has the form
>
> ((ax . ay) (bx . by) (cx . cy) (dx . dy))
>
> as you can see when you use plain \shape #'((ax . ay) (bx . by) (cx . cy)
> (dx . dy)) . That expression is a list of pairs (lists are in parentheses
> and pairs are in parentheses with a dot in the middle). So you can create
> it with either
>
> (list (cons ax ay) (cons bx by) (cons cx cy) (cons dx dy))
>
> where list is the function to build a list and cons is the function to
> build a pair, or
>
> `((,ax . ,ay) (,bx . ,by) (,cx . ,cy) (,dx . ,dy))
>
> which uses quasiquoting to achieve the same result.
>
> If you are not yet familiar with quoting, I really recommend reading about
> it (e.g., https://extending-lilypond.gitlab.io/en/scheme/quoting.html ).
> It's a concept that causes a lot of confusion for Scheme newcomers, yet is
> essential to understand for writing Scheme effectively.
>
>
>
>
>    - How would I call this function? I guess c'4 \shapedSlur fu #'((bs .
>    3.0) (ht . 2.0)) ( d)
>
>
>
> Yes, that's it.
>
> Best,
> Jean
>
>

Reply via email to