\version "2.16.0" #(define (capo grob) (let* ((orig (ly:grob-original grob)) (siblings (if (ly:spanner? orig) (ly:spanner-broken-into orig) '())) (total-found (length siblings))) (define (adjust-first-left piece) (let* ((sys (ly:grob-system piece)) (cols (ly:grob-object sys 'columns)) (cols-list (ly:grob-array->list cols)) (nearest-non-musical (find (lambda (col) (eq? #t (ly:grob-property col 'non-musical))) (find-tail (lambda (col) (eq? col (ly:grob-object (ly:spanner-bound piece LEFT) 'axis-group-parent-X))) (reverse cols-list))))) (ly:spanner-set-bound! piece LEFT nearest-non-musical))) (if (>= total-found 1) (if (eq? grob (car siblings)) (adjust-first-left grob)) (adjust-first-left grob)))) capoVHalf = { \override TextSpanner #'to-barline = ##t \override TextSpanner #'after-line-breaking = #capo \override TextSpanner #'(bound-details left text) = \markup { \teeny { "½ Capo V" } } } startCapo = <> \startTextSpan endCapo = <> \stopTextSpan melody = \relative c' { c2 c \capoVHalf \startCapo c c c c \endCapo c c } bass = \relative c, { e1 e a a } << \new StaffGroup << \new Staff { \clef "treble_8" %<< \melody \\ \bass >> % Line 50 \melody } >> >>