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