]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/fretted-strings.itely
Merge master into nested-bookparts
[lilypond.git] / Documentation / user / fretted-strings.itely
index 3c2d64d28bf26b64d502c69a50164dede5cf117d..eb071b4bd2f5f533946e66765dd144b4a68d0945 100644 (file)
@@ -6,7 +6,7 @@
     version that you are working on.  See TRANSLATION for details.
 @end ignore
 
-@c \version "2.11.53"
+@c \version "2.11.61"
 
 @node Fretted string instruments
 @section Fretted string instruments
@@ -17,7 +17,10 @@ This section discusses several aspects of music notation that are unique
 to fretted string instruments.
 
 @cindex tablature
+@cindex tablature, guitar
+@cindex tablature, banjo
 @cindex guitar tablature
+@cindex banjo tablature
 
 @menu
 * Common notation for fretted strings::  
@@ -43,7 +46,7 @@ to fretted string instruments.
 @end menu
 
 @node References for fretted strings
-@subsubsection References for fretted strings
+@unnumberedsubsubsec References for fretted strings
 
 Music for fretted string instruments is normally notated on
 a single staff, either in traditional music notation or in
@@ -70,18 +73,21 @@ in @ref{Collision resolution}.
 @seealso
 
 Notation Reference:
-@ref{Instrument names},
-@ref{Writing music in parallel},
 @ref{Fingering instructions},
 @ref{Ties},
+@ref{Collision resolution},
+@ref{Instrument names},
+@ref{Writing music in parallel},
 @ref{Arpeggio},
 @ref{List of articulations},
 @ref{Clef}.
 
 @node String number indications
-@subsubsection String number indications
+@unnumberedsubsubsec String number indications
 
-@cindex String numbers
+@cindex string numbers
+@cindex string vs. fingering numbers
+@cindex fingering vs. string numbers
 
 The string on which a note should be played may be indicated by
 appending @code{\@var{number}} to a note inside a chord construct
@@ -128,9 +134,13 @@ Internals Reference:
 
 
 @node Default tablatures
-@subsubsection Default tablatures
-@cindex Tablatures, basic
-@cindex Tablatures, default
+@unnumberedsubsubsec Default tablatures
+
+@cindex tablatures, basic
+@cindex tablatures, default
+
+@funindex TabStaff
+@funindex TabVoice
 
 Tablature notation is used for notating music for plucked string
 instruments.  Pitches are not denoted with note heads, but by
@@ -151,13 +161,14 @@ The notes are printed as tablature, by using @code{TabStaff} and
 @end lilypond
 
 @funindex minimumFret
+
 @cindex fret
 
 
 When no string is specified for a note, the note is assigned to
 the lowest string that can generate the note with a fret number
-greater than or equal to @code{minimumFret} is selected.  The
-default value for @code{minimumFret} is 0.
+greater than or equal to the value of @code{minimumFret}.
+The default value for @code{minimumFret} is 0.
 
 
 @lilypond[quote,ragged-right,verbatim]
@@ -175,6 +186,23 @@ default value for @code{minimumFret} is 0.
 >>
 @end lilypond
 
+@cindex harmonic indications in tablature notation
+@cindex tablature and harmonic indications
+@cindex slides in tablature notation
+@cindex tablature and slides
+
+Harmonic indications and slides can be added to tablature
+notation.
+
+@lilypond[fragment, verbatim, quote, relative=1]
+\new TabStaff {
+  \new TabVoice {
+    <c g'\harmonic> d\2\glissando e\2
+  }
+}
+@end lilypond
+
+
 @snippets
 
 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
@@ -219,31 +247,26 @@ melodia = \partcombine { e4 g g g }{ e4 e e e }
 >>
 @end lilypond
 
+Guitar special effects are limited to harmonics and slides.
 
 @node Custom tablatures
-@subsubsection Custom tablatures
-@cindex Tablatures, custom
+@unnumberedsubsubsec Custom tablatures
 
-You can change the tuning of the strings.  A string tuning is
-given as a Scheme list with one integer number for each string,
-the number being the pitch (measured in semitones relative to
-middle C) of an open string.  The numbers specified for
-@code{stringTunings} are the numbers of semitones to subtract or
-add, starting the specified pitch by default middle C, in string
-order.  LilyPond automatically calculates the number of strings by
-looking at @code{stringTunings}.
+@cindex tablatures, custom
+@cindex tablature, banjo
+@cindex tablature, mandolin
+@cindex tablature, bass guitar
+@cindex tablature, predefined string tunings
+@cindex fretted instruments, predefined string tunings
+@cindex predefined string tunings for fretted instruments
 
