]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/chords.itely
Add '-dcrop' option to ps and svg backends
[lilypond.git] / Documentation / notation / 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.  For details, see the Contributors'
7     Guide, node Updating translation committishes..
8 @end ignore
9
10 @c \version "2.19.28"
11
12
13 @node Chord notation
14 @section Chord notation
15
16 @lilypondfile[quote]{chords-headword.ly}
17
18 Chords can be entered either as normal notes or in chord mode and displayed
19 using a variety of traditional European chord naming conventions.  Chord
20 names and figured bass notation can also be displayed.
21
22 @menu
23 * Chord mode::
24 * Displaying chords::
25 * Figured bass::
26 @end menu
27
28
29 @node Chord mode
30 @subsection Chord mode
31
32 @cindex chord chords
33
34 Chord mode is used to enter chords using an indicator of the chord
35 structure, rather than the chord pitches.
36
37 @menu
38 * Chord mode overview::
39 * Common chords::
40 * Extended and altered chords::
41 @end menu
42
43 @node Chord mode overview
44 @unnumberedsubsubsec Chord mode overview
45
46 @cindex chord names
47 @cindex chord mode
48
49 Chords can be entered as simultaneous music, as discussed in
50 @ref{Chorded notes}.
51
52 Chords can also be entered in @qq{chord mode}, which is an input
53 mode that focuses on the structures of chords in traditional
54 European music, rather than on specific pitches.  This is
55 convenient for those who are familiar with using chord names to
56 describe chords.  More information on different input modes can be
57 found at @ref{Input modes}.
58
59 @lilypond[verbatim,quote,ragged-right]
60 \chordmode { c1 g a g c }
61 @end lilypond
62
63 Chords entered using chord mode are music elements, and can be
64 transposed just like chords entered using simultaneous music.
65 @code{\chordmode} is absolute, as @code{\relative} has no effect
66 on @code{chordmode} blocks.  However, in @code{\chordmode} the
67 absolute pitches are one octave higher than in note mode.
68
69 Chord mode and note mode can be mixed in sequential music:
70
71 @lilypond[verbatim,quote,ragged-right]
72 \relative {
73   <c' e g>2 <g b d>
74   \chordmode { c2 f }
75   <c e g>2 <g' b d>
76   \chordmode { f2 g }
77 }
78 @end lilypond
79
80 @seealso
81 Music Glossary:
82 @rglos{chord}.
83
84 Notation Reference:
85 @ref{Chorded notes},
86 @ref{Input modes}.
87
88 Snippets:
89 @rlsr{Chords}.
90
91 @knownissues
92 Predefined shorthands for articulations and ornaments cannot be used
93 on notes in chord mode, see @ref{Articulations and ornamentations}.
94
95
96 @node Common chords
97 @unnumberedsubsubsec Common chords
98
99 @cindex triads
100 @cindex seventh chords
101 @cindex root of chord
102 @cindex modifiers, in chords.
103 @cindex chord quality
104
105 Major triads are entered by including the root and an
106 optional duration:
107
108 @lilypond[verbatim,quote,ragged-right]
109 \chordmode { c2 f4 g }
110 @end lilypond
111
112 Minor, augmented, and diminished triads are entered by placing
113 @code{:} and a quality modifier string after the duration:
114
115 @lilypond[verbatim,quote,ragged-right]
116 \chordmode { c2:m f4:aug g:dim }
117 @end lilypond
118
119 Seventh chords can be created:
120
121 @lilypond[quote,ragged-right,verbatim]
122 \chordmode { c1:7 c:m7 c:maj7 c:dim7 c:aug7 }
123 @end lilypond
124
125 @funindex aug
126 @funindex dim
127 @funindex maj
128 @funindex m
129
130 The table below shows the actions of the quality modifiers on
131 triads and seventh chords.  The default seventh step added to
132 chords is a minor or flatted seventh, which makes the dominant
133 seventh the basic seventh chord.  All alterations are relative to
134 the dominant seventh.  A more complete table of modifier usage
135 is found at @ref{Common chord modifiers}.
136
137 @c @table @code
138 @multitable @columnfractions .2 .4 .3
139
140 @item
141 @b{Modifier}
142 @tab
143 @b{Action}
144 @tab
145 @b{Example}
146
147 @item
148 None
149 @tab
150 The default action; produces a major triad.
151 @tab
152 @lilypond[line-width=4\cm, noragged-right]
153 \chordmode {
154   \omit Staff.TimeSignature
155   c1
156 }
157 @end lilypond
158
159 @item
160 m, m7
161 @tab
162 The minor chord.  This modifier lowers the 3rd.
163 @tab
164 @lilypond[line-width=4\cm, noragged-right]
165 \chordmode {
166   \omit Staff.TimeSignature
167   c1:m c:m7
168 }
169 @end lilypond
170
171
172 @item
173 dim, dim7
174 @tab
175 The diminished chord.  This modifier lowers the 3rd, 5th and (if
176 present) the 7th step.
177 @tab
178 @lilypond[line-width=4\cm, noragged-right]
179 \chordmode {
180   \omit Staff.TimeSignature
181   c1:dim c:dim7
182 }
183 @end lilypond
184
185 @item
186 aug
187 @tab
188 The augmented chord.  This modifier raises the 5th step.
189 @tab
190 @lilypond[line-width=4\cm, noragged-right]
191 \chordmode {
192   \omit Staff.TimeSignature
193   c1:aug
194 }
195 @end lilypond
196
197 @item
198 maj, maj7
199 @tab
200 The major 7th chord.  This modifier adds a raised 7th step.  The
201 @code{7} following @code{maj} is optional.  Do NOT use this modifier
202 to create a major triad.
203 @tab
204 @lilypond[line-width=4\cm, noragged-right]
205 \chordmode {
206   \omit Staff.TimeSignature
207   c1:maj c:maj7
208 }
209 @end lilypond
210
211 @end multitable
212
213 @seealso
214 Notation Reference:
215 @ref{Common chord modifiers},
216 @ref{Extended and altered chords}.
217
218 Snippets:
219 @rlsr{Chords}.
220
221 @knownissues
222 Only one quality modifier should be used per chord, typically on the
223 highest step present in the chord.  Chords with more than quality
224 modifier will be parsed without an error or warning, but the results
225 are unpredictable.  Chords that cannot be achieved with a single
226 quality modifier should be altered by individual pitches, as described
227 in @ref{Extended and altered chords}.
228
229
230 @node Extended and altered chords
231 @unnumberedsubsubsec Extended and altered chords
232
233 @cindex extended chords
234 @cindex altered chords
235
236 Chord structures of arbitrary complexity can be created in chord
237 mode.  The modifier string can be used to extend a chord, add or
238 remove chord steps, raise or lower chord steps, and add a bass note
239 or create an inversion.
240
241 The first number following the @code{:} is taken to be the extent
242 of the chord.  The chord is constructed by sequentially adding
243 thirds to the root until the specified number has been reached.
244 Note that the seventh step added as part of an extended chord will be the
245 minor or flatted seventh, not the major seventh.
246 If the extent is not a third (e.g., 6), thirds are added up to the
247 highest third below the extent, and then the step of the extent is
248 added.  The largest possible value for the extent is 13.  Any
249 larger value is interpreted as 13.
250
251 @lilypond[quote,ragged-right,verbatim]
252 \chordmode {
253   c1:2 c:3 c:4 c:5
254   c1:6 c:7 c:8 c:9
255   c1:10 c:11 c:12 c:13
256   c1:14
257 }
258 @end lilypond
259
260 @noindent
261 As a special exception, @code{c:5} produces a @q{power chord} only
262 consisting of root and fifth.
263
264 Since an unaltered 11 does not sound good when combined with an
265 unaltered 13, the 11 is removed from a @code{:13} chord (unless it
266 is added explicitly).
267
268 @lilypond[quote,ragged-right,verbatim]
269 \chordmode {
270   c1:13 c:13.11 c:m13
271 }
272 @end lilypond
273
274 @cindex additions, in chords
275
276 Individual steps can be added to a chord.  Additions follow the
277 extent and are prefixed by a dot (@code{.}).  The basic seventh
278 step added to a chord is the minor or flatted seventh, rather than
279 the major seventh.
280
281 @lilypond[quote,verbatim]
282 \chordmode {
283   c1:3.5.6 c:3.7.8 c:3.6.13
284 }
285 @end lilypond
286
287 Added steps can be as high as desired.
288
289 @lilypond[quote,verbatim]
290 \chordmode {
291   c4:3.5.15 c:3.5.20 c:3.5.25 c:3.5.30
292 }
293 @end lilypond
294
295 @cindex chord steps, altering
296
297 Added chord steps can be altered by suffixing a @code{-} or @code{+}
298 sign to the number.  To alter a step that is automatically included
299 as part of the basic chord structure, add it as an altered step.
300
301 @lilypond[quote,verbatim]
302 \chordmode {
303   c1:7+ c:5+.3- c:3-.5-.7-
304 }
305 @end lilypond
306
307 @cindex removals, in chords
308
309 @funindex ^
310
311 Following any steps to be added, a series of steps to be removed
312 is introduced in a modifier string with a prefix of @code{^}.
313 If more than one step is to be removed, the steps to be
314 removed are separated by @code{.} following the
315 initial @code{^}.
316
317 @lilypond[quote,verbatim]
318 \chordmode {
319   c1^3 c:7^5 c:9^3 c:9^3.5 c:13.11^3.7
320 }
321 @end lilypond
322
323 @funindex sus
324
325 The modifier @code{sus} can be added to the modifier string to
326 create suspended chords.  This removes the 3rd step from the
327 chord.  Append either @code{2} or @code{4} to add the 2nd or 4th
328 step to the chord.  When @code{sus} is followed by either a 2nd or
329 4th step, it is equivalent to @code{^3}, otherwise to @code{sus4},
330 namely @code{5.4}.
331
332 @lilypond[quote,ragged-right,verbatim]
333 \chordmode {
334   c1:sus c:sus2 c:sus4 c:5.4
335 }
336 @end lilypond
337
338 @funindex /
339 @cindex chord inversions
340 @cindex bass note, for chords
341
342 Inversions (putting a pitch other than the root on the bottom of the
343 chord) and added bass notes can be specified by appending
344 @code{/}@var{pitch} to the chord.
345
346 @lilypond[quote,ragged-right,verbatim]
347 \chordmode {
348   c'1 c'/e c'/f
349 }
350 @end lilypond
351
352 @funindex /+
353
354 A bass note that is part of the chord can be added, instead of
355 moved as part of an inversion, by using @code{/+}@var{pitch}.
356
357 @lilypond[quote,ragged-right,verbatim]
358 \chordmode {
359   c'1 c'/g c'/+e
360 }
361 @end lilypond
362
363 Chord modifiers that can be used to produce a variety of
364 standard chords are shown in
365 @ref{Common chord modifiers}.
366
367 @seealso
368 Notation Reference:
369 @ref{Common chord modifiers}.
370
371 Snippets:
372 @rlsr{Chords}.
373
374 @knownissues
375 Each step can only be present in a chord once.  The following
376 simply produces the augmented chord, since @code{5+} is
377 interpreted last.
378
379 @lilypond[quote,ragged-right,verbatim]
380 \chordmode { c1:3.5.5-.5+ }
381 @end lilypond
382
383
384 @node Displaying chords
385 @subsection Displaying chords
386
387 Chords can be displayed by name, in addition to the standard display
388 as notes on a staff.
389
390 @menu
391 * Printing chord names::
392 * Customizing chord names::
393 @end menu
394
395 @node Printing chord names
396 @unnumberedsubsubsec Printing chord names
397
398 @cindex printing chord names
399 @cindex chord names
400 @cindex chords
401
402 Chord names are printed in the @code{ChordNames} context:
403
404 @lilypond[verbatim,quote,ragged-right]
405 \new ChordNames {
406   \chordmode {
407     c2 f4. g8
408   }
409 }
410 @end lilypond
411
412 Chords can be entered as simultaneous notes or through the use of
413 chord mode.  The displayed chord name will be the same, regardless
414 of the mode of entry, unless there are inversions or added bass notes:
415
416 @lilypond[verbatim,quote]
417 chordmusic = \relative {
418   <c' e g>2 <f bes c>
419   <f c' e g>1
420   \chordmode {
421     c2 f:sus4 c1:/f
422   }
423 }
424 <<
425   \new ChordNames {
426     \chordmusic
427   }
428   {
429     \chordmusic
430   }
431 >>
432 @end lilypond
433
434 @cindex no chord symbol
435 @cindex N.C. symbol
436 @cindex indicating No Chord in ChordNames
437
438 Rests passed to a @code{ChordNames} context will cause the
439 @code{noChordSymbol} markup to be displayed.
440
441 @lilypond[verbatim,quote]
442 <<
443   \new ChordNames \chordmode {
444     c1
445     r1
446     g1
447     c1
448   }
449   \chordmode {
450     c1
451     r1
452     g1
453     c1
454   }
455 >>
456 @end lilypond
457
458 @funindex{\chords}
459
460 @code{\chords @{ @dots{} @}} is a shortcut notation for
461 @code{\new ChordNames \chordmode @{ @dots{} @}}.
462
463 @lilypond[verbatim,quote,ragged-right]
464 \chords {
465   c2 f4.:m g8:maj7
466 }
467 @end lilypond
468
469 @lilypond[verbatim,quote,ragged-right]
470 \new ChordNames {
471   \chordmode {
472     c2 f4.:m g8:maj7
473   }
474 }
475 @end lilypond
476
477 @snippets
478
479 @c Keep index entries with following snippet
480 @cindex chords, suppressing repeated
481 @funindex chordChanges
482
483 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
484 {showing-chords-at-changes.ly}
485
486 @c @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
487 @c {adding-bar-lines-to-chordnames-context.ly}
488
489 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
490 {simple-lead-sheet.ly}
491
492 @seealso
493 Music Glossary:
494 @rglos{chord}.
495
496 Notation Reference:
497 @ref{Writing music in parallel}.
498
499 Snippets:
500 @rlsr{Chords}.
501
502 Internals Reference:
503 @rinternals{ChordNames},
504 @rinternals{ChordName},
505 @rinternals{Chord_name_engraver},
506 @rinternals{Volta_engraver},
507 @rinternals{Bar_engraver}.
508
509 @knownissues
510 Chords containing inversions or altered bass notes are not named
511 properly if entered using simultaneous music.
512
513
514 @node Customizing chord names
515 @unnumberedsubsubsec Customizing chord names
516
517 @cindex customizing chord names
518
519 There is no unique system for naming chords.  Different musical
520 traditions use different names for the same set of chords.  There
521 are also different symbols displayed for a given chord name.  The
522 names and symbols displayed for chord names are customizable.
523
524 @cindex jazz chords
525 @cindex chords, jazz
526
527 The basic chord name layout is a system for Jazz music, proposed
528 by Klaus Ignatzek (see @ressay{Literature list}).  The chord naming
529 system can be modified as described below.  An alternate jazz
530 chord system has been developed using these modifications.
531 The Ignatzek and alternate
532 Jazz notation are shown on the chart in @ref{Chord name chart}.
533
534 @c TODO --  Change this so we don't have a non-verbatim example.
535 @c  Make short example in docs, then move longer example to
536 @c  appendix, where the length of the snippet won't matter.
537
538 In addition to the different naming systems, different note names
539 are used for the root in different languages.  The predefined
540 commands @code{\germanChords}, @code{\semiGermanChords},
541 @code{\italianChords} and @code{\frenchChords} set these variables.
542 The effect is demonstrated here:
543
544 @lilypondfile[ragged-right]{chord-names-languages.ly}
545
546
547 @funindex chordNameLowercaseMinor
548
549 German songbooks may indicate minor chords as lowercase letters,
550 without any @var{m} suffix.  This can be obtained by setting the
551 @code{chordNameLowercaseMinor} property:
552
553 @lilypond[verbatim,quote,ragged-right]
554 \chords {
555   \set chordNameLowercaseMinor = ##t
556   c2 d:m e:m f
557 }
558 @end lilypond
559
560 If none of the existing settings give the desired output, the chord
561 name display can be tuned through the following properties.
562
563 @table @code
564
565 @funindex chordRootNamer
566
567 @item chordRootNamer
568
569 The chord name is usually printed as a letter for the root with an
570 optional alteration.  The transformation from pitch to letter is
571 done by this function.  Special note names (for example, the German
572 @q{H} for a B-chord) can be produced by storing a new function in
573 this property.
574
575 @funindex majorSevenSymbol
576
577 @item majorSevenSymbol
578
579 This property contains the markup object used to follow the output
580 of @code{chordRootNamer} to identify a major 7 chord.  Predefined
581 options are @code{whiteTriangleMarkup} and
582 @code{blackTriangleMarkup}.
583
584 @funindex additionalPitchPrefix
585
586 @item additionalPitchPrefix
587
588 When the chord name contains additional pitches, they can optionally
589 be prefixed with some text.  The default is no prefix, in order to
590 avoid too much visual clutter, but for small numbers of additional
591 pitches this can be visually effective.
592
593 @lilypond[verbatim,quote,ragged-right]
594 \new ChordNames {
595   <c e g d'>    % add9
596   \set additionalPitchPrefix = #"add"
597   <c e g d'>    % add9
598 }
599 @end lilypond
600
601 @funindex chordNoteNamer
602
603 @item chordNoteNamer
604
605 When the chord name contains additional pitches other than the root
606 (e.g., an added bass note), this function is used to print the
607 additional pitch.  By default the pitch is printed using
608 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
609 to a specialized function to change this behavior.  For example, the
610 bass note can be printed in lower case.
611
612 @funindex chordNameSeparator
613
614 @item chordNameSeparator
615
616 Different parts of a chord name are normally separated by a small
617 amount of horizontal space.  By setting @code{chordNameSeparator}, you
618 can use any desired markup for a separator.  This does not affect the
619 separator between a chord and its bass note; to customize that, use
620 @code{slashChordSeparator}.
621
622 @lilypond[verbatim,quote,ragged-right]
623 \chords {
624   c4:7.9- c:7.9-/g
625   \set chordNameSeparator = \markup { "/" }
626   \break
627   c4:7.9- c:7.9-/g
628 }
629 @end lilypond
630
631 @funindex slashChordSeparator
632
633 @item slashChordSeparator
634
635 Chords can be played over a bass note other than the conventional root
636 of the chord.  These are known as ``inversions'' or ``slash chords'',
637 because the default way of notating them is with a forward slash
638 between the main chord and the bass note.  Therefore the value of
639 @code{slashChordSeparator} defaults to a forward slash, but you can
640 change it to any markup you choose.
641
642 @lilypond[verbatim,quote,ragged-right]
643 \chords {
644   c4:7.9- c:7.9-/g
645   \set slashChordSeparator = \markup { " over " }
646   \break
647   c4:7.9- c:7.9-/g
648 }
649 @end lilypond
650
651 @funindex chordNameExceptions
652
653 @item chordNameExceptions
654
655 This property is a list of pairs.  The first item in each pair
656 is a set of pitches used to identify the steps present in the chord.
657 The second item is a markup that will follow the @code{chordRootNamer}
658 output to create the chord name.
659
660 @funindex minorChordModifier
661
662 @item minorChordModifier
663
664 Minor chords are often denoted via a @q{m} suffix to the right of the
665 root of the chord.  However some idioms prefer other suffices, such as
666 a minus sign.
667
668 @lilypond[verbatim,quote,ragged-right]
669 \chords {
670   c4:min f:min7
671   \set minorChordModifier = \markup { "-" }
672   \break
673   c4:min f:min7
674 }
675 @end lilypond
676
677 @funindex chordPrefixSpacer
678
679 @item chordPrefixSpacer
680
681 The modifier for minor chords as determined by
682 @code{minorChordModifier} is usually printed immediately to the right
683 of the root of the chord.  A spacer can be placed between the root and
684 the modifier by setting @code{chordPrefixSpacer}.  The spacer is not
685 used when the root is altered.
686
687 @end table
688
689
690 @predefined
691 @funindex major seven symbols
692 @code{\whiteTriangleMarkup},
693 @code{\blackTriangleMarkup},
694 @funindex \germanChords
695 @code{\germanChords},
696 @funindex \semiGermanChords
697 @code{\semiGermanChords},
698 @funindex \italianChords
699 @code{\italianChords},
700 @funindex \frenchChords
701 @code{\frenchChords}.
702 @endpredefined
703
704
705 @snippets
706
707 @cindex exceptions, chord names.
708 @lilypondfile[verbatim,quote,texidoc,doctitle]
709 {chord-name-exceptions.ly}
710
711 @c TODO - tweak snippet to use \blackTriangleMarkup as well
712 @lilypondfile[verbatim,quote,texidoc,doctitle]
713 {chord-name-major7.ly}
714
715 @lilypondfile[verbatim,quote,texidoc,doctitle]
716 {adding-bar-lines-to-chordnames-context.ly}
717
718 @lilypondfile[verbatim,quote,texidoc,doctitle]
719 {volta-below-chords.ly}
720
721 @lilypondfile[verbatim,quote,texidoc,doctitle]
722 {changing-chord-separator.ly}
723
724 @seealso
725 Notation Reference:
726 @ref{Chord name chart},
727 @ref{Common chord modifiers}.
728
729 Essay on automated music engraving:
730 @ressay{Literature list}.
731
732 Installed Files:
733 @file{scm/chords-ignatzek.scm},
734 @file{scm/chord-entry.scm},
735 @file{ly/chord-modifier-init.ly}.
736
737 Snippets:
738 @rlsr{Chords}.
739
740 @knownissues
741 Chord names are determined from both the pitches that are present
742 in the chord and the information on the chord structure that may
743 have been entered in @code{\chordmode}.  If the simultaneous pitches
744 method of entering chords is used, undesired names result from
745 inversions or bass notes.
746
747 @lilypond[quote,ragged-right,verbatim]
748 myChords = \relative c' {
749   \chordmode { c1 c/g c/f }
750   <c e g>1 <g c e> <f c' e g>
751 }
752 <<
753   \new ChordNames { \myChords }
754   \new Staff { \myChords }
755 >>
756 @end lilypond
757
758
759 @node Figured bass
760 @subsection Figured bass
761
762 @c Line width hack because of instrument names
763 @lilypondfile[quote,staffsize=18,line-width=14.5\cm]{figured-bass-headword.ly}
764
765 Figured bass notation can be displayed.
766
767 @menu
768 * Introduction to figured bass::
769 * Entering figured bass::
770 * Displaying figured bass::
771 @end menu
772
773 @node Introduction to figured bass
774 @unnumberedsubsubsec Introduction to figured bass
775
776 @cindex Basso continuo
777 @cindex Thorough bass
778 @cindex Figured bass
779 @cindex Bass, thorough
780 @cindex Bass, figured
781
782 @c TODO: musicological blurb about FB
783
784
785 LilyPond has support for figured bass, also called thorough bass
786 or basso continuo:
787
788 @lilypond[quote,ragged-right,verbatim]
789 <<
790   \new Voice { \clef bass dis4 c d ais g fis}
791   \new FiguredBass {
792     \figuremode {
793       < 6 >4 < 7\+ >8 < 6+ [_!] >
794       < 6 >4 <6 5 [3+] >
795       < _ >4 < 6 5/>4
796     }
797   }
798 >>
799 @end lilypond
800
801 The support for figured bass consists of two parts: there is an
802 input mode, introduced by @code{\figuremode}, that accepts
803 entry of bass figures, and there is a context named
804 @code{FiguredBass} that takes care of displaying
805 @code{BassFigure} objects.  Figured bass can also be displayed
806 in @code{Staff} contexts.
807
808 @code{\figures@{ @dots{} @}} is a shortcut notation for
809 @code{\new FiguredBass \figuremode @{ @dots{} @}}.
810
811
812 Although the support for figured bass may superficially resemble chord
813 support, it is much simpler.  @code{\figuremode} mode simply
814 stores the figures and the @code{FiguredBass} context prints them
815 as entered.  There is no conversion to pitches.
816
817 @ignore
818 Figures are created as markup texts.  Any of the standard markup
819 properties can be used to modify the display of figures.  For
820 example, the vertical spacing of the figures may be set with
821 @code{baseline-skip}.
822 @end ignore
823
824 @seealso
825 Music Glossary:
826 @rglos{figured bass}.
827
828 Snippets:
829 @rlsr{Chords}.
830
831
832 @node Entering figured bass
833 @unnumberedsubsubsec Entering figured bass
834
835 @code{\figuremode} is used to switch the input mode to figure mode.
836 More information on different input modes can be
837 found at @ref{Input modes}.
838
839 In figure mode, a group of bass figures is delimited by
840 @code{<} and @code{>}.  The duration is entered after the @code{>}.
841
842 @lilypond[verbatim,quote,ragged-right]
843 \new FiguredBass {
844   \figuremode {
845     <6 4>2
846   }
847 }
848 @end lilypond
849
850
851 Accidentals (including naturals) may be used for modifying scale steps.
852 These are entered by appending @code{+} (for sharps), @code{-} (for flats)
853 or @code{!} (for naturals) after the number.  For double accidentals the
854 modifier is applied twice.  For the modification of the third step the
855 number is often omitted, which can be achieved by using @code{_} instead
856 of a number.
857
858 @lilypond[verbatim,quote,ragged-right]
859 \figures {
860   <7! 6+ 4-> <5++> <3--> < _+ > < 7 _!>
861 }
862 @end lilypond
863
864 Augmented and diminished steps can be indicated:
865
866 @lilypond[verbatim,quote,ragged-right]
867 \figures {
868   <6\+ 5/> <7/>
869 }
870 @end lilypond
871
872 A backward slash through a figure (typically used for raised
873 sixth steps) can be created:
874
875 @lilypond[verbatim,quote,ragged-right]
876 \figures {
877   <6> <6\\>
878 }
879 @end lilypond
880
881 Brackets can be included in figures:
882
883 @lilypond[verbatim,quote,ragged-right]
884 \figures {
885   <[12] 8 [6  4]>
886 }
887 @end lilypond
888
889 Any text markup can be inserted as a figure:
890
891 @lilypond[verbatim,quote,ragged-right]
892 \figures {
893   <\markup { \tiny \number 6 \super (1) } 5>
894 }
895 @end lilypond
896
897 @c NOTE: We need to include notes any time we use extenders to
898 @c avoid extraneous staff creation due to Staff.use... in
899 @c \bassFigureExtendersOn
900
901 Continuation lines can be used to indicate repeated figures:
902
903 @lilypond[verbatim,quote,ragged-right]
904 <<
905   {
906     \clef bass
907     e4 d c b,
908     e4 d c b,
909   }
910   \figures {
911     \bassFigureExtendersOn
912     <6 4>4 <6 3> <7 3> <7 3>
913     \bassFigureExtendersOff
914     <6 4>4 <6 3> <7 3> <7 3>
915   }
916 >>
917 @end lilypond
918
919 @noindent
920 In this case, the extender lines replace existing figures,
921 unless the continuation lines have been explicitly terminated.
922
923 @lilypond[verbatim,quote,ragged-right]
924 <<
925   \figures {
926     \bassFigureExtendersOn
927     <6 4>4 <6 4> <6\! 4\!> <6 4>
928   }
929   {
930     \clef bass
931     d4 d c c
932   }
933 >>
934 @end lilypond
935
936 The table below summarizes the figure modifiers available.
937
938 @multitable @columnfractions .1 .5 .4
939
940 @item
941 @b{Modifier}
942 @tab
943 @b{Purpose}
944 @tab
945 @b{Example}
946
947 @item
948 +, -, !
949 @tab
950 Accidentals
951 @tab
952 @lilypond[line-width=4\cm]
953 \figures {
954   <7! 6+ 4-> <5++> <3-->
955 }
956 @end lilypond
957
958 @item
959 \+, /
960 @tab
961 Augmented and diminished steps
962 @tab
963 @lilypond[line-width=4\cm]
964 \figures {
965   <6\+ 5/> <7/>
966 }
967 @end lilypond
968
969 @item
970 \\
971 @tab
972 Raised sixth step
973 @tab
974 @lilypond[line-width=4\cm]
975 \figures {
976   <6\\>
977 }
978 @end lilypond
979
980 @item
981 \!
982 @tab
983 End of continuation line
984 @tab
985 @lilypond[line-width=4\cm]
986 <<
987   \figures {
988     \bassFigureExtendersOn
989     <6 4> <6 4> <6\! 4\!> <6 4>
990   }
991   {
992     \clef bass
993     d d c c
994   }
995 >>
996 @end lilypond
997
998 @end multitable
999
1000
1001 @predefined
1002 @cindex figured bass extender lines
1003 @code{\bassFigureExtendersOn},
1004 @code{\bassFigureExtendersOff}.
1005 @endpredefined
1006
1007
1008 @snippets
1009 @lilypondfile[verbatim,quote,texidoc,doctitle]
1010 {changing-the-positions-of-figured-bass-alterations.ly}
1011
1012 @seealso
1013 Snippets:
1014 @rlsr{Chords}.
1015
1016 Internals Reference:
1017 @rinternals{BassFigure},
1018 @rinternals{BassFigureAlignment},
1019 @rinternals{BassFigureLine},
1020 @rinternals{BassFigureBracket},
1021 @rinternals{BassFigureContinuation},
1022 @rinternals{FiguredBass}.
1023
1024
1025 @node Displaying figured bass
1026 @unnumberedsubsubsec Displaying figured bass
1027
1028 Figured bass can be displayed using the @code{FiguredBass} context,
1029 or in most staff contexts.
1030
1031 When displayed in a @code{FiguredBass} context, the vertical location
1032 of the figures is independent of the notes on the staff.
1033
1034 @lilypond[verbatim,ragged-right,quote]
1035 <<
1036   \relative {
1037     c''4 c'8 r8 c,4 c'
1038   }
1039   \new FiguredBass {
1040     \figuremode {
1041       <4>4 <10 6>8 s8
1042       <6 4>4 <6 4>
1043     }
1044   }
1045 >>
1046 @end lilypond
1047
1048 @noindent
1049 In the example above, the @code{FiguredBass} context must be
1050 explicitly instantiated to avoid creating a second (empty) staff.
1051
1052
1053 Figured bass can also be added to @code{Staff} contexts
1054 directly.  In this case, the vertical position of the
1055 figures is adjusted automatically.
1056
1057 @lilypond[verbatim,ragged-right,quote]
1058 <<
1059   \new Staff = "myStaff"
1060   \figuremode {
1061     <4>4 <10 6>8 s8
1062     <6 4>4 <6 4>
1063   }
1064   %% Put notes on same Staff as figures
1065   \context Staff = "myStaff"
1066   {
1067     \clef bass
1068     c4 c'8 r8 c4 c'
1069   }
1070 >>
1071 @end lilypond
1072
1073
1074 When added in a @code{Staff} context, figured bass can be displayed above
1075 or below the staff.
1076
1077 @lilypond[verbatim,ragged-right,quote]
1078 <<
1079   \new Staff = "myStaff"
1080   \figuremode {
1081     <4>4 <10 6>8 s8
1082     \bassFigureStaffAlignmentDown
1083     <6 4>4 <6 4>
1084   }
1085   %% Put notes on same Staff as figures
1086   \context Staff = "myStaff"
1087   {
1088     \clef bass
1089     c4 c'8 r8 c4 c'
1090   }
1091 >>
1092 @end lilypond
1093
1094 @predefined
1095 @cindex figured bass alignment
1096 @code{\bassFigureStaffAlignmentDown},
1097 @code{\bassFigureStaffAlignmentUp},
1098 @code{\bassFigureStaffAlignmentNeutral}.
1099 @endpredefined
1100
1101 @seealso
1102 Snippets:
1103 @rlsr{Chords}.
1104
1105 Internals Reference:
1106 @rinternals{BassFigure},
1107 @rinternals{BassFigureAlignment},
1108 @rinternals{BassFigureLine},
1109 @rinternals{BassFigureBracket},
1110 @rinternals{BassFigureContinuation},
1111 @rinternals{FiguredBass}.
1112
1113 @knownissues
1114 To ensure that continuation lines work properly, it is
1115 safest to use the same rhythm in the figure line as in
1116 the bass line.
1117
1118 @lilypond[verbatim,ragged-right,quote]
1119 <<
1120   {
1121     \clef bass
1122     \repeat unfold 4 { f16. g32 } f8. es16 d8 es
1123   }
1124   \figures {
1125     \bassFigureExtendersOn
1126     % The extenders are correct here, with the same rhythm as the bass
1127     \repeat unfold 4 { <6 4->16. <6 4->32 }
1128     <5>8. r16 <6>8 <6\! 5->
1129   }
1130 >>
1131 <<
1132   {
1133     \clef bass
1134     \repeat unfold 4 { f16. g32 } f8. es16 d8 es
1135   }
1136   \figures {
1137     \bassFigureExtendersOn
1138     % The extenders are incorrect here, even though the timing is the same
1139     <6 4->4 <6 4->4
1140     <5>8. r16 <6>8 <6\! 5->
1141   }
1142 >>
1143 @end lilypond