1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.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 half-bar chords (just uncomment the
14 appropriate line for to select either one).
16 The syntax is @code{\\bbarre #'fret_number' @{ notes @} }
22 doctitle = "Bar chords notation for Guitar ( with Text Spanner)"
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 %% %%%%%%% Cut here ----- Start 'bbarred.ly'
28 %% PostScript -------------------------------
30 \with-dimensions #'(0 . 0.8) #'(0 . 2.0)
36 (C)show %%change with B if you prefer
37 %(B)show %%change with C if you prefer
43 %% Span -----------------------------------
44 %% Syntax: \bbarre #"text" { notes } - text = any number of box
45 bbarre= #(define-music-function (barre location str music) (string? ly:music?)
47 (let ((first-element #f)
50 (music-map (lambda (m)
51 (if (eqv? (ly:music-property m 'name) 'EventChord)
53 (if (not first-found?)
55 (set! first-found? #t)
56 (set! first-element m)))
57 (set! last-element m)))
62 (set! (ly:music-property first-element 'elements)
63 (cons (make-music 'TextSpanEvent 'span-direction -1)
64 (ly:music-property first-element 'elements)))
65 (set! (ly:music-property last-element 'elements)
66 (cons (make-music 'TextSpanEvent 'span-direction 1)
67 (ly:music-property last-element 'elements)))))
69 (make-music 'SequentialMusic
72 \once \override TextSpanner #'font-size = #-2
73 \once \override TextSpanner #'font-shape = #'upright
74 \once \override TextSpanner #'staff-padding = #3
75 \once \override TextSpanner #'style = #'line
76 \once \override TextSpanner #'to-barline = ##f
77 \once \override TextSpanner #'bound-details = #'((left (Y . 0) (padding . 0.25) (attach-dir . -2)) (right (Y . 0) (padding . 0.25) (attach-dir . 2)))
78 \once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'( 0 . -.5) }
79 \once \override TextSpanner #'bound-details #'left #'text = \markup { \pScript $str }
80 %% uncomment this line for make full barred
81 % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" $str }
85 %% %%%%%%% Cut here ----- End 'bbarred.ly'
86 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
87 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
89 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
90 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }