]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/fretted-strings.itely
Docs: run convert-ly for 2.14.0.
[lilypond.git] / Documentation / notation / fretted-strings.itely
index 0b0c9549c1baeaa594191f33c499bb5c591674b8..5b4feef54573b2e918b51957e4d09d72713617a2 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.13.36"
+@c \version "2.14.0"
 
 @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
@@ -152,12 +153,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.
@@ -251,10 +255,11 @@ minimumFret is 0.
 
 @funindex \tabChordRepetition
 
-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}. 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.
 
 @lilypond[quote,verbatim]
 \tabChordRepetition
@@ -358,15 +363,63 @@ ties = \relative c' {
 @cindex tablature and harmonic indications
 @cindex slides in tablature notation
 @cindex tablature and slides
+@cindex chord glissandi
+@funindex \harmonic
+@funindex \harmonicByFret
+@funindex \harmonicByRatio
+
+Harmonic indications can be added to tablature notation as sounding
+pitches:
+
+@lilypond[verbatim,quote]
+firstHarmonic = {
+  <d'\4\harmonic>4
+  <g'\3\harmonic>4
+  <b'\2\harmonic>2
+}
+\score {
+  <<
+    \new Staff { \firstHarmonic }
+    \new TabStaff { \firstHarmonic }
+  >>
+}
+@end lilypond
 
-Harmonic indications and slides can be added to tablature
-notation.
+Note that the command @code{\harmonic} must always be defined
+inside a chord construct. 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 { \fretHarmonics }
+    \new TabStaff { \fretHarmonics }
+  >>
+}
+@end lilypond
 
-@lilypond[verbatim, quote, relative=1]
-\new TabStaff {
-  \new TabVoice {
-    <c g'\harmonic>4 d\2\glissando e\2
-  }
+Alternatively, harmonics can be computed by defining the ratio of
+string lengths above and below the harmonic fingering.
+
+@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 { \ratioHarmonics }
+    \new TabStaff { \ratioHarmonics }
+  >>
 }
 @end lilypond
 
@@ -379,10 +432,24 @@ notation.
 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {polyphony-in-tablature.ly}
 
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{open-string-harmonics-in-tablature.ly}
+
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{fretted-string-harmonics-in-tablature.ly}
+
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{slides-in-tablature.ly}
+
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{chord-glissando-in-tablature.ly}
+
 
 @seealso
 Notation Reference:
-@ref{Stems}.
+@ref{Stems},
+@ref{Harmonics},
+@ref{Glissando}.
 
 Snippets:
 @rlsr{Fretted strings}.
@@ -430,17 +497,23 @@ 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
 
-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.
@@ -466,28 +539,97 @@ 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 @code{scm/tablature.scm}.
+are found in @file{ly/string-tuning-init.ly}.
+
+@funindex contextStringTunings
+@funindex \contextStringTunings
+@cindex tablature, custom string tunings
+@cindex custom string tunings
+
+Any desired string tuning can be created.  The
+@code{\contextStringTuning} function can be
+used to define a string tuning and set it as the
+@code{stringTunings} for the current context.
+@code{\contextStringTuning} takes two arguments: the
+symbol in which the string tuning will be stored,
+and a chord construct
+that defines 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'}:
+
+@lilypond[quote,verbatim]
 
-A string tuning is a Scheme list of string pitches,
+mynotes = {
+  c'4 e' g' c'' |
+  e''4 g'' b'' c'''
+}
+
+<<
+  \new Staff {
+    \clef treble
+    \mynotes
+  }
+  \new TabStaff {
+    \contextStringTuning #'custom-tuning <c' g' d'' a''>
+    \mynotes
+  }
+>>
+@end lilypond
+
+The @code{stringTunings} property is also used by
+@code{FretBoards} to calculate automatic fret diagrams.
+
+@funindex makeStringTuning
+@funindex \makeStringTuning
+
+String tunings are used as part of the hash key
+for predefined fret diagrams
+(see @ref{Predefined fret diagrams}).  The @code{\makeStringTuning}
+function is used to create a string tuning without setting the
+@code{stringTunings} property in the current context.  The
+arguments to @code{\makeStringTuning} are the symbol to be
+used for the new string tuning and a chord construct used
+to define the tuning.
+The previous example could also be written as follows:
+
+@lilypond[quote,verbatim]
+\makeStringTuning #'custom-tuning <c' g' d'' a''>
+
+mynotes = {
+  c'4 e' g' c'' |
+  e''4 g'' b'' c'''
+}
+
+<<
+  \new Staff {
+    \clef treble
+    \mynotes
+  }
+  \new TabStaff {
+    \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 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'}:
+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}).
 
