1 %% Do not edit this file; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% This file is in the public domain.
7 lsrtags
= "chords, fretted-strings"
10 Here is how to print bar chords, or half-bar chords (just uncomment the
11 appropriate line for to select either one).
13 The syntax is @code{\\bbarre #'fret_number' @{ notes @} }
19 doctitle
= "Bar chords notation for Guitar ( with Text Spanner)"
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 %% %%%%%%% Cut here ----- Start 'bbarred.ly'
25 %% PostScript -------------------------------
27 \with-dimensions
#'(0 . 0.8) #'(0 . 2.0)
33 (C)show %%change with B if you prefer
34 %(B)show %%change with C if you prefer
40 %% Span -----------------------------------
41 %% Syntax: \bbarre #"text" { notes } - text = any number of box
42 bbarre
= #(define-music-function
(barre location str music
) (string? ly
:music?
)
44 (let
((first-element
#f)
47 (music-map
(lambda
(m
)
48 (if
(eqv?
(ly
:music-property m
'name
) 'EventChord
)
50 (if
(not first-found?
)
52 (set
! first-found?
#t
)
53 (set
! first-element m
)))
54 (set
! last-element m
)))
59 (set
! (ly
:music-property first-element
'elements
)
60 (cons
(make-music
'TextSpanEvent
'span-direction -
1)
61 (ly
:music-property first-element
'elements
)))
62 (set
! (ly
:music-property last-element
'elements
)
63 (cons
(make-music
'TextSpanEvent
'span-direction
1)
64 (ly
:music-property last-element
'elements
)))))
66 (make-music
'SequentialMusic
69 \once \override TextSpanner
#'font-size
= #-
2
70 \once \override TextSpanner
#'font-shape
= #'upright
71 \once \override TextSpanner
#'staff-padding
= #3
72 \once \override TextSpanner
#'style
= #'line
73 \once \override TextSpanner
#'to-barline
= ##f
74 \once \override TextSpanner
#'bound-details
= #'((left
(Y
. 0) (padding
. 0.25) (attach-dir
. -
2)) (right
(Y
. 0) (padding
. 0.25) (attach-dir
. 2)))
75 \once \override TextSpanner
#'bound-details
#'right
#'text
= \markup { \draw-line
#'( 0 . -
.5) }
76 \once \override TextSpanner
#'bound-details
#'left
#'text
= \markup { \pScript $str
}
77 %% uncomment this line for make full barred
78 % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" $str }
82 %% %%%%%%% Cut here ----- End 'bbarred.ly'
83 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
87 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }