]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/chords.itely
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / user / chords.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
12 @node Chord notation
13 @section Chord notation
14
15 Intro text.
16
17 @menu
18 * Modern chords::
19 * Figured bass::
20 @end menu
21
22
23 @node Modern chords
24 @subsection Modern chords
25
26 @menu
27 * Chord modes::
28 * Entering chord names::
29 * Building chords::
30 * Lead sheets::
31 * Printing chord names::
32 @end menu
33
34 @cindex chords
35 @cindex chord names
36
37 @node Chord modes
38 @subsubsection Chord modes
39
40 In popular music it is common to denote accompaniment with chord
41 names.  Such chords can be entered like notes,
42
43 @lilypond[verbatim,quote,ragged-right]
44 \chordmode { c2 f4. g8 }
45 @end lilypond
46
47 Now each pitch is read as the root of a chord instead of a note.
48 This mode is switched on with @code{\chordmode}.  Other chords can
49 be created by adding modifiers after a colon.  The following
50 example shows a few common modifiers:
51
52 @lilypond[verbatim,quote,ragged-right]
53 \chordmode { c2 f4:m g4:maj7 gis1:dim7 }
54 @end lilypond
55
56 @cindex Chords mode
57
58 In chord mode sets of pitches (chords) are entered with normal note
59 names.  A chord is entered by the root, which is entered like a
60 normal pitch
61
62 @lilypond[quote,ragged-right,fragment,verbatim]
63 \chordmode { es4. d8 c2 }
64 @end lilypond
65
66 @noindent
67 The mode is introduced by the keyword @code{\chordmode}.
68
69 @cindex chord entry
70 @cindex chord mode
71
72 Chords is a mode similar to @code{\lyricmode}, etc.  Most
73 of the commands continue to work, for example, @code{r} and
74 @code{\skip} can be used to insert rests and spaces, and property
75 commands may be used to change various settings.
76 It uses the same syntax as
77 @code{\chordmode}, but renders the notes in a @code{ChordNames}
78 context, with the following result:
79
80 @lilypond[verbatim,quote,ragged-right]
81 \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
82 @end lilypond
83
84
85 @knownissues
86
87 Each step can only be present in a chord once.  The following
88 simply produces the augmented chord, since @code{5+} is interpreted
89 last
90 @cindex clusters
91 @lilypond[quote,ragged-right,verbatim,fragment]
92 \chordmode { c:5.5-.5+ }
93 @end lilypond
94
95
96 @node Entering chord names
97 @subsubsection Entering chord names
98 @cindex chord names
99
100 LilyPond has support for printing chord names.  Chords may be entered
101 in musical chord notation, i.e., @code{< .. >}, but they can also be
102 entered by name.  Internally, the chords are represented as a set of
103 pitches, so they can be transposed
104
105
106 @lilypond[quote,ragged-right,verbatim,ragged-right]
107 twoWays = \transpose c c' {
108   \chordmode {
109     c1 f:sus4 bes/f
110   }
111   <c e g>
112   <f bes c'>
113   <f bes d'>
114 }
115
116 << \new ChordNames \twoWays
117    \new Voice \twoWays >>
118 @end lilypond
119
120 This example also shows that the chord printing routines do not try to
121 be intelligent.  The last chord (@code{f bes d}) is not interpreted as
122 an inversion.
123
124 Note that the duration of chords must be specified outside the
125 @code{<>}.
126
127 @example
128 <c e g>2
129 @end example
130
131 @node Building chords
132 @subsubsection Building chords
133
134 Other chords may be entered by suffixing a colon and introducing a
135 modifier (which may include a number if desired)
136
137 @lilypond[quote,fragment,verbatim]
138 \chordmode { e1:m e1:7 e1:m7 }
139 @end lilypond
140
141 The first number following the root is taken to be the @q{type} of the
142 chord, thirds are added to the root until it reaches the specified
143 number.  The exception is @code{c:13}, for which the 11 is omitted.
144
145 @lilypond[quote,fragment,verbatim]
146 \chordmode { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 c:13 }
147 @end lilypond
148
149 @cindex root of chord
150 @cindex additions, in chords
151 @cindex removals, in chords
152
153 More complex chords may also be constructed adding separate steps
154 to a chord.  Additions are added after the number following
155 the colon and are separated by dots
156
157 @lilypond[quote,verbatim,fragment]
158 \chordmode { c:5.6 c:3.7.8 c:3.6.13 }
159 @end lilypond
160
161 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
162 to the number
163
164 @lilypond[quote,verbatim,fragment]
165 \chordmode { c:7+ c:5+.3- c:3-.5-.7- }
166 @end lilypond
167
168 Removals are specified similarly and are introduced by a caret.  They
169 must come after the additions
170
171 @lilypond[quote,verbatim,fragment]
172 \chordmode { c^3 c:7^5 c:9^3.5 }
173 @end lilypond
174
175 Modifiers can be used to change pitches.  The following modifiers are
176 supported
177
178 @table @code
179 @item m
180 The minor chord.  This modifier lowers the 3rd and (if present) the 7th step.
181
182 @item dim
183 The diminished chord.  This modifier lowers the 3rd, 5th and (if present)
184 the 7th step.
185
186 @item aug
187 The augmented chord.  This modifier raises the 5th step.
188
189 @item maj
190 The major 7th chord.  This modifier raises the 7th step if present.
191
192 @item sus
193 The suspended 4th or 2nd.  This modifier removes the 3rd
194 step.  Append either @code{2} or @code{4} to add the 2nd or 4th step to
195 the chord.
196 @end table
197
198 Modifiers can be mixed with additions
199 @lilypond[quote,verbatim,fragment]
200   \chordmode { c:sus4 c:7sus4 c:dim7 c:m6 }
201 @end lilypond
202
203 @cindex modifiers, in chords.
204 @funindex aug
205 @funindex dim
206 @funindex maj
207 @funindex sus
208 @funindex m
209
210 Since an unaltered 11 does not sound good when combined with an
211 unaltered 13, the 11 is removed in this case (unless it is added
212 explicitly)
213 @lilypond[quote,ragged-right,fragment,verbatim]
214 \chordmode { c:13 c:13.11 c:m13 }
215 @end lilypond
216
217 @funindex /
218
219 An inversion (putting one pitch of the chord on the bottom), as well
220 as bass notes, can be specified by appending
221 @code{/}@var{pitch} to the chord
222 @lilypond[quote,ragged-right,fragment,verbatim]
223 \chordmode { c1 c/g c/f }
224 @end lilypond
225 @funindex /+
226
227 A bass note can be added instead of transposed out of the chord,
228 by using @code{/+}@var{pitch}.
229
230 @lilypond[quote,ragged-right,fragment,verbatim]
231 \chordmode { c1 c/+g c/+f }
232 @end lilypond
233
234
235 @node Lead sheets
236 @subsubsection Lead sheets
237
238 @cindex lead sheet
239
240 For lead sheets, chords are not printed on staves, but as names on
241 a line for themselves.  This is achieved by using @code{\chords}
242 instead of @code{\chordmode}.
243
244 When put together, chord names, lyrics and a melody form a lead
245 sheet,
246
247 @lilypond[verbatim,quote,ragged-right]
248 <<
249   \chords { c2 g:sus4 f e }
250   \relative c'' {
251     a4 e c8 e r4
252     b2 c4( d)
253   }
254   \addlyrics { One day this shall be free __ }
255 >>
256 @end lilypond
257
258
259
260 @node Printing chord names
261 @subsubsection Printing chord names
262
263 @cindex printing chord names
264 @cindex chord names
265 @cindex chords
266
267 For displaying printed chord names, use the @internalsref{ChordNames} context.
268 The chords may be entered either using the notation
269 described above, or directly using @code{<} and @code{>}
270
271 @lilypond[quote,verbatim,ragged-right]
272 harmonies = {
273   \chordmode {a1 b c} <d' f' a'> <e' g' b'>
274 }
275 <<
276   \new ChordNames \harmonies
277   \new Staff \harmonies
278 >>
279 @end lilypond
280
281 You can make the chord changes stand out by setting
282 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
283 display chord names when there is a change in the chords scheme and at
284 the start of a new line
285
286 @lilypond[quote,verbatim,ragged-right]
287 harmonies = \chordmode {
288   c1:m c:m \break c:m c:m d
289 }
290 <<
291   \new ChordNames {
292     \set chordChanges = ##t
293     \harmonies }
294   \new Staff \transpose c c' \harmonies
295 >>
296 @end lilypond
297
298 The previous examples all show chords over a staff.  This is not
299 necessary.  Chords may also be printed separately.  It may be necessary
300 to add @internalsref{Volta_engraver} and @internalsref{Bar_engraver}
301 for showing repeats.
302
303 @lilypond[ragged-right,verbatim]
304 \new ChordNames \with {
305   \override BarLine #'bar-size = #4
306   \consists Bar_engraver
307   \consists "Volta_engraver"
308 }
309 \chordmode { \repeat volta 2 {
310   f1:maj7 f:7 bes:7
311   c:maj7
312 } \alternative {
313   es e
314 }
315 }
316 @end lilypond
317
318
319 The default chord name layout is a system for Jazz music, proposed by
320 Klaus Ignatzek (see @ref{Literature list}).  It can be tuned through the
321 following properties
322
323 @table @code
324 @funindex chordNameExceptions
325 @item chordNameExceptions
326 This is a list that contains the chords that have special formatting.
327
328 The exceptions list should be encoded as
329 @example
330 @{ <c f g bes>1 \markup @{ \super "7" "wahh" @} @}
331 @end example
332
333 To get this information into @code{chordNameExceptions} takes a little
334 maneuvering.  The following code transforms @code{chExceptionMusic}
335 (which is a sequential music) into a list of exceptions.
336 @example
337 (sequential-music-to-chord-exceptions chExceptionMusic #t)
338 @end example
339 Then,
340 @example
341 (append
342  (sequential-music-to-chord-exceptions chExceptionMusic #t)
343  ignatzekExceptions)
344 @end example
345 adds the new exceptions to the default ones, which are defined in
346 @file{ly/@/chord@/-modifier@/-init@/.ly}.
347
348 For an example of tuning this property, see also
349 @c @lsr{chords,chord@/-name@/-exceptions@/.ly}
350 @cindex exceptions, chord names.
351
352
353 @funindex majorSevenSymbol
354 @item majorSevenSymbol
355 This property contains the markup object used for the 7th step, when
356 it is major.  Predefined options are @code{whiteTriangleMarkup} and
357 @code{blackTriangleMarkup}.  See
358 @c @lsr{chords,chord@/-name@/-major7@/.ly} for an example.
359
360 @funindex chordNameSeparator
361 @item chordNameSeparator
362 Different parts of a chord name are normally separated by a
363 slash.  By setting @code{chordNameSeparator}, you can specify other
364 separators, e.g.,
365 @lilypond[quote,ragged-right,fragment,verbatim]
366 \new ChordNames \chordmode {
367   c:7sus4
368   \set chordNameSeparator
369     = \markup { \typewriter "|" }
370   c:7sus4
371 }
372 @end lilypond
373
374 @funindex chordRootNamer
375 @item chordRootNamer
376 The root of a chord is usually printed as a letter with an optional
377 alteration.  The transformation from pitch to letter is done by this
378 function.  Special note names (for example, the German @q{H} for a
379 B-chord) can be produced by storing a new function in this property.
380
381 @funindex chordNoteNamer
382 @item chordNoteNamer
383 The default is to print single pitch, e.g., the bass note, using the
384 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
385 to a specialized function to change this behavior.  For example, the
386 base can be printed in lower case.
387
388 @funindex chordPrefixSpacer
389 @item chordPrefixSpacer
390 The @q{m} for minor chords is usually printed right after the root of
391 the chord.  By setting @code{chordPrefixSpacer}, you can fix a spacer
392 between the root and @q{m}.  The spacer is not used when the root
393 is altered.
394
395 @end table
396
397 The predefined variables @code{\germanChords},
398 @code{\semiGermanChords}, @code{\italianChords} and @code{\frenchChords}
399 set these variables.  The effect is
400 demonstrated here,
401
402 @lilypondfile[ragged-right]{chord-names-languages.ly}
403
404 There are also two other chord name schemes implemented: an alternate
405 Jazz chord notation, and a systematic scheme called Banter chords.  The
406 alternate Jazz notation is also shown on the chart in @ref{Chord name
407 chart}.  Turning on these styles is demonstrated in
408 @c @lsr{chords,chord-names-jazz.ly}.
409
410 @cindex Banter
411 @cindex jazz chords
412 @cindex chords, jazz
413
414
415 @predefined
416
417 @funindex \germanChords
418 @code{\germanChords},
419 @funindex \semiGermanChords
420 @code{\semiGermanChords}.
421 @funindex \italianChords
422 @code{\italianChords}.
423 @funindex \frenchChords
424 @code{\frenchChords}.
425
426
427
428
429 @seealso
430
431 Examples:
432 @c @lsrdir{chords}
433
434 Init files: @file{scm/@/chords@/-ignatzek@/.scm}, and
435 @file{scm/@/chord@/-entry@/.scm}.
436
437
438 @knownissues
439
440 Chord names are determined solely from the list of pitches.  Chord
441 inversions are not identified, and neither are added bass notes.  This
442 may result in strange chord names when chords are entered with the
443 @code{< .. >} syntax.
444
445
446 @node Figured bass
447 @subsection Figured bass
448
449 @menu
450 * Introduction to figured bass::
451 * Entering figures::
452 * Repeated figures::
453 @end menu
454
455 @node Introduction to figured bass
456 @subsubsection Introduction to figured bass
457
458 @cindex Basso continuo
459
460 @c TODO: musicological blurb about FB
461
462 LilyPond has support for figured bass
463
464 @lilypond[quote,ragged-right,verbatim,fragment]
465 <<
466   \new Voice { \clef bass dis4 c d ais g fis}
467   \new FiguredBass \figuremode {
468     < 6 >4 < 7\+ >8 < 6+ [_!] >
469     < 6 >4 <6 5 [3+] >
470     < _ >4 < 6 5/>4
471   }
472 >>
473 @end lilypond
474
475 Although the support for figured bass may superficially resemble chord
476 support, it is much simpler.  The @code{\figuremode} mode simply
477 stores the numbers and @internalsref{FiguredBass} context prints them
478 as entered.  There is no conversion to pitches and no realizations of
479 the bass are played in the MIDI file.
480
481 Internally, the code produces markup texts.  You can use any of the
482 markup text properties to override formatting.  For example, the
483 vertical spacing of the figures may be set with @code{baseline-skip}.
484
485
486 @node Entering figures
487 @subsubsection Entering figures
488
489 The support for figured bass consists of two parts: there is an input
490 mode, introduced by @code{\figuremode}, where you can enter bass figures
491 as numbers, and there is a context called @internalsref{FiguredBass} that
492 takes care of making @internalsref{BassFigure} objects.
493
494 In figures input mode, a group of bass figures is delimited by
495 @code{<} and @code{>}.  The duration is entered after the @code{>}
496 @example
497 <4 6>
498 @end example
499 @lilypond[quote,ragged-right,fragment]
500 \new FiguredBass
501 \figuremode { <4 6> }
502 @end lilypond
503
504 Accidentals are added when you append @code{-}, @code{!}, and @code{+}
505 to the numbers.  A plus sign is added when you append @code{\+}, and
506 diminished fifths and sevenths can be obtained with @code{5/} and @code{7/}.
507
508 @example
509 <4- 6+ 7!> <5++> <3--> <7/> r <6\+ 5/>
510 @end example
511 @lilypond[quote,ragged-right,fragment]
512 \figures { <4- 6+ 7!> <5++> <3--> <7/> r <6\+ 5/> }
513 @end lilypond
514
515 Spaces may be inserted by using @code{_}.  Brackets are
516 introduced with @code{[} and @code{]}.  You can also include text
517 strings and text markups, see @ref{Text markup commands}.
518
519 @example
520 < [4 6] 8 [_! 12] > < 5 \markup @{ \number 6 \super (1) @} >
521 @end example
522 @lilypond[quote,ragged-right,fragment]
523 \new FiguredBass
524 \figuremode { < [4 6] 8 [_! 12] > < 5 \markup{ \tiny \number 6 \super (1)} > }
525 @end lilypond
526
527
528 @node Repeated figures
529 @subsubsection Repeated figures
530
531
532 It is also possible to use continuation lines for repeated figures,
533
534 @lilypond[verbatim,relative=1]
535 <<
536   \new Staff {
537     \clef bass
538     c4 c c
539   }
540   \figures {
541     \set useBassFigureExtenders = ##t
542     <4 6> <3 6> <3 7>
543   }
544 >>
545 @end lilypond
546
547 @noindent
548 In this case, the extender lines always replace existing figures.
549
550 The @code{FiguredBass} context doesn't pay attention to the actual
551 bass line.  As a consequence, you may have to insert extra figures to
552 get extender lines below all notes, and you may have to add @code{\!}
553 to avoid getting an extender line, e.g.
554
555 @lilypond[relative=1]
556 <<
557   \new Voice
558   \figures {
559     \set useBassFigureExtenders = ##t
560     <6 4->4. <6 4->16. <6 4->32 <5>8. r16 <6>8 <6\! 5->
561   }
562   {
563     \clef bass
564     f16. g32 f16. g32 f16. g32 f16. g32 f8. es16 d8 es
565   }
566 >>
567 @end lilypond
568
569 When using continuation lines, common figures are always put in the
570 same vertical position.  When this is unwanted, you can insert a rest
571 with @code{r}.  The rest will clear any previous alignment.  For
572 example, you can write
573
574 @example
575   <4 6>8 r8
576 @end example
577
578 @noindent
579 instead of
580 @example
581   <4 6>4
582 @end example
583
584 Accidentals and plus signs can appear before or after the numbers,
585 depending on the @code{figuredBassAlterationDirection} and
586 @code{figuredBassPlusDirection}
587 properties
588
589 @lilypond
590   \figures {
591     <6\+> <5+> <6 4-> r
592     \set figuredBassAlterationDirection = #1
593     <6\+> <5+> <6 4-> r
594     \set figuredBassPlusDirection = #1
595     <6\+> <5+> <6 4-> r
596     \set figuredBassAlterationDirection = #-1
597     <6\+> <5+> <6 4-> r
598   }
599 @end lilypond
600
601
602 Figured bass can also be added to @code{Staff} contexts
603 directly.  In this case, their vertical position is adjusted
604 automatically.
605
606 @lilypond[ragged-right,fragment,quote]
607 <<
608   \new Staff = someUniqueName
609   \relative c'' {
610     c4 c'8 r8 c,4 c'
611   }
612
613   %% send to existing Staff.
614   \context Staff = someUniqueName
615   \figuremode {
616     <4>4 <6 10>8 s8
617
618     \set Staff.useBassFigureExtenders = ##t
619     <4 6>4 <4 6>
620   }
621 >>
622 @end lilypond
623
624
625 @snippets
626
627 By default, this method produces figures above the notes.  To get
628 figures below the notes, use
629
630 @example
631 \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN
632 @end example
633
634
635 @knownissues
636
637 When using figured bass above the staff with extender lines and
638 @code{implicitBassFigures} the lines may become swapped around.
639 Maintaining order consistently will be impossible when multiple figures
640 have overlapping extender lines.  To avoid this problem, please
641 use @code{stacking-dir} on @code{BassFigureAlignment}.
642
643
644 @seealso
645
646 Internals Reference: @internalsref{NewBassFigure},
647 @internalsref{BassFigureAlignment}, @internalsref{BassFigureLine},
648 @internalsref{BassFigureBracket}, and
649 @internalsref{BassFigureContinuation} objects and
650 @internalsref{FiguredBass} context.
651