Hi all,

I'm struggling to parametrize the creation of a stencil, and I must
admit I'm totally lost with the issue of multiple level
quoting/quasiquoting/unquoting.

See attached file which is derived from
http://lsr.di.unimi.it/LSR/Snippet?id=623.

It uses ly:make-stencil to create a stencil from a path. What I need is
a way to replace the path definition starting with

`(rmoveto

with a function call so that I can somehow write

#(ly:make-stencil
`(path 0.2 <call-to-function>)

But however I change where and how often to use (quasi)quoting I always
fail to get proper results.
Displaying this (working) path expression returns

(path 0.2 (quasiquote (rmoveto 0 0 rcurveto 0 0.75 1 0.75 1 0 rcurveto 0
-0.75 -1 -0.75 -1 0 rcurveto -1 0 -1 1.5 -0.5 1.5 rmoveto 0.5 -1.5
rcurveto -1 0 -1 -1.5 -0.5 -1.5 rmoveto 0.5 1.5 rmoveto 1 0 rcurveto 2.5
0 2.5 4 4 4 rmoveto -4 -4 rcurveto 2.5 0 2.5 -4 4 -4)))


and I don't manage to recreate this due to the fact that there are two
levels of quasiquoting.

Any enlightenment or (step towards) solution would be greatly appreciated.

Best
Urs

-- 
u...@openlilylib.org
https://openlilylib.org
http://lilypondblog.org

\version "2.19.52"

#(define l-arc (quote '(rcurveto 0 -0.5 0.5 -1 1 -1)))

#(define my-path
   `(append
    '(rmoveto 0.5 -3.5)
    '(rcurveto 0 -0.5 0.5 -1 1 -1)
    ; I want to replace the previous list with an expression
    ,l-arc
    '(rlineto 6 0)
    '(rcurveto 3 0 2 -4 2 2)
    ))

#(display   
  `(path
    0.15
    ,my-path))


curveStencil =
#(ly:make-stencil
  `(path
    0.15
    ,my-path))

{
  \override Slur.stencil = #curveStencil
  d' ( e' f' g' )
}
%
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to