lilypond-user
[Top][All Lists]
Advanced

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

Re: guile-question: how to do (apply ly:stencil-combine-at-edge args)?


From: Thomas Morley
Subject: Re: guile-question: how to do (apply ly:stencil-combine-at-edge args)?
Date: Wed, 19 Aug 2015 01:00:25 +0200

2015-08-18 13:37 GMT+02:00 David Nalesnik <address@hidden>:

> Not sure, but why not something like this?
>
>  \markup
>   \stencil
>   #(reduce-right
>     (lambda (f s)
>      (ly:stencil-combine-at-edge f X RIGHT s 0))
>     empty-stencil
>     (stils 3))
>
> HTH,
> David

2015-08-18 23:57 GMT+02:00 Gilles THIBAULT <address@hidden>:

> Perhaps you need to redefine ly:stencil-combine-at-edge
> according to your needs .
> Perhaps something like that :

> %%%%%%%%%%%%%%%%%
> #(define (stils n)
>   (map
>     (lambda (n)
>       (make-connected-path-stencil
>         `((0 0) (,n 0) (,n ,n) (0 ,n) (0 0))
>         0.1
>         1
>         1
>         #f
>         #f))
>      (iota n 1 1)))
>
> #(define (my-stencil-combine-at-edge stil1 stil2 . args)
> (let ((res (ly:stencil-combine-at-edge stil1 X RIGHT stil2)))
>   (if (pair? args)
>     (apply my-stencil-combine-at-edge res (car args) (cdr args))
>     res)))
>
> \markup
>   \stencil
>   #(apply my-stencil-combine-at-edge (stils 3))
>
> %%%%%%%%%%%%%%%%%%
>
> --
> Gilles





2015-08-19 0:20 GMT+02:00 Gilles THIBAULT <address@hidden>:

> .. or something more general, if you need it :
>
> #(define ((my-stencil-combine-at-edge axis dir) stil1 stil2 . args)
> (let ((res (ly:stencil-combine-at-edge stil1 axis dir stil2)))
>   (if (pair? args)
>     (apply (my-stencil-combine-at-edge axis dir) res (car args) (cdr args))
>     res)))
>
> \markup
>   \stencil
>   #(apply (my-stencil-combine-at-edge X RIGHT) (stils 3))

> --
> Gilles

Hi David and Giles,

thanks for all your suggestions. I'll study them carefully.

Best,
  Harm



reply via email to

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