-In the next example, @code{stringTunings} is set for the pitches
-e, a, d, and g.
+@funindex StringTunings
 
-@lilypond[quote,ragged-right,fragment,verbatim]
-\new TabStaff <<
-  \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
-  {
-    a,4 c' a e' e c' a e'
-  }
->>
-@end lilypond
+LilyPond tabulature automatically calculates the fret for 
+a note based on the string to which the note is assigned.
+In order to do this, the tuning of the strings must be
+specified.  The tuning of the strings is given in the
+@code{StringTunings} property.
 
 LilyPond comes with predefined string tunings for banjo, mandolin,
 guitar and bass guitar.  Lilypond automatically sets the correct 
@@ -252,45 +275,87 @@ for bass guitar, which sounds an octave lower than written.
 
 @lilypond[quote,ragged-right,verbatim]
 <<
-  \new Staff <<
+  \new Staff {
     \clef "bass_8"
     \relative c, {
-    c4 d e f
+      c4 d e f
     }
-  >>
-  \new TabStaff <<
+  }
+  \new TabStaff {
     \set TabStaff.stringTunings = #bass-tuning
     \relative c, {
-    c4 d e f
+      c4 d e f
     }
-  >>
+  }
 >>
 @end lilypond
 
-The default string tuning is @code{guitar-tuning} (the standard
-EADGBE tuning).  Some other predefined tunings are
+The default string tuning is @code{guitar-tuning}, which
+is the standard EADGBE tuning.  Some other predefined tunings are
 @code{guitar-open-g-tuning}, @code{mandolin-tuning} and
