[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding text to slurs
From: |
pablocordal |
Subject: |
Re: Adding text to slurs |
Date: |
Thu, 8 Nov 2018 08:00:23 -0700 (MST) |
Hi everyone!
I really have a special need with this function we have been talking about:
<code>
annotatedSlur =
#(define-music-function (parser location padding text) (number? markup?)
#{
\once \override Slur.after-line-breaking =
#(lambda (grob)
(let*
((stencil (ly:slur::print grob))
(dir (ly:grob-property grob 'direction))
(markup-stencil (grob-interpret-markup grob text))
(shift (- (interval-center (ly:stencil-extent stencil X))
(interval-center (ly:stencil-extent markup-stencil X))))
(new-stencil
(ly:stencil-combine-at-edge
stencil
Y dir
(ly:stencil-translate-axis markup-stencil shift X)
padding)))
(ly:grob-set-property! grob 'stencil new-stencil)))
#})
</code>
The funcion works fine, but I think it would be even better if it could
receive another number. This number should move the text horizontally in the
slur- sometimes, the text collides with another element, and it would be
great to move it forward or backward a little.
Any master coder out there can help me with this please?
Thank you. Best regards
--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html