1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. See TRANSLATION for details.
11 @node Fretted string instruments
12 @section Fretted string instruments
14 @lilypondfile[quote]{fretted-headword.ly}
16 This section discusses several aspects of music notation that are unique
17 to fretted string instruments.
20 @cindex guitar tablature
23 * Common notation for fretted strings::
28 @node Common notation for fretted strings
29 @subsection Common notation for fretted strings
31 This section discusses common notation that is unique
32 to fretted string instruments.
35 * References for fretted strings::
36 * String number indications::
37 * Default tablatures::
39 * Fret diagram markups::
40 * Predefined fret diagrams::
41 * Automatic fret diagrams::
42 * Right-hand fingerings::
45 @node References for fretted strings
46 @subsubsection References for fretted strings
48 Music for fretted string instruments is normally notated on
49 a single staff, either in traditional music notation or in
50 tablature. Sometimes the two types are combined, and it is
51 especially common in popular music to use chord diagrams above
52 a staff of traditional notation. The guitar and the banjo are
53 transposing instruments, sounding an octave lower than written.
54 Scores for these instruments should use the @code{"treble_8"} clef.
55 Some other elements pertinent to fretted string instruments
56 are covered elsewhere:
59 @item Fingerings are indicated with @ref{Fingering instructions}.
61 @item Instructions for @notation{Laissez vibrer} ties
62 as well as ties on arpeggios and tremolos is described in
65 @item Instructions on handling multiple voices is described
66 in @ref{Collision resolution}.
73 @ref{Instrument names},
74 @ref{Writing music in parallel},
75 @ref{Fingering instructions},
78 @ref{List of articulations},
81 @node String number indications
82 @subsubsection String number indications
84 @cindex String numbers
86 The string on which a note should be played may be indicated by
87 appending @code{\@var{number}} to a note inside a chord construct
90 @warning{String numbers @strong{must} be defined inside a chord
91 construct even if there is only a single note.}
93 @lilypond[verbatim,quote,relative=0]
99 When fingerings and string indications are used together, their
100 placement is controlled by the order in which the two items appear
103 @lilypond[verbatim,quote,relative=1]
111 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
112 {controlling-the-placement-of-chord-fingerings.ly}
114 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
115 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
120 @ref{Fingering instructions}.
123 @rlsr{Fretted strings}.
126 @rinternals{StringNumber},
127 @rinternals{Fingering}.
130 @node Default tablatures
131 @subsubsection Default tablatures
132 @cindex Tablatures, basic
133 @cindex Tablatures, default
135 Tablature notation is used for notating music for plucked string
136 instruments. Pitches are not denoted with note heads, but by
137 numbers indicating on which string and fret a note must be played.
138 LilyPond offers limited support for tablature.
140 The string number associated with a note is given as a backslash
141 followed by a number. By default, string 1 is the highest,
142 and the tuning defaults to the standard guitar tuning (with 6 strings).
143 The notes are printed as tablature, by using @code{TabStaff} and
144 @code{TabVoice} contexts
146 @lilypond[quote,ragged-right,fragment,verbatim]
153 @funindex minimumFret
157 When no string is specified for a note, the note is assigned to
158 the lowest string that can generate the note with a fret number
159 greater than or equal to @code{minimumFret} is selected. The
160 default value for @code{minimumFret} is 0.
163 @lilypond[quote,ragged-right,verbatim]
165 \new Staff \relative c {
170 \new TabStaff \relative c {
172 \set TabStaff.minimumFret = #5
180 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
181 {stem-and-beam-behavior-in-tablature.ly}
183 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
184 {polyphony-in-tablature.ly}
192 @rlsr{Fretted strings}.
195 @rinternals{TabNoteHead},
196 @rinternals{TabStaff},
197 @rinternals{TabVoice},
202 Chords are not handled in a special way, and hence the automatic
203 string selector may easily select the same string for two notes in
206 In order to handle @code{\partcombine}, a @code{TabStaff} must use
207 specially-created voices:
209 @lilypond[quote,ragged-right,verbatim]
210 melodia = \partcombine { e4 g g g }{ e4 e e e }
213 \new TabVoice = "one" s1
214 \new TabVoice = "two" s1
215 \new TabVoice = "shared" s1
216 \new TabVoice = "solo" s1
223 @node Custom tablatures
224 @subsubsection Custom tablatures
225 @cindex Tablatures, custom
227 You can change the tuning of the strings. A string tuning is
228 given as a Scheme list with one integer number for each string,
229 the number being the pitch (measured in semitones relative to
230 middle C) of an open string. The numbers specified for
231 @code{stringTunings} are the numbers of semitones to subtract or
232 add, starting the specified pitch by default middle C, in string
233 order. LilyPond automatically calculates the number of strings by
234 looking at @code{stringTunings}.
236 In the next example, @code{stringTunings} is set for the pitches
239 @lilypond[quote,ragged-right,fragment,verbatim]
241 \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
243 a,4 c' a e' e c' a e'
248 LilyPond comes with predefined string tunings for banjo, mandolin,
249 guitar and bass guitar. Lilypond automatically sets the correct
250 transposition for predefined tunings. The following example is
251 for bass guitar, which sounds an octave lower than written.
253 @lilypond[quote,ragged-right,verbatim]
262 \set TabStaff.stringTunings = #bass-tuning
270 The default string tuning is @code{guitar-tuning} (the standard
271 EADGBE tuning). Some other predefined tunings are
272 @code{guitar-open-g-tuning}, @code{mandolin-tuning} and
273 @code{banjo-open-g-tuning}.
278 @rlsr{Fretted strings}.
280 The file @file{scm/@/output@/-lib@/.scm} contains the predefined string
284 @rinternals{Tab_note_heads_engraver}.
288 No guitar special effects have been implemented.
290 @node Fret diagram markups
291 @subsubsection Fret diagram markups
292 @cindex fret diagrams
293 @cindex chord diagrams
295 Fret diagrams can be added to music as a markup to the desired
296 note. The markup contains information about the desired fret
297 diagram. There are three different fret-diagram markup
298 interfaces: standard, terse, and verbose. The three interfaces
299 produce equivalent markups, but have varying amounts of
300 information in the markup string. Details about the markup
301 interfaces are found at @ref{Text markup commands}.
303 The standard fret diagram markup string indicates the string
304 number and the fret number for each dot to be placed on the string.
305 In addition, open and unplayed (muted) strings can be indicated.
307 @lilypond[quote, verbatim]
309 \context ChordNames {
316 < c e g c' e' > 1 ^\markup
317 \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;"
318 < d a d' f'> ^\markup
319 \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-1;"
324 Barre indications can be added to the diagram from
325 the fret-diagram markup string.
327 @lilypond[quote, verbatim]
329 \context ChordNames {
336 < f, c f a c' f'>1 ^\markup
337 \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
338 < g, b, d g b' g'> ^\markup
339 \fret-diagram #"c:6-1-3;6-3;5-5;4-5;3-4;2-3;1-3;"
344 The size of the fret diagram, and the number of frets in the diagram
345 can be changed in the fret-diagram markup string.
347 @lilypond[quote, verbatim]
349 \context ChordNames {
356 < f, c f a c' f'>1 ^\markup
357 \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
358 < g, b, d g b' g'> ^\markup
359 \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;"
364 The number of strings in a fret diagram can be changed to accomodate
365 different instruments such as banjos and ukeleles with the fret-diagram
368 @lilypond[quote, verbatim]
370 \context ChordNames {
376 %% A chord for ukelele
377 a'1 ^\markup \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;"
382 Fingering indications can be added, and the location of fingering labels
383 can be controlled by the fret-diagram markup string.
385 @lilypond[quote, verbatim]
387 \context ChordNames {
394 < c e g c' e' > 1 ^\markup
395 \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;"
396 < d a d' f'> ^\markup
397 \fret-diagram #"f:2;6-x;5-x;4-o;3-2-2;2-3-3;1-1-1;"
402 Dot radius and dot position can be controlled with the fret-diagram
405 @lilypond[quote, verbatim]
407 \context ChordNames {
414 < c e g c' e' > 1 ^\markup
415 \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;"
416 < d a d' f'> ^\markup
417 \fret-diagram #"p:0.2;6-x;5-x;4-o;3-2;2-3;1-1;"
422 The fret-diagram-terse markup string omits string numbers; the string
423 number is implied by the presence of semicolons. There is one semicolon
424 for each string in the diagram. The first semicolon corresponds to the
425 highest string number and the last semicolon corresponds to the first string.
426 Mute strings, open strings, and fret numbers can be indicated.
428 @lilypond[quote, verbatim]
430 \context ChordNames {
437 < c e g c' e' > 1 ^\markup
438 \fret-diagram-terse #"x;3;2;o;1;o;"
439 < d a d' f'> ^\markup
440 \fret-diagram-terse #"x;x;o;2;3;1;"
445 Barre indicators can be included in the fret-diagram-terse markup string.
447 @lilypond[quote, verbatim]
449 \context ChordNames {
456 < f, c f a c' f'>1 ^\markup
457 \fret-diagram-terse #"1-(;3;3;2;1;1-);"
458 < g, b, d g b' g'> ^\markup
459 \fret-diagram-terse #"3-(;5;5;4;3;3-);"
464 Fingering indications can be included in the fret-diagram-terse markup string.
466 @c Need to use override to enable fingerings to show this -- can we do so?
467 @lilypond[quote, verbatim]
469 \context ChordNames {
475 \override Voice.TextScript
476 #'fret-diagram-details #'finger-code = #'below-string
478 < c e g c' e' > 1 ^\markup
479 \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;"
480 < d a d' f'> ^\markup
481 \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;"
486 Other fret diagram properties must be adjusted using @code{\override} when using
487 the fret-diagram-terse markup.
489 The fret-diagram-verbose markup string is in the format of a Scheme list. Each
490 element of the list indicates an item to be placed on the fret diagram.
492 @lilypond[quote, verbatim]
493 << \context ChordNames {
500 < c e g c' e' > 1 ^\markup
501 \fret-diagram-verbose #'(
509 < d a d' f'> ^\markup
510 \fret-diagram-verbose #'(
522 Fingering indications and barres can be included in a
523 fret-diagram-verbose markup string.
525 @c \override is necessary to make fingering visible
526 @lilypond[quote, verbatim]
528 \context ChordNames {
535 \override Voice.TextScript
536 #'fret-diagram-details #'finger-code = #'below-string
538 < f, c f a c' f'>1 ^\markup
539 \fret-diagram-verbose #'(
548 < g, b, d g b' g'> ^\markup
549 \fret-diagram-verbose #'(
561 All other fret diagram properties must be adjusted using @code{\override}
562 when using the fret-diagram-verbose markup.
565 The following example shows the three fret-diagram markup
566 interfaces, along with examples of common tweaks. For example,
567 the size of the verbose fret diagram is reduced to 0.75, and the
568 finger indications are specified to appear below the diagram. The
569 terse diagram includes tweaks to specify placement of finger code
572 @lilypond[verbatim,ragged-right,quote]
575 d^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
577 fis^\markup \override #'(size . 0.75) {
578 \override #'(finger-code . below-string) {
579 \fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2)
588 c^\markup \override #'(dot-radius . 0.35) {
589 \override #'(finger-code . in-dot) {
590 \override #'(dot-color . white) {
591 \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"
600 The graphical layout of a fret diagram can be customized according to
601 user preference through the properties of the @code{fret-diagram-interface}.
602 Details are found at @rinternals{fret-diagram-interface}. For a fret diagram
603 markup , the interface properties belong to @code{Voice.TextScript}.
606 TODO create snippets for changing properties. Use regression test?
611 @ref{Text markup commands}.
614 @rlsr{Fretted strings}.
617 @rinternals{fret-diagram-interface}.
619 @node Predefined fret diagrams
620 @subsubsection Predefined fret diagrams
621 @cindex fret diagrams
622 @cindex chord diagrams
624 Fret diagrams can be displayed using the @code{FretBoards} context. By
625 default, the @code{FretBoards} context will display fret diagrams that
626 are stored in a lookup table:
628 @lilypond[verbatim, ragged-right, quote]
629 \include "predefined-guitar-fretboards.ly"
630 \context FretBoards {
637 The default predefined fret diagrams are contained in the file
638 @code{predefined-guitar-fretboards.ly}. Fret diagrams are
639 stored based on the pitches of a chord and the value of
640 @code{stringTunings} that is currently in use.
641 @code{predefined-guitar-fretboards.ly} contains predefined
642 fret diagrams only for @code{guitar-tuning}. Predefined fret
643 diagrams can be added for other instruments or other tunings
644 by following the examples found in
645 @code{predefined-guitar-fretboards.ly}.
647 Chord pitches can be entered
648 either as simultaneous music or using chord mode (see
649 @ref{Chord mode overview}).
651 @lilypond[verbatim, ragged-right,quote]
652 \include "predefined-guitar-fretboards.ly"
653 \context FretBoards {
659 It is common that both chord names and fret diagrams are displayed together.
660 This is achieved by putting a @code{ChordNames} context in parallel with
661 a @code{FretBoards} context and giving both contexts the same music.
663 @lilypond[verbatim, ragged-right, quote]
664 \include "predefined-guitar-fretboards.ly"
665 mychords = \chordmode{
670 \context ChordNames {
673 \context FretBoards {
679 Predefined fret diagrams are transposable, as long as a diagram for the
680 transposed chord is stored in the fret diagram table.
682 @lilypond[verbatim, ragged-right, quote]
683 \include "predefined-guitar-fretboards.ly"
684 mychords = \chordmode{
690 \transpose c e { \mychords}
693 \context ChordNames {
696 \context FretBoards {
703 The predefined fret diagram table contains seven chords (major, minor,
704 augmented, diminished, dominant seventh, major seventh, minor seventh)
705 for each of 17 keys. A complete list of the predefined fret diagrams is
706 shown in @ref{Predefined fretboard diagrams}. If there is no entry in
707 the table for a chord, the FretBoards engraver will calculate a
708 fret-diagram using the automatic fret diagram functionality described in
709 @ref{Automatic fret diagrams}.
711 @lilypond[verbatim, ragged-right, quote]
712 \include "predefined-guitar-fretboards.ly"
713 mychords = \chordmode{
718 \context ChordNames {
721 \context FretBoards {
727 Fret diagrams can be added to the fret diagram table. To add a diagram,
728 you must specify the chord for the diagram, the tuning to be used, and the
729 fret-diagram-terse definition string for the diagram.
731 @lilypond[verbatim, ragged-right, quote]
732 \include "predefined-guitar-fretboards.ly"
734 \storePredefinedDiagram \chordmode {c:9}
736 #"x;3-2;2-1;3-3;3-4;x;"
738 mychords = \chordmode{
743 \context ChordNames {
746 \context FretBoards {
752 Different fret diagrams for the same chord name can be stored using different
755 @lilypond[verbatim, ragged-right, quote]
756 \include "predefined-guitar-fretboards.ly"
758 \storePredefinedDiagram \chordmode {c'}
760 #(offset-fret 2 (chord-shape 'bes))
762 mychords = \chordmode{
767 \context ChordNames {
770 \context FretBoards {
776 In addition to fret diagrams, LilyPond stores an internal list of chord
777 shapes. The chord shapes are fret diagrams that can be shifted along
778 the neck to different posistions to provide different chords. Chord
779 shapes can be added to the internal list and then used to define
780 predefined fret diagrams.
782 @lilypond[verbatim, ragged-right, quote]
783 \include "predefined-guitar-fretboards.ly"
785 % add a new chord shape
787 \addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
789 % add some new chords based on the power chord shape
791 \storePredefinedDiagram \chordmode {f'}
793 #(chord-shape 'powerf)
794 \storePredefinedDiagram \chordmode {g'}
796 #(offset-fret 2 (chord-shape 'powerf))
798 mychords = \chordmode{
803 \context ChordNames {
806 \context FretBoards {
812 The graphical layout of a fret diagram can be customized according to
813 user preference through the properties of the @code{fret-diagram-interface}.
814 Details are found at @rinternals{fret-diagram-interface}. For a
815 predefined fret diagram, the interface properties belong to
816 @code{FretBoards.FretBoard}.
823 @ref{Custom tablatures},
824 @ref{Automatic fret diagrams},
825 @ref{Chord mode overview},
826 @ref{Predefined fretboard diagrams}.
829 @file{ly/predefined-guitar-fretboards.ly}.
832 @rlsr{Fretted strings}.
835 @rinternals {fret-diagram-interface}.
838 @node Automatic fret diagrams
839 @subsubsection Automatic fret diagrams
840 @cindex fret diagrams
841 @cindex chord diagrams
843 Fret diagrams can be automatically created from entered notes using the
844 @code{FretBoards} context. If no predefined diagram is available for
845 the entered notes in the active @code{stringTunings}, this context
846 calculates strings and frets that can be used to play the notes.
848 @lilypond[quote,ragged-right,verbatim]
850 \context ChordNames {
855 \context FretBoards {
867 As no predefined diagrams are loaded by default, automatic calculation
868 of fret diagrams is the default behavior. Once default diagrams are
869 loaded, automatic calculation can be enabled and disabled with predefined
872 @lilypond[quote,ragged-right,verbatim]
874 \storePredefinedDiagram <c\5 e g c' e'>
876 #"x;3-1-(;5-2;5-3;5-4;3-1-1);"
878 \context ChordNames {
883 \context FretBoards {
885 \predefinedFretboardsOff
887 \predefinedFretboardsOn
901 Notes can be explicitly placed on a string. It is often enough
902 to place only the lowest note on an explicit string; the rest of
903 the notes will then be placed appropriately by the @code{FretBoards}
906 @lilypond[quote,ragged-right,verbatim]
908 \context ChordNames {
913 \context FretBoards {
929 Fingerings can be added to FretBoard fret diagrams.
931 @lilypond[quote, verbatim]
933 \context ChordNames {
938 \context FretBoards {
939 < c\5-3 e-2 g c'-1 e' > 1
950 The strings and frets for the @code{FretBoards} context depend
951 on the @code{stringTunings} property, which has the same meaning
952 as in the TabStaff context. See @ref{Custom tablatures} for
953 information on the @code{stringTunings} property.
955 The graphical layout of a fret diagram can be customized according to
956 user preference through the properties of the @code{fret-diagram-interface}.
957 Details are found at @rinternals{fret-diagram-interface}. For a
958 @code{FretBoards} fret diagram, the interface properties belong to
959 @code{FretBoards.FretBoard}.
962 The minimum fret to be used in calculating strings and frets for
963 the FretBoard context can be set with the @code{minimumFret}
966 @c TODO -- snippet showing minimum fret.
968 @c TODO -- snippet for using StringTunings
971 \predefinedFretboardsOff,
972 \predefinedFretboardsOn.
977 @ref{Custom tablatures}.
980 @rlsr{Fretted strings}.
983 @rinternals {fret-diagram-interface}.
986 @node Right-hand fingerings
987 @subsubsection Right-hand fingerings
989 Right-hand fingerings @var{p-i-m-a} must be entered within a
990 chord construct @code{<>} for them to be printed in the score,
991 even when applied to a single note.
993 @warning{There @strong{must} be a hyphen after the note and a space
994 before the closing @code{>}.}
996 @lilypond[quote,verbatim,relative=0]
998 <c-\rightHandFinger #1 >4
999 <e-\rightHandFinger #2 >
1000 <g-\rightHandFinger #3 >
1001 <c-\rightHandFinger #4 >
1002 <c,-\rightHandFinger #1 e-\rightHandFinger #2 g-\rightHandFinger #3 c-\rightHandFinger #4 >1
1005 For convenience, you can abbreviate @code{\rightHandFinger} to something
1006 short, for example @code{RH},
1009 #(define RH rightHandFinger)
1012 @cindex fingerings, right hand, for guitar
1013 @cindex right hand fingerings for guitar
1017 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1018 {placement-of-right-hand-fingerings.ly}
1020 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1021 {fingerings,-string-indications,-and-right-hand-fingerings.ly}
1026 @rlsr{Fretted strings}.
1028 Internals Reference:
1029 @rinternals{StrokeFinger}.
1035 Most of the notational issues associated with guitar music are
1036 covered sufficiently in the general fretted strings section, but there
1037 are a few more worth covering here. Occasionally users want to
1038 create songbook-type documents having only lyrics with chord
1039 indications above them. Since Lilypond is a music typesetter,
1040 it is not recommended for documents that have no music notation
1041 in them. A better alternative is a word processor, text editor,
1042 or, for experienced users, a typesetter like GuitarTeX.
1045 * Indicating position and barring::
1046 * Indicating harmonics and dampened notes::
1049 @node Indicating position and barring
1050 @subsubsection Indicating position and barring
1052 This example demonstrates how to include guitar position and
1053 barring indications.
1055 @lilypond[quote,ragged-right,fragment,verbatim,relative=0]
1059 \override TextSpanner #'bound-details #'left #'text = #"XII "
1061 b16 e g e b g\stopTextSpan
1068 @ref{Text spanners}.
1071 @rlsr{Fretted strings},
1072 @rlsr{Expressive marks}.
1074 @node Indicating harmonics and dampened notes
1075 @subsubsection Indicating harmonics and dampened notes
1077 Special note heads can be used to indicate dampened notes or
1078 harmonics. Harmonics are normally further explained with a
1081 @lilypond[quote,ragged-right,fragment,verbatim]
1084 \override Staff.NoteHead #'style = #'cross
1086 \override Staff.NoteHead #'style = #'harmonic-mixed
1087 d^\markup { \italic { \fontsize #-2 { "harm. 12" }}} <g b>1
1094 @rlsr{Fretted strings}.
1097 @ref{Special note heads},
1098 @ref{Note head styles}.
1104 * Banjo tablatures::
1107 @node Banjo tablatures
1108 @subsubsection Banjo tablatures
1109 @cindex Banjo tablatures
1111 LilyPond has basic support for the five-string banjo. When making tablatures
1112 for five-string banjo, use the banjo tablature format function to get
1113 correct fret numbers for the fifth string:
1115 @c due to crazy intervals of banjo music, absolute pitch is recommended
1117 @lilypond[quote,ragged-right,fragment,verbatim]
1119 \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo
1120 \set TabStaff.stringTunings = #banjo-open-g-tuning
1123 g8 d' g'\5 a b g e d' |
1124 g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
1130 A number of common tunings for banjo are predefined in LilyPond:
1131 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
1132 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}
1135 These tunings may be converted to four-string banjo tunings using the
1136 @code{four-string-banjo} function:
1139 \set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
1145 @rlsr{Fretted strings}.
1147 The file @file{scm/@/output@/-lib@/.scm} contains predefined banjo tunings.