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 #\"@var{fret number}\" @{ notes @} }.
12 doctitle = "Bar chords notation for Guitar (with Text Spanner)"
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16 %% %%%%%%% Cut here ----- Start 'bbarred.ly'
18 %% C with slash -------------------------------
19 cWithSlash = \markup {
20 \combine \roman C \translate #'(0.6 . -0.4) \draw-line #'(0 . 2.0)
22 %% Span -----------------------------------
23 %% Syntax: \bbarre #"text" { notes } - text = any number of box
25 #(define-music-function (barre location str music) (string? ly:music?)
26 (let ((elts (extract-named-music music '(NoteEvent EventChord))))
28 (let ((first-element (first elts))
29 (last-element (last elts)))
30 (set! (ly:music-property first-element 'articulations)
31 (cons (make-music 'TextSpanEvent 'span-direction -1)
32 (ly:music-property first-element 'articulations)))
33 (set! (ly:music-property last-element 'articulations)
34 (cons (make-music 'TextSpanEvent 'span-direction 1)
35 (ly:music-property last-element 'articulations))))))
37 \once \override TextSpanner #'font-size = #-2
38 \once \override TextSpanner #'font-shape = #'upright
39 \once \override TextSpanner #'staff-padding = #3
40 \once \override TextSpanner #'style = #'line
41 \once \override TextSpanner #'to-barline = ##f
42 \once \override TextSpanner #'bound-details =
44 (text . ,#{ \markup { \draw-line #'( 0 . -.5) } #})
49 (text . ,#{ \markup { \cWithSlash #str } #})
53 %% uncomment this line for make full barred
54 % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" #str }
58 %% %%%%%%% Cut here ----- End 'bbarred.ly'
59 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
63 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }