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