]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/chords.itely
Merge branch 'master' of git://git.sv.gnu.org/lilypond.git into td-lily
[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 Chords can be entered and displayed both as notes on a staff and
16 as a chord name.  In addition, figured bass notation can be
17 displayed.
18
19 @menu
20 * Entering chords::             
21 * old Modern chords::           
22 * Figured bass::                
23 @end menu
24
25
26 @node Entering chords
27 @subsection Entering chords
28
29 @cindex entering chords
30
31 @c I'm testing a @longcode{} that does @w{@code{}}; this should be
32 @c easier than writing @code{}@tie[}@code[}... -gp
33 @c stay tuned about this
34 Chords can be entered explicity through the use of the chord
35 constructors @code{<}@tie{}@code{>}.  They can also be entered in
36 chord mode, which allows chord pitches to be automatically
37 added to the specified root.
38
39 @menu
40 * Explicitly stating pitches::  
41 * Chord mode::                  
42 @end menu
43
44 @node Explicitly stating pitches
45 @unnumberedsubsubsec Explicitly stating pitches
46
47 The simplest method for entering chords is to enclose all of the
48 pitches for the chord in angle brackets, with the duration of the
49 chord specified outside the @code{<>}.
50
51 @lilypond[quote,ragged-right,fragment,verbatim]
52 <c e g>2
53 @end lilypond
54
55 @noindent
56 This construction causes all of the notes inside of the @code{<>}
57 to occur at the same moment and have the same duration.
58
59 In traditional European music, there is more to a chord than just
60 the occurence of simultaneous notes.  Chords are identified by a
61 root, and may have inversions.  Standard modifiers to the chords
62 are also widely used.  Bass notes may be added to a chord.  The
63 @code{<>} method for entering chords knows only the pitches, and
64 is unable to support any of these extra characteristics.  If these
65 characteristics are important, it is better to follow the method
66 described in @ref{Chord mode}.
67
68 @seealso
69
70 Music Glossary:
71 @rglos{chord}.
72
73 Notation Reference:
74 @ref{Chord mode}.
75
76
77 @node Chord mode
78 @unnumberedsubsubsec Chord mode
79
80 @cindex chord names
81 @cindex chord mode
82
83 Chord mode is an input mode that understands the usage of chords
84 in traditional european music.  Such chords can be entered like
85 notes,
86
87 @lilypond[verbatim,quote,ragged-right]
88 \chordmode { c2 f4. g8 }
89 @end lilypond
90
91 In chord mode each pitch is read as the root of a triad instead of a note.
92 This mode is switched on with @code{\chordmode}.
93
94 @cindex root of chord
95
96 @code{\chordmode} is similar to @code{\lyricmode}, etc.  Most of
97 the commands continue to work, for example, @code{r} and
98 @code{\skip} can be used to insert rests and spaces, and property
99 commands may be used to change various settings.
100
101 Chords entered using chord mode are music elements, and can be
102 transposed.
103
104 Chord mode is not limited to simple triads.  More complex chords
105 can be created by adding modifiers after a colon. The following
106 example shows a few common modifiers:
107
108 @lilypond[verbatim,quote,ragged-right]
109 \chordmode { c2 f4:m g4:maj7 gis1:dim7 }
110 @end lilypond
111
112 @noindent
113 Note that the colon and the modifiers follow the duration of the
114 chord.
115
116 Modifiers can be used to extend a chord, specify the @q{quality} of
117 the chord, add or remove chord steps, raise or lower chord steps,
118 and add a bass note or create an inversion.
119
120 The first number following the colon is taken to be the extent of
121 the chord. The chord is constructed by sequentially adding thirds
122 to the root until the specified number has been reached.
123
124 @lilypond[quote,ragged-right,fragment,verbatim]
125 \chordmode { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11}
126 @end lilypond
127
128 Since an unaltered 11 does not sound good when combined with an
129 unaltered 13, the 11 is removed from a :13 chord (unless it is
130 added explicitly).
131
132 @lilypond[quote,ragged-right,fragment,verbatim]
133 \chordmode { c:13 c:13.11 c:m13 }
134 @end lilypond
135
136 @cindex additions, in chords
137
138 The quality of a chord can be set according to standard chord naming
139 conventions. The following quality modifiers are supported:
140
141
142 @table @code
143 @item m The minor chord.  This modifier lowers the 3rd
144 and (if present) the 7th step.
145
146 @item dim The diminished chord.  This modifier lowers the 3rd, 5th
147 and (if present) the 7th step.
148
149 @item aug
150 The augmented chord.  This modifier raises the 5th step.
151
152 @item maj
153 The major 7th chord.  This modifier adds a raised the 7th step
154 to the chord.  The @code{7} following @code{maj} is optional.
155
156 @item sus
157 The suspended 4th or 2nd.  This modifier removes the 3rd
158 step.  Append either @code{2} or @code{4} to add the 2nd or 4th
159 step to the chord.
160 @end table
161
162 @cindex modifiers, in chords.
163 @cindex chord quality
164 @funindex aug
165 @funindex dim
166 @funindex maj
167 @funindex sus
168 @funindex m
169
170
171 Individual steps can be added to or removed from a chord.
172 Additions are added after the chord type and are prefixed by dots.
173
174 @lilypond[quote,verbatim,fragment]
175 \chordmode { c:5.6 c:3.7.8 c:3.6.13 }
176 @end lilypond
177
178 Chord steps can be altered by suffixing a @code{-} or @code{+}
179 sign to the number.
180
181 @lilypond[quote,verbatim,fragment]
182 \chordmode { c:7+ c:5+.3- c:3-.5-.7- }
183 @end lilypond
184
185 @cindex chord steps, altering
186
187 @cindex removals, in chords
188
189 @funindex ^
190 Steps to be removed are listed following the additions and are
191 prefixed by @code{^}.
192
193 @lilypond[quote,verbatim,fragment]
194 \chordmode { c^3 c:7^5 c:9^3.5 }
195 @end lilypond
196
197 @funindex /
198
199 Inversions (putting a pitch other than the root on the bottom of
200 the chord) and added bass notes, can be specified by appending
201 @code{/}@var{pitch} to the chord.
202
203 @lilypond[quote,ragged-right,fragment,verbatim]
204 \chordmode { c1 c/g c/f }
205 @end lilypond
206
207 @funindex /+
208
209 A bass note that is part of the chord can be added, instead of
210 moved as part of an inversion, by using @code{/+}@var{pitch}.
211
212 @lilypond[quote,ragged-right,fragment,verbatim]
213 \chordmode { c1 c/+g c/+f }
214 @end lilypond
215
216 @seealso
217
218
219 @knownissues
220
221 Each step can only be present in a chord once.  The following
222 simply produces the augmented chord, since @code{5+} is
223 interpreted last.
224
225 @cindex clusters
226
227 @lilypond[quote,ragged-right,verbatim,fragment]
228 \chordmode { c:5.5-.5+ }
229 @end lilypond
230
231
232
233 @ignore
234 @n ode Displaying chords
235 @s ubsection Displaying chords
236
237
238
239 @menu
240 * Printing chord names::        
241 * Customizing chord names::     
242 * Lead sheets::                 
243 @end menu
244
245 @n ode Printing chord names
246 @u nnumberedsubsubsec Printing chord names
247
248 @cindex printing chord names
249 @cindex chord names
250 @cindex chords
251
252 LilyPond has support for printing chord names.  Because chords are
253 music elements, they can be transposed, and the chord names will be
254 transposed along with the chords.
255
256 Chords can be entered using @code{< .. >} or through the use of
257 chord mode.  The displayed chord name will sometimes be different
258 depending upon the entry mode:
259
260 @lilypond[quote,ragged-right,verbatim,ragged-right]
261 twoWays = \transpose c c' {
262   \chordmode {
263     c1 f:sus4 bes/f
264   }
265   <c e g>
266   <f bes c'>
267   <f bes d'>
268 }
269
270 << \new ChordNames \twoWays
271    \new Voice \twoWays >>
272 @end lilypond
273
274 This example also shows that the chord printing routines cannot
275 correctly identify the root of a chord if it has been entered using
276 @code{< .. >} instead of named chord entry.  Therefore, the sixth
277 chord (@code{f bes d}) is not interpreted as an inversion.   In
278 contrast, the third chord, which contains the same notes as the sixth
279 chord, is correctly identified because it was entered in the named
280 chord mode.
281
282 For displaying printed chord names, use the @rinternals{ChordNames}
283 context.
284
285 @lilypond[quote,verbatim,ragged-right]
286 harmonies = {
287   \chordmode {a1 b c} <d' f' a'> <e' g' b'>
288 }
289 <<
290   \new ChordNames \harmonies
291   \new Staff \harmonies
292 >>
293 @end lilypond
294
295 The previous examples all show chords over a staff.  This is not
296 necessary.  Chords may also be printed separately.  It may be necessary
297 to add @rinternals{Volta_engraver} and @rinternals{Bar_engraver}
298 for showing repeats.
299
300 @lilypond[ragged-right,verbatim]
301 \new ChordNames \with {
302   \override BarLine #'bar-size = #4
303   \consists Bar_engraver
304   \consists "Volta_engraver"
305 }
306 \chordmode { \repeat volta 2 {
307   f1:maj7 f:7 bes:7
308   c:maj7
309 } \alternative {
310   es e
311 }
312 }
313 @end lilypond
314
315 @code{\chords} is a shortcut method used to change the input mode to
316 @code{\chordmode} and create a @code{ChordNames} context, with the
317 following result:
318
319 @lilypond[verbatim,quote,ragged-right]
320 \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
321 @end lilypond
322
323 @c @predefined
324
325 @c @snippets
326
327 @seealso
328 @c Music Glossary:
329 @c @rglos{}.
330
331 @c Learning Manual:
332 @c @rlearning{}.
333
334 @c Notation Reference:
335 @c @ruser{}.
336
337 @c Application Usage:
338 @c @rprogram{}.
339
340 @c Installed Files:
341 @c @file{}.
342
343 @c Snippets:
344 @c @rlsr{}.
345
346 @c Internals Reference:
347 @c @rinternals{}.
348
349 @c @knownissues
350
351
352 @n ode Customizing chord names
353 @u nnumberedsubsubsec Customizing chord names
354
355 @cindex customizing chord names
356
357 There is no unique system for naming chords.  Different musical
358 traditions use different names for the same set of chords. There are
359 also different symbols displayed for a given chord name.   The names
360 and symbols displayed for chord names are customizable.
361
362 The default chord name layout is a system for Jazz music, proposed
363 by Klaus Ignatzek (see @ref{Literature list}).  There are also two
364 other chord name schemes implemented: an alternate Jazz chord
365 notation, and a systematic scheme called Banter chords.  The
366 alternate Jazz notation is also shown on the chart in @ref{Chord
367 name chart}.
368
369 In addition to the different naming systems, different note names
370 are used for the root in different languages.  The predefined
371 variables @code{\germanChords}, @code{\semiGermanChords},
372 @code{\italianChords} and @code{\frenchChords} set these variables.
373 The effect is demonstrated here:
374
375 @lilypondfile[ragged-right]{chord-names-languages.ly}
376
377 If none of the default settings give the desired output, the chord
378 name display can be tuned through the following properties.
379
380 @c TODO Generate snippet based on the following
381 @c      and add explanation -td
382
383 @table
384 @item
385 @funindex chordNameExceptions
386
387 @code{chordNameExceptions} contains a list of markups used to follow
388 the root note name based on the pitches in the chord.  Creating the
389 list requires four steps.
390
391 The first step is to define sequential music that has the chords to
392 be named with the desired markup (except for the root name) attached
393 to the chord:
394
395 @example
396 FGGChordNames = @{
397   <c e g b d'>1-\markup @{ \super "maj9" @}
398   <c e g a d'>1-\markup @{ \super "6(add9)" @}
399 @}
400 @end example
401
402 The second step is to convert the music from the first step to an
403 exceptions list:
404
405 @example
406 FGGExceptions = #(sequential-music-to-chord-exceptions
407 FGGChordNames #t)
408 @end example
409
410 The third step is to append the default exceptions list (in this
411 case, the Ignatzek exceptions) to the newly-defined exceptions list:
412
413 @example
414 chExceptions = #(append FGGExceptions ignatzekExceptions)
415 @end example
416
417 The final step is to set @code{chordNameExceptions} to the
418 newly-created exceptions list:
419
420 @example
421 \set chordNameExceptions = #chExceptions
422 @end example
423
424 The entire process is illustrated below:
425
426 @lilypond[quote,ragged-right,verbatim,ragged-right]
427 FGGChordNames = {
428   <c e g b d'>1-\markup { \super "maj9" }
429   <c e g a d'>1-\markup { \super "6(add9)" }
430 }
431 FGGExceptions = #(sequential-music-to-chord-exceptions
432 FGGChordNames #t)
433 chExceptions = #(append FGGChordNames
434  ignatzekExceptions)
435
436 chordStuff = \chordmode
437 {
438 % standard names
439 g1:maj9
440 g1:6.9
441 % names with FGG's custom exceptions
442 \set chordNameExceptions = #chExceptions
443 g1:maj9
444 g1:6.9
445 }
446
447 \score
448 {
449 \new ChordNames \chordStuff
450 }
451 @end lilypond
452
453
454 @funindex majorSevenSymbol
455 @item majorSevenSymbol
456 This property contains the markup object used as part of the printed
457 chord name to identify a major 7 chord. Predefined options are
458 @code{whiteTriangleMarkup} and @code{blackTriangleMarkup}.
459
460 @funindex chordNameSeparator
461 @item chordNameSeparator
462 Different parts of a chord name are normally separated by a slash.
463 By setting @code{chordNameSeparator}, you can use any desired markup
464 for a separator, e.g.,
465 @lilypond[quote,ragged-right,fragment,verbatim]
466 \new ChordNames \chordmode {
467   c:7sus4
468   \set chordNameSeparator
469     = \markup { \typewriter "|" }
470   c:7sus4
471 }
472 @end lilypond
473
474 @funindex chordRootNamer
475 @item chordRootNamer
476 The chord name is usually printed as a letter for the root with an
477 optional alteration.  The transformation from pitch to letter is
478 done by this function.  Special note names (for example, the German
479 @q{H} for a B-chord) can be produced by storing a new function in
480 this property.
481
482 @funindex chordNoteNamer
483 @item chordNoteNamer
484 When the chord name contains an additional pitch besides the root
485 (e.g., an added bass note), this function is used to print the
486 additional pitch. By default the pitch is printed using
487 @code{chordRootNamer}. The @code{chordNoteNamer} property can be set
488 to a specialized function to change this behavior.  For example, the
489 bass note can be printed in lower case.
490
491 @funindex chordPrefixSpacer
492 @item chordPrefixSpacer
493 The @q{m} for minor chords is usually printed immediately to the
494 right of the root of the chord.  By setting
495 @code{chordPrefixSpacer}, you can fix a spacer between the root and
496 @q{m}.  The spacer is not used when the root is altered.
497
498 @end table
499
500
501
502
503 @cindex Banter
504 @cindex jazz chords
505 @cindex chords, jazz
506
507 @predefined
508 @funindex major seven symbols
509 @code{\whiteTriangleMarkup}
510 @code{\blackTriangleMarkup}
511 @funindex \germanChords
512 @code{\germanChords},
513 @funindex \semiGermanChords
514 @code{\semiGermanChords},
515 @funindex \italianChords
516 @code{\italianChords},
517 @funindex \frenchChords
518 @code{\frenchChords}.
519
520
521 @snippets
522 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
523 {chord-names-jazz.ly}
524
525 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
526 {chord-name-exceptions.ly}
527 @cindex exceptions, chord names.
528
529 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
530 {chord-name-major7.ly}
531
532 @seealso
533 @c Music Glossary:
534 @c @rglos{}.
535
536 @c Learning Manual:
537 @c @rlearning{}.
538
539 @c Notation Reference:
540 @c @ruser{}.
541
542 @c Application Usage:
543 @c @rprogram{}.
544
545 Installed Files:
546 @file{scm/@/chords@/-ignatzek@/.scm},
547 @file{scm/@/chord@/-entry@/.scm},
548 @file{ly/@/chord@/-modifier@/-init@/.ly}.
549
550 @c Snippets: @c @rlsr{}.
551
552 @c Internals Reference:
553 @c @rinternals{}.
554
555 @knownissues
556
557 When chords are entered with the @code{< .. >} syntax, the root and
558 any added bass notes are not identified.  In this  case, chord names
559 are determined solely from the list of pitches.  This may result in
560 strange chord names
561
562 @n ode Lead sheets
563 @u nnumberedsubsubsec Lead sheets
564
565 @cindex lead sheet
566
567 For lead sheets, chords are not printed on staves, but as names on a
568 line for themselves.  This is achieved by using a @code{ChordNames}
569 context simultaneously with the @code{Staff} context.  The
570 @code{\chords} keyword can be used as a shortcut for @code{\new
571 ChordNames \chordmode}.
572
573 When put together, chord names, a melody, and lyrics form a lead
574 sheet:
575
576 @lilypond[verbatim,quote,ragged-right]
577 <<
578   \chords { c2 g:sus4 f e }
579   \relative c'' {
580     a4 e c8 e r4
581     b2 c4( d)
582   }
583   \addlyrics { One day this shall be free __ }
584 >>
585 @end lilypond
586
587 @c @predefined
588
589 @c @snippets
590
591 @seealso
592 @c Music Glossary:
593 @c @rglos{}.
594
595 @c Learning Manual:
596 @c @rlearning{}.
597
598 @c Notation Reference:
599 @c @ruser{}.
600
601 @c Application Usage:
602 @c @rprogram{}.
603
604 @c Installed Files:
605 @c @file{}.
606
607 @c Snippets:
608 @c @rlsr{}.
609
610 @c Internals Reference:
611 @c @rinternals{}.
612
613 @c @knownissues
614
615
616
617
618 @end ignore
619
620
621 @node old Modern chords
622 @subsection old Modern chords
623
624 @menu
625 * Chord modes::                 
626 * Entering chord names::        
627 * Building chords::             
628 * Lead sheets::                 
629 * Printing chord names::        
630 @end menu
631
632 @cindex chords
633 @cindex chord names
634
635 @node Chord modes
636 @subsubsection Chord modes
637
638 In popular music it is common to denote accompaniment with chord
639 names.  Such chords can be entered like notes,
640
641 @lilypond[verbatim,quote,ragged-right]
642 \chordmode { c2 f4. g8 }
643 @end lilypond
644
645 Now each pitch is read as the root of a chord instead of a note.
646 This mode is switched on with @code{\chordmode}.  Other chords can
647 be created by adding modifiers after a colon.  The following
648 example shows a few common modifiers:
649
650 @lilypond[verbatim,quote,ragged-right]
651 \chordmode { c2 f4:m g4:maj7 gis1:dim7 }
652 @end lilypond
653
654 @cindex Chords mode
655
656 In chord mode sets of pitches (chords) are entered with normal note
657 names.  A chord is entered by the root, which is entered like a
658 normal pitch
659
660 @lilypond[quote,ragged-right,fragment,verbatim]
661 \chordmode { es4. d8 c2 }
662 @end lilypond
663
664 @noindent
665 The mode is introduced by the keyword @code{\chordmode}.
666
667 @cindex chord entry
668 @cindex chord mode
669
670 Chords is a mode similar to @code{\lyricmode}, etc.  Most
671 of the commands continue to work, for example, @code{r} and
672 @code{\skip} can be used to insert rests and spaces, and property
673 commands may be used to change various settings.
674 It uses the same syntax as
675 @code{\chordmode}, but renders the notes in a @code{ChordNames}
676 context, with the following result:
677
678 @lilypond[verbatim,quote,ragged-right]
679 \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
680 @end lilypond
681
682
683 @knownissues
684
685 Each step can only be present in a chord once.  The following
686 simply produces the augmented chord, since @code{5+} is interpreted
687 last
688 @cindex clusters
689 @lilypond[quote,ragged-right,verbatim,fragment]
690 \chordmode { c:5.5-.5+ }
691 @end lilypond
692
693
694 @node Entering chord names
695 @subsubsection Entering chord names
696 @cindex chord names
697
698 LilyPond has support for printing chord names.  Chords may be entered
699 in musical chord notation, i.e., @code{< .. >}, but they can also be
700 entered by name.  Internally, the chords are represented as a set of
701 pitches, so they can be transposed
702
703
704 @lilypond[quote,ragged-right,verbatim,ragged-right]
705 twoWays = \transpose c c' {
706   \chordmode {
707     c1 f:sus4 bes/f
708   }
709   <c e g>
710   <f bes c'>
711   <f bes d'>
712 }
713
714 << \new ChordNames \twoWays
715    \new Voice \twoWays >>
716 @end lilypond
717
718 This example also shows that the chord printing routines do not try to
719 be intelligent.  The last chord (@code{f bes d}) is not interpreted as
720 an inversion.
721
722 Note that the duration of chords must be specified outside the
723 @code{<>}.
724
725 @example
726 <c e g>2
727 @end example
728
729 @c TODO Generate snippet based on the following
730 @c      and add explanation -td
731
732 Custom chord names may be generated:
733
734 @lilypond[quote,ragged-right,verbatim,ragged-right]
735 FGGChordNames = {
736   <c e g b d'>1-\markup { \super "maj9" }
737   <c e g a d'>1-\markup { \super "6(add9)" }
738 }
739 chExceptions = #(append
740 (sequential-music-to-chord-exceptions
741 FGGChordNames #t) ignatzekExceptions)
742
743 chordStuff = \chordmode
744 {
745 % standard names
746 g1:maj9
747 g1:6.9
748 % names with FGG's custom exceptions
749 \set chordNameExceptions = #chExceptions
750 g1:maj9
751 g1:6.9
752 }
753
754 \score
755 {
756 \new ChordNames \chordStuff
757 }
758 @end lilypond
759
760 @node Building chords
761 @subsubsection Building chords
762
763 Other chords may be entered by suffixing a colon and introducing a
764 modifier (which may include a number if desired)
765
766 @lilypond[quote,fragment,verbatim]
767 \chordmode { e1:m e1:7 e1:m7 }
768 @end lilypond
769
770 The first number following the root is taken to be the @q{type} of the
771 chord, thirds are added to the root until it reaches the specified
772 number.  The exception is @code{c:13}, for which the 11 is omitted.
773
774 @lilypond[quote,fragment,verbatim]
775 \chordmode { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 c:13 }
776 @end lilypond
777
778 @cindex root of chord
779 @cindex additions, in chords
780 @cindex removals, in chords
781
782 More complex chords may also be constructed adding separate steps
783 to a chord.  Additions are added after the number following
784 the colon and are separated by dots
785
786 @lilypond[quote,verbatim,fragment]
787 \chordmode { c:5.6 c:3.7.8 c:3.6.13 }
788 @end lilypond
789
790 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
791 to the number
792
793 @lilypond[quote,verbatim,fragment]
794 \chordmode { c:7+ c:5+.3- c:3-.5-.7- }
795 @end lilypond
796
797 Removals are specified similarly and are introduced by a caret.  They
798 must come after the additions
799
800 @lilypond[quote,verbatim,fragment]
801 \chordmode { c^3 c:7^5 c:9^3.5 }
802 @end lilypond
803
804 Modifiers can be used to change pitches.  The following modifiers are
805 supported
806
807 @table @code
808 @item m
809 The minor chord.  This modifier lowers the 3rd and (if present) the 7th step.
810
811 @item dim
812 The diminished chord.  This modifier lowers the 3rd, 5th and (if present)
813 the 7th step.
814
815 @item aug
816 The augmented chord.  This modifier raises the 5th step.
817
818 @item maj
819 The major 7th chord.  This modifier raises the 7th step if present.
820
821 @item sus
822 The suspended 4th or 2nd.  This modifier removes the 3rd
823 step.  Append either @code{2} or @code{4} to add the 2nd or 4th step to
824 the chord.
825 @end table
826
827 Modifiers can be mixed with additions
828 @lilypond[quote,verbatim,fragment]
829   \chordmode { c:sus4 c:7sus4 c:dim7 c:m6 }
830 @end lilypond
831
832 @cindex modifiers, in chords.
833 @funindex aug
834 @funindex dim
835 @funindex maj
836 @funindex sus
837 @funindex m
838
839 Since an unaltered 11 does not sound good when combined with an
840 unaltered 13, the 11 is removed in this case (unless it is added
841 explicitly)
842 @lilypond[quote,ragged-right,fragment,verbatim]
843 \chordmode { c:13 c:13.11 c:m13 }
844 @end lilypond
845
846 @funindex /
847
848 An inversion (putting one pitch of the chord on the bottom), as well
849 as bass notes, can be specified by appending
850 @code{/}@var{pitch} to the chord
851 @lilypond[quote,ragged-right,fragment,verbatim]
852 \chordmode { c1 c/g c/f }
853 @end lilypond
854 @funindex /+
855
856 A bass note can be added instead of transposed out of the chord,
857 by using @code{/+}@var{pitch}.
858
859 @lilypond[quote,ragged-right,fragment,verbatim]
860 \chordmode { c1 c/+g c/+f }
861 @end lilypond
862
863
864 @node Lead sheets
865 @subsubsection Lead sheets
866
867 @cindex lead sheet
868
869 For lead sheets, chords are not printed on staves, but as names on
870 a line for themselves.  This is achieved by using @code{\chords}
871 instead of @code{\chordmode}.
872
873 When put together, chord names, lyrics and a melody form a lead
874 sheet,
875
876 @lilypond[verbatim,quote,ragged-right]
877 <<
878   \chords { c2 g:sus4 f e }
879   \relative c'' {
880     a4 e c8 e r4
881     b2 c4( d)
882   }
883   \addlyrics { One day this shall be free __ }
884 >>
885 @end lilypond
886
887
888
889 @node Printing chord names
890 @subsubsection Printing chord names
891
892 @cindex printing chord names
893 @cindex chord names
894 @cindex chords
895
896 For displaying printed chord names, use the @rinternals{ChordNames} context.
897 The chords may be entered either using the notation
898 described above, or directly using @code{<} and @code{>}
899
900 @lilypond[quote,verbatim,ragged-right]
901 harmonies = {
902   \chordmode {a1 b c} <d' f' a'> <e' g' b'>
903 }
904 <<
905   \new ChordNames \harmonies
906   \new Staff \harmonies
907 >>
908 @end lilypond
909
910 You can make the chord changes stand out by setting
911 @rinternals{ChordNames}.@code{chordChanges} to true.  This will only
912 display chord names when there is a change in the chords scheme and at
913 the start of a new line
914
915 @lilypond[quote,verbatim,ragged-right]
916 harmonies = \chordmode {
917   c1:m c:m \break c:m c:m d
918 }
919 <<
920   \new ChordNames {
921     \set chordChanges = ##t
922     \harmonies }
923   \new Staff \transpose c c' \harmonies
924 >>
925 @end lilypond
926
927 The previous examples all show chords over a staff.  This is not
928 necessary.  Chords may also be printed separately.  It may be necessary
929 to add @rinternals{Volta_engraver} and @rinternals{Bar_engraver}
930 for showing repeats.
931
932 @lilypond[ragged-right,verbatim]
933 \new ChordNames \with {
934   \override BarLine #'bar-size = #4
935   \consists Bar_engraver
936   \consists "Volta_engraver"
937 }
938 \chordmode { \repeat volta 2 {
939   f1:maj7 f:7 bes:7
940   c:maj7
941 } \alternative {
942   es e
943 }
944 }
945 @end lilypond
946
947
948 The default chord name layout is a system for Jazz music, proposed by
949 Klaus Ignatzek (see @ref{Literature list}).  It can be tuned through the
950 following properties
951
952 @table @code
953 @funindex chordNameExceptions
954 @item chordNameExceptions
955 This is a list that contains the chords that have special formatting.
956
957 The exceptions list should be encoded as
958 @example
959 @{ <c f g bes>1 \markup @{ \super "7" "wahh" @} @}
960 @end example
961
962 To get this information into @code{chordNameExceptions} takes a little
963 maneuvering.  The following code transforms @code{chExceptionMusic}
964 (which is a sequential music) into a list of exceptions.
965 @example
966 (sequential-music-to-chord-exceptions chExceptionMusic #t)
967 @end example
968 Then,
969 @example
970 (append
971  (sequential-music-to-chord-exceptions chExceptionMusic #t)
972  ignatzekExceptions)
973 @end example
974 adds the new exceptions to the default ones, which are defined in
975 @file{ly/@/chord@/-modifier@/-init@/.ly}.
976
977 For an example of tuning this property, see also
978 @c @lsr{chords,chord@/-name@/-exceptions@/.ly}
979 @cindex exceptions, chord names.
980
981
982 @funindex majorSevenSymbol
983 @item majorSevenSymbol
984 This property contains the markup object used for the 7th step, when
985 it is major.  Predefined options are @code{whiteTriangleMarkup} and
986 @code{blackTriangleMarkup}.  See
987 @c @lsr{chords,chord@/-name@/-major7@/.ly} for an example.
988
989 @funindex chordNameSeparator
990 @item chordNameSeparator
991 Different parts of a chord name are normally separated by a
992 slash.  By setting @code{chordNameSeparator}, you can specify other
993 separators, e.g.,
994 @lilypond[quote,ragged-right,fragment,verbatim]
995 \new ChordNames \chordmode {
996   c:7sus4
997   \set chordNameSeparator
998     = \markup { \typewriter "|" }
999   c:7sus4
1000 }
1001 @end lilypond
1002
1003 @funindex chordRootNamer
1004 @item chordRootNamer
1005 The root of a chord is usually printed as a letter with an optional
1006 alteration.  The transformation from pitch to letter is done by this
1007 function.  Special note names (for example, the German @q{H} for a
1008 B-chord) can be produced by storing a new function in this property.
1009
1010 @funindex chordNoteNamer
1011 @item chordNoteNamer
1012 The default is to print single pitch, e.g., the bass note, using the
1013 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
1014 to a specialized function to change this behavior.  For example, the
1015 base can be printed in lower case.
1016
1017 @funindex chordPrefixSpacer
1018 @item chordPrefixSpacer
1019 The @q{m} for minor chords is usually printed right after the root of
1020 the chord.  By setting @code{chordPrefixSpacer}, you can fix a spacer
1021 between the root and @q{m}.  The spacer is not used when the root
1022 is altered.
1023
1024 @end table
1025
1026 The predefined variables @code{\germanChords},
1027 @code{\semiGermanChords}, @code{\italianChords} and @code{\frenchChords}
1028 set these variables.  The effect is
1029 demonstrated here,
1030
1031 @lilypondfile[ragged-right]{chord-names-languages.ly}
1032
1033 There are also two other chord name schemes implemented: an alternate
1034 Jazz chord notation, and a systematic scheme called Banter chords.  The
1035 alternate Jazz notation is also shown on the chart in @ref{Chord name
1036 chart}.  Turning on these styles is demonstrated in
1037 @c @lsr{chords,chord-names-jazz.ly}.
1038
1039 @cindex Banter
1040 @cindex jazz chords
1041 @cindex chords, jazz
1042
1043
1044 @predefined
1045
1046 @funindex \germanChords
1047 @code{\germanChords},
1048 @funindex \semiGermanChords
1049 @code{\semiGermanChords}.
1050 @funindex \italianChords
1051 @code{\italianChords}.
1052 @funindex \frenchChords
1053 @code{\frenchChords}.
1054
1055
1056
1057
1058 @seealso
1059
1060 Examples:
1061
1062 Init files: @file{scm/@/chords@/-ignatzek@/.scm}, and
1063 @file{scm/@/chord@/-entry@/.scm}.
1064
1065
1066 @knownissues
1067
1068 Chord names are determined solely from the list of pitches.  Chord
1069 inversions are not identified, and neither are added bass notes.  This
1070 may result in strange chord names when chords are entered with the
1071 @code{< .. >} syntax.
1072
1073
1074 @node Figured bass
1075 @subsection Figured bass
1076
1077 @menu
1078 * Introduction to figured bass::  
1079 * Entering figured bass::       
1080 * Displaying figured bass::     
1081 @end menu
1082
1083 @node Introduction to figured bass
1084 @subsubsection Introduction to figured bass
1085
1086 @cindex Basso continuo
1087
1088 @c TODO: musicological blurb about FB
1089
1090 LilyPond has support for figured bass
1091
1092 @lilypond[quote,ragged-right,verbatim,fragment]
1093 <<
1094   \new Voice { \clef bass dis4 c d ais g fis}
1095   \new FiguredBass \figuremode {
1096     < 6 >4 < 7\+ >8 < 6+ [_!] >
1097     < 6 >4 <6 5 [3+] >
1098     < _ >4 < 6 5/>4
1099   }
1100 >>
1101 @end lilypond
1102
1103 The support for figured bass consists of two parts: there is an
1104 input mode, introduced by @code{\figuremode}, where you can enter
1105 bass figures as numbers, and there is a context named
1106 @rinternals{FiguredBass} that takes care of making
1107 @rinternals{BassFigure} objects.
1108
1109 Although the support for figured bass may superficially resemble chord
1110 support, it is much simpler.  The @code{\figuremode} mode simply
1111 stores the numbers and @rinternals{FiguredBass} context prints them
1112 as entered.  There is no conversion to pitches and no realizations of
1113 the bass are played in the MIDI file.
1114
1115 Internally, the code produces markup texts.  You can use any of the
1116 markup text properties to override formatting.  For example, the
1117 vertical spacing of the figures may be set with @code{baseline-skip}.
1118
1119
1120 @menu
1121 * Entering figured bass::
1122 * Displaying figured bass::
1123 @end menu
1124
1125 @node Entering figured bass
1126 @unnumberedsubsubsec Entering figured bass
1127
1128
1129 In figures input mode, a group of bass figures is delimited by
1130 @code{<} and @code{>}.  The duration is entered after the @code{>}
1131 @example
1132 <4 6>2
1133 @end example
1134 @lilypond[quote,ragged-right,fragment]
1135 \new FiguredBass
1136 \figuremode { <4 6>2 }
1137 @end lilypond
1138
1139 Accidentals are added when you append @code{-}, @code{!}, and @code{+}
1140 to the numbers.  A plus sign is added when you append @code{\+}, and
1141 diminished fifths and sevenths can be obtained with @code{5/} and @code{7/}.
1142
1143 @example
1144 <4- 6+ 7!>3 <5++> <3--> <7/> r <6\+ 5/>
1145 @end example
1146 @lilypond[quote,ragged-right,fragment]
1147 \figures { <4- 6+ 7!>4 <5++> <3--> <7/> r <6\+ 5/> }
1148 @end lilypond
1149
1150 Spaces may be inserted by using @code{_}.  Brackets are
1151 introduced with @code{[} and @code{]}.  You can also include text
1152 strings and text markups, see @ref{Text markup commands}.
1153
1154 @example
1155 < [4 6] 8 [_! 12] >4 < 5 \markup @{ \number 6 \super (1) @} >
1156 @end example
1157 @lilypond[quote,ragged-right,fragment]
1158 \new FiguredBass
1159 \figuremode { < [4 6] 8 [_! 12] >4 < 5 \markup{ \tiny \number 6 \super (1)} > }
1160 @end lilypond
1161
1162
1163 It is also possible to use continuation lines for repeated figures,
1164
1165 @lilypond[verbatim,relative=1]
1166 <<
1167   \new Staff {
1168     \clef bass
1169     c4 c c
1170   }
1171   \figures {
1172     \set useBassFigureExtenders = ##t
1173     <4 6>4 <3 6> <3 7>
1174   }
1175 >>
1176 @end lilypond
1177
1178 @noindent
1179 In this case, the extender lines always replace existing figures.
1180
1181 The @code{FiguredBass} context doesn't pay attention to the actual
1182 bass line.  As a consequence, you may have to insert extra figures to
1183 get extender lines below all notes, and you may have to add @code{\!}
1184 to avoid getting an extender line, e.g.
1185
1186 @lilypond[relative=1]
1187 <<
1188   \new Voice
1189   \figures {
1190     \set useBassFigureExtenders = ##t
1191     <6 4->4. <6 4->16. <6 4->32 <5>8. r16 <6>8 <6\! 5->
1192   }
1193   {
1194     \clef bass
1195     f16. g32 f16. g32 f16. g32 f16. g32 f8. es16 d8 es
1196   }
1197 >>
1198 @end lilypond
1199
1200 When using continuation lines, common figures are always put in the
1201 same vertical position.  When this is unwanted, you can insert a rest
1202 with @code{r}.  The rest will clear any previous alignment.  For
1203 example, you can write
1204
1205 @example
1206 <4 6>8 r8
1207 @end example
1208
1209 @noindent
1210 instead of
1211 @example
1212 <4 6>4
1213 @end example
1214
1215 Accidentals and plus signs can appear before or after the numbers,
1216 depending on the @code{figuredBassAlterationDirection} and
1217 @code{figuredBassPlusDirection}
1218 properties
1219
1220 @lilypond
1221   \figures {
1222     <6\+> <5+> <6 4-> r
1223     \set figuredBassAlterationDirection = #1
1224     <6\+> <5+> <6 4-> r
1225     \set figuredBassPlusDirection = #1
1226     <6\+> <5+> <6 4-> r
1227     \set figuredBassAlterationDirection = #-1
1228     <6\+> <5+> <6 4-> r
1229   }
1230 @end lilypond
1231
1232
1233 Figured bass can also be added to @code{Staff} contexts
1234 directly.  In this case, their vertical position is adjusted
1235 automatically.
1236
1237 @lilypond[ragged-right,fragment,quote]
1238 <<
1239   \new Staff = someUniqueName
1240   \relative c'' {
1241     c4 c'8 r8 c,4 c'
1242   }
1243
1244   %% send to existing Staff.
1245   \context Staff = someUniqueName
1246   \figuremode {
1247     <4>4 <6 10>8 s8
1248
1249     \set Staff.useBassFigureExtenders = ##t
1250     <4 6>4 <4 6>
1251   }
1252 >>
1253 @end lilypond
1254
1255 @c @predefined
1256
1257 @c @snippets
1258
1259 @seealso
1260 @c Music Glossary:
1261 @c @rglos{}.
1262
1263 @c Learning Manual:
1264 @c @rlearning{}.
1265
1266 @c Notation Reference:
1267 @c @ruser{}.
1268
1269 @c Application Usage:
1270 @c @rprogram{}.
1271
1272 @c Installed Files:
1273 @c @file{}.
1274
1275 @c Snippets:
1276 @c @rlsr{}.
1277
1278 @c Internals Reference:
1279 @c @rinternals{}.
1280
1281 @c @knownissues
1282
1283 @node Displaying figured bass
1284 @unnumberedsubsubsec Displaying figured bass
1285
1286 Figured bass is displayed using the @code{FiguredBass} context.
1287
1288 @c @predefined
1289
1290 @c @snippets
1291
1292 @seealso
1293 @c Music Glossary:
1294 @c @rglos{}.
1295
1296 @c Learning Manual:
1297 @c @rlearning{}.
1298
1299 @c Notation Reference:
1300 @c @ruser{}.
1301
1302 @c Application Usage:
1303 @c @rprogram{}.
1304
1305 @c Installed Files:
1306 @c @file{}.
1307
1308 @c Snippets:
1309 @c @rlsr{}.
1310
1311 Internals Reference:
1312 @rinternals{NewBassFigure},
1313 @rinternals{BassFigureAlignment},
1314 @rinternals{BassFigureLine},
1315 @rinternals{BassFigureBracket},
1316 @rinternals{BassFigureContinuation},
1317 @rinternals{FiguredBass}.
1318
1319 @knownissues
1320
1321 By default, this method produces figures above the notes.  To get
1322 figures below the notes, use
1323
1324 @example
1325 \override Staff.BassFigureAlignmentPositioning #'direction = #DOWN
1326 @end example
1327
1328 When using figured bass above the staff with extender lines and
1329 @code{implicitBassFigures} the lines may become swapped around.
1330 Maintaining order consistently will be impossible when multiple figures
1331 have overlapping extender lines.  To avoid this problem, please
1332 use @code{stacking-dir} on @code{BassFigureAlignment}.
1333
1334
1335 @seealso