barre = #(define-music-function (parser location fretnum osp dirn shorten adjBreak adjEnd)
(string? number? number? pair? number? number?)
#{
% set osp to 999 if spanner is colliding with another element
% this will position the spanner outside all other elements
% can be normally be set to zero
\once \override TextSpanner #'outside-staff-priority = #$osp
\once \override TextSpanner #'bound-details #'left #'text =
\markup { \concat { "C" $fretnum " " } }
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
\once \override TextSpanner #'direction = #$dirn
%draw a bracket edge on RHS
\once \override TextSpanner #'bound-details #'right #'text =
\markup { \draw-line #(cons 0 (/ $dirn -1)) }
% set alignment of line with reference to left text
\once \override TextSpanner #'bound-details #'left
#'stencil-align-dir-y = #CENTER
% change X pos of LH and RH end as desired
\once \override TextSpanner #'bound-details #'left #'padding =
#(car $shorten)
\once \override TextSpanner #'bound-details #'right #'padding =
#(cdr $shorten)
% allow adjustment of line end when it wraps to following stave
\once \override TextSpanner #'bound-details #'right-broken
#'padding = #$adjEnd
% adjust LH end of line when it wraps to following stave so that it
doesn't
% extend to the left of the notes on the stave
\once \override TextSpanner #'bound-details #'left-broken #'X =
#$adjBreak
% optional override to remove text and bracket edge at line breaks
\once \override TextSpanner #'bound-details #'left-broken #'text = ##f
\once \override TextSpanner #'bound-details #'right-broken #'text = ##f
#})
\relative c'' {
\barre "V" #0 #UP #'(-1 . -1) #10 #0.5 c4\startTextSpan \repeat
unfold 18 { c } c\stopTextSpan
}
<<attachment: barre.png>>
_______________________________________________ lilypond-user mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-user
