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