]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/customizing-markup-fret-diagrams.ly
Add '-dcrop' option to ps and svg backends
[lilypond.git] / Documentation / snippets / customizing-markup-fret-diagrams.ly
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
5 %%
6 %% This file is in the public domain.
7 \version "2.18.0"
8
9 \header {
10   lsrtags = "fretted-strings, tweaks-and-overrides"
11
12   texidoc = "
13 Fret diagram properties can be set through
14 @code{'fret-diagram-details}.  For markup fret diagrams, overrides can
15 be applied to the @code{Voice.TextScript} object or directly to the
16 markup.
17
18 "
19   doctitle = "Customizing markup fret diagrams"
20 } % begin verbatim
21
22 <<
23   \chords { c1 | c | c | d }
24
25   \new Voice = "mel" {
26     \textLengthOn
27     % Set global properties of fret diagram
28     \override TextScript.size = #'1.2
29     \override TextScript.fret-diagram-details.finger-code = #'in-dot
30     \override TextScript.fret-diagram-details.dot-color = #'white
31
32     %% C major for guitar, no barre, using defaults
33        % terse style
34     c'1^\markup { \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" }
35
36     %% C major for guitar, barred on third fret
37        % verbose style
38        % size 1.0
39        % roman fret label, finger labels below string, straight barre
40     c'1^\markup {
41       % standard size
42       \override #'(size . 1.0) {
43         \override #'(fret-diagram-details . (
44                      (number-type . roman-lower)
45                      (finger-code . in-dot)
46                      (barre-type . straight))) {
47           \fret-diagram-verbose #'((mute 6)
48                                    (place-fret 5 3 1)
49                                    (place-fret 4 5 2)
50                                    (place-fret 3 5 3)
51                                    (place-fret 2 5 4)
52                                    (place-fret 1 3 1)
53                                    (barre 5 1 3))
54         }
55       }
56     }
57
58     %% C major for guitar, barred on third fret
59        % verbose style
60        % landscape orientation, arabic numbers, M for mute string
61        % no barre, fret label down or left, small mute label font
62     c'1^\markup {
63       \override #'(fret-diagram-details . (
64                    (finger-code . below-string)
65                    (number-type . arabic)
66                    (label-dir . -1)
67                    (mute-string . "M")
68                    (orientation . landscape)
69                    (barre-type . none)
70                    (xo-font-magnification . 0.4)
71                    (xo-padding . 0.3))) {
72         \fret-diagram-verbose #'((mute 6)
73                                  (place-fret 5 3 1)
74                                  (place-fret 4 5 2)
75                                  (place-fret 3 5 3)
76                                  (place-fret 2 5 4)
77                                  (place-fret 1 3 1)
78                                  (barre 5 1 3))
79       }
80     }
81
82     %% simple D chord
83        % terse style
84        % larger dots, centered dots, fewer frets
85        % label below string
86     d'1^\markup {
87       \override #'(fret-diagram-details . (
88                    (finger-code . below-string)
89                    (dot-radius . 0.35)
90                    (dot-position . 0.5)
91                    (fret-count . 3))) {
92         \fret-diagram-terse #"x;x;o;2-1;3-2;2-3;"
93       }
94     }
95   }
96 >>