1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
6 %% This file is in the public domain.
10 lsrtags = "chords, fretted-strings"
13 Here is how to print bar chords (or barre chords) or half-bar chords
14 (just uncomment the appropriate line for to select either one). The
15 syntax is : @code{\\bbarre #'fret_number' note(s)}
23 doctitle = "Bar chords notation for Guitar (with Text Spanner)"
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 %% %%%%%%% Cut here ----- Start 'bbarred.ly'
29 %% C with slash -------------------------------
30 cWithSlash = \markup {
31 \combine \roman C \translate #'(0.6 . -0.4) \draw-line #'(0 . 2.0)
33 %% Span -----------------------------------
34 %% Syntax: \bbarre #"text" { notes } - text = any number of box
36 #(define-music-function (barre location str music) (string? ly:music?)
37 (let ((elts (extract-named-music music '(NoteEvent EventChord))))
39 (let ((first-element (first elts))
40 (last-element (last elts)))
41 (set! (ly:music-property first-element 'articulations)
42 (cons (make-music 'TextSpanEvent 'span-direction -1)
43 (ly:music-property first-element 'articulations)))
44 (set! (ly:music-property last-element 'articulations)
45 (cons (make-music 'TextSpanEvent 'span-direction 1)
46 (ly:music-property last-element 'articulations))))))
48 \once \override TextSpanner.font-size = #-2
49 \once \override TextSpanner.font-shape = #'upright
50 \once \override TextSpanner.staff-padding = #3
51 \once \override TextSpanner.style = #'line
52 \once \override TextSpanner.to-barline = ##f
53 \once \override TextSpanner.bound-details =
55 (text . ,#{ \markup { \draw-line #'( 0 . -.5) } #})
60 (text . ,#{ \markup { \cWithSlash #str } #})
64 %% uncomment this line for make full barred
65 % \once \override TextSpanner.bound-details.left.text = \markup{"B" #str}
69 %% %%%%%%% Cut here ----- End 'bbarred.ly'
70 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
74 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }