]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/bar-chords-notation-for-guitar--with-text-spanner.ly
5fa4486949a3d0846486557c0062728fa613055d
[lilypond.git] / Documentation / snippets / bar-chords-notation-for-guitar--with-text-spanner.ly
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
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.15.30
8 \version "2.15.30"
9
10 \header {
11 %% Translation of GIT committish: b482c3e5b56c3841a88d957e0ca12964bd3e64fa
12   texidoces = "
13 He aquí cómo imprimir acordes con cejilla o con media cejilla (quite
14 la marca de comentario de la línea adecuada para seleccionar uno de
15 ellos).
16
17 La sintaxis es @code{\\bbarre #\"@var{número de traste}\" @{ notas @} }.
18
19 "
20   doctitlees = "Notación de acordes de cejilla para guitarra (con elemento de extensión de texto)"
21
22 %% Translation of GIT committish: f5cfaf8ef4ac347702f554af0944ef0d8396e73a
23   texidocfr = "
24 Voici comment imprimer un accord développé sur une mesure ou une demie
25 mesure (décommenter la ligne appropriée).
26
27 La syntaxe est @code{\\bbarre #\"@var{numéro de fret}\" @{ notes @} }.
28
29 "
30   doctitlefr = "Notation d'accords barré développé (avec extension de texte)"
31
32   lsrtags = "chords, fretted-strings"
33
34   texidoc = "
35 Here is how to print bar chords, or half-bar chords (just uncomment the
36 appropriate line for to select either one).
37
38 The syntax is @code{\\bbarre #\"@var{fret number}\" @{ notes @} }.
39 "
40   doctitle = "Bar chords notation for Guitar (with Text Spanner)"
41 } % begin verbatim
42
43
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45 %% %%%%%%%  Cut here ----- Start 'bbarred.ly'
46
47 %% C with slash -------------------------------
48 cWithSlash = \markup {
49   \combine \roman C \translate #'(0.6 . -0.4) \draw-line #'(0 . 2.0)
50 }
51 %% Span -----------------------------------
52 %% Syntax: \bbarre #"text" { notes } - text = any number of box
53 bbarre =
54 #(define-music-function (barre location str music) (string? ly:music?)
55    (let ((elts (extract-named-music music '(NoteEvent EventChord))))
56      (if (pair? elts)
57          (let ((first-element (first elts))
58                (last-element (last elts)))
59            (set! (ly:music-property first-element 'articulations)
60                  (cons (make-music 'TextSpanEvent 'span-direction -1)
61                        (ly:music-property first-element 'articulations)))
62            (set! (ly:music-property last-element 'articulations)
63                  (cons (make-music 'TextSpanEvent 'span-direction 1)
64                        (ly:music-property last-element 'articulations))))))
65    #{
66        \once \override TextSpanner #'font-size = #-2
67        \once \override TextSpanner #'font-shape = #'upright
68        \once \override TextSpanner #'staff-padding = #3
69        \once \override TextSpanner #'style = #'line
70        \once \override TextSpanner #'to-barline = ##f
71        \once \override TextSpanner #'bound-details =
72             #`((left
73                 (text . ,#{ \markup { \draw-line #'( 0 . -.5) } #})
74                 (Y . 0)
75                 (padding . 0.25)
76                 (attach-dir . -2))
77                (right
78                 (text . ,#{ \markup { \cWithSlash #str } #})
79                 (Y . 0)
80                 (padding . 0.25)
81                 (attach-dir . 2)))
82 %% uncomment this line for make full barred
83        % \once  \override TextSpanner #'bound-details #'left #'text =  \markup { "B" #str }
84        $music
85    #})
86
87 %% %%%%%%%  Cut here ----- End 'bbarred.ly'
88 %% Copy and change the last line for full barred. Rename in 'fbarred.ly'
89 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90
91 %% Syntaxe: \bbarre #"text" { notes } - text = any number of box
92 \relative c'{ \clef "G_8" \stemUp \bbarre #"III" { <f a'>16[  c' d c d8] } }