Le 18/06/2022 à 00:24, Leo Correia de Verdier a écrit :
Dear list!
I’m quite likely just being somewhat dim, but is there a way to pass additional
arguments to a function used by grob-transformer (or any callback for that
matter)?
Would it be possible to do something equivalent to this following using an
override to the stencil using grob-transformer?
\version "2.23.7"
#(define elongate (lambda (grob amt)
(let ((stil (ly:grob-property grob 'stencil)))
(ly:grob-set-property! grob 'stencil (ly:stencil-scale
stil 1 amt)))))
{ \override Accidental.before-line-breaking = #(lambda (grob) (elongate grob
2))
cis'2 }
Thanks!
/Leo
Like this?
\version "2.23.9"
#(define (elongate amt)
(grob-transformer
'stencil
(lambda (grob original)
(ly:stencil-scale original 1 amt))))
{ \override Accidental.stencil = #(elongate 2)
cis'2 }
You might want to read this part of the Guile manual:
https://www.gnu.org/software/guile/manual/html_node/About-Closure.html#About-Closure
Best,
Jean