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