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. For details, see the Contributors'
7 Guide, node Updating translation committishes..
12 @node Fretted string instruments
13 @section Fretted string instruments
15 @lilypondfile[quote]{fretted-headword.ly}
17 This section discusses several aspects of music notation that are unique
18 to fretted string instruments.
21 @cindex tablature, guitar
22 @cindex tablature, banjo
23 @cindex guitar tablature
24 @cindex banjo tablature
27 * Common notation for fretted strings::
32 @node Common notation for fretted strings
33 @subsection Common notation for fretted strings
35 This section discusses common notation that is unique
36 to fretted string instruments.
39 * References for fretted strings::
40 * String number indications::
41 * Default tablatures::
43 * Fret diagram markups::
44 * Predefined fret diagrams::
45 * Automatic fret diagrams::
46 * Right-hand fingerings::
49 @node References for fretted strings
50 @unnumberedsubsubsec References for fretted strings
52 Music for fretted string instruments is normally notated on
53 a single staff, either in traditional music notation or in
54 tablature. Sometimes the two types are combined, and it is
55 especially common in popular music to use chord diagrams above
56 a staff of traditional notation. The guitar and the banjo are
57 transposing instruments, sounding an octave lower than written.
58 Scores for these instruments should use the @code{"treble_8"} clef
59 (or @code{\transposition c} to get correct MIDI output).
60 Some other elements pertinent to fretted string instruments
61 are covered elsewhere:
64 @item Fingerings are indicated as shown in
65 @ref{Fingering instructions}.
67 @item Instructions for @notation{Laissez vibrer} ties
68 as well as ties on arpeggios and tremolos can be found in
71 @item Instructions for handling multiple voices can be found
72 in @ref{Collision resolution}.
74 @item Instructions for indicating harmonics can be found in
82 @ref{Fingering instructions},
84 @ref{Collision resolution},
85 @ref{Instrument names},
86 @ref{Writing music in parallel},
88 @ref{List of articulations},
90 @ref{Instrument transpositions}.
93 @node String number indications
94 @unnumberedsubsubsec String number indications
96 @cindex string numbers
97 @cindex string vs. fingering numbers
98 @cindex fingering vs. string numbers
100 The string on which a note should be played may be indicated by
101 appending @code{\@var{number}} to a note inside a chord construct
104 @warning{String numbers @strong{must} be defined inside a chord
105 construct even if there is only a single note.}
107 @lilypond[verbatim,quote,relative=0]
113 When fingerings and string indications are used together, their
114 placement is controlled by the order in which the two items appear
117 @lilypond[verbatim,quote,relative=1]
125 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
126 {controlling-the-placement-of-chord-fingerings.ly}
128 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
129 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
134 @ref{Fingering instructions}.
137 @rlsr{Fretted strings}.
140 @rinternals{StringNumber},
141 @rinternals{Fingering}.
144 @node Default tablatures
145 @unnumberedsubsubsec Default tablatures
147 @cindex tablatures, basic
148 @cindex tablatures, default
153 Music for plucked string instruments is frequently notated using a
154 finger/touch notation or tablature. In contrast to traditional
155 notation pitches are not denoted with note heads, but by numbers (or
156 letter-like symbols in historical intavolatura). The staff lines
157 in tablature indicate the string on which the note is to be played,
158 and a number placed on a staff line indicated the fret at which
159 the corresponding string is to be pressed.
160 Notes that are to be played simultaneously are vertically aligned.
162 By default, string 1 is the highest string, and corresponds to the top
163 line on the @code{TabStaff}. The tuning of the @code{TabStaff}
164 strings defaults to the
165 standard guitar tuning (with 6 strings). The notes are printed as
166 tablature, by using @code{TabStaff} and @code{TabVoice} contexts. A
167 calligraphic tablature clef is added automatically.
169 @lilypond[quote,ragged-right,verbatim]
170 \new TabStaff \relative c' {
176 Default tablatures do not contain any symbols for tone duration nor any
177 other musical symbols such as e.g. expressive marks.
179 @lilypond[quote,ragged-right,verbatim]
191 \new Staff { \clef "G_8" \symbols }
192 \new TabStaff { \symbols }
197 @funindex \tabFullNotation
199 If all musical symbols used in traditional notation should also show up
200 in tablature one has to apply the command @code{\tabFullNotation} in a
201 @code{TabStaff}-context. Please bear in mind that half notes are
202 double-stemmed in tablature in order to distinguish them from quarter
205 @lilypond[quote,ragged-right,verbatim]
225 @funindex minimumFret
227 By default pitches are assigned to the lowest playing position on the
228 fret-board (first position). Open strings are automatically preferred.
229 If you would like a certain pitch to be played on a specific string
230 you can add a string number indication to the pitch name. If you
231 define pitch names and string numbers without a chord construct
232 (@code{<>}) the string number indications do not appear in traditional
233 notation. It is much more comfortable to define the playing position
234 by using the value of @code{minimumFret}. The default value for
238 @lilypond[quote,ragged-right,verbatim]
240 \new Staff \relative c {
244 c,16\5 d\5 e\4 f\4 g4\4
247 \new TabStaff \relative c {
249 c,16\5 d\5 e\4 f\4 g4\4
250 \set TabStaff.minimumFret = #5
256 @funindex \tabChordRepetition
258 Chord constructs can be repeated by the chord repetition symbol
259 @code{q}. To use this feature in combination with tablature,
260 @code{\tabChordRepetition} is provided. It preserves the string
261 information explicitly given within chord constructs so repeated chords
262 get identical tablature representations.
264 @lilypond[quote,verbatim]
267 guitar = \relative c' {
268 r8 <gis\4 cis\3 b\2>~ q4 q8~ q q4
274 \override Voice.StringNumber #'transparent = ##t
284 Ties over a line break are parenthesized by default. The same holds for
285 the second alternative of a repeat.
287 @lilypond[quote,ragged-right,verbatim]
288 ties = \relative c' {
295 { g4\repeatTie c,2. }
322 @funindex \hideSplitTiedTabNotes
324 The command @code{\hideSplitTiedTabNotes} cancels the behavior of
325 engraving fret numbers in parentheses:
327 @lilypond[quote,ragged-right,verbatim]
328 ties = \relative c' {
334 { g4\repeatTie c,2. }
350 \hideSplitTiedTabNotes
362 @cindex harmonic indications in tablature notation
363 @cindex tablature and harmonic indications
364 @cindex slides in tablature notation
365 @cindex tablature and slides
366 @cindex chord glissandi
368 @funindex \harmonicByFret
369 @funindex \harmonicByRatio
370 @funindex \chordGlissando
372 Harmonic indications can be added to tablature notation as sounding
375 @lilypond[verbatim,quote]
383 \new Staff { \firstHarmonic }
384 \new TabStaff { \firstHarmonic }
389 Note that the command @code{\harmonic} must always be defined
390 inside a chord construct. It only makes sense for open-string harmonics
391 in the 12th fret. All other harmonics should be calculated by LilyPond.
392 This can be achieved by indicating the fret where a finger of the
393 fretting hand should touch a string.
395 @lilypond[verbatim,quote]
397 \harmonicByFret #5 d16\4
398 \harmonicByFret #4 d16\4
399 \harmonicByFret #3 d8\4
400 \harmonicByFret #5 <g\3 b\2>2.
404 \new Staff { \fretHarmonics }
405 \new TabStaff { \fretHarmonics }
410 Alternatively, harmonics can be computed by defining the ratio of
411 string lengths above and below the harmonic fingering.
413 @lilypond[verbatim,quote]
415 \harmonicByRatio #1/2 <g\3 b\2 e'\1>4
416 \harmonicByRatio #1/3 <g\3 b\2 e'\1>4
417 \harmonicByRatio #1/4 { g8\3 b8\2 e'4\1 }
421 \new Staff { \ratioHarmonics }
422 \new TabStaff { \ratioHarmonics }
430 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
431 {stem-and-beam-behavior-in-tablature.ly}
433 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
434 {polyphony-in-tablature.ly}
436 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
437 {open-string-harmonics-in-tablature.ly}
439 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
440 {fretted-string-harmonics-in-tablature.ly}
442 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
443 {slides-in-tablature.ly}
445 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
446 {chord-glissando-in-tablature.ly}
456 @rlsr{Fretted strings}.
459 @rinternals{TabNoteHead},
460 @rinternals{TabStaff},
461 @rinternals{TabVoice},
467 Chords are not handled in a special way, and hence the automatic
468 string selector may easily select the same string for two notes in
471 In order to handle @code{\partcombine}, a @code{TabStaff} must use
472 specially-created voices:
474 @lilypond[quote,ragged-right,verbatim]
475 melodia = \partcombine { e4 g g g } { e4 e e e }
478 \new TabVoice = "one" s1
479 \new TabVoice = "two" s1
480 \new TabVoice = "shared" s1
481 \new TabVoice = "solo" s1
487 Guitar special effects are limited to harmonics and slides.
489 @node Custom tablatures
490 @unnumberedsubsubsec Custom tablatures
492 @cindex tablatures, custom
493 @cindex tablature, banjo
494 @cindex tablature, mandolin
495 @cindex tablature, guitar
496 @cindex tablature, bass guitar
497 @cindex tablature, ukulele
498 @cindex tablature, predefined string tunings
499 @cindex fretted instruments, predefined string tunings
500 @cindex predefined string tunings for fretted instruments
501 @cindex tablature, violin
502 @cindex tablature, viola
503 @cindex tablature, cello
504 @cindex tablature, bass
505 @cindex tablature, double bass
507 @funindex StringTunings
509 LilyPond tablature automatically calculates the fret for
510 a note based on the string to which the note is assigned.
511 In order to do this, the tuning of the strings must be
512 specified. The tuning of the strings is given in the
513 @code{stringTunings} property.
515 LilyPond comes with predefined string tunings for banjo, mandolin,
516 guitar, bass guitar, ukulele, violin, viola, cello, and double bass.
517 LilyPond automatically sets
518 the correct transposition for predefined tunings. The following
519 example is for bass guitar, which sounds an octave lower than
522 @lilypond[quote,ragged-right,verbatim]
531 \set TabStaff.stringTunings = #bass-tuning
539 The default string tuning is @code{guitar-tuning}, which
540 is the standard EADGBE tuning. Some other predefined tunings are
541 @code{guitar-open-g-tuning}, @code{mandolin-tuning} and
542 @code{banjo-open-g-tuning}. The predefined string tunings
543 are found in @file{ly/string-tuning-init.ly}.
545 @funindex contextStringTunings
546 @funindex \contextStringTunings
547 @cindex tablature, custom string tunings
548 @cindex custom string tunings
550 Any desired string tuning can be created. The
551 @code{\contextStringTuning} function can be
552 used to define a string tuning and set it as the
553 @code{stringTunings} for the current context.
554 @code{\contextStringTuning} takes two arguments: the
555 symbol in which the string tuning will be stored,
556 and a chord construct
557 that defines the pitches of each string in the tuning.
558 The chord construct must be in absolute octave mode,
559 see @ref{Absolute octave entry}. The string
560 with the highest number (generally the lowest string) must
561 come first in the chord. For example, we can
562 define a string tuning for a four-string instrument with pitches
563 of @code{a''}, @code{d''}, @code{g'}, and @code{c'}:
565 @lilypond[quote,verbatim]
578 \contextStringTuning #'custom-tuning <c' g' d'' a''>
584 The @code{stringTunings} property is also used by
585 @code{FretBoards} to calculate automatic fret diagrams.
587 @funindex makeStringTuning
588 @funindex \makeStringTuning
590 String tunings are used as part of the hash key
591 for predefined fret diagrams
592 (see @ref{Predefined fret diagrams}). The @code{\makeStringTuning}
593 function is used to create a string tuning without setting the
594 @code{stringTunings} property in the current context. The
595 arguments to @code{\makeStringTuning} are the symbol to be
596 used for the new string tuning and a chord construct used
597 to define the tuning.
598 The previous example could also be written as follows:
600 @lilypond[quote,verbatim]
601 \makeStringTuning #'custom-tuning <c' g' d'' a''>
614 \set TabStaff.stringTunings = #custom-tuning
620 Internally, a string tuning is a Scheme list of string pitches,
621 one for each string, ordered by string number from 1 to N,
622 where string 1 is at the top of the tablature staff and
623 string N is at the bottom. This ordinarily results in ordering
624 from highest pitch to lowest pitch, but some instruments
625 (e.g. ukulele) do not have strings ordered by pitch.
627 A string pitch in a string tuning list is a LilyPond pitch
628 object. Pitch objects are created with the Scheme function
629 @code{ly:make-pitch} (see @ref{Scheme functions}).
631 If desired, a string tuning can be created as a Scheme
632 literal. The example below recreates the examples above,
633 but the string tuning is not saved as a separate object:
635 @lilypond[quote,verbatim]
647 \set TabStaff.stringTunings = #`(,(ly:make-pitch 1 5 0)
648 ,(ly:make-pitch 1 1 0)
649 ,(ly:make-pitch 0 4 0)
650 ,(ly:make-pitch 0 0 0))
656 LilyPond automatically calculates the number of lines in the
657 @code{TabStaff} and the number of strings in an automatically
658 calculated @code{FretBoard} as the number of elements
659 in @code{stringTunings}.
661 @cindex moderntab clef
662 @cindex clef, moderntab
666 A modern tab clef can also be used.
668 @lilypond[quote,ragged-right,verbatim]
678 The modern tab clef supports tablatures from 4 to 7 strings.
682 @ref{Absolute octave entry},
683 @ref{Predefined fret diagrams},
684 @ref{Scheme functions}.
687 @file{ly/string-tuning-init.ly}
688 @file{scm/tablature.scm}.
691 @rlsr{Fretted strings}.
694 @rinternals{Tab_note_heads_engraver}.
697 Automatic tablature calculations do not work properly in most
698 cases for instruments where string pitches do not vary
699 monotonically with string number, such as ukuleles.
701 @node Fret diagram markups
702 @unnumberedsubsubsec Fret diagram markups
704 @cindex fret diagrams
705 @cindex chord diagrams
706 @cindex diagrams, fret
707 @cindex diagrams, chord for fretted instruments
708 @cindex fret diagrams, custom
709 @cindex custom fret diagrams
711 Fret diagrams can be added to music as a markup to the desired
712 note. The markup contains information about the desired fret
713 diagram. There are three different fret-diagram markup
714 interfaces: standard, terse, and verbose. The three interfaces
715 produce equivalent markups, but have varying amounts of
716 information in the markup string. Details about the
717 syntax of the different markup strings used to define
718 fret diagrams are found at @ref{Instrument Specific Markup}.
720 The standard fret diagram markup string indicates the string
721 number and the fret number for each dot to be placed on the string.
722 In addition, open and unplayed (muted) strings can be indicated.
724 @lilypond[quote, verbatim]
726 \context ChordNames {
733 <c e g c' e'>1^\markup {
734 \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;"
736 <d a d' f'>1^\markup {
737 \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-1;"
743 @cindex barre indications
745 Barre indications can be added to the diagram from
746 the fret-diagram markup string.
748 @lilypond[quote, verbatim]
750 \context ChordNames {
757 <f, c f a c' f'>1^\markup {
758 \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
760 <g, d g b d' g'>1^\markup {
761 \fret-diagram #"c:6-1-3;6-3;5-5;4-5;3-4;2-3;1-3;"
767 @cindex fret-diagram markup
770 @funindex fret-diagram
771 @funindex \fret-diagram
773 The size of the fret diagram, and the number of frets in the diagram
774 can be changed in the fret-diagram markup string.
776 @lilypond[quote, verbatim]
778 \context ChordNames {
785 <f, c f a c' f'>1^\markup {
786 \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
788 <g, b, d g b g'>1^\markup {
789 \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;"
795 The number of strings in a fret diagram can be changed to accommodate
796 different instruments such as banjos and ukuleles with the fret-diagram
799 @lilypond[quote, verbatim]
801 \context ChordNames {
807 % An 'A' chord for ukulele
809 \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;"
815 Fingering indications can be added, and the location of fingering labels
816 can be controlled by the fret-diagram markup string.
818 @lilypond[quote, verbatim]
820 \context ChordNames {
827 <c e g c' e'>1^\markup {
828 \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;"
830 <d a d' f'>1^\markup {
831 \fret-diagram #"f:2;6-x;5-x;4-o;3-2-2;2-3-3;1-1-1;"
837 Dot radius and dot position can be controlled with the fret-diagram
840 @lilypond[quote, verbatim]
842 \context ChordNames {
849 <c e g c' e'>1^\markup {
850 \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;"
852 <d a d' f'>1^\markup {
853 \fret-diagram #"p:0.2;6-x;5-x;4-o;3-2;2-3;1-1;"
859 @cindex fret-diagram-terse markup
861 @funindex fret-diagram-terse
862 @funindex \fret-diagram-terse
864 The fret-diagram-terse markup string omits string numbers; the string
865 number is implied by the presence of semicolons. There is one semicolon
866 for each string in the diagram. The first semicolon corresponds to the
867 highest string number and the last semicolon corresponds to the first string.
868 Mute strings, open strings, and fret numbers can be indicated.
870 @lilypond[quote, verbatim]
872 \context ChordNames {
879 <c e g c' e'>1^\markup {
880 \fret-diagram-terse #"x;3;2;o;1;o;"
882 <d a d' f'>1^\markup {
883 \fret-diagram-terse #"x;x;o;2;3;1;"
889 Barre indicators can be included in the fret-diagram-terse markup string.
891 @lilypond[quote, verbatim]
893 \context ChordNames {
900 <f, c f a c' f'>1^\markup {
901 \fret-diagram-terse #"1-(;3;3;2;1;1-);"
903 <g, d g b d' g'>1^\markup {
904 \fret-diagram-terse #"3-(;5;5;4;3;3-);"
910 Fingering indications can be included in the fret-diagram-terse markup string.
912 @c Need to use override to enable fingerings to show this -- can we do so?
913 @lilypond[quote, verbatim]
915 \context ChordNames {
921 \override Voice.TextScript
922 #'(fret-diagram-details finger-code) = #'below-string
924 <c e g c' e'>1^\markup {
925 \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;"
927 <d a d' f'>1^\markup {
928 \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;"
934 Other fret diagram properties must be adjusted using
935 @code{\override} when using the fret-diagram-terse markup.
937 @cindex fret-diagram-verbose markup
940 @funindex fret-diagram-verbose
941 @funindex \fret-diagram-verbose
943 The fret-diagram-verbose markup string is in the format of a Scheme list. Each
944 element of the list indicates an item to be placed on the fret diagram.
946 @lilypond[quote, verbatim]
948 \context ChordNames {
955 <c e g c' e'>1^\markup {
956 \fret-diagram-verbose #'(
965 <d a d' f'>1^\markup {
966 \fret-diagram-verbose #'(
979 Fingering indications and barres can be included in a
980 fret-diagram-verbose markup string. Unique to the
981 fret-diagram-verbose interface is a capo indication that
982 can be placed on the fret diagram. The capo indication is
983 a thick bar that covers all strings. The fret with the
984 capo will be the lowest fret in the fret diagram.
986 @c \override is necessary to make fingering visible
987 @lilypond[quote, verbatim]
989 \context ChordNames {
996 \override Voice.TextScript
997 #'(fret-diagram-details finger-code) = #'below-string
998 <f, c f a c' f'>1^\markup {
999 \fret-diagram-verbose #'(
1009 <g, b, d g b g'>1^\markup {
1010 \fret-diagram-verbose #'(
1019 <c e g c' e'>1^\markup {
1020 \fret-diagram-verbose #'(
1032 All other fret diagram properties must be adjusted using
1033 @code{\override} when using the fret-diagram-verbose markup.
1036 The following example shows the three fret-diagram markup
1037 interfaces, along with examples of common tweaks. For example,
1038 the size of the verbose fret diagram is reduced to 0.75, and the
1039 finger indications are specified to appear below the diagram. The
1040 terse diagram includes tweaks to specify placement of finger code
1043 @lilypond[verbatim,ragged-right,quote]
1047 \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
1051 \override #'(size . 0.75) {
1052 \override #'(finger-code . below-string) {
1053 \fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2)
1064 \override #'(dot-radius . 0.35) {
1065 \override #'(finger-code . in-dot) {
1066 \override #'(dot-color . white) {
1067 \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"
1077 @cindex customized fret diagram
1078 @cindex fret diagram, customized
1079 @cindex diagram, fret, customized
1081 @funindex fret-diagram-interface
1083 The graphical layout of a fret diagram can be customized according to
1084 user preference through the properties of the
1085 @code{fret-diagram-interface}. Details are found at
1086 @rinternals{fret-diagram-interface}. For a fret diagram
1087 markup, the interface properties belong to @code{Voice.TextScript}.
1091 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1092 {changing-fret-orientations.ly}
1094 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1095 {customizing-markup-fret-diagrams.ly}
1099 @ref{Instrument Specific Markup}.
1102 @rlsr{Fretted strings}.
1104 Internals Reference:
1105 @rinternals{fret-diagram-interface}.
1108 @node Predefined fret diagrams
1109 @unnumberedsubsubsec Predefined fret diagrams
1112 @cindex fret diagrams
1113 @cindex fret diagrams, ukulele
1114 @cindex chord diagrams
1116 @funindex FretBoards
1117 @funindex stringTunings
1119 Fret diagrams can be displayed using the @code{FretBoards} context. By
1120 default, the @code{FretBoards} context will display fret diagrams that
1121 are stored in a lookup table:
1123 @lilypond[verbatim, ragged-right, quote]
1124 \include "predefined-guitar-fretboards.ly"
1125 \context FretBoards {
1132 The default predefined fret diagrams are contained in the file
1133 @file{predefined-guitar-fretboards.ly}. Fret diagrams are
1134 stored based on the pitches of a chord and the value of
1135 @code{stringTunings} that is currently in use.
1136 @file{predefined-guitar-fretboards.ly} contains predefined
1137 fret diagrams only for @code{guitar-tuning}. Predefined fret
1138 diagrams can be added for other instruments or other tunings
1139 by following the examples found in
1140 @file{predefined-guitar-fretboards.ly}.
1142 Fret diagrams for the ukulele are contained in the file
1143 @file{predefined-ukulele-fretboards.ly}.
1145 @lilypond[verbatim, ragged-right, quote]
1146 \include "predefined-ukulele-fretboards.ly"
1148 myChords = \chordmode { a1 a:m a:aug }
1155 \set stringTunings = #ukulele-tuning
1160 Chord pitches can be entered
1161 either as simultaneous music or using chord mode (see
1162 @ref{Chord mode overview}).
1164 @lilypond[verbatim, ragged-right,quote]
1165 \include "predefined-guitar-fretboards.ly"
1166 \context FretBoards {
1172 @cindex chord names with fret diagrams
1173 @cindex fret diagrams with chord names
1175 @funindex ChordNames
1177 @funindex \chordmode
1179 It is common that both chord names and fret diagrams are displayed together.
1180 This is achieved by putting a @code{ChordNames} context in parallel with
1181 a @code{FretBoards} context and giving both contexts the same music.
1183 @lilypond[verbatim, ragged-right, quote]
1184 \include "predefined-guitar-fretboards.ly"
1185 mychords = \chordmode{
1190 \context ChordNames {
1193 \context FretBoards {
1199 @cindex transposing fret diagrams
1200 @cindex fret diagrams, transposing
1201 @cindex diagrams, fret, transposing
1203 Predefined fret diagrams are transposable, as long as a diagram for the
1204 transposed chord is stored in the fret diagram table.
1206 @lilypond[verbatim, ragged-right, quote]
1207 \include "predefined-guitar-fretboards.ly"
1208 mychords = \chordmode{
1214 \transpose c e { \mychords }
1217 \context ChordNames {
1220 \context FretBoards {
1227 The predefined fret diagram table for guitar contains eight chords (major, minor,
1228 augmented, diminished, dominant seventh, major seventh, minor seventh, dominant ninth)
1229 for each of 17 keys.
1230 The predefined fret diagram table for ukulele contains these chords
1231 plus an additional three chords (major sixth, suspended second, and
1233 A complete list of the predefined fret diagrams is
1234 shown in @ref{Predefined fretboard diagrams}. If there is no entry in
1235 the table for a chord, the FretBoards engraver will calculate a
1236 fret-diagram using the automatic fret diagram functionality described in
1237 @ref{Automatic fret diagrams}.
1239 @lilypond[verbatim, ragged-right, quote]
1240 \include "predefined-guitar-fretboards.ly"
1241 mychords = \chordmode{
1246 \context ChordNames {
1249 \context FretBoards {
1255 @cindex fret diagrams, adding custom
1256 @cindex custom fret diagrams, adding
1257 @cindex adding custom fret diagrams
1259 Fret diagrams can be added to the fret diagram table. To add a diagram,
1260 you must specify the hash table for the diagram, the chord for the
1261 diagram, the tuning to be used, and
1262 a definition for the diagram. Normally, the hash table will be
1263 @var{default-fret-table}. The diagram definition can be either a
1264 fret-diagram-terse definition string or a fret-diagram-verbose
1267 @lilypond[verbatim, ragged-right, quote]
1268 \include "predefined-guitar-fretboards.ly"
1270 \storePredefinedDiagram #default-fret-table
1271 \chordmode { c:maj9 }
1275 mychords = \chordmode {
1280 \context ChordNames {
1283 \context FretBoards {
1289 Different fret diagrams for the same chord name can be stored using different
1290 octaves of pitches. The different octave should be at least two octaves
1291 above or below the default octave, because the octaves above and below the
1292 default octave are used for transposing fretboards.
1294 @lilypond[verbatim, ragged-right, quote]
1295 \include "predefined-guitar-fretboards.ly"
1297 \storePredefinedDiagram #default-fret-table
1300 #(offset-fret 2 (chord-shape 'bes guitar-tuning))
1302 mychords = \chordmode {
1307 \context ChordNames {
1310 \context FretBoards {
1316 @cindex fretted instruments, chord shapes
1317 @cindex chord shapes for fretted instruments
1319 @funindex \addChordShape
1320 @funindex addChordShape
1321 @funindex storePredefinedDiagram
1322 @funindex \storePredefinedDiagram
1324 In addition to fret diagrams, LilyPond stores an internal list of chord
1325 shapes. The chord shapes are fret diagrams that can be shifted along
1326 the neck to different positions to provide different chords. Chord
1327 shapes can be added to the internal list and then used to define
1328 predefined fret diagrams. Because they can be moved to various
1329 positions on the neck, chord shapes will normally not contain
1330 any open strings. Like fret diagrams, chord shapes can be
1331 entered as either fret-diagram-terse strings or fret-diagram-verbose
1334 @lilypond[verbatim, ragged-right, quote]
1335 \include "predefined-guitar-fretboards.ly"
1337 % Add a new chord shape
1339 \addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
1341 % add some new chords based on the power chord shape
1343 \storePredefinedDiagram #default-fret-table
1346 #(chord-shape 'powerf guitar-tuning)
1347 \storePredefinedDiagram #default-fret-table
1350 #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
1352 mychords = \chordmode{
1357 \context ChordNames {
1360 \context FretBoards {
1366 The graphical layout of a fret diagram can be customized according to
1367 user preference through the properties of the
1368 @code{fret-diagram-interface}. Details are found at
1369 @rinternals{fret-diagram-interface}. For a predefined fret diagram,
1370 the interface properties belong to @code{FretBoards.FretBoard}.
1374 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1375 {customizing-fretboard-fret-diagrams.ly}
1377 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1378 {defining-predefined-fretboards-for-other-instruments.ly}
1380 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1381 {chordchanges-for-fretboards.ly}
1383 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1384 {fretboards-alternate-tables.ly}
1389 @ref{Custom tablatures},
1390 @ref{Automatic fret diagrams},
1391 @ref{Chord mode overview},
1392 @ref{Predefined fretboard diagrams}.
1395 @file{ly/predefined-guitar-fretboards.ly},
1396 @file{ly/predefined-guitar-ninth-fretboards.ly},
1397 @file{ly/predefined-ukulele-fretboards.ly}.
1400 @rlsr{Fretted strings}.
1402 Internals Reference:
1403 @rinternals {fret-diagram-interface}.
1406 @node Automatic fret diagrams
1407 @unnumberedsubsubsec Automatic fret diagrams
1409 @cindex fret diagrams, automatic
1410 @cindex chord diagrams, automatic
1411 @cindex automatic fret diagrams
1412 @cindex automatic chord diagrams
1414 Fret diagrams can be automatically created from entered notes using the
1415 @code{FretBoards} context. If no predefined diagram is available for
1416 the entered notes in the active @code{stringTunings}, this context
1417 calculates strings and frets that can be used to play the notes.
1419 @lilypond[quote,ragged-right,verbatim]
1421 \context ChordNames {
1426 \context FretBoards {
1438 @funindex predefinedFretboardsOff
1439 @funindex \predefinedFretboardsOff
1440 @funindex predefinedFretboardsOn
1441 @funindex \predefinedFretboardsOn
1443 As no predefined diagrams are loaded by default, automatic calculation
1444 of fret diagrams is the default behavior. Once default diagrams are
1445 loaded, automatic calculation can be enabled and disabled with predefined
1448 @lilypond[quote,ragged-right,verbatim]
1450 \storePredefinedDiagram #default-fret-table
1453 #"x;3-1-(;5-2;5-3;5-4;3-1-1-);"
1455 \context ChordNames {
1460 \context FretBoards {
1462 \predefinedFretboardsOff
1464 \predefinedFretboardsOn
1478 Sometimes the fretboard calculator will be unable to find
1479 an acceptable diagram. This can often be remedied by
1480 manually assigning a note to a string. In many cases, only one
1481 note need be manually placed on a string; the rest of
1482 the notes will then be placed appropriately by the
1483 @code{FretBoards} context.
1485 @cindex fret diagrams, adding fingerings
1486 @cindex fingerings, adding to fret diagrams
1488 Fingerings can be added to FretBoard fret diagrams.
1490 @lilypond[quote, verbatim]
1492 \context ChordNames {
1497 \context FretBoards {
1498 <c-3 e-2 g c'-1 e'>1
1509 @funindex minimumFret
1511 The minimum fret to be used in calculating strings and frets for
1512 the FretBoard context can be set with the @code{minimumFret}
1515 @lilypond[quote, verbatim]
1517 \context ChordNames {
1522 \context FretBoards {
1524 \set FretBoards.minimumFret = #5
1535 The strings and frets for the @code{FretBoards} context depend
1536 on the @code{stringTunings} property, which has the same meaning
1537 as in the TabStaff context. See @ref{Custom tablatures} for
1538 information on the @code{stringTunings} property.
1540 The graphical layout of a fret diagram can be customized according to
1541 user preference through the properties of the
1542 @code{fret-diagram-interface}. Details are found at
1543 @rinternals{fret-diagram-interface}. For a @code{FretBoards} fret
1544 diagram, the interface properties belong to
1545 @code{FretBoards.FretBoard}.
1549 @code{\predefinedFretboardsOff},
1550 @code{\predefinedFretboardsOn}.
1556 @ref{Custom tablatures}.
1559 @rlsr{Fretted strings}.
1561 Internals Reference:
1562 @rinternals {fret-diagram-interface}.
1565 Automatic fretboard calculations do not work properly for instruments
1566 with non-monotonic tunings.
1569 @node Right-hand fingerings
1570 @unnumberedsubsubsec Right-hand fingerings
1572 @cindex fretted instruments, right hand fingerings
1573 @cindex fingerings, right hand for fretted instruments
1574 @cindex right hand fingerings for fretted instruments
1576 @funindex rightHandFinger
1577 @funindex \rightHandFinger
1579 Right-hand fingerings @var{p-i-m-a} must be entered within a
1580 chord construct @code{<>} for them to be printed in the score,
1581 even when applied to a single note.
1583 @warning{There @strong{must} be a hyphen before
1584 @code{@bs{}rightHandFinger} and a space before the closing @code{>}.}
1586 @lilypond[quote,verbatim,relative=0]
1588 <c-\rightHandFinger #1 >4
1589 <e-\rightHandFinger #2 >
1590 <g-\rightHandFinger #3 >
1591 <c-\rightHandFinger #4 >
1592 <c,-\rightHandFinger #1 e-\rightHandFinger #2
1593 g-\rightHandFinger #3 c-\rightHandFinger #4 >1
1596 For convenience, you can abbreviate @code{\rightHandFinger} to something
1597 short, for example @code{RH},
1600 #(define RH rightHandFinger)
1606 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1607 {placement-of-right-hand-fingerings.ly}
1609 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1610 {fingerings,-string-indications,-and-right-hand-fingerings.ly}
1615 @rlsr{Fretted strings}.
1617 Internals Reference:
1618 @rinternals{StrokeFinger}.
1624 Most of the notational issues associated with guitar music are
1625 covered sufficiently in the general fretted strings section, but there
1626 are a few more worth covering here. Occasionally users want to
1627 create songbook-type documents having only lyrics with chord
1628 indications above them. Since LilyPond is a music typesetter,
1629 it is not recommended for documents that have no music notation
1630 in them. A better alternative is a word processor, text editor,
1631 or, for experienced users, a typesetter like GuitarTeX.
1634 * Indicating position and barring::
1635 * Indicating harmonics and dampened notes::
1636 * Indicating power chords::
1639 @node Indicating position and barring
1640 @unnumberedsubsubsec Indicating position and barring
1642 @cindex indicating position and barring for fretted instruments
1643 @cindex fretted instruments, indicating position and barring
1645 This example demonstrates how to include guitar position and
1646 barring indications.
1648 @lilypond[quote,ragged-right,verbatim,relative=0]
1652 \override TextSpanner #'(bound-details left text) = #"XII "
1654 b16 e g e b g\stopTextSpan
1661 @ref{Text spanners}.
1664 @rlsr{Fretted strings},
1665 @rlsr{Expressive marks}.
1668 @node Indicating harmonics and dampened notes
1669 @unnumberedsubsubsec Indicating harmonics and dampened notes
1671 @cindex fretted instruments, dampened notes
1672 @cindex fretted instruments, harmonics
1673 @cindex dampened notes on fretted instruments
1674 @cindex harmonics on fretted instruments
1676 Special note heads can be used to indicate dampened notes or
1677 harmonics. Harmonics are normally further explained with a
1680 @lilypond[quote,ragged-right,verbatim]
1683 \override Staff.NoteHead #'style = #'harmonic-mixed
1684 d^\markup { \italic { \fontsize #-2 { "harm. 12" }}} <g b>1
1688 Dampened notes (also called @notation{dead notes}) are supported
1689 within normal and tablature staves:
1691 @lilypond[quote,ragged-right,verbatim]
1692 music = \relative c' {
1693 < a\3 \deadNote c\2 a'\1 >4
1694 < b\3 \deadNote d\2 b'\1 >
1695 < c\3 \deadNote e\2 c'\1 >
1697 \times 2/3 { g8 b e }
1712 Another playing technique (especially used on electric guitars) is
1713 called @notation{palm mute}. The string is hereby partly muted by the
1714 palm of the striking hand (hence the name). Lilypond supports
1715 the notation of palm mute-style notes by changing the note head to a
1718 @lilypond[quote,ragged-right,verbatim]
1719 \new Voice { % Warning: explicit Voice instantiation is
1720 % required to have palmMuteOff work properly
1721 % when palmMuteOn comes at the beginning of
1726 e8^\markup { \musicglyph #"noteheads.u2do" = palm mute }
1729 e e \palmMute e e e |
1730 e8 \palmMute { e e e } e e e e |
1731 < \palmMute e b' e >8 \palmMute { e e e } < \palmMute e b' e >2
1738 @rlsr{Fretted strings}.
1741 @ref{Special note heads},
1742 @ref{Note head styles}.
1745 @node Indicating power chords
1746 @unnumberedsubsubsec Indicating power chords
1748 @funindex powerChords
1749 @funindex \powerChords
1751 @cindex power chords
1752 @cindex chords, power
1754 Power chords and their symbols can be engraved in chord mode or as chord
1757 @lilypond[quote,ragged-right,verbatim]
1758 ChordsAndSymbols = {
1763 \set minimumFret = #8
1767 \set minimumFret = #5
1787 Power chord symbols are automatically switched off as soon as one of the
1788 other common chord modifier is used:
1790 @lilypond[quote,ragged-right,verbatim]
1791 mixedChords = \chordmode {
1816 @rglos{power chord}.
1819 @ref{Extended and altered chords},
1820 @ref{Printing chord names}.
1823 @rlsr{Fretted strings}.
1830 * Banjo tablatures::
1833 @node Banjo tablatures
1834 @unnumberedsubsubsec Banjo tablatures
1836 @cindex banjo tablatures
1837 @cindex tablature, banjo
1839 LilyPond has basic support for the five-string banjo. When making tablatures
1840 for five-string banjo, use the banjo tablature format function to get
1841 correct fret numbers for the fifth string:
1843 @c due to crazy intervals of banjo music, absolute pitch is recommended
1845 @lilypond[quote,ragged-right,verbatim]
1847 \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo
1848 \set TabStaff.stringTunings = #banjo-open-g-tuning
1851 g8 d' g'\5 a b g e d' |
1852 g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
1858 @cindex banjo tunings
1859 @cindex tunings, banjo
1861 @funindex banjo-c-tuning
1862 @funindex banjo-modal-tuning
1863 @funindex banjo-open-d-tuning
1864 @funindex banjo-open-dm-tuning
1865 @funindex four-string-banjo
1867 A number of common tunings for banjo are predefined in LilyPond:
1868 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
1869 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}
1872 These tunings may be converted to four-string banjo tunings using the
1873 @code{four-string-banjo} function:
1876 \set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
1882 @rlsr{Fretted strings}.
1885 @file{scm/output-lib.scm} contains predefined banjo tunings.