]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/chords.itely
59c9cdcb8ac35ce32ca73ab66efecda9aa6539e7
[lilypond.git] / Documentation / user / chords.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3
4 @node Chords Blah
5 @section Chords Blah
6
7 Intro text.
8
9 @menu
10 * TODO chords fix::             
11 @end menu
12
13 @node TODO chords fix
14 @subsection TODO chords fix
15
16
17 @c  awkward name; awkward section name.
18 @c  still, the Basic "chords" seems like a good name...  :(
19 @menu
20 * A lead sheet::                
21 * Introducing chord names::     
22 * Chords mode::                 
23 * Printing chord names::        
24 @end menu
25
26 @c really awkward; I just shoved this in here from the tutorial.
27 @node A lead sheet
28 @unnumberedsubsubsec A lead sheet
29
30 @cindex Lead sheets
31 @cindex chords
32 @cindex chord names
33
34 In popular music it is common to denote accompaniment with chord
35 names.  Such chords can be entered like notes,
36
37 @lilypond[verbatim,quote,ragged-right]
38 \chordmode { c2 f4. g8 }
39 @end lilypond
40
41 Now each pitch is read as the root of a chord instead of a note.
42 This mode is switched on with @code{\chordmode}.  Other chords can
43 be created by adding modifiers after a colon.  The following
44 example shows a few common modifiers:
45
46 @lilypond[verbatim,quote,ragged-right]
47 \chordmode { c2 f4:m g4:maj7 gis1:dim7 }
48 @end lilypond
49
50 For lead sheets, chords are not printed on staves, but as names on
51 a line for themselves.  This is achieved by using @code{\chords}
52 instead of @code{\chordmode}.  This uses the same syntax as
53 @code{\chordmode}, but renders the notes in a @code{ChordNames}
54 context, with the following result:
55
56 @lilypond[verbatim,quote,ragged-right]
57 \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
58 @end lilypond
59
60 @cindex lead sheet
61 When put together, chord names, lyrics and a melody form a lead
62 sheet,
63
64 @lilypond[verbatim,quote,ragged-right]
65 <<
66   \chords { c2 g:sus4 f e }
67   \relative c'' {
68     a4 e c8 e r4
69     b2 c4( d)
70   }
71   \addlyrics { One day this shall be free __ }
72 >>
73 @end lilypond
74
75
76 @seealso
77 @quotation
78 A complete list of modifiers and other options for layout can be
79 found in @ruser{Chords}.
80 @end quotation
81
82
83 @node Introducing chord names
84 @unnumberedsubsubsec Introducing chord names
85 @cindex chord names
86
87 LilyPond has support for printing chord names.  Chords may be entered
88 in musical chord notation, i.e., @code{< .. >}, but they can also be
89 entered by name.  Internally, the chords are represented as a set of
90 pitches, so they can be transposed
91
92
93 @lilypond[quote,ragged-right,verbatim,ragged-right]
94 twoWays = \transpose c c' {
95   \chordmode {
96     c1 f:sus4 bes/f
97   }
98   <c e g>
99   <f bes c'>
100   <f bes d'>
101 }
102
103 << \new ChordNames \twoWays
104    \new Voice \twoWays >>
105 @end lilypond
106
107 This example also shows that the chord printing routines do not try to
108 be intelligent.  The last chord (@code{f bes d}) is not interpreted as
109 an inversion.
110
111 Note that the duration of chords must be specified outside the
112 @code{<>}.
113
114 @example
115 <c e g>2
116 @end example
117
118
119 @node Chords mode
120 @unnumberedsubsubsec Chords mode
121 @cindex Chords mode
122
123 In chord mode sets of pitches (chords) are entered with normal note
124 names.  A chord is entered by the root, which is entered like a
125 normal pitch
126
127 @lilypond[quote,ragged-right,fragment,verbatim]
128 \chordmode { es4. d8 c2 }
129 @end lilypond
130
131 @noindent
132 The mode is introduced by the keyword @code{\chordmode}.
133
134 @cindex chord entry
135 @cindex chord mode
136
137 Other chords may be entered by suffixing a colon and introducing a
138 modifier (which may include a number if desired)
139
140 @lilypond[quote,fragment,verbatim]
141 \chordmode { e1:m e1:7 e1:m7 }
142 @end lilypond
143
144 The first number following the root is taken to be the @q{type} of the
145 chord, thirds are added to the root until it reaches the specified
146 number.  The exception is @code{c:13}, for which the 11 is omitted.
147
148 @lilypond[quote,fragment,verbatim]
149 \chordmode { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 c:13 }
150 @end lilypond
151
152 @cindex root of chord
153 @cindex additions, in chords
154 @cindex removals, in chords
155
156 More complex chords may also be constructed adding separate steps
157 to a chord.  Additions are added after the number following
158 the colon and are separated by dots
159
160 @lilypond[quote,verbatim,fragment]
161 \chordmode { c:5.6 c:3.7.8 c:3.6.13 }
162 @end lilypond
163
164 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
165 to the number
166
167 @lilypond[quote,verbatim,fragment]
168 \chordmode { c:7+ c:5+.3- c:3-.5-.7- }
169 @end lilypond
170
171 Removals are specified similarly and are introduced by a caret.  They
172 must come after the additions
173
174 @lilypond[quote,verbatim,fragment]
175 \chordmode { c^3 c:7^5 c:9^3.5 }
176 @end lilypond
177
178 Modifiers can be used to change pitches.  The following modifiers are
179 supported
180
181 @table @code
182 @item m
183 The minor chord.  This modifier lowers the 3rd and (if present) the 7th step.
184
185 @item dim
186 The diminished chord.  This modifier lowers the 3rd, 5th and (if present)
187 the 7th step.
188
189 @item aug
190 The augmented chord.  This modifier raises the 5th step.
191
192 @item maj
193 The major 7th chord.  This modifier raises the 7th step if present.
194
195 @item sus
196 The suspended 4th or 2nd.  This modifier removes the 3rd
197 step.  Append either @code{2} or @code{4} to add the 2nd or 4th step to
198 the chord.
199 @end table
200
201 Modifiers can be mixed with additions
202 @lilypond[quote,verbatim,fragment]
203   \chordmode { c:sus4 c:7sus4 c:dim7 c:m6 }
204 @end lilypond
205
206 @cindex modifiers, in chords.
207 @funindex aug
208 @funindex dim
209 @funindex maj
210 @funindex sus
211 @funindex m
212
213 Since an unaltered 11 does not sound good when combined with an
214 unaltered 13, the 11 is removed in this case (unless it is added
215 explicitly)
216 @lilypond[quote,ragged-right,fragment,verbatim]
217 \chordmode { c:13 c:13.11 c:m13 }
218 @end lilypond
219
220 @funindex /
221
222 An inversion (putting one pitch of the chord on the bottom), as well
223 as bass notes, can be specified by appending
224 @code{/}@var{pitch} to the chord
225 @lilypond[quote,ragged-right,fragment,verbatim]
226 \chordmode { c1 c/g c/f }
227 @end lilypond
228 @funindex /+
229
230 A bass note can be added instead of transposed out of the chord,
231 by using @code{/+}@var{pitch}.
232
233 @lilypond[quote,ragged-right,fragment,verbatim]
234 \chordmode { c1 c/+g c/+f }
235 @end lilypond
236
237 Chords is a mode similar to @code{\lyricmode}, etc.  Most
238 of the commands continue to work, for example, @code{r} and
239 @code{\skip} can be used to insert rests and spaces, and property
240 commands may be used to change various settings.
241
242
243
244 @refbugs
245
246 Each step can only be present in a chord once.  The following
247 simply produces the augmented chord, since @code{5+} is interpreted
248 last
249 @cindex clusters
250 @lilypond[quote,ragged-right,verbatim,fragment]
251 \chordmode { c:5.5-.5+ }
252 @end lilypond
253
254
255 @node Printing chord names
256 @unnumberedsubsubsec Printing chord names
257
258 @cindex printing chord names
259 @cindex chord names
260 @cindex chords
261
262 For displaying printed chord names, use the @internalsref{ChordNames} context.
263 The chords may be entered either using the notation
264 described above, or directly using @code{<} and @code{>}
265
266 @lilypond[quote,verbatim,ragged-right]
267 harmonies = {
268   \chordmode {a1 b c} <d' f' a'> <e' g' b'>
269 }
270 <<
271   \new ChordNames \harmonies
272   \new Staff \harmonies
273 >>
274 @end lilypond
275
276 You can make the chord changes stand out by setting
277 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
278 display chord names when there is a change in the chords scheme and at
279 the start of a new line
280
281 @lilypond[quote,verbatim,ragged-right]
282 harmonies = \chordmode {
283   c1:m c:m \break c:m c:m d
284 }
285 <<
286   \new ChordNames {
287     \set chordChanges = ##t
288     \harmonies }
289   \new Staff \transpose c c' \harmonies
290 >>
291 @end lilypond
292
293 The previous examples all show chords over a staff.  This is not
294 necessary.  Chords may also be printed separately.  It may be necessary
295 to add @internalsref{Volta_engraver} and @internalsref{Bar_engraver}
296 for showing repeats.
297
298 @lilypond[ragged-right,verbatim]
299 \new ChordNames \with {
300   \override BarLine #'bar-size = #4
301   \consists Bar_engraver
302   \consists "Volta_engraver"
303 }
304 \chordmode { \repeat volta 2 {
305   f1:maj7 f:7 bes:7
306   c:maj7
307 } \alternative {
308   es e
309 }
310 }
311 @end lilypond
312
313
314 The default chord name layout is a system for Jazz music, proposed by
315 Klaus Ignatzek (see @ref{Literature list}).  It can be tuned through the
316 following properties
317
318 @table @code
319 @funindex chordNameExceptions
320 @item chordNameExceptions
321 This is a list that contains the chords that have special formatting.
322
323 The exceptions list should be encoded as
324 @example
325 @{ <c f g bes>1 \markup @{ \super "7" "wahh" @} @}
326 @end example
327
328 To get this information into @code{chordNameExceptions} takes a little
329 manoeuvring.  The following code transforms @code{chExceptionMusic}
330 (which is a sequential music) into a list of exceptions.
331 @example
332 (sequential-music-to-chord-exceptions chExceptionMusic #t)
333 @end example
334 Then,
335 @example
336 (append
337  (sequential-music-to-chord-exceptions chExceptionMusic #t)
338  ignatzekExceptions)
339 @end example
340 adds the new exceptions to the default ones, which are defined in
341 @file{ly/@/chord@/-modifier@/-init@/.ly}.
342
343 For an example of tuning this property, see also
344 @lsr{chords,chord@/-name@/-exceptions@/.ly}
345 @cindex exceptions, chord names.
346
347
348 @funindex majorSevenSymbol
349 @item majorSevenSymbol
350 This property contains the markup object used for the 7th step, when
351 it is major.  Predefined options are @code{whiteTriangleMarkup} and
352 @code{blackTriangleMarkup}.  See
353 @lsr{chords,chord@/-name@/-major7@/.ly} for an example.
354
355 @funindex chordNameSeparator
356 @item chordNameSeparator
357 Different parts of a chord name are normally separated by a
358 slash.  By setting @code{chordNameSeparator}, you can specify other
359 separators, e.g.,
360 @lilypond[quote,ragged-right,fragment,verbatim]
361 \new ChordNames \chordmode {
362   c:7sus4
363   \set chordNameSeparator
364     = \markup { \typewriter "|" }
365   c:7sus4
366 }
367 @end lilypond
368
369 @funindex chordRootNamer
370 @item chordRootNamer
371 The root of a chord is usually printed as a letter with an optional
372 alteration.  The transformation from pitch to letter is done by this
373 function.  Special note names (for example, the German @q{H} for a
374 B-chord) can be produced by storing a new function in this property.
375
376 @funindex chordNoteNamer
377 @item chordNoteNamer
378 The default is to print single pitch, e.g., the bass note, using the
379 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
380 to a specialized function to change this behavior.  For example, the
381 base can be printed in lower case.
382
383 @funindex chordPrefixSpacer
384 @item chordPrefixSpacer
385 The @q{m} for minor chords is usually printed right after the root of
386 the chord. By setting @code{chordPrefixSpacer}, you can fix a spacer
387 between the root and @q{m}. The spacer is not used when the root
388 is altered.
389
390 @end table
391
392 The predefined variables @code{\germanChords},
393 @code{\semiGermanChords}, @code{\italianChords} and @code{\frenchChords}
394 set these variables.  The effect is
395 demonstrated here,
396
397 @lilypondfile[ragged-right]{chord-names-languages.ly}
398
399 There are also two other chord name schemes implemented: an alternate
400 Jazz chord notation, and a systematic scheme called Banter chords.  The
401 alternate Jazz notation is also shown on the chart in @ref{Chord name
402 chart}.  Turning on these styles is demonstrated in
403 @lsr{chords,chord-names-jazz.ly}.
404
405 @cindex Banter
406 @cindex jazz chords
407 @cindex chords, jazz
408
409
410 @refcommands
411
412 @funindex \germanChords
413 @code{\germanChords},
414 @funindex \semiGermanChords
415 @code{\semiGermanChords}.
416 @funindex \italianChords
417 @code{\italianChords}.
418 @funindex \frenchChords
419 @code{\frenchChords}.
420
421
422
423
424 @seealso
425
426 Examples:
427 @lsrdir{chords}
428
429 Init files: @file{scm/@/chords@/-ignatzek@/.scm}, and
430 @file{scm/@/chord@/-entry@/.scm}.
431
432
433 @refbugs
434
435 Chord names are determined solely from the list of pitches.  Chord
436 inversions are not identified, and neither are added bass notes.  This
437 may result in strange chord names when chords are entered with the
438 @code{< .. >} syntax.
439
440
441
442
443
444