X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fnotation%2Ffretted-strings.itely;fp=Documentation%2Fnotation%2Ffretted-strings.itely;h=1f462c0d963cb4ceda316bb1fd94ed6095437db9;hb=e90f0536f9be39ada0bef0aeb0d275dec3b2fb5b;hp=0000000000000000000000000000000000000000;hpb=a8c9e8a7ca320ab0df5fd32e717fd62cd7635ce6;p=lilypond.git diff --git a/Documentation/notation/fretted-strings.itely b/Documentation/notation/fretted-strings.itely new file mode 100644 index 0000000000..1f462c0d96 --- /dev/null +++ b/Documentation/notation/fretted-strings.itely @@ -0,0 +1,1905 @@ +@c -*- coding: utf-8; mode: texinfo; -*- +@ignore + Translation of GIT committish: FILL-IN-HEAD-COMMITTISH + + When revising a translation, copy the HEAD committish of the + version that you are working on. For details, see the Contributors' + Guide, node Updating translation committishes.. +@end ignore + +@c \version "2.14.0" + +@node Fretted string instruments +@section Fretted string instruments + +@lilypondfile[quote]{fretted-headword.ly} + +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:: +* Guitar:: +* Banjo:: +@end menu + +@node Common notation for fretted strings +@subsection Common notation for fretted strings + +This section discusses common notation that is unique +to fretted string instruments. + +@menu +* References for fretted strings:: +* String number indications:: +* Default tablatures:: +* Custom tablatures:: +* Fret diagram markups:: +* Predefined fret diagrams:: +* Automatic fret diagrams:: +* Right-hand fingerings:: +@end menu + +@node 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 +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). +Some other elements pertinent to fretted string instruments +are covered elsewhere: + +@itemize +@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 +@ref{Ties}. + +@item Instructions for handling multiple voices can be found +in @ref{Collision resolution}. + +@item Instructions for indicating harmonics can be found in +@ref{Harmonics}. + +@end itemize + + +@seealso +Notation Reference: +@ref{Fingering instructions}, +@ref{Ties}, +@ref{Collision resolution}, +@ref{Instrument names}, +@ref{Writing music in parallel}, +@ref{Arpeggio}, +@ref{List of articulations}, +@ref{Clef}, +@ref{Instrument transpositions}. + + +@node String number indications +@unnumberedsubsubsec String number indications + +@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 +@code{<>}. + +@warning{String numbers @strong{must} be defined inside a chord +construct even if there is only a single note.} + +@lilypond[verbatim,quote,relative=0] +\clef "treble_8" +4 2 +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: + +@lilypond[verbatim,quote,relative=1] +\clef "treble_8" +2 + +@end lilypond + +@snippets + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{controlling-the-placement-of-chord-fingerings.ly} + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{allowing-fingerings-to-be-printed-inside-the-staff.ly} + + +@seealso +Notation Reference: +@ref{Fingering instructions}. + +Snippets: +@rlsr{Fretted strings}. + +Internals Reference: +@rinternals{StringNumber}, +@rinternals{Fingering}. + + +@node Default tablatures +@unnumberedsubsubsec Default tablatures + +@cindex tablatures, basic +@cindex tablatures, default + +@funindex TabStaff +@funindex TabVoice + +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 +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. + +@lilypond[quote,ragged-right,verbatim] +\new TabStaff \relative c' { + a,8 a' a + d,8 a' a +} +@end lilypond + +Default tablatures do not contain any symbols for tone duration nor any +other musical symbols such as e.g. expressive marks. + +@lilypond[quote,ragged-right,verbatim] +symbols = { + \time 3/4 + c4-.^"Allegro" d( e) + f4-.\f g a^\fermata + \mark \default + c8_.\<\( c16 c~ c2\! + c'2.\prall\) +} + +\score { + << + \new Staff { \clef "G_8" \symbols } + \new TabStaff { \symbols } + >> +} +@end lilypond + +@funindex \tabFullNotation + +If all musical symbols used in traditional notation should also show up +in tablature one has to apply the command @code{\tabFullNotation} in a +@code{TabStaff}-context. Please bear in mind that half notes are +double-stemmed in tablature in order to distinguish them from quarter +notes. + +@lilypond[quote,ragged-right,verbatim] +symbols = { + \time 3/4 + c4-.^"Allegro" d( e) + f4-.\f g a^\fermata + \mark \default + c8_.\<\( c16 c~ c2\! + c'2.\prall\) +} + +\score { + \new TabStaff { + \tabFullNotation + \symbols + } +} +@end lilypond + +@cindex fret + +@funindex minimumFret + +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. + + +@lilypond[quote,ragged-right,verbatim] +\new StaffGroup << + \new Staff \relative c { + \clef "treble_8" + \time 2/4 + c16 d e f g4 + c,16\5 d\5 e\4 f\4 g4\4 + c,16 d e f g4 + } + \new TabStaff \relative c { + c16 d e f g4 + c,16\5 d\5 e\4 f\4 g4\4 + \set TabStaff.minimumFret = #5 + c,16 d e f g4 + } +>> +@end lilypond + +@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. + +@lilypond[quote,verbatim] +\tabChordRepetition + +guitar = \relative c' { + r8 ~ q4 q8~ q q4 +} + +\new StaffGroup << + \new Staff { + \clef "treble_8" + \override Voice.StringNumber #'transparent = ##t + \guitar + } + \new TabStaff { + \guitar + } +>> +@end lilypond + + +Ties over a line break are parenthesized by default. The same holds for +the second alternative of a repeat. + +@lilypond[quote,ragged-right,verbatim] +ties = \relative c' { + \repeat volta 2 { + e2. f4~ + f2 g2~ + } + \alternative { + { g4 f2. } + { g4\repeatTie c,2. } + } + b1~ + \break + b1 + \bar "|." +} + +\score { + << + \new StaffGroup << + \context Staff { + \clef "treble_8" + \ties + } + \context TabStaff { + \ties + } + >> + >> + \layout { + indent = #0 + ragged-right = ##t + } +} +@end lilypond + +@funindex \hideSplitTiedTabNotes + +The command @code{\hideSplitTiedTabNotes} cancels the behavior of +engraving fret numbers in parentheses: + +@lilypond[quote,ragged-right,verbatim] +ties = \relative c' { + \repeat volta 2 { + e2. f4~ + f2 g2~ } + \alternative { + { g4 f2. } + { g4\repeatTie c,2. } + } + b1~ + \break + b1 + \bar "|." +} + +\score { + << + \new StaffGroup << + \context Staff { + \clef "treble_8" + \ties + } + \context TabStaff { + \hideSplitTiedTabNotes + \ties + } + >> + >> + \layout { + indent = #0 + ragged-right = ##t + } +} +@end lilypond + +@cindex harmonic indications in tablature notation +@cindex tablature and harmonic indications +@cindex slides in tablature notation +@cindex tablature and slides +@cindex chord glissandi +@funindex \harmonic +@funindex \harmonicByFret +@funindex \harmonicByRatio +@funindex \chordGlissando + +Harmonic indications can be added to tablature notation as sounding +pitches: + +@lilypond[verbatim,quote] +firstHarmonic = { + 4 + 4 + 2 +} +\score { + << + \new Staff { \firstHarmonic } + \new TabStaff { \firstHarmonic } + >> +} +@end lilypond + +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 2. +} +\score { + << + \new Staff { \fretHarmonics } + \new TabStaff { \fretHarmonics } + >> +} +@end lilypond + +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 4 + \harmonicByRatio #1/3 4 + \harmonicByRatio #1/4 { g8\3 b8\2 e'4\1 } +} +\score { + << + \new Staff { \ratioHarmonics } + \new TabStaff { \ratioHarmonics } + >> +} +@end lilypond + + +@snippets + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{stem-and-beam-behavior-in-tablature.ly} + +@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{Harmonics}, +@ref{Glissando}. + +Snippets: +@rlsr{Fretted strings}. + +Internals Reference: +@rinternals{TabNoteHead}, +@rinternals{TabStaff}, +@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. + +In order to handle @code{\partcombine}, a @code{TabStaff} must use +specially-created voices: + +@lilypond[quote,ragged-right,verbatim] +melodia = \partcombine { e4 g g g } { e4 e e e } +<< + \new TabStaff << + \new TabVoice = "one" s1 + \new TabVoice = "two" s1 + \new TabVoice = "shared" s1 + \new TabVoice = "solo" s1 + { \melodia } + >> +>> +@end lilypond + +Guitar special effects are limited to harmonics and slides. + +@node Custom tablatures +@unnumberedsubsubsec Custom tablatures + +@cindex tablatures, custom +@cindex tablature, banjo +@cindex tablature, mandolin +@cindex tablature, guitar +@cindex tablature, bass guitar +@cindex tablature, ukulele +@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 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, 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 { + \clef "bass_8" + \relative c, { + c4 d e f + } + } + \new TabStaff { + \set TabStaff.stringTunings = #bass-tuning + \relative c, { + c4 d e f + } + } +>> +@end lilypond + +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{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] + +mynotes = { + c'4 e' g' c'' | + e''4 g'' b'' c''' +} + +<< + \new Staff { + \clef treble + \mynotes + } + \new TabStaff { + \contextStringTuning #'custom-tuning + \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 + +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 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 = { + c'4 e' g' c'' | + e''4 g'' b'' c''' +} + +<< + \new Staff { + \clef treble + \mynotes + } + \new TabStaff { + \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 +@cindex tab clef + +A modern tab clef can also be used. + +@lilypond[quote,ragged-right,verbatim] +\new TabStaff { + \clef moderntab + 1 + \break + \clef tab + 1 +} +@end lilypond + +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-tuning-init.ly} +@file{scm/tablature.scm}. + +Snippets: +@rlsr{Fretted strings}. + +Internals Reference: +@rinternals{Tab_note_heads_engraver}. + +@knownissues +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 + +@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 +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 +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. +In addition, open and unplayed (muted) strings can be indicated. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + c1 d:m + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;" + } + 1^\markup { + \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-1;" + } + } +>> +@end lilypond + +@cindex barre indications + +Barre indications can be added to the diagram from +the fret-diagram markup string. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + f1 g + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;" + } + 1^\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 +@cindex ukulele + +@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. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + f1 g + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;" + } + 1^\markup { + \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;" + } + } +>> +@end lilypond + +The number of strings in a fret diagram can be changed to accommodate +different instruments such as banjos and ukuleles with the fret-diagram +markup string. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + a1 + } + } + \context Staff { + % An 'A' chord for ukulele + a'1^\markup { + \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;" + } + } +>> +@end lilypond + +Fingering indications can be added, and the location of fingering labels +can be controlled by the fret-diagram markup string. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + c1 d:m + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;" + } + 1^\markup { + \fret-diagram #"f:2;6-x;5-x;4-o;3-2-2;2-3-3;1-1-1;" + } + } +>> +@end lilypond + +Dot radius and dot position can be controlled with the fret-diagram +markup string. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + c1 d:m + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;" + } + 1^\markup { + \fret-diagram #"p:0.2;6-x;5-x;4-o;3-2;2-3;1-1;" + } + } +>> +@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 +highest string number and the last semicolon corresponds to the first string. +Mute strings, open strings, and fret numbers can be indicated. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + c1 d:m + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram-terse #"x;3;2;o;1;o;" + } + 1^\markup { + \fret-diagram-terse #"x;x;o;2;3;1;" + } + } +>> +@end lilypond + +Barre indicators can be included in the fret-diagram-terse markup string. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + f1 g + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram-terse #"1-(;3;3;2;1;1-);" + } + 1^\markup { + \fret-diagram-terse #"3-(;5;5;4;3;3-);" + } + } +>> +@end lilypond + +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 { + \chordmode { + c1 d:m + } + } + \context Staff { + \override Voice.TextScript + #'(fret-diagram-details finger-code) = #'below-string + \clef "treble_8" + 1^\markup { + \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" + } + 1^\markup { + \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;" + } + } +>> +@end lilypond + +Other fret diagram properties must be adjusted using +@code{\override} when using the fret-diagram-terse markup. + +@cindex fret-diagram-verbose markup +@cindex capo + +@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. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + c1 d:m + } + } + \context Staff { + \clef "treble_8" + 1^\markup { + \fret-diagram-verbose #'( + (mute 6) + (place-fret 5 3) + (place-fret 4 2) + (open 3) + (place-fret 2 1) + (open 1) + ) + } + 1^\markup { + \fret-diagram-verbose #'( + (mute 6) + (mute 5) + (open 4) + (place-fret 3 2) + (place-fret 2 3) + (place-fret 1 1) + ) + } + } +>> +@end lilypond + +Fingering indications and barres can be included in a +fret-diagram-verbose markup string. Unique to the +fret-diagram-verbose interface is a capo indication that +can be placed on the fret diagram. The capo indication is +a thick bar that covers all strings. The fret with the +capo will be the lowest fret in the fret diagram. + +@c \override is necessary to make fingering visible +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + f1 g c + } + } + \context Staff { + \clef "treble_8" + \override Voice.TextScript + #'(fret-diagram-details finger-code) = #'below-string + 1^\markup { + \fret-diagram-verbose #'( + (place-fret 6 1) + (place-fret 5 3) + (place-fret 4 3) + (place-fret 3 2) + (place-fret 2 1) + (place-fret 1 1) + (barre 6 1 1) + ) + } + 1^\markup { + \fret-diagram-verbose #'( + (place-fret 6 3 2) + (place-fret 5 2 1) + (open 4) + (open 3) + (open 2) + (place-fret 1 3 3) + ) + } + 1^\markup { + \fret-diagram-verbose #'( + (capo 3) + (mute 6) + (place-fret 4 5 1) + (place-fret 3 5 2) + (place-fret 2 5 3) + ) + } + } +>> +@end lilypond + +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 +interfaces, along with examples of common tweaks. For example, +the size of the verbose fret diagram is reduced to 0.75, and the +finger indications are specified to appear below the diagram. The +terse diagram includes tweaks to specify placement of finger code +and color of dots. + +@lilypond[verbatim,ragged-right,quote] +\new Voice { + \clef "treble_8" + d4^\markup { + \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;" + } + d4 d d + fis^\markup { + \override #'(size . 0.75) { + \override #'(finger-code . below-string) { + \fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2) + (place-fret 5 4 3) + (place-fret 4 4 4) + (place-fret 3 3 2) + (place-fret 2 2 1) + (place-fret 1 2 1)) + } + } + } + fis4 fis fis + c^\markup { + \override #'(dot-radius . 0.35) { + \override #'(finger-code . in-dot) { + \override #'(dot-color . white) { + \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);" + } + } + } + } + c4 c c +} +@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}. + +@snippets + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{changing-fret-orientations.ly} + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{customizing-markup-fret-diagrams.ly} + +@seealso +Notation Reference: +@ref{Instrument Specific Markup}. + +Snippets: +@rlsr{Fretted strings}. + +Internals Reference: +@rinternals{fret-diagram-interface}. + + +@node Predefined fret diagrams +@unnumberedsubsubsec Predefined fret diagrams + + +@cindex fret diagrams +@cindex fret diagrams, ukulele +@cindex fret diagrams, mandolin +@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: + +@lilypond[verbatim, ragged-right, quote] +\include "predefined-guitar-fretboards.ly" +\context FretBoards { + \chordmode { + c1 d + } +} +@end lilypond + +The default predefined fret diagrams are contained in the file +@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. +@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 +@file{predefined-guitar-fretboards.ly}. + +Fret diagrams for the ukulele are contained in the file +@file{predefined-ukulele-fretboards.ly}. + +@lilypond[verbatim, ragged-right, quote] +\include "predefined-ukulele-fretboards.ly" + +myChords = \chordmode { a1 a:m a:aug } + +\new ChordNames { + \myChords +} + +\new FretBoards { + \set 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 stringTunings = #mandolin-tuning + \myChords +} +@end lilypond + +Chord pitches can be entered +either as simultaneous music or using chord mode (see +@ref{Chord mode overview}). + +@lilypond[verbatim, ragged-right,quote] +\include "predefined-guitar-fretboards.ly" +\context FretBoards { + \chordmode { c1 } + 1 +} +@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. + +@lilypond[verbatim, ragged-right, quote] +\include "predefined-guitar-fretboards.ly" +mychords = \chordmode{ + c1 f g +} + +<< + \context ChordNames { + \mychords + } + \context FretBoards { + \mychords + } +>> +@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. + +@lilypond[verbatim, ragged-right, quote] +\include "predefined-guitar-fretboards.ly" +mychords = \chordmode{ + c1 f g +} + +mychordlist = { + \mychords + \transpose c e { \mychords } +} +<< + \context ChordNames { + \mychordlist + } + \context FretBoards { + \mychordlist + } +>> +@end lilypond + + +The predefined fret diagram table for guitar contains eight chords (major, minor, +augmented, diminished, dominant seventh, major seventh, minor seventh, dominant ninth) +for each of 17 keys. +The predefined fret diagram table for ukulele contains these chords +plus an additional three chords (major sixth, suspended second, and +suspended fourth). +A complete list of the predefined fret diagrams is +shown in @ref{Predefined fretboard diagrams}. If there is no entry in +the table for a chord, the FretBoards engraver will calculate a +fret-diagram using the automatic fret diagram functionality described in +@ref{Automatic fret diagrams}. + +@lilypond[verbatim, ragged-right, quote] +\include "predefined-guitar-fretboards.ly" +mychords = \chordmode{ + c1 c:maj9 +} + +<< + \context ChordNames { + \mychords + } + \context FretBoards { + \mychords + } +>> +@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 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 } + #guitar-tuning + #"x;3-2;o;o;o;o;" + +mychords = \chordmode { + c1 c:maj9 +} + +<< + \context ChordNames { + \mychords + } + \context FretBoards { + \mychords + } +>> +@end lilypond + +Different fret diagrams for the same chord name can be stored using different +octaves of pitches. The different octave should be at least two octaves +above or below the default octave, because the octaves above and below the +default octave are used for transposing fretboards. + +@lilypond[verbatim, ragged-right, quote] +\include "predefined-guitar-fretboards.ly" + +\storePredefinedDiagram #default-fret-table + \chordmode { c'' } + #guitar-tuning + #(offset-fret 2 (chord-shape 'bes guitar-tuning)) + +mychords = \chordmode { + c1 c'' +} + +<< + \context ChordNames { + \mychords + } + \context FretBoards { + \mychords + } +>> +@end lilypond + +@cindex fretted instruments, chord shapes +@cindex chord shapes for fretted instruments + +@funindex \addChordShape +@funindex addChordShape +@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 positions to provide different chords. Chord +shapes can be added to the internal list and then used to define +predefined fret diagrams. Because they can be moved to various +positions on the neck, chord shapes will normally not contain +any open strings. Like fret diagrams, chord shapes can be +entered as either fret-diagram-terse strings or fret-diagram-verbose +marking lists. + +@lilypond[verbatim, ragged-right, quote] +\include "predefined-guitar-fretboards.ly" + +% Add a new chord shape + +\addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;" + +% add some new chords based on the power chord shape + +\storePredefinedDiagram #default-fret-table + \chordmode { f'' } + #guitar-tuning + #(chord-shape 'powerf guitar-tuning) +\storePredefinedDiagram #default-fret-table + \chordmode { g'' } + #guitar-tuning + #(offset-fret 2 (chord-shape 'powerf guitar-tuning)) + +mychords = \chordmode{ + f1 f'' g g'' +} + +<< + \context ChordNames { + \mychords + } + \context 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}. + +@snippets + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{customizing-fretboard-fret-diagrams.ly} + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{defining-predefined-fretboards-for-other-instruments.ly} + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{chordchanges-for-fretboards.ly} + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{fretboards-alternate-tables.ly} + + +@seealso +Notation Reference: +@ref{Custom tablatures}, +@ref{Automatic fret diagrams}, +@ref{Chord mode overview}, +@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-mandolin-fretboards.ly}. + +Snippets: +@rlsr{Fretted strings}. + +Internals Reference: +@rinternals {fret-diagram-interface}. + + +@node Automatic fret 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 +the entered notes in the active @code{stringTunings}, this context +calculates strings and frets that can be used to play the notes. + +@lilypond[quote,ragged-right,verbatim] +<< + \context ChordNames { + \chordmode { + f1 g + } + } + \context FretBoards { + 1 + 1 + } + \context Staff { + \clef "treble_8" + 1 + 1 + } +>> +@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 +commands: + +@lilypond[quote,ragged-right,verbatim] + +\storePredefinedDiagram #default-fret-table + + #guitar-tuning + #"x;3-1-(;5-2;5-3;5-4;3-1-1-);" +<< + \context ChordNames { + \chordmode { + c1 c c + } + } + \context FretBoards { + 1 + \predefinedFretboardsOff + 1 + \predefinedFretboardsOn + 1 + } + \context Staff { + \clef "treble_8" + 1 + 1 + 1 + } +>> +@end lilypond + + + +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. + +@cindex fret diagrams, adding fingerings +@cindex fingerings, adding to fret diagrams + +Fingerings can be added to FretBoard fret diagrams. + +@lilypond[quote, verbatim] +<< + \context ChordNames { + \chordmode { + c1 d:m + } + } + \context FretBoards { + 1 + 1 + } + \context Staff { + \clef "treble_8" + 1 + 1 + } +>> +@end lilypond + +@funindex minimumFret + +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 { + 1 + \set FretBoards.minimumFret = #5 + 1 + } + \context Staff { + \clef "treble_8" + 1 + 1 + } +>> +@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 +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 +@code{FretBoards.FretBoard}. + + +@predefined +@code{\predefinedFretboardsOff}, +@code{\predefinedFretboardsOn}. +@endpredefined + + +@seealso +Notation Reference: +@ref{Custom tablatures}. + +Snippets: +@rlsr{Fretted strings}. + +Internals Reference: +@rinternals {fret-diagram-interface}. + +@knownissues +Automatic fretboard calculations do not work properly for instruments +with non-monotonic tunings. + + +@node 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, +even when applied to a single note. + +@warning{There @strong{must} be a hyphen before +@code{@bs{}rightHandFinger} and a space before the closing @code{>}.} + +@lilypond[quote,verbatim,relative=0] +\clef "treble_8" +4 + + + +1 +@end lilypond + +For convenience, you can abbreviate @code{\rightHandFinger} to something +short, for example @code{RH}, + +@example +#(define RH rightHandFinger) +@end example + + +@snippets + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{placement-of-right-hand-fingerings.ly} + +@lilypondfile[verbatim,lilyquote,texidoc,doctitle] +{fingerings,-string-indications,-and-right-hand-fingerings.ly} + + +@seealso +Snippets: +@rlsr{Fretted strings}. + +Internals Reference: +@rinternals{StrokeFinger}. + + +@node Guitar +@subsection Guitar + +Most of the notational issues associated with guitar music are +covered sufficiently in the general fretted strings section, but there +are a few more worth covering here. Occasionally users want to +create songbook-type documents having only lyrics with chord +indications above them. Since LilyPond is a music typesetter, +it is not recommended for documents that have no music notation +in them. A better alternative is a word processor, text editor, +or, for experienced users, a typesetter like GuitarTeX. + +@menu +* Indicating position and barring:: +* Indicating harmonics and dampened notes:: +* Indicating power chords:: +@end menu + +@node 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. + +@lilypond[quote,ragged-right,verbatim,relative=0] +\clef "treble_8" +b16 d g b e +\textSpannerDown +\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}. + +Snippets: +@rlsr{Fretted strings}, +@rlsr{Expressive marks}. + + +@node 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 +text markup. + +@lilypond[quote,ragged-right,verbatim] +\relative c' { + \clef "treble_8" + \override Staff.NoteHead #'style = #'harmonic-mixed + d^\markup { \italic { \fontsize #-2 { "harm. 12" }}} 1 +} +@end lilypond + +Dampened notes (also called @notation{dead notes}) are supported +within normal and tablature staves: + +@lilypond[quote,ragged-right,verbatim] +music = \relative c' { + < a\3 \deadNote c\2 a'\1 >4 + < b\3 \deadNote d\2 b'\1 > + < c\3 \deadNote e\2 c'\1 > + \deadNotesOn + \times 2/3 { g8 b e } + \deadNotesOff + < a,\3 c\2 e\1 >1 +} +\new StaffGroup << + \new Staff { + \clef "treble_8" + \music + } + \new TabStaff { + \music + } +>> +@end lilypond + +Another playing technique (especially used on electric guitars) is +called @notation{palm mute}. The string is hereby partly muted by the +palm of the striking hand (hence the name). Lilypond supports +the notation of palm mute-style notes by changing the note head to a +triangle shape. + +@lilypond[quote,ragged-right,verbatim] +\new Voice { % Warning: explicit Voice instantiation is + % required to have palmMuteOff work properly + % when palmMuteOn comes at the beginning of + % the piece. + \relative c, { + \clef "G_8" + \palmMuteOn + e8^\markup { \musicglyph #"noteheads.u2do" = palm mute } + < e b' e > e + \palmMuteOff + e e \palmMute e e e | + e8 \palmMute { e e e } e e e e | + < \palmMute e b' e >8 \palmMute { e e e } < \palmMute e b' e >2 + } +} +@end lilypond + +@seealso +Snippets: +@rlsr{Fretted strings}. + +Notation Reference: +@ref{Special note heads}, +@ref{Note head styles}. + + +@node Indicating power chords +@unnumberedsubsubsec Indicating power chords + +@funindex powerChords +@funindex \powerChords + +@cindex power chords +@cindex chords, power + +Power chords and their symbols can be engraved in chord mode or as chord +constructs: + +@lilypond[quote,ragged-right,verbatim] +ChordsAndSymbols = { + \chordmode { + \powerChords + e,,1:1.5 + a,,1:1.5.8 + \set minimumFret = #8 + c,1:1.5 + f,1:1.5.8 + } + \set minimumFret = #5 + 1 + 1 +} +\score { + << + \new ChordNames { + \ChordsAndSymbols + } + \new Staff { + \clef "treble_8" + \ChordsAndSymbols + } + \new TabStaff { + \ChordsAndSymbols + } + >> +} +@end lilypond + +Power chord symbols are automatically switched off as soon as one of the +other common chord modifier is used: + +@lilypond[quote,ragged-right,verbatim] +mixedChords = \chordmode { + c,1 + \powerChords + b,,1:1.5 + fis,,1:1.5.8 + g,,1:m +} +\score { + << + \new ChordNames { + \mixedChords + } + \new Staff { + \clef "treble_8" + \mixedChords + } + \new TabStaff { + \mixedChords + } + >> +} +@end lilypond + +@seealso +Music Glossary: +@rglos{power chord}. + +Notation Reference: +@ref{Extended and altered chords}, +@ref{Printing chord names}. + +Snippets: +@rlsr{Fretted strings}. + + +@node Banjo +@subsection Banjo + +@menu +* Banjo tablatures:: +@end menu + +@node 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 +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 + } +>> +@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} +(aDFAD). + +These tunings may be converted to four-string banjo tunings using the +@code{four-string-banjo} function: + +@example +\set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning) +@end example + + +@seealso +Snippets: +@rlsr{Fretted strings}. + +Installed Files: +@file{scm/string-tunings-init.scm} contains predefined banjo tunings.