]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/guitar.itely
Merge branch 'master' of git://git.sv.gnu.org/lilypond
[lilypond.git] / Documentation / user / guitar.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 @node Guitar
10 @section Guitar
11
12 @cindex tablature
13 @cindex guitar tablature
14
15 @menu
16 * Guitar sections::             
17 @end menu
18
19 @node Guitar sections
20 @subsection Guitar sections
21
22 @menu
23 * String number indications::   
24 * Tablatures basic::            
25 * Non-guitar tablatures::       
26 * Banjo tablatures::            
27 * Fret diagrams::               
28 * Right hand fingerings::       
29 * Other guitar issues::         
30 @end menu
31
32 @node String number indications
33 @subsubsection String number indications
34
35 @cindex String numbers
36
37 String numbers can be added to chords, by indicating the string number
38 with @code{\}@var{number},
39
40 @lilypond[relative,relative=1,ragged-right,fragment]
41 <c\1 e\2 g\3>
42 @end lilypond
43
44
45 @seealso
46
47 Internals Reference: @internalsref{StringNumber},
48 @c @lsr{guitar/,string-number.ly}.
49
50
51 @node Tablatures basic
52 @subsubsection Tablatures basic
53 @cindex Tablatures basic
54
55 Tablature notation is used for notating music for plucked string
56 instruments.  Pitches are not denoted with note heads, but by
57 numbers indicating on which string and fret a note must be played.  LilyPond
58 offers limited support for tablature.
59
60 The string number associated to a note is given as a backslash
61 followed by a number, e.g., @code{c4\3} for a C quarter on the third
62 string.  By default, string 1 is the highest one, and the tuning
63 defaults to the standard guitar tuning (with 6 strings).  The notes
64 are printed as tablature, by using @internalsref{TabStaff} and
65 @internalsref{TabVoice} contexts
66
67 @lilypond[quote,ragged-right,fragment,verbatim]
68 \new TabStaff {
69   a,4\5 c'\2 a\3 e'\1
70   e\4 c'\2 a\3 e'\1
71 }
72 @end lilypond
73
74 @funindex minimumFret
75 @cindex fret
76
77 When no string is specified, the first string that does not give a
78 fret number less than @code{minimumFret} is selected.  The default
79 value for @code{minimumFret} is 0
80
81
82 @example
83 e16 fis gis a b4
84 \set TabStaff.minimumFret = #8
85 e16 fis gis a b4
86 @end example
87 @lilypond[quote,ragged-right]
88 frag = {
89   \key e \major
90   e16 fis gis a b4
91   \set TabStaff.minimumFret = #8
92   e16 fis gis a b4
93 }
94   \new StaffGroup <<
95     \new Staff { \clef "G_8" \frag }
96     \new TabStaff { \frag }
97   >>
98 @end lilypond
99
100
101 @commonprop
102
103 To print tablatures with stems down and horizontal beams,
104 initialize the @code{TabStaff} with this code:
105
106 @example
107 \stemDown
108 \override Beam #'damping = #100000
109 @end example
110
111 @seealso
112
113 Internals Reference: @internalsref{TabNoteHead}, @internalsref{TabStaff}, @internalsref{TabVoice}.
114
115 @refbugs
116
117 Chords are not handled in a special way, and hence the automatic
118 string selector may easily select the same string to two notes in a
119 chord.
120
121 In order to handle @code{\partcombine}, a @code{TabStaff} must use
122 specially-created voices:
123
124 @lilypond[quote,ragged-right,verbatim]
125 melodia = \partcombine { e4 g g g }{ e4 e e e }
126 <<
127   \new TabStaff <<
128     \new TabVoice = "one" s1
129     \new TabVoice = "two" s1
130     \new TabVoice = "shared" s1
131     \new TabVoice = "solo" s1
132     { \melodia }
133   >>
134 >>
135 @end lilypond
136
137
138 @node Non-guitar tablatures
139 @subsubsection Non-guitar tablatures
140 @cindex Non-guitar tablatures
141
142 You can change the tuning of the strings.  A string tuning is given as
143 a Scheme list with one integer number for each string, the number
144 being the pitch (measured in semitones relative to middle C) of an
145 open string.  The numbers specified for @code{stringTunings} are the
146 numbers of semitones to subtract or add, starting the specified pitch
147 by default middle C, in string order.  LilyPond automatically calculates
148 the number of strings by looking at @code{stringTunings}.
149
150 In the next example,
151 @code{stringTunings} is set for the pitches e, a, d, and g
152
153 @lilypond[quote,ragged-right,fragment,verbatim]
154 \new TabStaff <<
155   \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
156   {
157     a,4 c' a e' e c' a e'
158   }
159 >>
160 @end lilypond
161
162 LilyPond comes with predefined string tunings for banjo, mandolin, guitar
163 and bass guitar.
164
165 @example
166 \set TabStaff.stringTunings = #bass-tuning
167 @end example
168
169 The default string tuning is @code{guitar-tuning} (the standard EADGBE
170 tuning).
171 Some other predefined tunings are @code{guitar-open-g-tuning},
172 @code{mandolin-tuning} and @code{banjo-open-g-tuning}.
173
174 @seealso
175
176 The file @file{scm/@/output@/-lib@/.scm} contains the predefined string
177 tunings.
178 Internals Reference: @internalsref{Tab_note_heads_engraver}.
179
180 @refbugs
181
182 No guitar special effects have been implemented.
183
184
185
186 @node Banjo tablatures
187 @subsubsection Banjo tablatures
188 @cindex Banjo tablatures
189
190 LilyPond has basic support for five stringed banjo.  When making tablatures
191 for five stringed banjo, use the banjo tablature format function to get
192 correct
193 fret numbers for the fifth string:
194
195 @lilypond[quote,ragged-right,fragment,verbatim]
196 \new TabStaff <<
197   \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo
198   \set TabStaff.stringTunings = #banjo-open-g-tuning
199   {
200     \stemDown
201     g8 d' g'\5 a b g e d' |
202     g4 d''8\5 b' a'\2 g'\5 e'\2 d' |
203     g4
204   }
205 >>
206 @end lilypond
207
208 A number of common tunings for banjo are predefined in LilyPond:
209 @code{banjo-c-tuning} (gCGBD), @code{banjo-modal-tuning} (gDGCD),
210 @code{banjo-open-d-tuning} (aDF#AD) and @code{banjo-open-dm-tuning}
211 (aDFAD).
212
213 These tunings may be converted to four string banjo tunings using the
214 @code{four-string-banjo} function:
215
216 @example
217 \set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
218 @end example
219
220 @seealso
221
222 The file @file{scm/@/output@/-lib@/.scm} contains predefined banjo tunings.
223
224
225 @node Fret diagrams
226 @subsubsection Fret diagrams
227 @cindex fret diagrams
228 @cindex chord diagrams
229
230 Fret diagrams can be added to music as a markup to the desired note.  The
231 markup contains information about the desired fret diagram, as shown in the
232 following example
233
234 @lilypond[verbatim, ragged-right, quote]
235 \new Voice {
236   d'^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
237   d' d' d'
238   fis'^\markup \override #'(size . 0.75) {
239     \override #'(finger-code . below-string) {
240       \fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2)
241                                (place-fret 5 4 3) (place-fret 4 4 4)
242                                (place-fret 3 3 2) (place-fret 2 2 1)
243                                (place-fret 1 2 1))
244     }
245   }
246   fis' fis' fis'
247   c'^\markup \override #'(dot-radius . 0.35) {
248     \override #'(finger-code . in-dot) {
249       \override #'(dot-color . white) {
250         \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"
251       }
252     }
253   }
254   c' c' c'
255 }
256 @end lilypond
257
258
259 There are three different fret-diagram markup interfaces: standard, terse,
260 and verbose.  The three interfaces produce equivalent markups, but have
261 varying amounts of information in the markup string.  Details about the
262 markup interfaces are found at @ref{Overview of text markup commands}.
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 @internalsref{fret-diagram-interface}.
267
268
269 @seealso
270
271 Examples: @c @lsrdir{guitar}
272
273
274 @node Right hand fingerings
275 @subsubsection Right hand fingerings
276
277 Right hand fingerings in chords can be entered using
278 @code{@var{note}-\rightHandFinger @var{finger}}
279
280 @lilypond[verbatim,fragment,relative=2]
281   <c-\rightHandFinger #1 e-\rightHandFinger #2 >
282 @end lilypond
283
284 for brevity, you can abbreviate @code{\rightHandFinger} to something
285 short, for example @code{RH},
286
287 @example
288 #(define RH rightHandFinger)
289 @end example
290
291 @cindex fingerings, right hand, for guitar 
292 @cindex right hand fingerings for guitar
293  
294 @commonprop
295
296 You may exercise greater control over right handing fingerings by
297 setting @code{strokeFingerOrientations},
298
299 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
300 #(define RH rightHandFinger)
301 {
302   \set strokeFingerOrientations = #'(up down)
303   <c-\RH #1 es-\RH #2 g-\RH #4 > 4
304   \set strokeFingerOrientations = #'(up right down)
305   <c-\RH #1 es-\RH #2 g-\RH #4 > 4
306 }
307 @end lilypond
308
309 The letters used for the fingerings are contained in the property
310 @code{digit-names}, but they can also be set individually by supplying
311 @code{\rightHandFinger} with a string argument, as in the following example
312
313
314 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
315 #(define RH rightHandFinger)
316 {
317   \set strokeFingerOrientations = #'(right)
318   \override StrokeFinger #'digit-names = ##("x" "y" "z" "!" "@") 
319   <c-\RH #5 >4
320   <c-\RH "@">4  
321 }
322 @end lilypond
323
324 @seealso
325
326 Internals Reference: @internalsref{StrokeFinger}
327
328
329
330 @node Other guitar issues
331 @subsubsection Other guitar issues
332
333 This example demonstrates how to include guitar position and
334 barring indications.
335
336 @lilypond[quote,ragged-right,fragment,verbatim,relative=0]
337 \clef "G_8"
338 b16 d16 g16 b16 e16
339 \textSpannerDown
340 \override TextSpanner #'bound-details #'left #'text = #"XII "
341   g16\startTextSpan
342   b16 e16 g16 e16 b16 g16\stopTextSpan
343 e16 b16 g16 d16
344 @end lilypond
345
346
347 Stopped (X) note heads are used in guitar music to signal a place where the
348 guitarist must play a certain note or chord, with its fingers just
349 touching the strings instead of fully pressing them.  This gives the sound a
350 percussive noise-like sound that still maintains part of the original
351 pitch.  It is notated with cross note heads; this is
352 demonstrated in @ref{Special note heads}.
353
354
355