Next: Predefined fret diagrams, Previous: Custom tablatures, Up: Common notation for fretted strings
Fret diagrams can be added to music as a markup to the desired note. The markup contains information about the desired fret diagram. There are three different fret-diagram markup interfaces: standard, terse, and verbose. The three interfaces produce equivalent markups, but have varying amounts of information in the markup string. Details about the markup interfaces are found at Text markup commands.
The standard fret diagram markup string indicates the string number and the fret number for each dot to be placed on the string. In addition, open and unplayed (muted) strings can be indicated.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;" < d a d' f'> ^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-1;" } >>
Barre indications can be added to the diagram from the fret-diagram markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" < f, c f a c' f'>1 ^\markup \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;" < g, d g b d' g'> ^\markup \fret-diagram #"c:6-1-3;6-3;5-5;4-5;3-4;2-3;1-3;" } >>
The size of the fret diagram, and the number of frets in the diagram can be changed in the fret-diagram markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" < f, c f a c' f'>1 ^\markup \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;" < g, b, d g b g'> ^\markup \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;" } >>
The number of strings in a fret diagram can be changed to accomodate different instruments such as banjos and ukeleles with the fret-diagram markup string.
<< \context ChordNames { \chordmode { a1 } } \context Staff { %% A chord for ukelele a'1 ^\markup \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;" } >>
Fingering indications can be added, and the location of fingering labels can be controlled by the fret-diagram markup string.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;" < d a d' f'> ^\markup \fret-diagram #"f:2;6-x;5-x;4-o;3-2-2;2-3-3;1-1-1;" } >>
Dot radius and dot position can be controlled with the fret-diagram markup string.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;" < d a d' f'> ^\markup \fret-diagram #"p:0.2;6-x;5-x;4-o;3-2;2-3;1-1;" } >>
The fret-diagram-terse markup string omits string numbers; the string number is implied by the presence of semicolons. There is one semicolon for each string in the diagram. The first semicolon corresponds to the highest string number and the last semicolon corresponds to the first string. Mute strings, open strings, and fret numbers can be indicated.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram-terse #"x;3;2;o;1;o;" < d a d' f'> ^\markup \fret-diagram-terse #"x;x;o;2;3;1;" } >>
Barre indicators can be included in the fret-diagram-terse markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" < f, c f a c' f'>1 ^\markup \fret-diagram-terse #"1-(;3;3;2;1;1-);" < g, d g b d' g'> ^\markup \fret-diagram-terse #"3-(;5;5;4;3;3-);" } >>
Fingering indications can be included in the fret-diagram-terse markup string.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \override Voice.TextScript #'fret-diagram-details #'finger-code = #'below-string \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" < d a d' f'> ^\markup \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;" } >>
Other fret diagram properties must be adjusted using \override
when using
the fret-diagram-terse markup.
The fret-diagram-verbose markup string is in the format of a Scheme list. Each element of the list indicates an item to be placed on the fret diagram.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram-verbose #'( (mute 6) (place-fret 5 3) (place-fret 4 2) (open 3) (place-fret 2 1) (open 1) ) < d a d' f'> ^\markup \fret-diagram-verbose #'( (mute 6) (mute 5) (open 4) (place-fret 3 2) (place-fret 2 3) (place-fret 1 1) ) } >>
Fingering indications and barres can be included in a fret-diagram-verbose markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" \override Voice.TextScript #'fret-diagram-details #'finger-code = #'below-string < f, c f a c' f'>1 ^\markup \fret-diagram-verbose #'( (place-fret 6 1) (place-fret 5 3) (place-fret 4 3) (place-fret 3 2) (place-fret 2 1) (place-fret 1 1) (barre 6 1 1) ) < g, b, d g b g'> ^\markup \fret-diagram-verbose #'( (place-fret 6 3 2) (place-fret 5 2 1) (open 4) (open 3) (open 2) (place-fret 1 3 3) ) } >>
All other fret diagram properties must be adjusted using \override
when using the fret-diagram-verbose markup.
The graphical layout of a fret diagram can be customized according to
user preference through the properties of the fret-diagram-interface
.
Details are found at fret-diagram-interface. For a fret diagram
markup , the interface properties belong to Voice.TextScript
.
Customizing markup fret diagrams
Fret diagram properties can be set through
fret-diagram-details
. For markup fret diagrams, overrides
can be applied to the Voice.TextScript
object or directly
to the markup.
<< \chords { c1 c c d } \new Voice = "mel" { \textLengthOn % Set global properties of fret diagram \override Voice.TextScript #'size = #'1.2 \override Voice.TextScript #'fret-diagram-details #'finger-code = #'in-dot \override Voice.TextScript #'fret-diagram-details #'dot-color = #'white %% C major for guitar, no barre, using defaults % terse style c'1^\markup { \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" } %% C major for guitar, barred on third fret % verbose style % size 1.0 % roman fret label, finger labels below string, straight barre c'1^\markup { % standard size \override #'(size . 1.0) { \override #'(fret-diagram-details . ( (number-type . roman-lower) (finger-code . in-dot) (barre-type . straight))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } } %% C major for guitar, barred on third fret % verbose style % landscape orientation, arabic numbers, M for mute string % no barre, fret label down or left, small mute label font c'1^\markup { \override #'(fret-diagram-details . ( (finger-code . below-string) (number-type . arabic) (label-dir . -1) (mute-string . "M") (orientation . landscape) (barre-type . none) (xo-font-magnification . 0.4) (xo-padding . 0.3))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } %% simple D chord % terse style % larger dots, centered dots, fewer frets % label below string d'1^\markup { \override #'(fret-diagram-details . ( (finger-code . below-string) (dot-radius . 0.35) (dot-position . 0.5) (fret-count . 3))) { \fret-diagram-terse #"x;x;o;2-1;3-2;2-3;" } } } >>
Notation Reference: Text markup commands.
Snippets: Fretted strings.
Internals Reference: fret-diagram-interface.
This page is for LilyPond-2.11.58 (development-branch).
Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.
Your suggestions for the documentation are welcome.