Can this be adapted to work with Text Spanners? Does anyone have any similar workarounds? I just need to automatically extend TextSpanners to the end of the duration without too many manual guesstimations.
#(define (encompass-duration grob) (let* ((rb (ly:spanner-bound grob RIGHT)) (sys (ly:grob-system grob)) (cols (ly:grob-array->list (ly:grob-object sys 'columns))) (me-forward (memq rb cols))) (if (and me-forward (> (length me-forward) 1)) (ly:spanner-set-bound! grob RIGHT (cadr me-forward))) (ly:piano-pedal-bracket::print grob))) { \override Staff.PianoPedalBracket.stencil = #encompass-duration % \override Staff.PianoPedalBracket.shorten-pair = #'(0 . 0.5) \set Staff.pedalSustainStyle = #'bracket c'4\sustainOn c' c' c'\sustainOff c'4 c'\sustainOn c'\sustainOff c' c'4\sustainOn c' c' c' \break c'4\sustainOff c' c' c' }