]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/fretted-strings.itely
Doc: NR 2.4.1 - add Hammer/Pull snippets
[lilypond.git] / Documentation / notation / fretted-strings.itely
index 1de78a04981931fb08a227d25bb41eeb7bafa6b1..121dfc0580d83731a42bb7f340ae8243f50cfd90 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.13.36"
+@c \version "2.17.30"
 
 @node Fretted string instruments
 @section Fretted string instruments
@@ -55,13 +55,14 @@ tablature.  Sometimes the two types are combined, and it is
 especially common in popular music to use chord diagrams above
 a staff of traditional notation.  The guitar and the banjo are
 transposing instruments, sounding an octave lower than written.
-Scores for these instruments should use the @code{"treble_8"} clef (or
-@code{\transposition c} to get correct MIDI output).
+Scores for these instruments should use the @code{"treble_8"} clef
+(or @code{\transposition c} to get correct MIDI output).
 Some other elements pertinent to fretted string instruments
 are covered elsewhere:
 
 @itemize
-@item Fingerings are indicated as shown in @ref{Fingering instructions}.
+@item Fingerings are indicated as shown in
+@ref{Fingering instructions}.
 
 @item Instructions for @notation{Laissez vibrer} ties
 as well as ties on arpeggios and tremolos can be found in
@@ -75,7 +76,6 @@ in @ref{Collision resolution}.
 
 @end itemize
 
-
 @seealso
 Notation Reference:
 @ref{Fingering instructions},
@@ -97,37 +97,36 @@ Notation Reference:
 @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
-@code{<>}.
-
-@warning{String numbers @strong{must} be defined inside a chord
-construct even if there is only a single note.}
+appending @code{\@var{number}} to a note.
 
 @lilypond[verbatim,quote,relative=0]
 \clef "treble_8"
-<c\5>4 <e\4> <g\3>2
+c4\5 e\4 g2\3
 <c,\5 e\4 g\3>1
 @end lilypond
 
 When fingerings and string indications are used together, their
-placement is controlled by the order in which the two items appear
-in the code:
+placement can be controlled by the order in which the two items appear
+in the code @emph{only} if they appear inside of an explicit chord:
+applied to whole chords or single notes @emph{outside} of chords,
+fingerings are placed using a different mechanism.
 
 @lilypond[verbatim,quote,relative=1]
 \clef "treble_8"
-<g\3-0>2
+g4\3-0
+g-0\3
+<g\3-0>
 <g-0\3>
 @end lilypond
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {controlling-the-placement-of-chord-fingerings.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
 
-
 @seealso
 Notation Reference:
 @ref{Fingering instructions}.
@@ -152,12 +151,15 @@ Internals Reference:
 Music for plucked string instruments is frequently notated using a
 finger/touch notation or tablature.  In contrast to traditional
 notation pitches are not denoted with note heads, but by numbers (or
-letterlike symbols in historical intavolatura).  The numbers
-indicate on which string and fret a note must be played.  The numbers
-are printed on top of each other if they are to be played
-simultaneously.
-
-By default, string 1 is the highest, and the tuning defaults to the
+letter-like symbols in historical intavolatura).  The staff lines
+in tablature indicate the string on which the note is to be played,
+and a number placed on a staff line indicated the fret at which
+the corresponding string is to be pressed.
+Notes that are to be played simultaneously are vertically aligned.
+
+By default, string 1 is the highest string, and corresponds to the top
+line on the @code{TabStaff}.  The tuning of the @code{TabStaff}
+strings defaults to the
 standard guitar tuning (with 6 strings).  The notes are printed as
 tablature, by using @code{TabStaff} and @code{TabVoice} contexts.  A
 calligraphic tablature clef is added automatically.
@@ -219,19 +221,23 @@ symbols = {
 @cindex fret
 
 @funindex minimumFret
+@funindex restrainOpenStrings
 
 By default pitches are assigned to the lowest playing position on the
 fret-board (first position).  Open strings are automatically preferred.
-If you would like a certain pitch to be played on a specific string
-you can add a string number indication to the pitch name.  If you
-define pitch names and string numbers without a chord construct
-(@code{<>}) the string number indications do not appear in traditional
-notation.  It is much more comfortable to define the playing position
-by using the value of @code{minimumFret}.  The default value for
-minimumFret is 0.
+If you would like a certain pitch to be played on a specific string you
+can add a string number indication to the pitch name.  If you don't want
+to have string number indications appear in traditional notation, you
+can override the respective stencil.  Usually it will be more
+comfortable to define the playing position by using the value of
+@code{minimumFret}.  The default value for minimumFret is 0.
 
+Even when @code{minimumFret} is set, open strings are used whenever
+possible.  This behaviour can be changed by setting @code{restrainOpenStrings}
+to @code{#t}.
 
 @lilypond[quote,ragged-right,verbatim]
+\layout { \omit Voice.StringNumber }
 \new StaffGroup <<
    \new Staff \relative c {
      \clef "treble_8"
@@ -244,38 +250,44 @@ minimumFret is 0.
      c16 d e f g4
      c,16\5 d\5 e\4 f\4 g4\4
      \set TabStaff.minimumFret = #5
+     \set TabStaff.restrainOpenStrings = ##t
      c,16 d e f g4
    }
 >>
 @end lilypond
 
-@funindex \tabChordRepetition
+@funindex \tabChordRepeats
+@funindex \chordRepeats
+@cindex Chord, repetition
+@cindex repetition, using @code{q}
 
-Chord constructs can be repeated by the chord repetition symbol @code{q}.
-To use this feature in combination with tablature, @code{\tabChordRepetition}
-is provided.  It preserves the string information explicitly given within
-chord constructs so repeated chords get identical tablature representations.
+Chord constructs can be repeated by the chord repetition symbol
+@code{q}.  In combination with tabulatures, its behavior of removing
+string and finger numbers alongside with other events is cumbersome, so
+you'll want to run
+@example
+\chordRepeats #'(string-number-event fingering-event)
+@end example
+explicitly on music expressions in tabulature using @ref{Chord
+repetition}.  This particular command is so common that it is available
+as @code{\tabChordRepeats}.
 
 @lilypond[quote,verbatim]
-\tabChordRepetition
-
 guitar = \relative c' {
-  r8 <gis\4 cis\3 b\2>~ q4 q8~ q q4
+  r8 <gis-2 cis-3 b-0>~ q4 q8~ q q4
 }
 
 \new StaffGroup <<
   \new Staff {
     \clef "treble_8"
-    \override Voice.StringNumber #'transparent = ##t
     \guitar
   }
   \new TabStaff {
-    \guitar
+    \tabChordRepeats \guitar
   }
 >>
 @end lilypond
 
-
 Ties over a line break are parenthesized by default.  The same holds for
 the second alternative of a repeat.
 
@@ -298,11 +310,11 @@ ties = \relative c' {
 \score {
   <<
     \new StaffGroup  <<
-      \context Staff {
+      \new Staff {
         \clef "treble_8"
         \ties
       }
-      \context TabStaff {
+      \new TabStaff {
         \ties
       }
     >>
@@ -337,11 +349,11 @@ ties = \relative c' {
 \score {
   <<
     \new StaffGroup  <<
-      \context Staff {
+      \new Staff {
         \clef "treble_8"
         \ties
       }
-      \context TabStaff {
+      \new TabStaff {
       \hideSplitTiedTabNotes
         \ties
       }
@@ -356,33 +368,119 @@ ties = \relative c' {
 
 @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.
+@funindex \harmonic
+@funindex \harmonicByFret
+@funindex \harmonicByRatio
+
+Harmonic indications can be added to tablature notation as sounding
+pitches:
+
+@lilypond[verbatim,quote]
+\layout { \omit Voice.StringNumber }
+firstHarmonic = {
+  d'4\4\harmonic
+  g'4\3\harmonic
+  b'2\2\harmonic
+}
+\score {
+  <<
+    \new Staff {
+      \clef "treble_8"
+      \firstHarmonic
+    }
+    \new TabStaff { \firstHarmonic }
+  >>
+}
+@end lilypond
 
-@lilypond[verbatim, quote, relative=1]
-\new TabStaff {
-  \new TabVoice {
-    <c g'\harmonic>4 d\2\glissando e\2
-  }
+Note that the command @code{\harmonic} must always be attached to single
+notes (possibly inside of a chord) instead of whole chords.
+It only makes sense for open-string harmonics
+in the 12th fret. All other harmonics should be calculated by LilyPond.
+This can be achieved by indicating the fret where a finger of the
+fretting hand should touch a string.
+
+@lilypond[verbatim,quote]
+fretHarmonics = {
+  \harmonicByFret #5 d16\4
+  \harmonicByFret #4 d16\4
+  \harmonicByFret #3 d8\4
+  \harmonicByFret #5 <g\3 b\2>2.
+}
+\score {
+  <<
+    \new Staff {
+      \clef "treble_8"
+      \fretHarmonics
+    }
+    \new TabStaff { \fretHarmonics }
+  >>
 }
 @end lilypond
 
+Alternatively, harmonics can be computed by defining the ratio of
+string lengths above and below the harmonic fingering.
 
-@snippets
+@lilypond[verbatim,quote]
+ratioHarmonics = {
+  \harmonicByRatio #1/2 <g\3 b\2 e'\1>4
+  \harmonicByRatio #1/3 <g\3 b\2 e'\1>4
+  \harmonicByRatio #1/4 { g8\3 b8\2 e'4\1 }
+}
+\score {
+  <<
+    \new Staff {
+      \clef "treble_8"
+      \ratioHarmonics
+    }
+    \new TabStaff { \ratioHarmonics }
+  >>
+}
+@end lilypond
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@snippets
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {stem-and-beam-behavior-in-tablature.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {polyphony-in-tablature.ly}
 
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{open-string-harmonics-in-tablature.ly}
+
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{fretted-string-harmonics-in-tablature.ly}
+
+@cindex slides in tablature notation
+@cindex tablature and slides
+
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{slides-in-tablature.ly}
+
+@cindex chord glissandi
+
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{chord-glissando-in-tablature.ly}
+
+@cindex hammer on
+@cindex pull off
+
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{hammer-on-and-pull-off.ly}
+
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{hammer-on-and-pull-off-using-voices.ly}
+
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{hammer-on-and-pull-off-using-chords.ly}
 
 @seealso
 Notation Reference:
-@ref{Stems}.
+@ref{Chord repetition},
+@ref{Glissando},
+@ref{Harmonics},
+@ref{Stems},
+@ref{Written-out repeats}.
 
 Snippets:
 @rlsr{Fretted strings}.
@@ -393,9 +491,7 @@ Internals Reference:
 @rinternals{TabVoice},
 @rinternals{Beam}.
 
-
 @knownissues
-
 Chords are not handled in a special way, and hence the automatic
 string selector may easily select the same string for two notes in
 a chord.
@@ -418,6 +514,7 @@ melodia = \partcombine { e4 g g g } { e4 e e e }
 
 Guitar special effects are limited to harmonics and slides.
 
+
 @node Custom tablatures
 @unnumberedsubsubsec Custom tablatures
 
@@ -430,31 +527,40 @@ Guitar special effects are limited to harmonics and slides.
 @cindex tablature, predefined string tunings
 @cindex fretted instruments, predefined string tunings
 @cindex predefined string tunings for fretted instruments
+@cindex tablature, violin
+@cindex tablature, viola
+@cindex tablature, cello
+@cindex tablature, bass
+@cindex tablature, double bass
 
-@funindex StringTunings
+@funindex stringTunings
 
-LilyPond tabulature automatically calculates the fret for
+LilyPond tablature 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, bass guitar and ukulele.  LilyPond automatically sets
+guitar, bass guitar, ukulele, violin, viola, cello, and double bass.
+LilyPond automatically sets
 the correct transposition for predefined tunings.  The following
 example is for bass guitar, which sounds an octave lower than
 written.
 
 @lilypond[quote,ragged-right,verbatim]
 <<
-  \new Staff {
+  \new Voice \with {
+    \omit StringNumber
+  } {
     \clef "bass_8"
     \relative c, {
       c4 d e f
     }
   }
-  \new TabStaff {
-    \set TabStaff.stringTunings = #bass-tuning
+  \new TabStaff \with {
+    stringTunings = #bass-tuning
+  } {
     \relative c, {
       c4 d e f
     }
@@ -466,30 +572,58 @@ 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}.  The predefined string tunings
-are found in @file{scm/tablature.scm}.
+are found in @file{ly/string-tunings-init.ly}.
+
+@funindex stringTuning
+@funindex \stringTuning
+@cindex tablature, custom string tunings
+@cindex custom string tunings
+
+Any desired string tuning can be created.  The
+@code{\stringTuning} function can be
+used to define a string tuning which can be used
+to set @code{stringTunings} for the current context.
+
+Its argument is a chord construct
+defining the pitches of each string in the tuning.
+The chord construct must be in absolute octave mode,
+see @ref{Absolute octave entry}.  The string
+with the highest number (generally the lowest string) must
+come first in the chord.  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'}:
 
-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.
+@lilypond[quote,verbatim]
 
-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.
+mynotes = {
+  c'4 e' g' c'' |
+  e''4 g'' b'' c'''
+}
 
-LilyPond automatically calculates the number of strings in the
-@code{TabStaff} as the number of elements in @code{stringTunings}.
+<<
+  \new Staff {
+    \clef treble
+    \mynotes
+  }
+  \new TabStaff {
+    \set Staff.stringTunings = \stringTuning <c' g' d'' a''>
+    \mynotes
+  }
+>>
+@end lilypond
 
-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'}:
+The @code{stringTunings} property is also used by
+@code{FretBoards} to calculate automatic fret diagrams.
 
+String tunings are used as part of the hash key
+for predefined fret diagrams
+(see @ref{Predefined fret diagrams}).
+
+The previous example could also be written as follows:
 
 @lilypond[quote,verbatim]
+custom-tuning = \stringTuning <c' g' d'' a''>
+
 mynotes = {
   c'4 e' g' c'' |
   e''4 g'' b'' c'''
@@ -501,12 +635,43 @@ mynotes = {
     \mynotes
   }
   \new TabStaff {
-    \set TabStaff.stringTunings = #'(21 14 7 0)
+    \set TabStaff.stringTunings = #custom-tuning
     \mynotes
   }
 >>
 @end lilypond
 
+Internally, 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 a LilyPond pitch
+object.  Pitch objects are created with the Scheme function
+@code{ly:make-pitch} (see @ref{Scheme functions}).
+
+@code{\stringTuning} creates such an object from chord input.
+
+LilyPond automatically calculates the number of lines in the
+@code{TabStaff} and the number of strings in an automatically
+calculated @code{FretBoard} as the number of elements
+in @code{stringTunings}.
+
+To let all TabStaff contexts use the same custom tuning by default,
+you can use
+
+@example
+\layout @{
+  \context @{
+    \TabStaff
+    stringTunings = \stringTuning <c' g' d'' a''>
+  @}
+@}
+@end example
+
+
 @cindex moderntab clef
 @cindex clef, moderntab
 @cindex clef, tab
@@ -527,7 +692,13 @@ A modern tab clef can also be used.
 The modern tab clef supports tablatures from 4 to 7 strings.
 
 @seealso
+Notation Reference:
+@ref{Absolute octave entry},
+@ref{Predefined fret diagrams},
+@ref{Scheme functions}.
+
 Installed Files:
+@file{ly/string-tunings-init.ly},
 @file{scm/tablature.scm}.
 
 Snippets:
@@ -541,6 +712,7 @@ Automatic tablature calculations do not work properly in most
 cases for instruments where string pitches do not vary
 monotonically with string number, such as ukuleles.
 
+
 @node Fret diagram markups
 @unnumberedsubsubsec Fret diagram markups
 
@@ -556,8 +728,9 @@ note.  The markup contains information about the desired fret
 diagram.  There are three different fret-diagram markup
 interfaces: standard, terse, and verbose.  The three interfaces
 produce equivalent markups, but have varying amounts of
-information in the markup string.  Details about the markup
-interfaces are found at @ref{Text markup commands}.
+information in the markup string.  Details about the
+syntax of the different markup strings used to define
+fret diagrams are found at @ref{Instrument Specific Markup}.
 
 The standard fret diagram markup string indicates the string
 number and the fret number for each dot to be placed on the string.
@@ -565,12 +738,12 @@ In addition, open and unplayed (muted) strings can be indicated.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       c1 d:m
     }
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <c e g c' e'>1^\markup {
       \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;"
@@ -589,12 +762,12 @@ the fret-diagram markup string.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
      \chordmode {
        f1 g
      }
   }
-  \context Staff {
+  \new Staff {
     \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;"
@@ -617,12 +790,12 @@ can be changed in the fret-diagram markup string.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
      \chordmode {
        f1 g
      }
   }
-  \context Staff {
+  \new Staff {
     \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;"
@@ -640,12 +813,12 @@ markup string.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       a1
     }
   }
-  \context Staff {
+  \new Staff {
     % An 'A' chord for ukulele
     a'1^\markup {
       \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;"
@@ -659,12 +832,12 @@ can be controlled by the fret-diagram markup string.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       c1 d:m
     }
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <c e g c' e'>1^\markup {
       \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;"
@@ -681,12 +854,12 @@ markup string.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       c1 d:m
     }
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <c e g c' e'>1^\markup {
       \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;"
@@ -711,12 +884,12 @@ Mute strings, open strings, and fret numbers can be indicated.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       c1 d:m
     }
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <c e g c' e'>1^\markup {
       \fret-diagram-terse #"x;3;2;o;1;o;"
@@ -732,12 +905,12 @@ Barre indicators can be included in the fret-diagram-terse markup string.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       f1 g
     }
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <f, c f a c' f'>1^\markup {
       \fret-diagram-terse #"1-(;3;3;2;1;1-);"
@@ -754,14 +927,13 @@ Fingering indications can be included in the fret-diagram-terse markup string.
 @c Need to use override to enable fingerings to show this -- can we do so?
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       c1 d:m
     }
   }
-  \context Staff {
-    \override Voice.TextScript
-      #'(fret-diagram-details finger-code) = #'below-string
+  \new Staff {
+    \override Voice.TextScript.fret-diagram-details.finger-code = #'below-string
     \clef "treble_8"
     <c e g c' e'>1^\markup {
       \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;"
@@ -773,8 +945,8 @@ Fingering indications can be included in the fret-diagram-terse markup string.
 >>
 @end lilypond
 
-Other fret diagram properties must be adjusted using @code{\override} when using
-the fret-diagram-terse markup.
+Other fret diagram properties must be adjusted using
+@code{\override} when using the fret-diagram-terse markup.
 
 @cindex fret-diagram-verbose markup
 @cindex capo
@@ -787,12 +959,12 @@ element of the list indicates an item to be placed on the fret diagram.
 
 @lilypond[quote, verbatim]
 <<
-    \context ChordNames {
+    \new ChordNames {
       \chordmode {
         c1 d:m
       }
     }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <c e g c' e'>1^\markup {
       \fret-diagram-verbose #'(
@@ -828,15 +1000,14 @@ capo will be the lowest fret in the fret diagram.
 @c \override is necessary to make fingering visible
 @lilypond[quote, verbatim]
 <<
-    \context ChordNames {
+    \new ChordNames {
       \chordmode {
         f1 g c
       }
     }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
-    \override Voice.TextScript
-      #'(fret-diagram-details finger-code) = #'below-string
+    \override Voice.TextScript.fret-diagram-details.finger-code = #'below-string
     <f, c f a c' f'>1^\markup {
       \fret-diagram-verbose #'(
         (place-fret 6 1)
@@ -858,7 +1029,7 @@ capo will be the lowest fret in the fret diagram.
         (place-fret 1 3 3)
       )
     }
-    <c e g c' e'>1^\markup {
+    <c g c' e' g'>1^\markup {
       \fret-diagram-verbose #'(
         (capo 3)
         (mute 6)
@@ -871,8 +1042,8 @@ capo will be the lowest fret in the fret diagram.
 >>
 @end lilypond
 
-All other fret diagram properties must be adjusted using @code{\override}
-when using the fret-diagram-verbose markup.
+All other fret diagram properties must be adjusted using
+@code{\override} when using the fret-diagram-verbose markup.
 
 @ignore
 The following example shows the three fret-diagram markup
@@ -923,21 +1094,22 @@ and color of dots.
 @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
+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}.
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {changing-fret-orientations.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {customizing-markup-fret-diagrams.ly}
 
 @seealso
 Notation Reference:
-@ref{Text markup commands}.
+@ref{Instrument Specific Markup}.
 
 Snippets:
 @rlsr{Fretted strings}.
@@ -949,9 +1121,9 @@ Internals Reference:
 @node Predefined fret diagrams
 @unnumberedsubsubsec Predefined fret diagrams
 
-
 @cindex fret diagrams
 @cindex fret diagrams, ukulele
+@cindex fret diagrams, mandolin
 @cindex chord diagrams
 
 @funindex FretBoards
@@ -963,7 +1135,7 @@ are stored in a lookup table:
 
 @lilypond[verbatim, ragged-right, quote]
 \include "predefined-guitar-fretboards.ly"
-\context FretBoards {
+\new FretBoards {
   \chordmode {
     c1 d
   }
@@ -980,7 +1152,7 @@ diagrams can be added for other instruments or other tunings
 by following the examples found in
 @file{predefined-guitar-fretboards.ly}.
 
-Fret diagrams for the ukulele are contained in the file
+Fret diagrams for the ukulele are contained in the file @*
 @file{predefined-ukulele-fretboards.ly}.
 
 @lilypond[verbatim, ragged-right, quote]
@@ -993,7 +1165,25 @@ myChords = \chordmode { a1 a:m a:aug }
 }
 
 \new FretBoards {
-  \set stringTunings = #ukulele-tuning
+  \set Staff.stringTunings = #ukulele-tuning
+  \myChords
+}
+@end lilypond
+
+Fret diagrams for the mandolin are contained in the file @*
+@file{predefined-mandolin-fretboards.ly}.
+
+@lilypond[verbatim, ragged-right, quote]
+\include "predefined-mandolin-fretboards.ly"
+
+myChords = \chordmode { c1 c:m7.5- c:aug }
+
+\new ChordNames {
+  \myChords
+}
+
+\new FretBoards {
+  \set Staff.stringTunings = #mandolin-tuning
   \myChords
 }
 @end lilypond
@@ -1004,7 +1194,7 @@ either as simultaneous music or using chord mode (see
 
 @lilypond[verbatim, ragged-right,quote]
 \include "predefined-guitar-fretboards.ly"
-\context FretBoards {
+\new FretBoards {
   \chordmode { c1 }
   <c' e' g'>1
 }
@@ -1028,10 +1218,10 @@ mychords = \chordmode{
 }
 
 <<
-  \context ChordNames {
+  \new ChordNames {
     \mychords
   }
-  \context FretBoards {
+  \new FretBoards {
     \mychords
   }
 >>
@@ -1055,10 +1245,10 @@ mychordlist = {
   \transpose c e { \mychords }
 }
 <<
-  \context ChordNames {
+  \new ChordNames {
     \mychordlist
   }
-  \context FretBoards {
+  \new FretBoards {
     \mychordlist
   }
 >>
@@ -1084,10 +1274,10 @@ mychords = \chordmode{
 }
 
 <<
-  \context ChordNames {
+  \new ChordNames {
     \mychords
   }
-  \context FretBoards {
+  \new FretBoards {
     \mychords
   }
 >>
@@ -1118,10 +1308,10 @@ mychords = \chordmode {
 }
 
 <<
-  \context ChordNames {
+  \new ChordNames {
     \mychords
   }
-  \context FretBoards {
+  \new FretBoards {
     \mychords
   }
 >>
@@ -1145,10 +1335,10 @@ mychords = \chordmode {
 }
 
 <<
-  \context ChordNames {
+  \new ChordNames {
     \mychords
   }
-  \context FretBoards {
+  \new FretBoards {
     \mychords
   }
 >>
@@ -1195,36 +1385,35 @@ mychords = \chordmode{
 }
 
 <<
-  \context ChordNames {
+  \new ChordNames {
     \mychords
   }
-  \context FretBoards {
+  \new FretBoards {
     \mychords
   }
 >>
 @end lilypond
 
 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
-predefined fret diagram, the interface properties belong to
-@code{FretBoards.FretBoard}.
+user preference through the properties of the
+@code{fret-diagram-interface}. Details are found at
+@rinternals{fret-diagram-interface}.  For a predefined fret diagram,
+the interface properties belong to @code{FretBoards.FretBoard}.
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {customizing-fretboard-fret-diagrams.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {defining-predefined-fretboards-for-other-instruments.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle,ragged-right]
 {chordchanges-for-fretboards.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {fretboards-alternate-tables.ly}
 
-
 @seealso
 Notation Reference:
 @ref{Custom tablatures},
@@ -1233,9 +1422,10 @@ Notation Reference:
 @ref{Predefined fretboard diagrams}.
 
 Installed Files:
-@file{ly/predefined-guitar-fretboards.ly},
-@file{ly/predefined-guitar-ninth-fretboards.ly},
-@file{ly/predefined-ukulele-fretboards.ly}.
+@file{ly/predefined-guitar-fretboards.ly}, @*
+@file{ly/predefined-guitar-ninth-fretboards.ly}, @*
+@file{ly/predefined-ukulele-fretboards.ly}, @*
+@file{ly/predefined-mandolin-fretboards.ly}.
 
 Snippets:
 @rlsr{Fretted strings}.
@@ -1259,16 +1449,16 @@ calculates strings and frets that can be used to play the notes.
 
 @lilypond[quote,ragged-right,verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       f1 g
     }
   }
-  \context FretBoards {
+  \new FretBoards {
     <f, c f a c' f'>1
     <g,\6 b, d g b g'>1
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <f, c f a c' f'>1
     <g, b, d g b' g'>1
@@ -1293,19 +1483,19 @@ commands:
                         #guitar-tuning
                         #"x;3-1-(;5-2;5-3;5-4;3-1-1-);"
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       c1 c c
     }
   }
-  \context FretBoards {
+  \new FretBoards {
     <c e g c' e'>1
     \predefinedFretboardsOff
     <c e g c' e'>1
     \predefinedFretboardsOn
     <c e g c' e'>1
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <c e g c' e'>1
     <c e g c' e'>1
@@ -1320,8 +1510,8 @@ Sometimes the fretboard calculator will be unable to find
 an acceptable 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.
+the notes will then be placed appropriately by the
+@code{FretBoards} context.
 
 @cindex fret diagrams, adding fingerings
 @cindex fingerings, adding to fret diagrams
@@ -1330,16 +1520,16 @@ Fingerings can be added to FretBoard fret diagrams.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       c1 d:m
     }
   }
-  \context FretBoards {
+  \new FretBoards {
     <c-3 e-2 g c'-1 e'>1
     <d a-2 d'-3 f'-1>1
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <c e g c' e'>1
     <d a d' f'>1
@@ -1355,17 +1545,17 @@ property.
 
 @lilypond[quote, verbatim]
 <<
-  \context ChordNames {
+  \new ChordNames {
     \chordmode {
       d1:m d:m
     }
   }
-  \context FretBoards {
+  \new FretBoards {
     <d a d' f'>1
     \set FretBoards.minimumFret = #5
     <d a d' f'>1
   }
-  \context Staff {
+  \new Staff {
     \clef "treble_8"
     <d a d' f'>1
     <d a d' f'>1
@@ -1379,9 +1569,10 @@ as in the TabStaff context.  See @ref{Custom tablatures} for
 information on the @code{stringTunings} property.
 
 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
-@code{FretBoards} fret diagram, the interface properties belong to
+user preference through the properties of the
+@code{fret-diagram-interface}. Details are found at
+@rinternals{fret-diagram-interface}.  For a @code{FretBoards} fret
+diagram, the interface properties belong to
 @code{FretBoards.FretBoard}.
 
 
@@ -1390,7 +1581,6 @@ Details are found at @rinternals{fret-diagram-interface}.  For a
 @code{\predefinedFretboardsOn}.
 @endpredefined
 
-
 @seealso
 Notation Reference:
 @ref{Custom tablatures}.
@@ -1416,40 +1606,38 @@ with non-monotonic tunings.
 @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,
-even when applied to a single note.
+Right-hand fingerings @var{p-i-m-a} must be entered using
+@code{\rightHandFinger} followed by a number.
 
-@warning{There @strong{must} be a hyphen before
-@code{@bs{}rightHandFinger} and a space before the closing @code{>}.}
+@warning{If the number is entered in Scheme notation, remember to append
+a space before following it with a closing @code{>} or similar.}
 
 @lilypond[quote,verbatim,relative=0]
 \clef "treble_8"
-<c-\rightHandFinger #1 >4
-<e-\rightHandFinger #2 >
-<g-\rightHandFinger #3 >
-<c-\rightHandFinger #4 >
-<c,-\rightHandFinger #1 e-\rightHandFinger #2
- g-\rightHandFinger #3 c-\rightHandFinger #4 >1
+c4\rightHandFinger #1
+e\rightHandFinger #2
+g\rightHandFinger #3
+c\rightHandFinger #4
+<c,\rightHandFinger #1 e\rightHandFinger #2
+ g\rightHandFinger #3 c\rightHandFinger #4 >1
 @end lilypond
 
 For convenience, you can abbreviate @code{\rightHandFinger} to something
 short, for example @code{RH},
 
 @example
-#(define RH rightHandFinger)
+RH=#rightHandFinger
 @end example
 
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {placement-of-right-hand-fingerings.ly}
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {fingerings,-string-indications,-and-right-hand-fingerings.ly}
 
-
 @seealso
 Snippets:
 @rlsr{Fretted strings}.
@@ -1489,13 +1677,12 @@ barring indications.
 \clef "treble_8"
 b16 d g b e
 \textSpannerDown
-\override TextSpanner #'(bound-details left text) = #"XII "
+\override TextSpanner.bound-details.left.text = #"XII "
 g16\startTextSpan
 b16 e g e b g\stopTextSpan
 e16 b g d
 @end lilypond
 
-
 @seealso
 Notation Reference:
 @ref{Text spanners}.
@@ -1520,7 +1707,7 @@ text markup.
 @lilypond[quote,ragged-right,verbatim]
 \relative c' {
   \clef "treble_8"
-  \override Staff.NoteHead #'style = #'harmonic-mixed
+  \override Staff.NoteHead.style = #'harmonic-mixed
   d^\markup { \italic { \fontsize #-2 { "harm. 12" }}} <g b>1
 }
 @end lilypond
@@ -1534,7 +1721,7 @@ music = \relative c' {
   < b\3 \deadNote d\2 b'\1 >
   < c\3 \deadNote e\2 c'\1 >
   \deadNotesOn
-  \times 2/3 { g8 b e }
+  \tuplet 3/2 { g8 b e }
   \deadNotesOff
   < a,\3 c\2 e\1 >1
 }
@@ -1683,15 +1870,20 @@ correct fret numbers for the fifth string:
 @c due to crazy intervals of banjo music, absolute pitch is recommended
 
 @lilypond[quote,ragged-right,verbatim]
-\new TabStaff <<
-  \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo
-  \set TabStaff.stringTunings = #banjo-open-g-tuning
-  {
-    \stemDown
-    g8 d' g'\5 a b g e d' |
-    g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
-    g4
+music = {
+  g8 d' g'\5 a b g e d' |
+  g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
+  g4
+}
+
+<<
+  \new Staff \with { \omit StringNumber }
+  { \clef "treble_8"  \music }
+  \new TabStaff \with {
+    tablatureFormat = #fret-number-tablature-format-banjo
+    stringTunings = #banjo-open-g-tuning
   }
+  { \music }
 >>
 @end lilypond
 
@@ -1704,22 +1896,21 @@ correct fret numbers for the fifth string:
 @funindex banjo-open-dm-tuning
 @funindex four-string-banjo
 
-A number of common tunings for banjo are predefined in LilyPond:
+A number of common tunings for the five-string banjo are predefined:
 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}
 (aDFAD).
 
-These tunings may be converted to four-string banjo tunings using the
+These may be converted to four-string tunings using the
 @code{four-string-banjo} function:
 
 @example
 \set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
 @end example
 
-
 @seealso
+Installed Files:
+@file{ly/string-tunings-init.ly}.
+
 Snippets:
 @rlsr{Fretted strings}.
-
-Installed Files:
-@file{scm/output-lib.scm} contains predefined banjo tunings.