summaryrefslogtreecommitdiff
path: root/Documentation/snippets/how-to-change-fret-diagram-position.ly
blob: da24c5a5dda064c02dbe9cc86f0adebdd7e1e3cd (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%% DO NOT EDIT this file manually; it is automatically
%% generated from LSR http://lsr.dsi.unimi.it
%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
%% and then run scripts/auxiliar/makelsr.py
%%
%% This file is in the public domain.
\version "2.19.2"

\header {
  lsrtags = "fretted-strings, specific-notation, tweaks-and-overrides"

  texidoc = "
If you want to move the position of a fret diagram, for example, to
avoid collision, or to place it between two notes, you have various
possibilities:

1) modify #'padding or #'extra-offset values (as shown in the first
snippet)

2) you can add an invisible voice and attach the fret diagrams to the
invisible notes in that voice (as shown in the second example).

 If you need to move the fret according with a rythmic position inside
the bar (in the example, the third beat of the measure) the second
example is better, because the fret is aligned with the third beat
itself.

"
  doctitle = "How to change fret diagram position"
} % begin verbatim


harmonies = \chordmode
{
  a8:13
% THE FOLLOWING IS THE COMMAND TO MOVE THE CHORD NAME
  \once \override ChordNames.ChordName.extra-offset = #'(10 . 0)
  b8:13 s2.
% THIS LINE IS THE SECOND METHOD
    s4 s4  b4:13
}

\score
{
  <<
    \context ChordNames \harmonies
    \context Staff
    {a8^\markup { \fret-diagram  #"6-x;5-0;4-2;3-0;2-0;1-2;"  }
% THE FOLLOWING IS THE COMMAND TO MOVE THE FRET DIAGRAM
     \once \override TextScript.extra-offset = #'(10 . 0)
     b4.~^\markup { \fret-diagram  #"6-x;5-2;4-4;3-2;2-2;1-4;"  } b4. a8\break
% HERE IS THE SECOND METHOD
     <<
       { a8 b4.~ 4. a8}
       { s4 s4 s4^\markup { \fret-diagram  #"6-x;5-2;4-4;3-2;2-2;1-4;"  }
       }
     >>
   }
  >>
}