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