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