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