I have attached the barre and half barre functions I use that work with 2.12, and your test.ly modified to use them.
Nick > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On > Behalf Of Allan Spagnol Comar > Sent: Saturday, 25 April 2009 14:08 > To: [email protected] > Subject: Bug on markups migrating from 2.10 to 2.12 > > Hi guys, I had just upgraded from 2.10 to 2.12.1, and I was used to use > some music addons that I had done a few years ago for guitar sheets. In > this version the result is nothing as expected. I had already tried to > run convert-ly but still the same result. > > I am attaching the original guitar.ly a test.ly file, one pdf generated > with 2.10 and one caled teste-new.pdf that has the output for the 2.12 > version. > > Can some one please help me ?
% postscript slash for half barres
#(define slash "0.18 setlinewidth 0.76 1.53 moveto 0 -1.62 rlineto stroke")
% Parameters
%
% "<fretnum>" % fret number (eg "5")
% #osp % outside-staff-priority - normally set to #0 unless barre is colliding with other elements
% #.(lpad . rpad) % left and right padding to apply to TextSpanner
% #adjBreak % when barre wraps to following stave, set value to prevent TextSpanner on following stave starting above the clef symbol
% #adjend % when barre wraps to following stave, set value to prevent TextSpanner going to the very end of the stave
%
% Example:
% \barre "5" #0 #'(-0.5 . -1) #8 #1
% <g,-2>\startTextSpan <c-3> <bf'-4>-> <ef,-1> <af-1>-> <c,-3>\stopTextSpan
%
barre = #(define-music-function (parser location fretnum osp shorten adjBreak adjEnd) (string? 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 { \small { \concat { "C" "." $fretnum " " } } }
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
%draw a bracket edge on RHS
\once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -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
#})
% barre below stave
barreDn = #(define-music-function (parser location fretnum osp shorten adjBreak adjEnd) (string? 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 { \small { \concat { "C" "." $fretnum " " } } }
\once \override TextSpanner #'direction = #DOWN
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
%draw a bracket edge on RHS
\once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . 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
#})
% Half barre. e.g.
% \hbarre "5" #0 #'(-0.5 . -1) #8 #1
% <g,-2>\startTextSpan <c-3> <bf'-4>-> <ef,-1> <af-1>-> <c,-3>\stopTextSpan
%
hbarre = #(define-music-function (parser location fretnum osp shorten adjBreak adjEnd) (string? 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 { \small { \concat { \postscript #slash "C" "." $fretnum " " } } }
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
%draw a bracket edge on RHS
\once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -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
#})
hbarreDn = #(define-music-function (parser location fretnum osp shorten adjBreak adjEnd) (string? 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 { \small { \concat { \postscript #slash "C" "." $fretnum " " } } }
\once \override TextSpanner #'direction = #DOWN
\once \override TextSpanner #'style = #'line
\once \override TextSpanner #'font-shape = #'upright
%draw a bracket edge on RHS
\once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . 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
#})
\version "2.12.0"
\include "barre.ly"
melodia=
\relative c''
{
\hbarre "7" #0 #'(-0.5 . -1) #8 #1 { <d, fis d'>4\arpeggio\startTextSpan <d fis d'>8\stopTextSpan }
\hbarre "7" #0 #'(-0.5 . -1) #8 #1 { <d fis d'>4\arpeggio\startTextSpan <d fis d'>4\arpeggio\stopTextSpan }
}
\book {
\paper {
}
\score
{
<<
\melodia
>>
\layout { }
}
}
<<attachment: test.png>>
_______________________________________________ lilypond-user mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-user
