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: David Nalesnik
Subject: Re: guile-question: how to do (apply ly:stencil-combine-at-edge args)?
Date: Tue, 18 Aug 2015 06:37:06 -0500

Hi Harm,

On Mon, Aug 17, 2015 at 6:44 PM, Thomas Morley <address@hidden> wrote:
Hi all,

I want to "put together" an arbitrary number of stencils,
pseudo-code:
(apply
  some-put-together-procedure
  stil-list)

While using `ly:stencil-add', it's quite simple:

#(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)))

\markup
  \stencil
  #(apply ly:stencil-add (stils 3))


But now I want to use `ly:stencil-combine-at-edge' with
axis: X
direction: RIGHT
padding: 0

As if I wrote:

\markup
  \stencil
  #(ly:stencil-combine-at-edge
     (car (stils 3))
     X
     RIGHT
     (ly:stencil-combine-at-edge
       (cadr (stils 3))
       X
       RIGHT
       (caddr (stils 3))
       0)
     0)


I wasn't able to find the correct syntax how to do:
(apply ly:stencil-combine-at-edge <what-ever-args>)

Any hints?


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

reply via email to

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