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