+If desired, a string tuning can be created as a Scheme
+literal.  The example below recreates the examples above,
+but the string tuning is not saved as a separate object:
 
 @lilypond[quote,verbatim]
 mynotes = {
@@ -501,12 +643,20 @@ mynotes = {
     \mynotes
   }
   \new TabStaff {
-    \set TabStaff.stringTunings = #'(21 14 7 0)
+    \set TabStaff.stringTunings = #`(,(ly:make-pitch 1 5 0)
+                                    ,(ly:make-pitch 1 1 0)
+                                    ,(ly:make-pitch 0 4 0)
+                                    ,(ly:make-pitch 0 0 0))
     \mynotes
   }
 >>
 @end lilypond
 
+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}.
+
 @cindex moderntab clef
 @cindex clef, moderntab
 @cindex clef, tab
@@ -527,8 +677,14 @@ 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{scm/@/tablature@/.scm}.
+@file{ly/string-tuning-init.ly}
+@file{scm/tablature.scm}.
 
 Snippets:
 @rlsr{Fretted strings}.
@@ -556,8 +712,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.
@@ -773,8 +930,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
@@ -871,8 +1028,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,8 +1080,9 @@ 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
@@ -937,7 +1095,7 @@ markup, the interface properties belong to @code{Voice.TextScript}.
 
 @seealso
 Notation Reference:
-@ref{Text markup commands}.
+@ref{Instrument Specific Markup}.
 
 Snippets:
 @rlsr{Fretted strings}.
@@ -952,6 +1110,7 @@ Internals Reference:
 
 @cindex fret diagrams
 @cindex fret diagrams, ukulele
+@cindex fret diagrams, mandolin
 @cindex chord diagrams
 
 @funindex FretBoards
@@ -971,17 +1130,17 @@ are stored in a lookup table:
 @end lilypond
 
 The default predefined fret diagrams are contained in the file
-@code{predefined-guitar-fretboards.ly}.  Fret diagrams are
+@file{predefined-guitar-fretboards.ly}.  Fret diagrams are
 stored based on the pitches of a chord and the value of
 @code{stringTunings} that is currently in use.
-@code{predefined-guitar-fretboards.ly} contains predefined
+@file{predefined-guitar-fretboards.ly} contains predefined
 fret diagrams only for @code{guitar-tuning}.  Predefined fret
 diagrams can be added for other instruments or other tunings
 by following the examples found in
-@code{predefined-guitar-fretboards.ly}.
+@file{predefined-guitar-fretboards.ly}.
 
 Fret diagrams for the ukulele are contained in the file
-@code{predefined-ukulele-fretboards.ly}.
+@file{predefined-ukulele-fretboards.ly}.
 
 @lilypond[verbatim, ragged-right, quote]
 \include "predefined-ukulele-fretboards.ly"
@@ -998,6 +1157,24 @@ myChords = \chordmode { a1 a:m a:aug }
 }
 @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 stringTunings = #mandolin-tuning
+  \myChords
+}
+@end lilypond
+
 Chord pitches can be entered
 either as simultaneous music or using chord mode (see
 @ref{Chord mode overview}).
@@ -1205,10 +1382,10 @@ mychords = \chordmode{
 @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
 
@@ -1233,9 +1410,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}.
@@ -1320,8 +1498,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
@@ -1379,9 +1557,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}.
 
 
@@ -1722,4 +1901,4 @@ Snippets:
 @rlsr{Fretted strings}.
 
 Installed Files:
-@file{scm/@/output@/-lib@/.scm} contains predefined banjo tunings.
+@file{scm/string-tunings-init.scm} contains predefined banjo tunings.