-@code{banjo-open-g-tuning}.
+@code{banjo-open-g-tuning}.  The predefined string tunings 
+are found in @code{scm/output-lib.scm}.
+
+A string tuning is a Scheme list of string pitches, 
+one for each string, ordered by string number from 1 to N,
+where string 1 is at the top of the tablature staff and
+string N is at the bottom.  This ordinarily results in ordering 
+from highest pitch to lowest pitch, but some instruments 
+(e.g. ukulele) do not have strings ordered by pitch.
+
+A string pitch in a string tuning list is the pitch difference  
+of the open string from middle C measured in semitones.  The 
+string pitch must be an integer.  Lilypond calculates the actual 
+pitch of the string by adding the string tuning pitch to the 
+actual pitch for middle C.
+
+LilyPond automatically calculates the number of strings in the
+@code{TabStaff} as the number of elements in @code{stringTunings}.
+
+Any desired string tuning can be created.  For example, we can
+define a string tuning for a four-string instrument with pitches
+of @code{a''},  @code{d''},  @code{g'}, and @code{c'}:
+
+
+@lilypond[quote,verbatim]
+mynotes = {
+    c'4 e' g' c'' |
+    e'' g'' b'' c'''
+}
+
+<<
+  \new Staff {
+    \clef treble
+    \mynotes
+  }
+  \new TabStaff {
+    \set TabStaff.stringTunings = #'(21 14 7 0)
+    \mynotes
+  }
+>>
+@end lilypond
 
 @seealso
 
+Installed Files:
+@file{scm/output-lib.scm}.
+
 Snippets:
 @rlsr{Fretted strings}.
 
-The file @file{scm/@/output@/-lib@/.scm} contains the predefined string
-tunings.
-
 Internals Reference: 
 @rinternals{Tab_note_heads_engraver}.
 
-@knownissues
-
-No guitar special effects have been implemented.
 
 @node Fret diagram markups
-@subsubsection Fret diagram markups
+@unnumberedsubsubsec Fret diagram markups
+
 @cindex fret diagrams
 @cindex chord diagrams
+@cindex diagrams, fret
+@cindex diagrams, chord for fretted instruments
+@cindex fret diagrams, custom
+@cindex custom fret diagrams
 
 Fret diagrams can be added to music as a markup to the desired
 note.  The markup contains information about the desired fret
@@ -321,6 +386,8 @@ In addition, open and unplayed (muted) strings can be indicated.
 >>
 @end lilypond
 
+@cindex barre indications
+
 Barre indications can be added to the diagram from
 the fret-diagram markup string.
 
@@ -335,12 +402,17 @@ the fret-diagram markup string.
     \clef "treble_8"
     < f, c f a c' f'>1 ^\markup
       \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
-    < g, b, d g b' g'> ^\markup
+    < g, d g b d' g'> ^\markup
       \fret-diagram #"c:6-1-3;6-3;5-5;4-5;3-4;2-3;1-3;"
   }
 >>
 @end lilypond
 
+@cindex fret-diagram markup
+
+@funindex fret-diagram
+@funindex \fret-diagram
+
 The size of the fret diagram, and the number of frets in the diagram
 can be changed in the fret-diagram markup string.
 
@@ -355,7 +427,7 @@ can be changed in the fret-diagram markup string.
     \clef "treble_8"
     < f, c f a c' f'>1 ^\markup
       \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;"
-    < g, b, d g b' g'> ^\markup
+    < g, b, d g b g'> ^\markup
       \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;"
   }
 >>
@@ -419,6 +491,11 @@ markup string.
 >>
 @end lilypond
 
+@cindex fret-diagram-terse markup
+
+@funindex fret-diagram-terse
+@funindex \fret-diagram-terse
+
 The fret-diagram-terse markup string omits string numbers; the string
 number is implied by the presence of semicolons.  There is one semicolon 
 for each string in the diagram.  The first semicolon corresponds to the
@@ -455,7 +532,7 @@ Barre indicators can be included in the fret-diagram-terse markup string.
     \clef "treble_8"
     < f, c f a c' f'>1 ^\markup
       \fret-diagram-terse #"1-(;3;3;2;1;1-);"
-    < g, b, d g b' g'> ^\markup
+    < g, d g b d' g'> ^\markup
       \fret-diagram-terse #"3-(;5;5;4;3;3-);"
   }
 >>
@@ -486,6 +563,11 @@ Fingering indications can be included in the fret-diagram-terse markup string.
 Other fret diagram properties must be adjusted using @code{\override} when using
 the fret-diagram-terse markup.
 
+@cindex fret-diagram-verbose markup
+
+@funindex fret-diagram-verbose
+@funindex \fret-diagram-verbose
+
 The fret-diagram-verbose markup string is in the format of a Scheme list.  Each
 element of the list indicates an item to be placed on the fret diagram.
 
@@ -545,7 +627,7 @@ fret-diagram-verbose markup string.
         (place-fret 1 1)
         (barre 6 1 1)
       )
-    < g, b, d g b' g'> ^\markup
+    < g, b, d g b g'> ^\markup
       \fret-diagram-verbose #'(
         (place-fret 6 3 2)
         (place-fret 5 2 1)
@@ -597,13 +679,22 @@ and color of dots.
 @end lilypond
 @end ignore
 
+@cindex customized fret diagram
+@cindex fret diagram, customized
+@cindex diagram, fret, customized
+
+@funindex fret-diagram-interface
+
 The graphical layout of a fret diagram can be customized according to
 user preference through the properties of the @code{fret-diagram-interface}.
 Details are found at @rinternals{fret-diagram-interface}.  For a fret diagram
-markup , the interface properties belong to @code{Voice.TextScript}.
+markup, the interface properties belong to @code{Voice.TextScript}.
 
 @snippets
-TODO create snippets for changing properties.  Use regression test?
+
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{customizing-markup-fret-diagrams.ly}
+
 
 @seealso
 
@@ -617,10 +708,15 @@ Internals Reference:
 @rinternals{fret-diagram-interface}.
 
 @node Predefined fret diagrams
-@subsubsection Predefined fret diagrams
+@unnumberedsubsubsec Predefined fret diagrams
+
+
 @cindex fret diagrams
 @cindex chord diagrams
 
+@funindex FretBoards
+@funindex stringTunings
+
 Fret diagrams can be displayed using the @code{FretBoards} context.  By
 default, the @code{FretBoards} context will display fret diagrams that
 are stored in a lookup table:
@@ -656,6 +752,13 @@ either as simultaneous music or using chord mode (see
 }
 @end lilypond
 
+@cindex chord names with fret diagrams
+@cindex fret diagrams with chord names
+
+@funindex ChordNames
+@funindex chordmode
+@funindex \chordmode
+
 It is common that both chord names and fret diagrams are displayed together.
 This is achieved by putting a @code{ChordNames} context in parallel with
 a @code{FretBoards} context and giving both contexts the same music.
@@ -676,6 +779,10 @@ mychords = \chordmode{
 >>
 @end lilypond
 
+@cindex transposing fret diagrams
+@cindex fret diagrams, transposing
+@cindex diagrams, fret, transposing
+
 Predefined fret diagrams are transposable, as long as a diagram for the
 transposed chord is stored in the fret diagram table.
 
@@ -724,6 +831,10 @@ mychords = \chordmode{
 >>
 @end lilypond
 
+@cindex fret diagrams, adding custom
+@cindex custom fret diagrams, adding
+@cindex adding custom fret diagrams
+
 Fret diagrams can be added to the fret diagram table.  To add a diagram,
 you must specify the chord for the diagram, the tuning to be used, and the
 fret-diagram-terse definition string for the diagram.
@@ -773,6 +884,14 @@ mychords = \chordmode{
 >>
 @end lilypond
 
+@cindex fretted instruments, chord shapes
+@cindex chord shapes for fretted instruments
+
+@funindex \addChordShape
+@funindex add ChordShape
+@funindex storePredefinedDiagram
+@funindex \storePredefinedDiagram
+
 In addition to fret diagrams, LilyPond stores an internal list of chord
 shapes.  The chord shapes are fret diagrams that can be shifted along
 the neck to different posistions to provide different chords.  Chord
@@ -815,7 +934,11 @@ Details are found at @rinternals{fret-diagram-interface}.  For a
 predefined fret diagram, the interface properties belong to 
 @code{FretBoards.FretBoard}.
 
-@c @snippets
+@snippets
+
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{customizing-fretboard-fret-diagrams.ly}
+
 
 @seealso
 
@@ -836,9 +959,12 @@ Internals Reference:
 
 
 @node Automatic fret diagrams
-@subsubsection Automatic fret diagrams
-@cindex fret diagrams
-@cindex chord diagrams
+@unnumberedsubsubsec Automatic fret diagrams
+
+@cindex fret diagrams, automatic
+@cindex chord diagrams, automatic
+@cindex automatic fret diagrams
+@cindex automatic chord diagrams
 
 Fret diagrams can be automatically created from entered notes using the 
 @code{FretBoards} context.  If no predefined diagram is available for
@@ -864,6 +990,11 @@ calculates strings and frets that can be used to play the notes.
 >>
 @end lilypond
 
+@funindex predefinedFretboardsOff
+@funindex \predefinedFretboardsOff
+@funindex predefinedFretboardsOn
+@funindex \predefinedFretboardsOn
+
 As no predefined diagrams are loaded by default, automatic calculation 
 of fret diagrams is the default behavior.  Once default diagrams are
 loaded, automatic calculation can be enabled and disabled with predefined
@@ -871,7 +1002,7 @@ commands:
 
 @lilypond[quote,ragged-right,verbatim]
 
-\storePredefinedDiagram <c\5 e g c' e'>
+\storePredefinedDiagram <c e g c' e'>
                         #guitar-tuning
                         #"x;3-1-(;5-2;5-3;5-4;3-1-1);"
 <<
@@ -881,25 +1012,27 @@ commands:
      }
   }
   \context FretBoards {
-    <c\5 e g c' e'>1
+    <c e g c' e'>1
     \predefinedFretboardsOff
-    <c\5 e g c' e'>
+    <c e g c' e'>
     \predefinedFretboardsOn
-    <c\5 e g c' e'>
+    <c e g c' e'>
   }
   \context Staff {
     \clef "treble_8"
-    <c\5 e g c' e'>1
-    <c\5 e g c' e'>
-    <c\5 e g c' e'>
+    <c e g c' e'>1
+    <c e g c' e'>
+    <c e g c' e'>
   }  
 >>
 @end lilypond
 
   
 
-Notes can be explicitly placed on a string.  It is often enough
-to place only the lowest note on an explicit string; the rest of 
+Sometimes the fretboard calculator will be unable to find
+an accceptable diagram.  This can often be remedied by
+manually assigning a note to a string.  In many cases, only one
+note need be manually placed on a string; the rest of 
 the notes will then be placed appropriately by the @code{FretBoards}
 context.
 
@@ -907,25 +1040,24 @@ context.
 <<
   \context ChordNames {
      \chordmode { 
-       c1 c d:m d:m    
+       c1 c 
      }
   }
   \context FretBoards {
-    < c e g c' e' > 1
-    < c\5 e g c' e' > 1
-    < d a d' f'>
-    < d\4 a d' f'>
+    < c g c' e' g'> 1
+    < c g\4 c' e' g'> 1
   }
   \context Staff {
     \clef "treble_8"
-    < c e g c' e' > 1
-    < c e g c' e' > 1
-    < d a d' f'>
-    < d a d' f'>
+    < c g c' e' g'> 1
+    < c g c' e' g'> 1
   }  
 >>
 @end lilypond
 
+@cindex fret diagrams, adding fingerings
+@cindex fingerings, adding to fret diagrams
+
 Fingerings can be added to FretBoard fret diagrams.
 
 @lilypond[quote, verbatim]
@@ -936,8 +1068,8 @@ Fingerings can be added to FretBoard fret diagrams.
      }
   }
   \context FretBoards {
-    < c\5-3 e-2 g c'-1 e' > 1
-    < d\4 a-2 d'-3 f'-1>
+    < c-3 e-2 g c'-1 e' > 1
+    < d a-2 d'-3 f'-1>
   }
   \context Staff {
     \clef "treble_8"
@@ -947,6 +1079,30 @@ Fingerings can be added to FretBoard fret diagrams.
 >>
 @end lilypond
 
+The minimum fret to be used in calculating strings and frets for
+the FretBoard context can be set with the @code{minimumFret}
+property.
+
+@lilypond[quote, verbatim]
+<<
+  \context ChordNames {
+     \chordmode {
+       d1:m d:m
+     }
+  }
+  \context FretBoards {
+    < d a d' f'>
+    \set FretBoards.minimumFret = #5
+    < d a d' f'>
+  }
+  \context Staff {
+    \clef "treble_8"
+    < d a d' f'>
+    < d a d' f'>
+  }
+>>
+@end lilypond
+
 The strings and frets for the @code{FretBoards} context depend
 on the @code{stringTunings} property, which has the same meaning
 as in the TabStaff context.  See @ref{Custom tablatures} for 
@@ -958,18 +1114,9 @@ Details are found at @rinternals{fret-diagram-interface}.  For a
 @code{FretBoards} fret diagram, the interface properties belong to 
 @code{FretBoards.FretBoard}.
 
-@snippets
-The minimum fret to be used in calculating strings and frets for
-the FretBoard context can be set with the @code{minimumFret}
-property.
-
-@c TODO -- snippet showing minimum fret.
-
-@c TODO -- snippet for using StringTunings
-
 @predefined
-\predefinedFretboardsOff,
-\predefinedFretboardsOn.
+@code{\predefinedFretboardsOff},
+@code{\predefinedFretboardsOn}.
 
 @seealso
 
@@ -984,7 +1131,14 @@ Internals Reference:
 
 
 @node Right-hand fingerings
-@subsubsection Right-hand fingerings
+@unnumberedsubsubsec Right-hand fingerings
+
+@cindex fretted instruments, right hand fingerings
+@cindex fingerings, right hand for fretted instruments
+@cindex right hand fingerings for fretted instruments
+
+@funindex rightHandFinger
+@funindex \rightHandFinger
 
 Right-hand fingerings @var{p-i-m-a} must be entered within a  
 chord construct @code{<>} for them to be printed in the score, 
@@ -1009,8 +1163,6 @@ short, for example @code{RH},
 #(define RH rightHandFinger)
 @end example
 
-@cindex fingerings, right hand, for guitar
-@cindex right hand fingerings for guitar
 
 @snippets
 
@@ -1047,7 +1199,10 @@ or, for experienced users, a typesetter like GuitarTeX.
 @end menu
 
 @node Indicating position and barring
-@subsubsection Indicating position and barring
+@unnumberedsubsubsec Indicating position and barring
+
+@cindex indicating position and barring for fretted instruments
+@cindex fretted instruments, indicating position and barring
 
 This example demonstrates how to include guitar position and
 barring indications.
@@ -1072,7 +1227,12 @@ Snippets:
 @rlsr{Expressive marks}.
 
 @node Indicating harmonics and dampened notes
-@subsubsection Indicating harmonics and dampened notes
+@unnumberedsubsubsec Indicating harmonics and dampened notes
+
+@cindex fretted instruments, dampened notes
+@cindex fretted instruments, harmonics
+@cindex dampened notes on fretted instruments
+@cindex harmonics on fretted instruments
 
 Special note heads can be used to indicate dampened notes or 
 harmonics.  Harmonics are normally further explained with a 
@@ -1105,8 +1265,10 @@ Notation Reference:
 @end menu
 
 @node Banjo tablatures
-@subsubsection Banjo tablatures
-@cindex Banjo tablatures
+@unnumberedsubsubsec Banjo tablatures
+
+@cindex banjo tablatures
+@cindex tablature, banjo
 
 LilyPond has basic support for the five-string banjo.  When making tablatures
 for five-string banjo, use the banjo tablature format function to get
@@ -1127,6 +1289,15 @@ correct fret numbers for the fifth string:
 >>
 @end lilypond
 
+@cindex banjo tunings
+@cindex tunings, banjo
+
+@funindex banjo-c-tuning
+@funindex banjo-modal-tuning
+@funindex banjo-open-d-tuning
+@funindex banjo-open-dm-tuning
+@funindex four-string-banjo
+
 A number of common tunings for banjo are predefined in LilyPond:
 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}