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