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