4 lsrtags = "chords, fretted-strings"
7 Here is how to print bar chords, or half-bar chords (just uncomment the
8 appropriate line for to select either one).
10 The syntax is @code{\\bbarre #'fret_number' @{ notes @} }
16 doctitle = "Bar chords notation for Guitar ( with Text Spanner)"
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 %% %%%%%%% Cut here ----- Start 'bbarred.ly'
22 %% PostScript -------------------------------
24 \with-dimensions #'(0 . 0.8) #'(0 . 2.0)
30 (C)show %%change with B if you prefer
31 %(B)show %%change with C if you prefer
37 %% Span -----------------------------------
38 %% Syntax: \bbarre #"text" { notes } - text = any number of box
39 bbarre= #(define-music-function (barre location str music) (string? ly:music?)
41 (let ((first-element #f)
44 (music-map (lambda (m)
45 (if (eqv? (ly:music-property m 'name) 'EventChord)
47 (if (not first-found?)
49 (set! first-found? #t)
50 (set! first-element m)))
51 (set! last-element m)))
56 (set! (ly:music-property first-element 'elements)
57 (cons (make-music 'TextSpanEvent 'span-direction -1)
58 (ly:music-property first-element 'elements)))
59 (set! (ly:music-property last-element 'elements)
60 (cons (make-music 'TextSpanEvent 'span-direction 1)
61 (ly:music-property last-element 'elements)))))
63 (make-music 'SequentialMusic
66 \once \override TextSpanner #'font-size = #-2
67 \once \override TextSpanner #'font-shape = #'upright
68 \once \override TextSpanner #'staff-padding = #3
69 \once \override TextSpanner #'style = #'line
70 \once \override TextSpanner #'to-barline = ##f
71 \once \override TextSpanner #'bound-details = #'((left (Y . 0) (padding . 0.25) (attach-dir . -2)) (right (Y . 0) (padding . 0.25) (attach-dir . 2)))
72 \once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'( 0 . -.5) }
73 \once \override TextSpanner #'bound-details #'left #'text = \markup { \pScript #str }
74 %% uncomment this line for make full barred
75 % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" #str }
79 %% %%%%%%% Cut here ----- End 'bbarred.ly'
80 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
83 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
84 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }