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