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