% postscript slash for half barres #(define slash "0.18 setlinewidth 0.76 1.53 moveto 0 -1.62 rlineto stroke") % Parameters % % "" % 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 % \startTextSpan -> -> \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 % \startTextSpan -> -> \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 #})