]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/fretted-strings.itely
Update from Jonathan.
[lilypond.git] / Documentation / user / fretted-strings.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
5     When revising a translation, copy the HEAD committish of the
6     version that you are working on.  See TRANSLATION for details.
7 @end ignore
8
9 @c \version "2.11.38"
10
11 @node Fretted string instruments
12 @section Fretted string instruments
13
14 @cindex tablature
15 @cindex guitar tablature
16
17 @menu
18 * Common notation for fretted strings::
19 * Guitar::
20 * Banjo::
21 @end menu
22
23 @node Common notation for fretted strings
24 @subsection Common notation for fretted strings
25
26 @menu
27 * References for fretted strings::
28 * String number indications::
29 * Default tablatures::
30 * Custom tablatures::
31 * Fret diagrams::
32 * Right hand fingerings::
33 @end menu
34
35 @node References for fretted strings
36 @subsubsection References for fretted strings
37
38 @c TODO Add refs
39 TBC
40
41 @node String number indications
42 @subsubsection String number indications
43
44 @cindex String numbers
45
46 The string on which a note should be played may be indicated by
47 appending @code{\}@tie{}@var{number} to a note inside a chord.
48
49 @warning{String numbers @strong{must} be defined inside a chord,
50 even if there is only a single note in the chord.}
51
52 @lilypond[verbatim,quote,relative=2]
53 <c\5>4 <e\4> <g\3>2
54 <c,\5 e\4 g\3>1
55 @end lilypond
56
57
58 @ignore
59 In notation for fretted stringed instruments, the string on which
60 a note should be played is indicated by a circled number, and this
61 is added with @code{\}@var{number} inside a chord construct.  The 
62 string indication must occur within a @code{<>} chord construct for it to
63 be printed in the score, even if it is a single note.  If the 
64 @code{\}@var{number} is placed outside the @code{<>}, it will not generate
65 errors but also will not print the string indication.  
66
67 @warning{rhythmic durations must be specified outside of the
68 chords.}
69 example, @code{<c\5>4} will produce a quarter-note C on the fifth
70 string.
71 @end ignore
72
73 Although fingering is covered in detail elsewhere, it is worth noting
74 here how fingerings and string indications behave together, since
75 guitar music often incorporates both at once.  The usual convention
76 is to place the fingering closest to the note, then the string 
77 indication outside the fingering.  This is controlled by the order in 
78 which the two items appear:
79
80 @lilypond[verbatim,quote,relative=2]
81 <g\3-0>2
82 <g-0\3>
83 @end lilypond
84
85 @snippets
86
87 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
88 {controlling-the-placement-of-chord-fingerings.ly}
89
90 @seealso
91
92 Internals Reference: @rinternals{StringNumber},
93 @c @lsr{guitar/,string-number.ly}.
94
95
96 @node Default tablatures
97 @subsubsection Default tablatures
98 @cindex Tablatures, basic
99 @cindex Tablatures, default
100
101 Tablature notation is used for notating music for plucked string
102 instruments.  Pitches are not denoted with note heads, but by
103 numbers indicating on which string and fret a note must be played.  
104 LilyPond offers limited support for tablature.
105
106 The string number associated to a note is given as a backslash
107 followed by a number, e.g., @code{c4\3} for a C quarter on the third
108 string.  By default, string 1 is the highest one, and the tuning
109 defaults to the standard guitar tuning (with 6 strings).  The notes
110 are printed as tablature, by using @rinternals{TabStaff} and
111 @rinternals{TabVoice} contexts
112
113 @lilypond[quote,ragged-right,fragment,verbatim]
114 \new TabStaff {
115   a,4\5 c'\2 a\3 e'\1
116   e\4 c'\2 a\3 e'\1
117 }
118 @end lilypond
119
120 @funindex minimumFret
121 @cindex fret
122
123 When no string is specified, the first string that does not give a
124 fret number less than @code{minimumFret} is selected.  The default
125 value for @code{minimumFret} is 0
126
127
128 @example
129 e16 fis gis a b4
130 \set TabStaff.minimumFret = #8
131 e16 fis gis a b4
132 @end example
133 @lilypond[quote,ragged-right]
134 frag = {
135   \key e \major
136   e16 fis gis a b4
137   \set TabStaff.minimumFret = #8
138   e16 fis gis a b4
139 }
140   \new StaffGroup <<
141     \new Staff { \clef "G_8" \frag }
142     \new TabStaff { \frag }
143   >>
144 @end lilypond
145
146
147 @snippets
148
149 To print tablatures with stems down and horizontal beams,
150 initialize the @code{TabStaff} with this code:
151
152 @example
153 \stemDown
154 \override Beam #'damping = #100000
155 @end example
156
157 @seealso
158
159 Internals Reference: @rinternals{TabNoteHead}, @rinternals{TabStaff}, @rinternals{TabVoice}.
160
161 @knownissues
162
163 Chords are not handled in a special way, and hence the automatic
164 string selector may easily select the same string to two notes in a
165 chord.
166
167 In order to handle @code{\partcombine}, a @code{TabStaff} must use
168 specially-created voices:
169
170 @lilypond[quote,ragged-right,verbatim]
171 melodia = \partcombine { e4 g g g }{ e4 e e e }
172 <<
173   \new TabStaff <<
174     \new TabVoice = "one" s1
175     \new TabVoice = "two" s1
176     \new TabVoice = "shared" s1
177     \new TabVoice = "solo" s1
178     { \melodia }
179   >>
180 >>
181 @end lilypond
182
183
184 @node Custom tablatures
185 @subsubsection Custom tablatures
186 @cindex Tablatures, custom
187
188 You can change the tuning of the strings.  A string tuning is given as
189 a Scheme list with one integer number for each string, the number
190 being the pitch (measured in semitones relative to middle C) of an
191 open string.  The numbers specified for @code{stringTunings} are the
192 numbers of semitones to subtract or add, starting the specified pitch
193 by default middle C, in string order.  LilyPond automatically calculates
194 the number of strings by looking at @code{stringTunings}.
195
196 In the next example,
197 @code{stringTunings} is set for the pitches e, a, d, and g
198
199 @lilypond[quote,ragged-right,fragment,verbatim]
200 \new TabStaff <<
201   \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
202   {
203     a,4 c' a e' e c' a e'
204   }
205 >>
206 @end lilypond
207
208 LilyPond comes with predefined string tunings for banjo, mandolin, guitar
209 and bass guitar.
210
211 @example
212 \set TabStaff.stringTunings = #bass-tuning
213 @end example
214
215 The default string tuning is @code{guitar-tuning} (the standard EADGBE
216 tuning).
217 Some other predefined tunings are @code{guitar-open-g-tuning},
218 @code{mandolin-tuning} and @code{banjo-open-g-tuning}.
219
220 @seealso
221
222 The file @file{scm/@/output@/-lib@/.scm} contains the predefined string
223 tunings.
224 Internals Reference: @rinternals{Tab_note_heads_engraver}.
225
226 @knownissues
227
228 No guitar special effects have been implemented.
229
230
231
232 @node Fret diagrams
233 @subsubsection Fret diagrams
234 @cindex fret diagrams
235 @cindex chord diagrams
236
237 Fret diagrams can be added to music as a markup to the desired note.  
238 The markup contains information about the desired fret diagram.
239 There are three different fret-diagram markup interfaces: standard, terse,
240 and verbose.  The three interfaces produce equivalent markups, but have
241 varying amounts of information in the markup string.  Details about the
242 markup interfaces are found at @ref{Text markup commands}.
243
244 The following example shows the three fret-diagram markup interfaces,
245 along with examples of common tweaks.  For example, the size of the verbose
246 fret diagram is reduced to 0.75, and the finger indications are specified
247 to appear below the diagram.  The terse diagram includes tweaks to 
248 specify placement of finger code and color of dots.
249
250 @lilypond[verbatim, ragged-right, quote]
251 \new Voice {
252   d'^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
253   d' d' d'
254   fis'^\markup \override #'(size . 0.75) {
255     \override #'(finger-code . below-string) {
256       \fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2)
257                                (place-fret 5 4 3) 
258                                (place-fret 4 4 4)
259                                (place-fret 3 3 2) 
260                                (place-fret 2 2 1)
261                                (place-fret 1 2 1))
262     }
263   }
264   fis' fis' fis'
265   c'^\markup \override #'(dot-radius . 0.35) {
266     \override #'(finger-code . in-dot) {
267       \override #'(dot-color . white) {
268         \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"
269       }
270     }
271   }
272   c' c' c'
273 }
274 @end lilypond
275
276 You can set a number of graphical properties according to your preference.
277 Details about the property interface to fret diagrams are found at
278 @rinternals{fret-diagram-interface}.
279
280
281 @seealso
282
283
284
285 @node Right hand fingerings
286 @subsubsection Right hand fingerings
287
288 Right-hand fingerings @var{p-i-m-a} can be entered using 
289 @code{<@var{note}-\rightHandFinger @var{finger} >}.
290 The right-hand fingering indication must occur within a @code{<>} chord 
291 construct for it to be printed in the score, even if it is a single note.  
292 There must be a hyphen after the note and the space
293 before the closing @code{>}.
294
295
296 @lilypond[quote,ragged-right,fragment,verbatim]
297 \relative c' {
298   <c-\rightHandFinger #1 >4 
299   <e-\rightHandFinger #2 > 
300   <g-\rightHandFinger #3 > 
301   <c-\rightHandFinger #4 >
302   <c,-\rightHandFinger #1 e-\rightHandFinger #2 g-\rightHandFinger #3 c-\rightHandFinger #4 >1
303 }
304 @end lilypond
305
306 for brevity, you can abbreviate @code{\rightHandFinger} to something
307 short, for example @code{RH},
308
309 @example
310 #(define RH rightHandFinger)
311 @end example
312
313 @cindex fingerings, right hand, for guitar
314 @cindex right hand fingerings for guitar
315
316 @snippets
317
318 You may exercise greater control over the placement of right-hand 
319 fingerings by setting @code{strokeFingerOrientations},
320
321 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
322 #(define RH rightHandFinger)
323 {
324   \set strokeFingerOrientations = #'(up down)
325   <c-\RH #1 es-\RH #2 g-\RH #4 > 4
326   \set strokeFingerOrientations = #'(up right down)
327   <c-\RH #1 es-\RH #2 g-\RH #4 > 4
328 }
329 @end lilypond
330
331 The letters used for the fingerings are contained in the property
332 @code{digit-names}, but they can also be set individually by supplying
333 @code{\rightHandFinger} with a string argument, as in the following example
334
335
336 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
337 #(define RH rightHandFinger)
338 {
339   \set strokeFingerOrientations = #'(right)
340   \override StrokeFinger #'digit-names = ##("x" "y" "z" "!" "@")
341   <c-\RH #5 >4
342   <c-\RH "@">4
343   <c-\RH #2 >4
344   <c-\RH "z">4
345 }
346 @end lilypond
347
348 This example combines left-hand fingering, string indication, and 
349 right-hand fingering
350
351 @lilypond[quote,ragged-right,fragment,verbatim]
352 #(define RH rightHandFinger)
353 \relative c' {
354   <c-3\5-\RH #1 >4 
355   <e-2\4-\RH #2 > 
356   <g-0\3-\RH #3 > 
357   <c-1\2-\RH #4 >
358 }
359 @end lilypond
360
361 @seealso
362
363 Internals Reference: @rinternals{StrokeFinger}
364
365
366 @node Guitar
367 @subsection Guitar
368
369 @c TODO Make a snippet based on
370 @c http://www.nabble.com/Creating-a-nice-formatted-Chords-%2B-Lyrics-layout-for-guitar-players-to13829430.html
371 @c and include it somewhere -td
372
373 @menu
374 * Guitar tablatures::
375 * Indicating position and barring::
376 @end menu
377
378 @node Guitar tablatures
379 @subsubsection Guitar tablatures
380
381 @c TODO Add text
382 TBC
383
384 @node Indicating position and barring
385 @subsubsection Indicating position and barring
386
387 This example demonstrates how to include guitar position and
388 barring indications.
389
390 @lilypond[quote,ragged-right,fragment,verbatim,relative=0]
391 \clef "G_8"
392 b16 d16 g16 b16 e16
393 \textSpannerDown
394 \override TextSpanner #'bound-details #'left #'text = #"XII "
395   g16\startTextSpan
396   b16 e16 g16 e16 b16 g16\stopTextSpan
397 e16 b16 g16 d16
398 @end lilypond
399
400
401 Stopped (X) note heads are used in guitar music to signal a place where the
402 guitarist must play a certain note or chord, with its fingers just
403 touching the strings instead of fully pressing them.  This gives the sound a
404 percussive noise-like sound that still maintains part of the original
405 pitch.  It is notated with cross note heads; this is
406 demonstrated in @ref{Special note heads}.
407
408
409 @node Banjo
410 @subsection Banjo
411
412 @menu Banjo tablatures
413 * Banjo tablatures::
414 @end menu
415
416 @node Banjo tablatures
417 @subsubsection Banjo tablatures
418 @cindex Banjo tablatures
419
420 LilyPond has basic support for five stringed banjo.  When making tablatures
421 for five stringed banjo, use the banjo tablature format function to get
422 correct
423 fret numbers for the fifth string:
424
425 @lilypond[quote,ragged-right,fragment,verbatim]
426 \new TabStaff <<
427   \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo
428   \set TabStaff.stringTunings = #banjo-open-g-tuning
429   {
430     \stemDown
431     g8 d' g'\5 a b g e d' |
432     g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
433     g4
434   }
435 >>
436 @end lilypond
437
438 A number of common tunings for banjo are predefined in LilyPond:
439 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
440 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}
441 (aDFAD).
442
443 These tunings may be converted to four string banjo tunings using the
444 @code{four-string-banjo} function:
445
446 @example
447 \set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
448 @end example
449
450 @seealso
451
452 The file @file{scm/@/output@/-lib@/.scm} contains predefined banjo tunings.
453
454
455