]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/how-to-change-fret-diagram-position.ly
Web-hu: Fix tiny mistake
[lilypond.git] / Documentation / snippets / how-to-change-fret-diagram-position.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.19.22
8 \version "2.19.22"
9
10 \header {
11   lsrtags = "fretted-strings, specific-notation, tweaks-and-overrides"
12
13   texidoc = "
14 If you want to move the position of a fret diagram, for example, to
15 avoid collision, or to place it between two notes, you have various
16 possibilities:
17
18 1) modify #'padding or #'extra-offset values (as shown in the first
19 snippet)
20
21 2) you can add an invisible voice and attach the fret diagrams to the
22 invisible notes in that voice (as shown in the second example).
23
24  If you need to move the fret according with a rythmic position inside
25 the bar (in the example, the third beat of the measure) the second
26 example is better, because the fret is aligned with the third beat
27 itself.
28
29 "
30   doctitle = "How to change fret diagram position"
31 } % begin verbatim
32
33 harmonies = \chordmode
34 {
35   a8:13
36 % THE FOLLOWING IS THE COMMAND TO MOVE THE CHORD NAME
37   \once \override ChordNames.ChordName.extra-offset = #'(10 . 0)
38   b8:13 s2.
39 % THIS LINE IS THE SECOND METHOD
40     s4 s4  b4:13
41 }
42
43 \score
44 {
45   <<
46     \new ChordNames \harmonies
47     \new Staff
48     {a8^\markup { \fret-diagram  #"6-x;5-0;4-2;3-0;2-0;1-2;"  }
49 % THE FOLLOWING IS THE COMMAND TO MOVE THE FRET DIAGRAM
50      \once \override TextScript.extra-offset = #'(10 . 0)
51      b4.~^\markup { \fret-diagram  #"6-x;5-2;4-4;3-2;2-2;1-4;"  } b4. a8\break
52 % HERE IS THE SECOND METHOD
53      <<
54        { a8 b4.~ b4. a8}
55        { s4 s4 s4^\markup { \fret-diagram  #"6-x;5-2;4-4;3-2;2-2;1-4;"  }
56        }
57      >>
58    }
59   >>
60 }