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