This music function for indicating barring in guitar scores worked fine
in versions up to 2.15.19, but in 2.15.20, an attempt to use it gets an
error. It was run through convert.ly for 2.15.20. Trying to build the
example below gets the errors shown below the code.
%==============================================
\version "2.15.20"
barre = #(define-music-function (parser location fretnum dirn vdrop
shorten adjBreak adjEnd)
(string? number? number? pair? number? number?)
#{
\once \override TextSpanner #'bound-details #'left #'text =
\markup\small\bold { \concat {
\postscript #(string-append
"0.1 setlinewidth 0.7 -0.5 moveto 0 -"
(number->string vdrop)
" rlineto 0.5 0 rlineto stroke")
$fretnum " "
} }
\once \override TextSpanner #'font-shape = #'upright
\once \override TextSpanner #'direction = #dirn
% set dashed line and draw a bracket edge on RHS
\once \override TextSpanner #'dash-period = #1
\once \override TextSpanner #'dash-fraction = #0.6
\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
% 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 "III" #UP #8 #'(-1.6 . -1) #5 #1 c4\startTextSpan c c
c\stopTextSpan
}
%==============================================
Processing `/home/nick/lilypond/examples/test.ly'
Parsing...
<string>:13:111: error: wrong type for argument 1. Expecting pair of
numbers, found right
\once \override TextSpanner #(quote bound-details) #(quote right)
#(quote text) = \markup { \draw-line
#(cons 0 (/ dirn -1)) }
/home/nick/lilypond/examples/test.ly:5:1: In procedure reverse! in
expression (ly:parse-string-expression clone "
\x09\\once \\override TextSpanner #(quote bound-details) #(quote left)
#(quote text) =
\x09\\markup\\small\\bold { \\concat {
\x09\x09\\postscript #(string-append \"0.1 setlinewidth 0.7 -0.5 moveto
0 -\" (number->string vdrop) \" rlineto 0.5 0 rlineto stroke\")
\x09\x09$fretnum \" \"
\x09} }
\x09\\once \\override TextSpanner #(quote font-shape) = #(quote upright)
\x09\\once \\override TextSpanner #(quote direction) = #dirn
\x09% set dashed line and draw a bracket edge on RHS
\x09\\once \\override TextSpanner #(quote dash-period) = #1
\x09\\once \\override TextSpanner #(quote dash-fraction) = #0.6
%\x09\\once \\override TextSpanner #(quote thickness) = #0.8
\x09\\once \\override TextSpanner #(quote bound-details) #(quote right)
#(quote text) = \\markup { \\draw-line #(cons 0 (/ dirn -1)) }
\x09% set alignment of line with reference to left text
\x09\\once \\override TextSpanner #(quote bound-details) #(quote left)
#(quote stencil-align-dir-y) = #CENTER
\x09% change X pos of LH and RH end as desired
\x09\\once \\override TextSpanner #(quote bound-details) #(quote left)
#(quote padding) = #(car shorten)
\x09\\once \\override TextSpanner #(quote bound-details) #(quote right)
#(quote padding) = #(cdr shorten)
\x09% allow adjustment of line end when it wraps to following stave
\x09\\once \\override TextSpanner #(quote bound-details) #(quote
right-broken) #(quote padding) = #adjEnd
\x09% adjust LH end of line when it wraps to following stave so that it
doesn't
\x09% extend to the left of the notes on the stave
\x09\\once \\override TextSpanner #(quote bound-details) #(quote
left-broken) #(quote X) = #adjBreak
\x09% override to remove text and bracket edge at line breaks
\x09\\once \\override TextSpanner #(quote bound-details) #(quote
left-broken) #(quote text) = ##f
\x09\\once \\override TextSpanner #(quote bound-details) #(quote
right-broken) #(quote text) = ##f
"):
/home/nick/lilypond/examples/test.ly:5:1: Wrong type argument in
position 1: (right . #f)
Processing time: 0 seconds
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user