1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
6 % This file is in the public domain.
7 %% Note: this file works from version 2.15.24
11 lsrtags = "chords, fretted-strings"
14 Here is how to print bar chords, or half-bar chords (just uncomment the
15 appropriate line for to select either one).
17 The syntax is @code{\\bbarre #'fret_number' @{ notes @} }
23 doctitle = "Bar chords notation for Guitar ( with Text Spanner)"
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 %% %%%%%%% Cut here ----- Start 'bbarred.ly'
30 %% C with slash -------------------------------
31 cWithSlash = \markup {
32 \combine \roman C \translate #'(0.6 . -0.4) \draw-line #'(0 . 2.0)
34 %% Span -----------------------------------
35 %% Syntax: \bbarre #"text" { notes } - text = any number of box
36 bbarre= #(define-music-function (barre location str music) (string? ly:music?)
38 (let ((first-element #f)
41 (music-map (lambda (m)
42 (if (eqv? (ly:music-property m 'name) 'EventChord)
44 (if (not first-found?)
46 (set! first-found? #t)
47 (set! first-element m)))
48 (set! last-element m)))
53 (set! (ly:music-property first-element 'elements)
54 (cons (make-music 'TextSpanEvent 'span-direction -1)
55 (ly:music-property first-element 'elements)))
56 (set! (ly:music-property last-element 'elements)
57 (cons (make-music 'TextSpanEvent 'span-direction 1)
58 (ly:music-property last-element 'elements)))))
60 (make-music 'SequentialMusic
63 \once \override TextSpanner #'font-size = #-2
64 \once \override TextSpanner #'font-shape = #'upright
65 \once \override TextSpanner #'staff-padding = #3
66 \once \override TextSpanner #'style = #'line
67 \once \override TextSpanner #'to-barline = ##f
68 \once \override TextSpanner #'bound-details = #'((left (Y . 0) (padding . 0.25) (attach-dir . -2)) (right (Y . 0) (padding . 0.25) (attach-dir . 2)))
69 \once \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'( 0 . -.5) }
70 \once \override TextSpanner #'bound-details #'left #'text = \markup { \cWithSlash #str }
71 %% uncomment this line for make full barred
72 % \once \override TextSpanner #'bound-details #'left #'text = \markup { "B" #str }
76 %% %%%%%%% Cut here ----- End 'bbarred.ly'
77 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
81 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[ c' d c d8] } }