lilypond-user
[Top][All Lists]
Advanced

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

Re: ly:make-stencil arguments question


From: Thomas Morley
Subject: Re: ly:make-stencil arguments question
Date: Wed, 18 Jan 2017 21:18:22 +0100

2017-01-18 11:15 GMT+01:00 Urs Liska <address@hidden>:
>
>
> Am 18.01.2017 um 11:13 schrieb Urs Liska:
>>
>> See attached file which is derived from
>> http://lsr.di.unimi.it/LSR/Snippet?id=623.
>>
>
> Sorry, please *ignore* the attachment of the previous post, here's the
> correct one.
>

In

customClefStencil =
  #(ly:make-stencil
    `(path 0.2
      `(rmoveto 0 0
     ...

the second ` is unneeded ' would work as well.


To insert a function, unquote the function-call, and quote the result:

func =
#(define-scheme-function (val)(number?)
  (list
    'rmoveto 0 0
    'rcurveto 0 (+ 0.75 val) 1 (+ 0.75 val) 1 0
    'rcurveto 0 (- -0.75 val) -1 (- -0.75 val) -1 0))


customClefStencilOne =
  #(ly:make-stencil `(path 0.2 ',(func 1))
     (cons -0.5 1)
     (cons -3 5))

customClefOne = \override Staff.Clef.stencil = \customClefStencilOne

\relative c' {
  \customClefOne
  \clef "alto"
  c1
}


HTH,
  Harm



reply via email to

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