]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/fretted-strings.itely
Imported Upstream version 2.16.1
[lilypond.git] / Documentation / notation / fretted-strings.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
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..
8 @end ignore
9
10 @c \version "2.16.0"
11
12 @node Fretted string instruments
13 @section Fretted string instruments
14
15 @lilypondfile[quote]{fretted-headword.ly}
16
17 This section discusses several aspects of music notation that are unique
18 to fretted string instruments.
19
20 @cindex tablature
21 @cindex tablature, guitar
22 @cindex tablature, banjo
23 @cindex guitar tablature
24 @cindex banjo tablature
25
26 @menu
27 * Common notation for fretted strings::
28 * Guitar::
29 * Banjo::
30 @end menu
31
32 @node Common notation for fretted strings
33 @subsection Common notation for fretted strings
34
35 This section discusses common notation that is unique
36 to fretted string instruments.
37
38 @menu
39 * References for fretted strings::
40 * String number indications::
41 * Default tablatures::
42 * Custom tablatures::
43 * Fret diagram markups::
44 * Predefined fret diagrams::
45 * Automatic fret diagrams::
46 * Right-hand fingerings::
47 @end menu
48
49 @node References for fretted strings
50 @unnumberedsubsubsec References for fretted strings
51
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:
62
63 @itemize
64 @item Fingerings are indicated as shown in
65 @ref{Fingering instructions}.
66
67 @item Instructions for @notation{Laissez vibrer} ties
68 as well as ties on arpeggios and tremolos can be found in
69 @ref{Ties}.
70
71 @item Instructions for handling multiple voices can be found
72 in @ref{Collision resolution}.
73
74 @item Instructions for indicating harmonics can be found in
75 @ref{Harmonics}.
76
77 @end itemize
78
79 @seealso
80 Notation Reference:
81 @ref{Fingering instructions},
82 @ref{Ties},
83 @ref{Collision resolution},
84 @ref{Instrument names},
85 @ref{Writing music in parallel},
86 @ref{Arpeggio},
87 @ref{List of articulations},
88 @ref{Clef},
89 @ref{Instrument transpositions}.
90
91
92 @node String number indications
93 @unnumberedsubsubsec String number indications
94
95 @cindex string numbers
96 @cindex string vs. fingering numbers
97 @cindex fingering vs. string numbers
98
99 The string on which a note should be played may be indicated by
100 appending @code{\@var{number}} to a note.
101
102 @lilypond[verbatim,quote,relative=0]
103 \clef "treble_8"
104 c4\5 e\4 g2\3
105 <c,\5 e\4 g\3>1
106 @end lilypond
107
108 When fingerings and string indications are used together, their
109 placement can be controlled by the order in which the two items appear
110 in the code @emph{only} if they appear inside of an explicit chord:
111 applied to whole chords or single notes @emph{outside} of chords,
112 fingerings are placed using a different mechanism.
113
114 @lilypond[verbatim,quote,relative=1]
115 \clef "treble_8"
116 g4\3-0
117 g-0\3
118 <g\3-0>
119 <g-0\3>
120 @end lilypond
121
122 @snippets
123
124 @lilypondfile[verbatim,quote,texidoc,doctitle]
125 {controlling-the-placement-of-chord-fingerings.ly}
126
127 @lilypondfile[verbatim,quote,texidoc,doctitle]
128 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
129
130 @seealso
131 Notation Reference:
132 @ref{Fingering instructions}.
133
134 Snippets:
135 @rlsr{Fretted strings}.
136
137 Internals Reference:
138 @rinternals{StringNumber},
139 @rinternals{Fingering}.
140
141
142 @node Default tablatures
143 @unnumberedsubsubsec Default tablatures
144
145 @cindex tablatures, basic
146 @cindex tablatures, default
147
148 @funindex TabStaff
149 @funindex TabVoice
150
151 Music for plucked string instruments is frequently notated using a
152 finger/touch notation or tablature.  In contrast to traditional
153 notation pitches are not denoted with note heads, but by numbers (or
154 letter-like symbols in historical intavolatura).  The staff lines
155 in tablature indicate the string on which the note is to be played,
156 and a number placed on a staff line indicated the fret at which
157 the corresponding string is to be pressed.
158 Notes that are to be played simultaneously are vertically aligned.
159
160 By default, string 1 is the highest string, and corresponds to the top
161 line on the @code{TabStaff}.  The tuning of the @code{TabStaff}
162 strings defaults to the
163 standard guitar tuning (with 6 strings).  The notes are printed as
164 tablature, by using @code{TabStaff} and @code{TabVoice} contexts.  A
165 calligraphic tablature clef is added automatically.
166
167 @lilypond[quote,ragged-right,verbatim]
168 \new TabStaff \relative c' {
169   a,8 a' <c e> a
170   d,8 a' <d f> a
171 }
172 @end lilypond
173
174 Default tablatures do not contain any symbols for tone duration nor any
175 other musical symbols such as e.g. expressive marks.
176
177 @lilypond[quote,ragged-right,verbatim]
178 symbols = {
179   \time 3/4
180   c4-.^"Allegro" d( e)
181   f4-.\f g a^\fermata
182   \mark \default
183   c8_.\<\( c16 c~ c2\!
184   c'2.\prall\)
185 }
186
187 \score {
188   <<
189     \new Staff { \clef "G_8" \symbols }
190     \new TabStaff { \symbols }
191   >>
192 }
193 @end lilypond
194
195 @funindex \tabFullNotation
196
197 If all musical symbols used in traditional notation should also show up
198 in tablature one has to apply the command @code{\tabFullNotation} in a
199 @code{TabStaff}-context.  Please bear in mind that half notes are
200 double-stemmed in tablature in order to distinguish them from quarter
201 notes.
202
203 @lilypond[quote,ragged-right,verbatim]
204 symbols = {
205   \time 3/4
206   c4-.^"Allegro" d( e)
207   f4-.\f g a^\fermata
208   \mark \default
209   c8_.\<\( c16 c~ c2\!
210   c'2.\prall\)
211 }
212
213 \score {
214   \new TabStaff {
215     \tabFullNotation
216     \symbols
217   }
218 }
219 @end lilypond
220
221 @cindex fret
222
223 @funindex minimumFret
224 @funindex restrainOpenStrings
225
226 By default pitches are assigned to the lowest playing position on the
227 fret-board (first position).  Open strings are automatically preferred.
228 If you would like a certain pitch to be played on a specific string you
229 can add a string number indication to the pitch name.  If you don't want
230 to have string number indications appear in traditional notation, you
231 can override the respective stencil.  Usually it will be more
232 comfortable to define the playing position by using the value of
233 @code{minimumFret}.  The default value for minimumFret is 0.
234
235 Even when @code{minimumFret} is set, open strings are used whenever
236 possible.  This behaviour can be changed by setting @code{restrainOpenStrings}
237 to @code{#t}.
238
239 @lilypond[quote,ragged-right,verbatim]
240 \layout { \override Voice.StringNumber #'stencil = ##f }
241 \new StaffGroup <<
242    \new Staff \relative c {
243      \clef "treble_8"
244      \time 2/4
245      c16 d e f g4
246      c,16\5 d\5 e\4 f\4 g4\4
247      c,16 d e f g4
248    }
249    \new TabStaff \relative c {
250      c16 d e f g4
251      c,16\5 d\5 e\4 f\4 g4\4
252      \set TabStaff.minimumFret = #5
253      \set TabStaff.restrainOpenStrings = ##t
254      c,16 d e f g4
255    }
256 >>
257 @end lilypond
258
259 @funindex \tabChordRepeats
260 @funindex \chordRepeats
261 @cindex Chord, repetition
262 @cindex repetition, using @code{q}
263
264 Chord constructs can be repeated by the chord repetition symbol
265 @code{q}.  In combination with tabulatures, its behavior of removing
266 string and finger numbers alongside with other events is cumbersome, so
267 you'll want to run
268 @example
269 \chordRepeats #'(string-number-event fingering-event)
270 @end example
271 explicitly on music expressions in tabulature using @ref{Chord
272 repetition}.  This particular command is so common that it is available
273 as @code{\tabChordRepeats}.
274
275 @lilypond[quote,verbatim]
276 guitar = \relative c' {
277   r8 <gis-2 cis-3 b-0>~ q4 q8~ q q4
278 }
279
280 \new StaffGroup <<
281   \new Staff {
282     \clef "treble_8"
283     \guitar
284   }
285   \new TabStaff {
286     \tabChordRepeats \guitar
287   }
288 >>
289 @end lilypond
290
291 Ties over a line break are parenthesized by default.  The same holds for
292 the second alternative of a repeat.
293
294 @lilypond[quote,ragged-right,verbatim]
295 ties = \relative c' {
296   \repeat volta 2 {
297     e2. f4~
298     f2 g2~
299   }
300   \alternative {
301      { g4 f2. }
302      { g4\repeatTie c,2. }
303   }
304   b1~
305   \break
306   b1
307   \bar "|."
308 }
309
310 \score {
311   <<
312     \new StaffGroup  <<
313       \context Staff {
314         \clef "treble_8"
315         \ties
316       }
317       \context TabStaff {
318         \ties
319       }
320     >>
321   >>
322   \layout {
323   indent = #0
324   ragged-right = ##t
325   }
326 }
327 @end lilypond
328
329 @funindex \hideSplitTiedTabNotes
330
331 The command @code{\hideSplitTiedTabNotes} cancels the behavior of
332 engraving fret numbers in parentheses:
333
334 @lilypond[quote,ragged-right,verbatim]
335 ties = \relative c' {
336   \repeat volta 2 {
337     e2. f4~
338     f2 g2~ }
339   \alternative {
340     { g4 f2. }
341     { g4\repeatTie c,2. }
342   }
343   b1~
344   \break
345   b1
346   \bar "|."
347 }
348
349 \score {
350   <<
351     \new StaffGroup  <<
352       \context Staff {
353         \clef "treble_8"
354         \ties
355       }
356       \context TabStaff {
357       \hideSplitTiedTabNotes
358         \ties
359       }
360     >>
361   >>
362   \layout {
363   indent = #0
364   ragged-right = ##t
365   }
366 }
367 @end lilypond
368
369 @cindex harmonic indications in tablature notation
370 @cindex tablature and harmonic indications
371 @cindex slides in tablature notation
372 @cindex tablature and slides
373 @cindex chord glissandi
374 @funindex \harmonic
375 @funindex \harmonicByFret
376 @funindex \harmonicByRatio
377
378 Harmonic indications can be added to tablature notation as sounding
379 pitches:
380
381 @lilypond[verbatim,quote]
382 \layout { \override Voice.StringNumber #'stencil = ##f }
383 firstHarmonic = {
384   d'4\4\harmonic
385   g'4\3\harmonic
386   b'2\2\harmonic
387 }
388 \score {
389   <<
390     \new Staff {
391       \clef "treble_8"
392       \firstHarmonic
393     }
394     \new TabStaff { \firstHarmonic }
395   >>
396 }
397 @end lilypond
398
399 Note that the command @code{\harmonic} must always be attached to single
400 notes (possibly inside of a chord) instead of whole chords.
401 It only makes sense for open-string harmonics
402 in the 12th fret. All other harmonics should be calculated by LilyPond.
403 This can be achieved by indicating the fret where a finger of the
404 fretting hand should touch a string.
405
406 @lilypond[verbatim,quote]
407 fretHarmonics = {
408   \harmonicByFret #5 d16\4
409   \harmonicByFret #4 d16\4
410   \harmonicByFret #3 d8\4
411   \harmonicByFret #5 <g\3 b\2>2.
412 }
413 \score {
414   <<
415     \new Staff {
416       \clef "treble_8"
417       \fretHarmonics
418     }
419     \new TabStaff { \fretHarmonics }
420   >>
421 }
422 @end lilypond
423
424 Alternatively, harmonics can be computed by defining the ratio of
425 string lengths above and below the harmonic fingering.
426
427 @lilypond[verbatim,quote]
428 ratioHarmonics = {
429   \harmonicByRatio #1/2 <g\3 b\2 e'\1>4
430   \harmonicByRatio #1/3 <g\3 b\2 e'\1>4
431   \harmonicByRatio #1/4 { g8\3 b8\2 e'4\1 }
432 }
433 \score {
434   <<
435     \new Staff {
436       \clef "treble_8"
437       \ratioHarmonics
438     }
439     \new TabStaff { \ratioHarmonics }
440   >>
441 }
442 @end lilypond
443
444 @snippets
445 @lilypondfile[verbatim,quote,texidoc,doctitle]
446 {stem-and-beam-behavior-in-tablature.ly}
447
448 @lilypondfile[verbatim,quote,texidoc,doctitle]
449 {polyphony-in-tablature.ly}
450
451 @lilypondfile[verbatim,quote,texidoc,doctitle]
452 {open-string-harmonics-in-tablature.ly}
453
454 @lilypondfile[verbatim,quote,texidoc,doctitle]
455 {fretted-string-harmonics-in-tablature.ly}
456
457 @lilypondfile[verbatim,quote,texidoc,doctitle]
458 {slides-in-tablature.ly}
459
460 @lilypondfile[verbatim,quote,texidoc,doctitle]
461 {chord-glissando-in-tablature.ly}
462
463 @seealso
464 Notation Reference:
465 @ref{Chord repetition},
466 @ref{Glissando},
467 @ref{Harmonics},
468 @ref{Stems},
469 @ref{Written-out repeats}.
470
471 Snippets:
472 @rlsr{Fretted strings}.
473
474 Internals Reference:
475 @rinternals{TabNoteHead},
476 @rinternals{TabStaff},
477 @rinternals{TabVoice},
478 @rinternals{Beam}.
479
480 @knownissues
481 Chords are not handled in a special way, and hence the automatic
482 string selector may easily select the same string for two notes in
483 a chord.
484
485 In order to handle @code{\partcombine}, a @code{TabStaff} must use
486 specially-created voices:
487
488 @lilypond[quote,ragged-right,verbatim]
489 melodia = \partcombine { e4 g g g } { e4 e e e }
490 <<
491   \new TabStaff <<
492     \new TabVoice = "one" s1
493     \new TabVoice = "two" s1
494     \new TabVoice = "shared" s1
495     \new TabVoice = "solo" s1
496     { \melodia }
497   >>
498 >>
499 @end lilypond
500
501 Guitar special effects are limited to harmonics and slides.
502
503
504 @node Custom tablatures
505 @unnumberedsubsubsec Custom tablatures
506
507 @cindex tablatures, custom
508 @cindex tablature, banjo
509 @cindex tablature, mandolin
510 @cindex tablature, guitar
511 @cindex tablature, bass guitar
512 @cindex tablature, ukulele
513 @cindex tablature, predefined string tunings
514 @cindex fretted instruments, predefined string tunings
515 @cindex predefined string tunings for fretted instruments
516 @cindex tablature, violin
517 @cindex tablature, viola
518 @cindex tablature, cello
519 @cindex tablature, bass
520 @cindex tablature, double bass
521
522 @funindex stringTunings
523
524 LilyPond tablature automatically calculates the fret for
525 a note based on the string to which the note is assigned.
526 In order to do this, the tuning of the strings must be
527 specified.  The tuning of the strings is given in the
528 @code{stringTunings} property.
529
530 LilyPond comes with predefined string tunings for banjo, mandolin,
531 guitar, bass guitar, ukulele, violin, viola, cello, and double bass.
532 LilyPond automatically sets
533 the correct transposition for predefined tunings.  The following
534 example is for bass guitar, which sounds an octave lower than
535 written.
536
537 @lilypond[quote,ragged-right,verbatim]
538 <<
539   \new Voice \with {
540     \override StringNumber #'stencil = ##f
541   } {
542     \clef "bass_8"
543     \relative c, {
544       c4 d e f
545     }
546   }
547   \new TabStaff \with {
548     stringTunings = #bass-tuning
549   } {
550     \relative c, {
551       c4 d e f
552     }
553   }
554 >>
555 @end lilypond
556
557 The default string tuning is @code{guitar-tuning}, which
558 is the standard EADGBE tuning.  Some other predefined tunings are
559 @code{guitar-open-g-tuning}, @code{mandolin-tuning} and
560 @code{banjo-open-g-tuning}.  The predefined string tunings
561 are found in @file{ly/string-tunings-init.ly}.
562
563 @funindex stringTuning
564 @funindex \stringTuning
565 @cindex tablature, custom string tunings
566 @cindex custom string tunings
567
568 Any desired string tuning can be created.  The
569 @code{\stringTuning} function can be
570 used to define a string tuning which can be used
571 to set @code{stringTunings} for the current context.
572
573 Its argument is a chord construct
574 defining the pitches of each string in the tuning.
575 The chord construct must be in absolute octave mode,
576 see @ref{Absolute octave entry}.  The string
577 with the highest number (generally the lowest string) must
578 come first in the chord.  For example, we can
579 define a string tuning for a four-string instrument with pitches
580 of @code{a''},  @code{d''},  @code{g'}, and @code{c'}:
581
582 @lilypond[quote,verbatim]
583
584 mynotes = {
585   c'4 e' g' c'' |
586   e''4 g'' b'' c'''
587 }
588
589 <<
590   \new Staff {
591     \clef treble
592     \mynotes
593   }
594   \new TabStaff {
595     \set Staff.stringTunings = \stringTuning <c' g' d'' a''>
596     \mynotes
597   }
598 >>
599 @end lilypond
600
601 The @code{stringTunings} property is also used by
602 @code{FretBoards} to calculate automatic fret diagrams.
603
604 String tunings are used as part of the hash key
605 for predefined fret diagrams
606 (see @ref{Predefined fret diagrams}).
607
608 The previous example could also be written as follows:
609
610 @lilypond[quote,verbatim]
611 custom-tuning = \stringTuning <c' g' d'' a''>
612
613 mynotes = {
614   c'4 e' g' c'' |
615   e''4 g'' b'' c'''
616 }
617
618 <<
619   \new Staff {
620     \clef treble
621     \mynotes
622   }
623   \new TabStaff {
624     \set TabStaff.stringTunings = #custom-tuning
625     \mynotes
626   }
627 >>
628 @end lilypond
629
630 Internally, a string tuning is a Scheme list of string pitches,
631 one for each string, ordered by string number from 1 to N,
632 where string 1 is at the top of the tablature staff and
633 string N is at the bottom.  This ordinarily results in ordering
634 from highest pitch to lowest pitch, but some instruments
635 (e.g. ukulele) do not have strings ordered by pitch.
636
637 A string pitch in a string tuning list is a LilyPond pitch
638 object.  Pitch objects are created with the Scheme function
639 @code{ly:make-pitch} (see @ref{Scheme functions}).
640
641 @code{\stringTuning} creates such an object from chord input.
642
643 LilyPond automatically calculates the number of lines in the
644 @code{TabStaff} and the number of strings in an automatically
645 calculated @code{FretBoard} as the number of elements
646 in @code{stringTunings}.
647
648 To let all TabStaff contexts use the same custom tuning by default,
649 you can use
650
651 @example
652 \layout @{
653   \context @{
654     \TabStaff
655     stringTunings = \stringTuning \notemode @{ <c' g' d'' a''> @}
656   @}
657 @}
658 @end example
659
660
661 @cindex moderntab clef
662 @cindex clef, moderntab
663 @cindex clef, tab
664 @cindex tab clef
665
666 A modern tab clef can also be used.
667
668 @lilypond[quote,ragged-right,verbatim]
669 \new TabStaff {
670   \clef moderntab
671   <a, e a>1
672   \break
673   \clef tab
674   <a, e a>1
675 }
676 @end lilypond
677
678 The modern tab clef supports tablatures from 4 to 7 strings.
679
680 @seealso
681 Notation Reference:
682 @ref{Absolute octave entry},
683 @ref{Predefined fret diagrams},
684 @ref{Scheme functions}.
685
686 Installed Files:
687 @file{ly/string-tunings-init.ly},
688 @file{scm/tablature.scm}.
689
690 Snippets:
691 @rlsr{Fretted strings}.
692
693 Internals Reference:
694 @rinternals{Tab_note_heads_engraver}.
695
696 @knownissues
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.
700
701
702 @node Fret diagram markups
703 @unnumberedsubsubsec Fret diagram markups
704
705 @cindex fret diagrams
706 @cindex chord diagrams
707 @cindex diagrams, fret
708 @cindex diagrams, chord for fretted instruments
709 @cindex fret diagrams, custom
710 @cindex custom fret diagrams
711
712 Fret diagrams can be added to music as a markup to the desired
713 note.  The markup contains information about the desired fret
714 diagram.  There are three different fret-diagram markup
715 interfaces: standard, terse, and verbose.  The three interfaces
716 produce equivalent markups, but have varying amounts of
717 information in the markup string.  Details about the
718 syntax of the different markup strings used to define
719 fret diagrams are found at @ref{Instrument Specific Markup}.
720
721 The standard fret diagram markup string indicates the string
722 number and the fret number for each dot to be placed on the string.
723 In addition, open and unplayed (muted) strings can be indicated.
724
725 @lilypond[quote, verbatim]
726 <<
727   \context ChordNames {
728     \chordmode {
729       c1 d:m
730     }
731   }
732   \context Staff {
733     \clef "treble_8"
734     <c e g c' e'>1^\markup {
735       \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;"
736     }
737     <d a d' f'>1^\markup {
738       \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-1;"
739     }
740   }
741 >>
742 @end lilypond
743
744 @cindex barre indications
745
746 Barre indications can be added to the diagram from
747 the fret-diagram markup string.
748
749 @lilypond[quote, verbatim]
750 <<
751   \context ChordNames {
752      \chordmode {
753        f1 g
754      }
755   }
756   \context Staff {
757     \clef "treble_8"
758     <f, c f a c' f'>1^\markup {
759       \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
760     }
761     <g, d g b d' g'>1^\markup {
762       \fret-diagram #"c:6-1-3;6-3;5-5;4-5;3-4;2-3;1-3;"
763     }
764   }
765 >>
766 @end lilypond
767
768 @cindex fret-diagram markup
769 @cindex ukulele
770
771 @funindex fret-diagram
772 @funindex \fret-diagram
773
774 The size of the fret diagram, and the number of frets in the diagram
775 can be changed in the fret-diagram markup string.
776
777 @lilypond[quote, verbatim]
778 <<
779   \context ChordNames {
780      \chordmode {
781        f1 g
782      }
783   }
784   \context Staff {
785     \clef "treble_8"
786     <f, c f a c' f'>1^\markup {
787       \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
788     }
789     <g, b, d g b g'>1^\markup {
790       \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;"
791     }
792   }
793 >>
794 @end lilypond
795
796 The number of strings in a fret diagram can be changed to accommodate
797 different instruments such as banjos and ukuleles with the fret-diagram
798 markup string.
799
800 @lilypond[quote, verbatim]
801 <<
802   \context ChordNames {
803     \chordmode {
804       a1
805     }
806   }
807   \context Staff {
808     % An 'A' chord for ukulele
809     a'1^\markup {
810       \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;"
811     }
812   }
813 >>
814 @end lilypond
815
816 Fingering indications can be added, and the location of fingering labels
817 can be controlled by the fret-diagram markup string.
818
819 @lilypond[quote, verbatim]
820 <<
821   \context ChordNames {
822     \chordmode {
823       c1 d:m
824     }
825   }
826   \context Staff {
827     \clef "treble_8"
828     <c e g c' e'>1^\markup {
829       \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;"
830     }
831     <d a d' f'>1^\markup {
832       \fret-diagram #"f:2;6-x;5-x;4-o;3-2-2;2-3-3;1-1-1;"
833     }
834   }
835 >>
836 @end lilypond
837
838 Dot radius and dot position can be controlled with the fret-diagram
839 markup string.
840
841 @lilypond[quote, verbatim]
842 <<
843   \context ChordNames {
844     \chordmode {
845       c1 d:m
846     }
847   }
848   \context Staff {
849     \clef "treble_8"
850     <c e g c' e'>1^\markup {
851       \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;"
852     }
853     <d a d' f'>1^\markup {
854       \fret-diagram #"p:0.2;6-x;5-x;4-o;3-2;2-3;1-1;"
855     }
856   }
857 >>
858 @end lilypond
859
860 @cindex fret-diagram-terse markup
861
862 @funindex fret-diagram-terse
863 @funindex \fret-diagram-terse
864
865 The fret-diagram-terse markup string omits string numbers; the string
866 number is implied by the presence of semicolons.  There is one semicolon
867 for each string in the diagram.  The first semicolon corresponds to the
868 highest string number and the last semicolon corresponds to the first string.
869 Mute strings, open strings, and fret numbers can be indicated.
870
871 @lilypond[quote, verbatim]
872 <<
873   \context ChordNames {
874     \chordmode {
875       c1 d:m
876     }
877   }
878   \context Staff {
879     \clef "treble_8"
880     <c e g c' e'>1^\markup {
881       \fret-diagram-terse #"x;3;2;o;1;o;"
882     }
883     <d a d' f'>1^\markup {
884       \fret-diagram-terse #"x;x;o;2;3;1;"
885     }
886   }
887 >>
888 @end lilypond
889
890 Barre indicators can be included in the fret-diagram-terse markup string.
891
892 @lilypond[quote, verbatim]
893 <<
894   \context ChordNames {
895     \chordmode {
896       f1 g
897     }
898   }
899   \context Staff {
900     \clef "treble_8"
901     <f, c f a c' f'>1^\markup {
902       \fret-diagram-terse #"1-(;3;3;2;1;1-);"
903     }
904     <g, d g b d' g'>1^\markup {
905       \fret-diagram-terse #"3-(;5;5;4;3;3-);"
906     }
907   }
908 >>
909 @end lilypond
910
911 Fingering indications can be included in the fret-diagram-terse markup string.
912
913 @c Need to use override to enable fingerings to show this -- can we do so?
914 @lilypond[quote, verbatim]
915 <<
916   \context ChordNames {
917     \chordmode {
918       c1 d:m
919     }
920   }
921   \context Staff {
922     \override Voice.TextScript
923       #'(fret-diagram-details finger-code) = #'below-string
924     \clef "treble_8"
925     <c e g c' e'>1^\markup {
926       \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;"
927     }
928     <d a d' f'>1^\markup {
929       \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;"
930     }
931   }
932 >>
933 @end lilypond
934
935 Other fret diagram properties must be adjusted using
936 @code{\override} when using the fret-diagram-terse markup.
937
938 @cindex fret-diagram-verbose markup
939 @cindex capo
940
941 @funindex fret-diagram-verbose
942 @funindex \fret-diagram-verbose
943
944 The fret-diagram-verbose markup string is in the format of a Scheme list.  Each
945 element of the list indicates an item to be placed on the fret diagram.
946
947 @lilypond[quote, verbatim]
948 <<
949     \context ChordNames {
950       \chordmode {
951         c1 d:m
952       }
953     }
954   \context Staff {
955     \clef "treble_8"
956     <c e g c' e'>1^\markup {
957       \fret-diagram-verbose #'(
958         (mute 6)
959         (place-fret 5 3)
960         (place-fret 4 2)
961         (open 3)
962         (place-fret 2 1)
963         (open 1)
964       )
965     }
966     <d a d' f'>1^\markup {
967       \fret-diagram-verbose #'(
968         (mute 6)
969         (mute 5)
970         (open 4)
971         (place-fret 3 2)
972         (place-fret 2 3)
973         (place-fret 1 1)
974       )
975     }
976   }
977 >>
978 @end lilypond
979
980 Fingering indications and barres can be included in a
981 fret-diagram-verbose markup string.  Unique to the
982 fret-diagram-verbose interface is a capo indication that
983 can be placed on the fret diagram.  The capo indication is
984 a thick bar that covers all strings.  The fret with the
985 capo will be the lowest fret in the fret diagram.
986
987 @c \override is necessary to make fingering visible
988 @lilypond[quote, verbatim]
989 <<
990     \context ChordNames {
991       \chordmode {
992         f1 g c
993       }
994     }
995   \context Staff {
996     \clef "treble_8"
997     \override Voice.TextScript
998       #'(fret-diagram-details finger-code) = #'below-string
999     <f, c f a c' f'>1^\markup {
1000       \fret-diagram-verbose #'(
1001         (place-fret 6 1)
1002         (place-fret 5 3)
1003         (place-fret 4 3)
1004         (place-fret 3 2)
1005         (place-fret 2 1)
1006         (place-fret 1 1)
1007         (barre 6 1 1)
1008       )
1009     }
1010     <g, b, d g b g'>1^\markup {
1011       \fret-diagram-verbose #'(
1012         (place-fret 6 3 2)
1013         (place-fret 5 2 1)
1014         (open 4)
1015         (open 3)
1016         (open 2)
1017         (place-fret 1 3 3)
1018       )
1019     }
1020     <c e g c' e'>1^\markup {
1021       \fret-diagram-verbose #'(
1022         (capo 3)
1023         (mute 6)
1024         (place-fret 4 5 1)
1025         (place-fret 3 5 2)
1026         (place-fret 2 5 3)
1027       )
1028     }
1029   }
1030 >>
1031 @end lilypond
1032
1033 All other fret diagram properties must be adjusted using
1034 @code{\override} when using the fret-diagram-verbose markup.
1035
1036 @ignore
1037 The following example shows the three fret-diagram markup
1038 interfaces, along with examples of common tweaks.  For example,
1039 the size of the verbose fret diagram is reduced to 0.75, and the
1040 finger indications are specified to appear below the diagram.  The
1041 terse diagram includes tweaks to specify placement of finger code
1042 and color of dots.
1043
1044 @lilypond[verbatim,ragged-right,quote]
1045 \new Voice {
1046   \clef "treble_8"
1047   d4^\markup {
1048     \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
1049   }
1050   d4 d d
1051   fis^\markup {
1052     \override #'(size . 0.75) {
1053       \override #'(finger-code . below-string) {
1054         \fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2)
1055                                  (place-fret 5 4 3)
1056                                  (place-fret 4 4 4)
1057                                  (place-fret 3 3 2)
1058                                  (place-fret 2 2 1)
1059                                  (place-fret 1 2 1))
1060       }
1061     }
1062   }
1063   fis4 fis fis
1064   c^\markup {
1065     \override #'(dot-radius . 0.35) {
1066       \override #'(finger-code . in-dot) {
1067         \override #'(dot-color . white) {
1068           \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"
1069         }
1070       }
1071     }
1072   }
1073   c4 c c
1074 }
1075 @end lilypond
1076 @end ignore
1077
1078 @cindex customized fret diagram
1079 @cindex fret diagram, customized
1080 @cindex diagram, fret, customized
1081
1082 @funindex fret-diagram-interface
1083
1084 The graphical layout of a fret diagram can be customized according to
1085 user preference through the properties of the
1086 @code{fret-diagram-interface}. Details are found at
1087 @rinternals{fret-diagram-interface}.  For a fret diagram
1088 markup, the interface properties belong to @code{Voice.TextScript}.
1089
1090 @snippets
1091
1092 @lilypondfile[verbatim,quote,texidoc,doctitle]
1093 {changing-fret-orientations.ly}
1094
1095 @lilypondfile[verbatim,quote,texidoc,doctitle]
1096 {customizing-markup-fret-diagrams.ly}
1097
1098 @seealso
1099 Notation Reference:
1100 @ref{Instrument Specific Markup}.
1101
1102 Snippets:
1103 @rlsr{Fretted strings}.
1104
1105 Internals Reference:
1106 @rinternals{fret-diagram-interface}.
1107
1108
1109 @node Predefined fret diagrams
1110 @unnumberedsubsubsec Predefined fret diagrams
1111
1112 @cindex fret diagrams
1113 @cindex fret diagrams, ukulele
1114 @cindex fret diagrams, mandolin
1115 @cindex chord diagrams
1116
1117 @funindex FretBoards
1118 @funindex stringTunings
1119
1120 Fret diagrams can be displayed using the @code{FretBoards} context.  By
1121 default, the @code{FretBoards} context will display fret diagrams that
1122 are stored in a lookup table:
1123
1124 @lilypond[verbatim, ragged-right, quote]
1125 \include "predefined-guitar-fretboards.ly"
1126 \context FretBoards {
1127   \chordmode {
1128     c1 d
1129   }
1130 }
1131 @end lilypond
1132
1133 The default predefined fret diagrams are contained in the file
1134 @file{predefined-guitar-fretboards.ly}.  Fret diagrams are
1135 stored based on the pitches of a chord and the value of
1136 @code{stringTunings} that is currently in use.
1137 @file{predefined-guitar-fretboards.ly} contains predefined
1138 fret diagrams only for @code{guitar-tuning}.  Predefined fret
1139 diagrams can be added for other instruments or other tunings
1140 by following the examples found in
1141 @file{predefined-guitar-fretboards.ly}.
1142
1143 Fret diagrams for the ukulele are contained in the file @*
1144 @file{predefined-ukulele-fretboards.ly}.
1145
1146 @lilypond[verbatim, ragged-right, quote]
1147 \include "predefined-ukulele-fretboards.ly"
1148
1149 myChords = \chordmode { a1 a:m a:aug }
1150
1151 \new ChordNames {
1152   \myChords
1153 }
1154
1155 \new FretBoards {
1156   \set Staff.stringTunings = #ukulele-tuning
1157   \myChords
1158 }
1159 @end lilypond
1160
1161 Fret diagrams for the mandolin are contained in the file @*
1162 @file{predefined-mandolin-fretboards.ly}.
1163
1164 @lilypond[verbatim, ragged-right, quote]
1165 \include "predefined-mandolin-fretboards.ly"
1166
1167 myChords = \chordmode { c1 c:m7.5- c:aug }
1168
1169 \new ChordNames {
1170   \myChords
1171 }
1172
1173 \new FretBoards {
1174   \set Staff.stringTunings = #mandolin-tuning
1175   \myChords
1176 }
1177 @end lilypond
1178
1179 Chord pitches can be entered
1180 either as simultaneous music or using chord mode (see
1181 @ref{Chord mode overview}).
1182
1183 @lilypond[verbatim, ragged-right,quote]
1184 \include "predefined-guitar-fretboards.ly"
1185 \context FretBoards {
1186   \chordmode { c1 }
1187   <c' e' g'>1
1188 }
1189 @end lilypond
1190
1191 @cindex chord names with fret diagrams
1192 @cindex fret diagrams with chord names
1193
1194 @funindex ChordNames
1195 @funindex chordmode
1196 @funindex \chordmode
1197
1198 It is common that both chord names and fret diagrams are displayed together.
1199 This is achieved by putting a @code{ChordNames} context in parallel with
1200 a @code{FretBoards} context and giving both contexts the same music.
1201
1202 @lilypond[verbatim, ragged-right, quote]
1203 \include "predefined-guitar-fretboards.ly"
1204 mychords = \chordmode{
1205   c1 f g
1206 }
1207
1208 <<
1209   \context ChordNames {
1210     \mychords
1211   }
1212   \context FretBoards {
1213     \mychords
1214   }
1215 >>
1216 @end lilypond
1217
1218 @cindex transposing fret diagrams
1219 @cindex fret diagrams, transposing
1220 @cindex diagrams, fret, transposing
1221
1222 Predefined fret diagrams are transposable, as long as a diagram for the
1223 transposed chord is stored in the fret diagram table.
1224
1225 @lilypond[verbatim, ragged-right, quote]
1226 \include "predefined-guitar-fretboards.ly"
1227 mychords = \chordmode{
1228   c1 f g
1229 }
1230
1231 mychordlist = {
1232   \mychords
1233   \transpose c e { \mychords }
1234 }
1235 <<
1236   \context ChordNames {
1237     \mychordlist
1238   }
1239   \context FretBoards {
1240     \mychordlist
1241   }
1242 >>
1243 @end lilypond
1244
1245
1246 The predefined fret diagram table for guitar contains eight chords (major, minor,
1247 augmented, diminished, dominant seventh, major seventh, minor seventh, dominant ninth)
1248 for each of 17 keys.
1249 The predefined fret diagram table for ukulele contains these chords
1250 plus an additional three chords (major sixth, suspended second, and
1251 suspended fourth).
1252 A complete list of the predefined fret diagrams is
1253 shown in @ref{Predefined fretboard diagrams}.  If there is no entry in
1254 the table for a chord, the FretBoards engraver will calculate a
1255 fret-diagram using the automatic fret diagram functionality described in
1256 @ref{Automatic fret diagrams}.
1257
1258 @lilypond[verbatim, ragged-right, quote]
1259 \include "predefined-guitar-fretboards.ly"
1260 mychords = \chordmode{
1261   c1 c:maj9
1262 }
1263
1264 <<
1265   \context ChordNames {
1266     \mychords
1267   }
1268   \context FretBoards {
1269     \mychords
1270   }
1271 >>
1272 @end lilypond
1273
1274 @cindex fret diagrams, adding custom
1275 @cindex custom fret diagrams, adding
1276 @cindex adding custom fret diagrams
1277
1278 Fret diagrams can be added to the fret diagram table.  To add a diagram,
1279 you must specify the hash table for the diagram, the chord for the
1280 diagram, the tuning to be used, and
1281 a definition for the diagram.  Normally, the hash table will be
1282 @var{default-fret-table}.  The diagram definition can be either a
1283 fret-diagram-terse definition string or a fret-diagram-verbose
1284 marking list.
1285
1286 @lilypond[verbatim, ragged-right, quote]
1287 \include "predefined-guitar-fretboards.ly"
1288
1289 \storePredefinedDiagram #default-fret-table
1290                         \chordmode { c:maj9 }
1291                         #guitar-tuning
1292                         #"x;3-2;o;o;o;o;"
1293
1294 mychords = \chordmode {
1295   c1 c:maj9
1296 }
1297
1298 <<
1299   \context ChordNames {
1300     \mychords
1301   }
1302   \context FretBoards {
1303     \mychords
1304   }
1305 >>
1306 @end lilypond
1307
1308 Different fret diagrams for the same chord name can be stored using different
1309 octaves of pitches.  The different octave should be at least two octaves
1310 above or below the default octave, because the octaves above and  below the
1311 default octave are used for transposing fretboards.
1312
1313 @lilypond[verbatim, ragged-right, quote]
1314 \include "predefined-guitar-fretboards.ly"
1315
1316 \storePredefinedDiagram #default-fret-table
1317                         \chordmode { c'' }
1318                         #guitar-tuning
1319                         #(offset-fret 2 (chord-shape 'bes guitar-tuning))
1320
1321 mychords = \chordmode {
1322   c1 c''
1323 }
1324
1325 <<
1326   \context ChordNames {
1327     \mychords
1328   }
1329   \context FretBoards {
1330     \mychords
1331   }
1332 >>
1333 @end lilypond
1334
1335 @cindex fretted instruments, chord shapes
1336 @cindex chord shapes for fretted instruments
1337
1338 @funindex \addChordShape
1339 @funindex addChordShape
1340 @funindex storePredefinedDiagram
1341 @funindex \storePredefinedDiagram
1342
1343 In addition to fret diagrams, LilyPond stores an internal list of chord
1344 shapes.  The chord shapes are fret diagrams that can be shifted along
1345 the neck to different positions to provide different chords.  Chord
1346 shapes can be added to the internal list and then used to define
1347 predefined fret diagrams.  Because they can be moved to various
1348 positions on the neck, chord shapes will normally not contain
1349 any open strings.  Like fret diagrams, chord shapes can be
1350 entered as either fret-diagram-terse strings or fret-diagram-verbose
1351 marking lists.
1352
1353 @lilypond[verbatim, ragged-right, quote]
1354 \include "predefined-guitar-fretboards.ly"
1355
1356 % Add a new chord shape
1357
1358 \addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
1359
1360 % add some new chords based on the power chord shape
1361
1362 \storePredefinedDiagram #default-fret-table
1363                         \chordmode { f'' }
1364                         #guitar-tuning
1365                         #(chord-shape 'powerf guitar-tuning)
1366 \storePredefinedDiagram #default-fret-table
1367                         \chordmode { g'' }
1368                         #guitar-tuning
1369                         #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
1370
1371 mychords = \chordmode{
1372   f1 f'' g g''
1373 }
1374
1375 <<
1376   \context ChordNames {
1377     \mychords
1378   }
1379   \context FretBoards {
1380     \mychords
1381   }
1382 >>
1383 @end lilypond
1384
1385 The graphical layout of a fret diagram can be customized according to
1386 user preference through the properties of the
1387 @code{fret-diagram-interface}. Details are found at
1388 @rinternals{fret-diagram-interface}.  For a predefined fret diagram,
1389 the interface properties belong to @code{FretBoards.FretBoard}.
1390
1391 @snippets
1392
1393 @lilypondfile[verbatim,quote,texidoc,doctitle]
1394 {customizing-fretboard-fret-diagrams.ly}
1395
1396 @lilypondfile[verbatim,quote,texidoc,doctitle]
1397 {defining-predefined-fretboards-for-other-instruments.ly}
1398
1399 @lilypondfile[verbatim,quote,texidoc,doctitle]
1400 {chordchanges-for-fretboards.ly}
1401
1402 @lilypondfile[verbatim,quote,texidoc,doctitle]
1403 {fretboards-alternate-tables.ly}
1404
1405 @seealso
1406 Notation Reference:
1407 @ref{Custom tablatures},
1408 @ref{Automatic fret diagrams},
1409 @ref{Chord mode overview},
1410 @ref{Predefined fretboard diagrams}.
1411
1412 Installed Files:
1413 @file{ly/predefined-guitar-fretboards.ly}, @*
1414 @file{ly/predefined-guitar-ninth-fretboards.ly}, @*
1415 @file{ly/predefined-ukulele-fretboards.ly}, @*
1416 @file{ly/predefined-mandolin-fretboards.ly}.
1417
1418 Snippets:
1419 @rlsr{Fretted strings}.
1420
1421 Internals Reference:
1422 @rinternals {fret-diagram-interface}.
1423
1424
1425 @node Automatic fret diagrams
1426 @unnumberedsubsubsec Automatic fret diagrams
1427
1428 @cindex fret diagrams, automatic
1429 @cindex chord diagrams, automatic
1430 @cindex automatic fret diagrams
1431 @cindex automatic chord diagrams
1432
1433 Fret diagrams can be automatically created from entered notes using the
1434 @code{FretBoards} context.  If no predefined diagram is available for
1435 the entered notes in the active @code{stringTunings}, this context
1436 calculates strings and frets that can be used to play the notes.
1437
1438 @lilypond[quote,ragged-right,verbatim]
1439 <<
1440   \context ChordNames {
1441     \chordmode {
1442       f1 g
1443     }
1444   }
1445   \context FretBoards {
1446     <f, c f a c' f'>1
1447     <g,\6 b, d g b g'>1
1448   }
1449   \context Staff {
1450     \clef "treble_8"
1451     <f, c f a c' f'>1
1452     <g, b, d g b' g'>1
1453   }
1454 >>
1455 @end lilypond
1456
1457 @funindex predefinedFretboardsOff
1458 @funindex \predefinedFretboardsOff
1459 @funindex predefinedFretboardsOn
1460 @funindex \predefinedFretboardsOn
1461
1462 As no predefined diagrams are loaded by default, automatic calculation
1463 of fret diagrams is the default behavior.  Once default diagrams are
1464 loaded, automatic calculation can be enabled and disabled with predefined
1465 commands:
1466
1467 @lilypond[quote,ragged-right,verbatim]
1468
1469 \storePredefinedDiagram #default-fret-table
1470                         <c e g c' e'>
1471                         #guitar-tuning
1472                         #"x;3-1-(;5-2;5-3;5-4;3-1-1-);"
1473 <<
1474   \context ChordNames {
1475     \chordmode {
1476       c1 c c
1477     }
1478   }
1479   \context FretBoards {
1480     <c e g c' e'>1
1481     \predefinedFretboardsOff
1482     <c e g c' e'>1
1483     \predefinedFretboardsOn
1484     <c e g c' e'>1
1485   }
1486   \context Staff {
1487     \clef "treble_8"
1488     <c e g c' e'>1
1489     <c e g c' e'>1
1490     <c e g c' e'>1
1491   }
1492 >>
1493 @end lilypond
1494
1495
1496
1497 Sometimes the fretboard calculator will be unable to find
1498 an acceptable diagram.  This can often be remedied by
1499 manually assigning a note to a string.  In many cases, only one
1500 note need be manually placed on a string; the rest of
1501 the notes will then be placed appropriately by the
1502 @code{FretBoards} context.
1503
1504 @cindex fret diagrams, adding fingerings
1505 @cindex fingerings, adding to fret diagrams
1506
1507 Fingerings can be added to FretBoard fret diagrams.
1508
1509 @lilypond[quote, verbatim]
1510 <<
1511   \context ChordNames {
1512     \chordmode {
1513       c1 d:m
1514     }
1515   }
1516   \context FretBoards {
1517     <c-3 e-2 g c'-1 e'>1
1518     <d a-2 d'-3 f'-1>1
1519   }
1520   \context Staff {
1521     \clef "treble_8"
1522     <c e g c' e'>1
1523     <d a d' f'>1
1524   }
1525 >>
1526 @end lilypond
1527
1528 @funindex minimumFret
1529
1530 The minimum fret to be used in calculating strings and frets for
1531 the FretBoard context can be set with the @code{minimumFret}
1532 property.
1533
1534 @lilypond[quote, verbatim]
1535 <<
1536   \context ChordNames {
1537     \chordmode {
1538       d1:m d:m
1539     }
1540   }
1541   \context FretBoards {
1542     <d a d' f'>1
1543     \set FretBoards.minimumFret = #5
1544     <d a d' f'>1
1545   }
1546   \context Staff {
1547     \clef "treble_8"
1548     <d a d' f'>1
1549     <d a d' f'>1
1550   }
1551 >>
1552 @end lilypond
1553
1554 The strings and frets for the @code{FretBoards} context depend
1555 on the @code{stringTunings} property, which has the same meaning
1556 as in the TabStaff context.  See @ref{Custom tablatures} for
1557 information on the @code{stringTunings} property.
1558
1559 The graphical layout of a fret diagram can be customized according to
1560 user preference through the properties of the
1561 @code{fret-diagram-interface}. Details are found at
1562 @rinternals{fret-diagram-interface}.  For a @code{FretBoards} fret
1563 diagram, the interface properties belong to
1564 @code{FretBoards.FretBoard}.
1565
1566
1567 @predefined
1568 @code{\predefinedFretboardsOff},
1569 @code{\predefinedFretboardsOn}.
1570 @endpredefined
1571
1572 @seealso
1573 Notation Reference:
1574 @ref{Custom tablatures}.
1575
1576 Snippets:
1577 @rlsr{Fretted strings}.
1578
1579 Internals Reference:
1580 @rinternals {fret-diagram-interface}.
1581
1582 @knownissues
1583 Automatic fretboard calculations do not work properly for instruments
1584 with non-monotonic tunings.
1585
1586
1587 @node Right-hand fingerings
1588 @unnumberedsubsubsec Right-hand fingerings
1589
1590 @cindex fretted instruments, right hand fingerings
1591 @cindex fingerings, right hand for fretted instruments
1592 @cindex right hand fingerings for fretted instruments
1593
1594 @funindex rightHandFinger
1595 @funindex \rightHandFinger
1596
1597 Right-hand fingerings @var{p-i-m-a} must be entered using
1598 @code{\rightHandFinger} followed by a number.
1599
1600 @warning{If the number is entered in Scheme notation, remember to append
1601 a space before following it with a closing @code{>} or similar.}
1602
1603 @lilypond[quote,verbatim,relative=0]
1604 \clef "treble_8"
1605 c4\rightHandFinger #1
1606 e\rightHandFinger #2
1607 g\rightHandFinger #3
1608 c\rightHandFinger #4
1609 <c,\rightHandFinger #1 e\rightHandFinger #2
1610  g\rightHandFinger #3 c\rightHandFinger #4 >1
1611 @end lilypond
1612
1613 For convenience, you can abbreviate @code{\rightHandFinger} to something
1614 short, for example @code{RH},
1615
1616 @example
1617 RH=#rightHandFinger
1618 @end example
1619
1620
1621 @snippets
1622
1623 @lilypondfile[verbatim,quote,texidoc,doctitle]
1624 {placement-of-right-hand-fingerings.ly}
1625
1626 @lilypondfile[verbatim,quote,texidoc,doctitle]
1627 {fingerings,-string-indications,-and-right-hand-fingerings.ly}
1628
1629 @seealso
1630 Snippets:
1631 @rlsr{Fretted strings}.
1632
1633 Internals Reference:
1634 @rinternals{StrokeFinger}.
1635
1636
1637 @node Guitar
1638 @subsection Guitar
1639
1640 Most of the notational issues associated with guitar music are
1641 covered sufficiently in the general fretted strings section, but there
1642 are a few more worth covering here.  Occasionally users want to
1643 create songbook-type documents having only lyrics with chord
1644 indications above them.  Since LilyPond is a music typesetter,
1645 it is not recommended for documents that have no music notation
1646 in them.  A better alternative is a word processor, text editor,
1647 or, for experienced users, a typesetter like GuitarTeX.
1648
1649 @menu
1650 * Indicating position and barring::
1651 * Indicating harmonics and dampened notes::
1652 * Indicating power chords::
1653 @end menu
1654
1655 @node Indicating position and barring
1656 @unnumberedsubsubsec Indicating position and barring
1657
1658 @cindex indicating position and barring for fretted instruments
1659 @cindex fretted instruments, indicating position and barring
1660
1661 This example demonstrates how to include guitar position and
1662 barring indications.
1663
1664 @lilypond[quote,ragged-right,verbatim,relative=0]
1665 \clef "treble_8"
1666 b16 d g b e
1667 \textSpannerDown
1668 \override TextSpanner #'(bound-details left text) = #"XII "
1669 g16\startTextSpan
1670 b16 e g e b g\stopTextSpan
1671 e16 b g d
1672 @end lilypond
1673
1674 @seealso
1675 Notation Reference:
1676 @ref{Text spanners}.
1677
1678 Snippets:
1679 @rlsr{Fretted strings},
1680 @rlsr{Expressive marks}.
1681
1682
1683 @node Indicating harmonics and dampened notes
1684 @unnumberedsubsubsec Indicating harmonics and dampened notes
1685
1686 @cindex fretted instruments, dampened notes
1687 @cindex fretted instruments, harmonics
1688 @cindex dampened notes on fretted instruments
1689 @cindex harmonics on fretted instruments
1690
1691 Special note heads can be used to indicate dampened notes or
1692 harmonics.  Harmonics are normally further explained with a
1693 text markup.
1694
1695 @lilypond[quote,ragged-right,verbatim]
1696 \relative c' {
1697   \clef "treble_8"
1698   \override Staff.NoteHead #'style = #'harmonic-mixed
1699   d^\markup { \italic { \fontsize #-2 { "harm. 12" }}} <g b>1
1700 }
1701 @end lilypond
1702
1703 Dampened notes (also called @notation{dead notes}) are supported
1704 within normal and tablature staves:
1705
1706 @lilypond[quote,ragged-right,verbatim]
1707 music = \relative c' {
1708   < a\3 \deadNote c\2 a'\1 >4
1709   < b\3 \deadNote d\2 b'\1 >
1710   < c\3 \deadNote e\2 c'\1 >
1711   \deadNotesOn
1712   \times 2/3 { g8 b e }
1713   \deadNotesOff
1714   < a,\3 c\2 e\1 >1
1715 }
1716 \new StaffGroup <<
1717   \new Staff {
1718     \clef "treble_8"
1719     \music
1720   }
1721   \new TabStaff {
1722     \music
1723   }
1724 >>
1725 @end lilypond
1726
1727 Another playing technique (especially used on electric guitars) is
1728 called @notation{palm mute}.  The string is hereby partly muted by the
1729 palm of the striking hand (hence the name).  Lilypond supports
1730 the notation of palm mute-style notes by changing the note head to a
1731 triangle shape.
1732
1733 @lilypond[quote,ragged-right,verbatim]
1734 \new Voice { % Warning: explicit Voice instantiation is
1735              %    required to have palmMuteOff work properly
1736              %    when palmMuteOn comes at the beginning of
1737              %    the piece.
1738   \relative c, {
1739     \clef "G_8"
1740     \palmMuteOn
1741     e8^\markup { \musicglyph #"noteheads.u2do"  = palm mute }
1742     < e b' e > e
1743     \palmMuteOff
1744     e e  \palmMute e e e |
1745     e8 \palmMute { e e e } e e e e |
1746     < \palmMute e b' e >8 \palmMute { e e e } < \palmMute e b' e >2
1747   }
1748 }
1749 @end lilypond
1750
1751 @seealso
1752 Snippets:
1753 @rlsr{Fretted strings}.
1754
1755 Notation Reference:
1756 @ref{Special note heads},
1757 @ref{Note head styles}.
1758
1759
1760 @node Indicating power chords
1761 @unnumberedsubsubsec Indicating power chords
1762
1763 @funindex powerChords
1764 @funindex \powerChords
1765
1766 @cindex power chords
1767 @cindex chords, power
1768
1769 Power chords and their symbols can be engraved in chord mode or as chord
1770 constructs:
1771
1772 @lilypond[quote,ragged-right,verbatim]
1773 ChordsAndSymbols = {
1774   \chordmode {
1775     \powerChords
1776     e,,1:1.5
1777     a,,1:1.5.8
1778     \set minimumFret = #8
1779     c,1:1.5
1780     f,1:1.5.8
1781   }
1782   \set minimumFret = #5
1783   <a, e>1
1784   <g d' g'>1
1785 }
1786 \score {
1787   <<
1788     \new ChordNames {
1789     \ChordsAndSymbols
1790     }
1791     \new Staff {
1792       \clef "treble_8"
1793       \ChordsAndSymbols
1794     }
1795     \new TabStaff {
1796       \ChordsAndSymbols
1797     }
1798   >>
1799 }
1800 @end lilypond
1801
1802 Power chord symbols are automatically switched off as soon as one of the
1803 other common chord modifier is used:
1804
1805 @lilypond[quote,ragged-right,verbatim]
1806 mixedChords = \chordmode {
1807   c,1
1808   \powerChords
1809   b,,1:1.5
1810   fis,,1:1.5.8
1811   g,,1:m
1812 }
1813 \score {
1814   <<
1815     \new ChordNames {
1816       \mixedChords
1817     }
1818     \new Staff {
1819       \clef "treble_8"
1820       \mixedChords
1821     }
1822     \new TabStaff {
1823       \mixedChords
1824     }
1825   >>
1826 }
1827 @end lilypond
1828
1829 @seealso
1830 Music Glossary:
1831 @rglos{power chord}.
1832
1833 Notation Reference:
1834 @ref{Extended and altered chords},
1835 @ref{Printing chord names}.
1836
1837 Snippets:
1838 @rlsr{Fretted strings}.
1839
1840
1841 @node Banjo
1842 @subsection Banjo
1843
1844 @menu
1845 * Banjo tablatures::
1846 @end menu
1847
1848 @node Banjo tablatures
1849 @unnumberedsubsubsec Banjo tablatures
1850
1851 @cindex banjo tablatures
1852 @cindex tablature, banjo
1853
1854 LilyPond has basic support for the five-string banjo.  When making tablatures
1855 for five-string banjo, use the banjo tablature format function to get
1856 correct fret numbers for the fifth string:
1857
1858 @c due to crazy intervals of banjo music, absolute pitch is recommended
1859
1860 @lilypond[quote,ragged-right,verbatim]
1861 \new TabStaff <<
1862   \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo
1863   \set TabStaff.stringTunings = #banjo-open-g-tuning
1864   {
1865     \stemDown
1866     g8 d' g'\5 a b g e d' |
1867     g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
1868     g4
1869   }
1870 >>
1871 @end lilypond
1872
1873 @cindex banjo tunings
1874 @cindex tunings, banjo
1875
1876 @funindex banjo-c-tuning
1877 @funindex banjo-modal-tuning
1878 @funindex banjo-open-d-tuning
1879 @funindex banjo-open-dm-tuning
1880 @funindex four-string-banjo
1881
1882 A number of common tunings for the five-string banjo are predefined:
1883 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
1884 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}
1885 (aDFAD).
1886
1887 These may be converted to four-string tunings using the
1888 @code{four-string-banjo} function:
1889
1890 @example
1891 \set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
1892 @end example
1893
1894 @seealso
1895 Installed Files:
1896 @file{ly/string-tunings-init.ly}.
1897
1898 Snippets:
1899 @rlsr{Fretted strings}.