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

pablocordal
Hi,

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)
        (let*
         ((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)))
          (new-stencil
           (ly:stencil-combine-at-edge
            stencil
            Y dir
            (ly:stencil-translate-axis markup-stencil shift X)
            paddingVertical)))
          (ly:grob-set-property! grob 'stencil new-stencil)))
   #})

Best regards for all

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user