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