]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/fretted-strings.itely
Doc: Couple of Typos and line break fixes
[lilypond.git] / Documentation / notation / fretted-strings.itely
index 90f126fb4521f5f78f2c379aaf43c62e1f79ec38..ab6f7ba54bf8efef7a46f751746da76180a9ae0b 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.13.36"
+@c \version "2.13.46"
 
 @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
@@ -251,10 +252,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
@@ -430,6 +432,11 @@ 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
 
@@ -440,7 +447,8 @@ 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 +474,96 @@ 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, 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]
+
+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'''
+}
 
-A string tuning is a Scheme list of string pitches,
+<<
+  \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 +577,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 strings 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 +611,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 +646,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 +864,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 +962,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 +1014,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 +1029,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}.
@@ -971,17 +1063,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"
@@ -1098,15 +1190,18 @@ mychords = \chordmode{
 @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
-a definition for the diagram.  The diagram definition can be either a
+you must specify the hash table for the diagram, the chord for the
+diagram, the tuning to be used, and
+a definition for the diagram.  Normally, the hash table will be
+@var{default-fret-table}.  The diagram definition can be either a
 fret-diagram-terse definition string or a fret-diagram-verbose
 marking list.
 
 @lilypond[verbatim, ragged-right, quote]
 \include "predefined-guitar-fretboards.ly"
 
-\storePredefinedDiagram #default-fret-table \chordmode { c:maj9 }
+\storePredefinedDiagram #default-fret-table
+                        \chordmode { c:maj9 }
                         #guitar-tuning
                         #"x;3-2;o;o;o;o;"
 
@@ -1132,7 +1227,8 @@ default octave are used for transposing fretboards.
 @lilypond[verbatim, ragged-right, quote]
 \include "predefined-guitar-fretboards.ly"
 
-\storePredefinedDiagram #default-fret-table \chordmode { c'' }
+\storePredefinedDiagram #default-fret-table
+                        \chordmode { c'' }
                         #guitar-tuning
                         #(offset-fret 2 (chord-shape 'bes guitar-tuning))
 
@@ -1177,10 +1273,12 @@ marking lists.
 
 % add some new chords based on the power chord shape
 
-\storePredefinedDiagram #default-fret-table \chordmode { f'' }
+\storePredefinedDiagram #default-fret-table
+                        \chordmode { f'' }
                         #guitar-tuning
                         #(chord-shape 'powerf guitar-tuning)
-\storePredefinedDiagram #default-fret-table \chordmode { g'' }
+\storePredefinedDiagram #default-fret-table
+                        \chordmode { g'' }
                         #guitar-tuning
                         #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
 
@@ -1199,10 +1297,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
 
@@ -1215,6 +1313,9 @@ predefined fret diagram, the interface properties belong to
 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {chordchanges-for-fretboards.ly}
 
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{fretboards-alternate-tables.ly}
+
 
 @seealso
 Notation Reference:
@@ -1224,8 +1325,9 @@ Notation Reference:
 @ref{Predefined fretboard diagrams}.
 
 Installed Files:
-@file{ly/@/predefined@/-guitar@/-fretboards@/.ly},
-@file{ly/@/predefined@/-guitar@/-ninth@/-fretboards@/.ly}.
+@file{ly/predefined-guitar-fretboards.ly},
+@file{ly/predefined-guitar-ninth-fretboards.ly},
+@file{ly/predefined-ukulele-fretboards.ly}.
 
 Snippets:
 @rlsr{Fretted strings}.
@@ -1278,7 +1380,8 @@ commands:
 
 @lilypond[quote,ragged-right,verbatim]
 
-\storePredefinedDiagram #default-fret-table <c e g c' e'>
+\storePredefinedDiagram #default-fret-table
+                        <c e g c' e'>
                         #guitar-tuning
                         #"x;3-1-(;5-2;5-3;5-4;3-1-1-);"
 <<
@@ -1309,8 +1412,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
@@ -1368,9 +1471,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}.
 
 
@@ -1711,4 +1815,4 @@ Snippets:
 @rlsr{Fretted strings}.
 
 Installed Files:
-@file{scm/@/output@/-lib@/.scm} contains predefined banjo tunings.
+@file{scm/output-lib.scm} contains predefined banjo tunings.