Adding text (with horizontal padding) to slur

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Adding text (with horizontal padding) to slur


Finally I figured it out myself. This is function modified to incorporate a horizontal padding:

annotatedSlur =
#(define-music-function (parser location paddingVertical paddingHorizontal texto) (number? number? markup?)
     \once \override Slur.after-line-breaking =
     #(lambda (grob)
         ((stencil (ly:slur::print grob))
          (dir (ly:grob-property grob 'direction))
          (markup-stencil (grob-interpret-markup grob texto))
          (shift (- (interval-center (ly:stencil-extent stencil X))  (- (interval-center (ly:stencil-extent markup-stencil X)) paddingHorizontal)))
            Y dir
            (ly:stencil-translate-axis markup-stencil shift X)
          (ly:grob-set-property! grob 'stencil new-stencil)))

Best regards for all

lilypond-user mailing list
[hidden email]