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