]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/pitches.itely
Merge branch 'lilypond/translation' of /home/jcharles/GIT/Lily/.
[lilypond.git] / Documentation / notation / pitches.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.13.36"
11
12
13 @node Pitches
14 @section Pitches
15
16 @lilypondfile[quote]{pitches-headword.ly}
17
18 This section discusses how to specify the pitch of notes.  There
19 are three steps to this process: input, modification, and output.
20
21 @menu
22 * Writing pitches::
23 * Changing multiple pitches::
24 * Displaying pitches::
25 * Note heads::
26 @end menu
27
28
29 @node Writing pitches
30 @subsection Writing pitches
31
32 This section discusses how to input pitches.  There are two
33 different ways to place notes in octaves: absolute and relative
34 mode.  In most cases, relative mode will be more convenient.
35
36 @menu
37 * Absolute octave entry::
38 * Relative octave entry::
39 * Accidentals::
40 * Note names in other languages::
41 @end menu
42
43
44 @node Absolute octave entry
45 @unnumberedsubsubsec Absolute octave entry
46
47 @cindex pitch names
48 @cindex pitches
49 @cindex absolute
50 @cindex absolute octave specification
51 @cindex octave specification, absolute
52 @cindex absolute octave entry
53 @cindex octave entry, absolute
54
55 A pitch name is specified using lowercase letters@tie{}@code{a}
56 through@tie{}@code{g}.  The note names @code{c} to @code{b} are
57 engraved in the octave below middle C.
58
59 @c don't use c' here.
60 @lilypond[verbatim,quote]
61 {
62   \clef bass
63   c4 d e f
64   g4 a b c
65   d4 e f g
66 }
67 @end lilypond
68
69 @cindex octave changing mark
70
71 @funindex '
72 @funindex ,
73
74 Other octaves may be specified with a single quote@tie{}(@code{'})
75 or comma@tie{}(@code{,}) character.  Each@tie{}@code{'} raises the
76 pitch by one octave; each@tie{}@code{,} lowers the pitch by an
77 octave.
78
79 @lilypond[verbatim,quote]
80 {
81   \clef treble
82   c'4 c'' e' g
83   d''4 d' d c
84   \clef bass
85   c,4 c,, e, g
86   d,,4 d, d c
87 }
88 @end lilypond
89
90
91 @seealso
92 Music Glossary:
93 @rglos{Pitch names}.
94
95 Snippets:
96 @rlsr{Pitches}.
97
98
99 @node Relative octave entry
100 @unnumberedsubsubsec Relative octave entry
101
102 @cindex relative
103 @cindex relative octave entry
104 @cindex octave entry, relative
105 @cindex relative octave specification
106 @cindex octave specification, relative
107
108 @funindex relative
109 @funindex \relative
110
111 When octaves are specified in absolute mode it is easy to
112 accidentally put a pitch in the wrong octave.  Relative octave
113 mode reduces these errors since most of the time it is not
114 necessary to indicate any octaves at all.  Furthermore, in
115 absolute mode a single mistake may be difficult to spot, while in
116 relative mode a single error puts the rest of the piece off by one
117 octave.
118
119 @example
120 \relative @var{startpitch} @var{musicexpr}
121 @end example
122
123 In relative mode, each note is assumed to be as close to the
124 previous note as possible.  This means that the octave of each
125 pitch inside @code{@var{musicexpr}} is calculated as follows:
126
127 @itemize
128 @item
129 If no octave changing mark is used on a pitch, its octave is
130 calculated so that the interval with the previous note is less
131 than a fifth.  This interval is determined without considering
132 accidentals.
133
134 @item
135 An octave changing mark@tie{}@code{'} or@tie{}@code{,} can be
136 added to respectively raise or lower a pitch by an extra octave,
137 relative to the pitch calculated without an octave mark.
138
139 @item
140 Multiple octave changing marks can be used.  For example,
141 @code{''}@tie{}and@tie{}@code{,,} will alter the pitch by two
142 octaves.
143
144 @item
145 The pitch of the first note is relative to
146 @code{@var{startpitch}}.  @code{@var{startpitch}} is specified in
147 absolute octave mode, and it is recommended that it be a octave of
148 @code{c}.
149 @end itemize
150
151 Here is the relative mode shown in action:
152
153 @lilypond[verbatim,quote]
154 \relative c {
155   \clef bass
156   c d e f
157   g a b c
158   d e f g
159 }
160 @end lilypond
161
162 Octave changing marks are used for intervals greater than a
163 fourth:
164
165 @lilypond[verbatim,quote]
166 \relative c'' {
167   c g c f,
168   c' a, e'' c
169 }
170 @end lilypond
171
172 A note sequence without a single octave mark can nevertheless span
173 large intervals:
174
175 @lilypond[verbatim,quote]
176 \relative c {
177   c f b e
178   a d g c
179 }
180 @end lilypond
181
182 When @code{\relative} blocks are nested, the innermost
183 @code{\relative} block applies.
184
185 @lilypond[verbatim,quote]
186 \relative c' {
187   c d e f
188   \relative c'' {
189     c d e f
190   }
191 }
192 @end lilypond
193
194 @code{\relative} has no effect on @code{\chordmode} blocks.
195
196 @lilypond[verbatim,quote]
197 \new Staff {
198   \relative c''' {
199     \chordmode { c1 }
200   }
201   \chordmode { c1 }
202 }
203 @end lilypond
204
205 @code{\relative} is not allowed inside of @code{\chordmode} blocks.
206
207 Music inside a @code{\transpose} block is absolute unless a
208 @code{\relative} is included.
209
210 @lilypond[verbatim,quote]
211 \relative c' {
212   d e
213   \transpose f g {
214     d e
215     \relative c' {
216       d e
217     }
218   }
219 }
220 @end lilypond
221
222
223 @cindex chords and relative octave entry
224 @cindex relative octave entry and chords
225
226 If the preceding item is a chord, the first note of the chord is
227 used as the reference point for the octave placement of a
228 following note or chord.  Inside chords, the next note is always
229 relative to the preceding one.  Examine the next example
230 carefully, paying attention to the @code{c} notes.
231
232 @lilypond[verbatim,quote]
233 \relative c' {
234   c
235   <c e g>
236   <c' e g'>
237   <c, e, g''>
238 }
239 @end lilypond
240
241 As explained above, the octave of pitches is calculated only with
242 the note names, regardless of any alterations.  Therefore, an
243 E-double-sharp following a B will be placed higher, while an
244 F-double-flat will be placed lower.  In other words, a
245 double-augmented fourth is considered a smaller interval than a
246 double-diminished fifth, regardless of the number of semitones
247 that each interval contains.
248
249 @lilypond[verbatim,quote]
250 \relative c'' {
251   c2 fis
252   c2 ges
253   b2 eisis
254   b2 feses
255 }
256 @end lilypond
257
258
259 @seealso
260 Music Glossary:
261 @rglos{fifth},
262 @rglos{interval},
263 @rglos{Pitch names}.
264
265 Notation Reference:
266 @ref{Octave checks}.
267
268 Snippets:
269 @rlsr{Pitches}.
270
271 Internals Reference:
272 @rinternals{RelativeOctaveMusic}.
273
274
275 @cindex relative octave entry and transposition
276 @cindex transposition and relative octave entry
277
278 @funindex \transpose
279 @funindex transpose
280 @funindex \chordmode
281 @funindex chordmode
282 @funindex \relative
283 @funindex relative
284
285
286 @c DEPRECATED
287 If no @code{@var{startpitch}} is specified for @code{\relative},
288 then@tie{}@code{c'} is assumed.  However, this is a deprecated
289 option and may disappear in future versions, so its use is
290 discouraged.
291
292
293
294 @node Accidentals
295 @unnumberedsubsubsec Accidentals
296
297 @cindex accidental
298 @cindex key signature
299 @cindex clef
300
301 @c duplicated in Key signature and Accidentals
302 @warning{New users are sometimes confused about accidentals and
303 key signatures.  In LilyPond, note names are the raw input; key
304 signatures and clefs determine how this raw input is displayed.
305 An unaltered note like@tie{}@code{c} means @q{C natural},
306 regardless of the key signature or clef.  For more information,
307 see @rlearning{Accidentals and key signatures}.}
308
309 @cindex note names, Dutch
310 @cindex note names, default
311 @cindex default note names
312 @cindex sharp
313 @cindex flat
314 @cindex double sharp
315 @cindex sharp, double
316 @cindex double flat
317 @cindex flat, double
318 @cindex natural sign
319 @cindex natural pitch
320
321 A @notation{sharp} pitch is made by adding @code{is} to the note
322 name, and a @notation{flat} pitch by adding @code{es}.  As you
323 might expect, a @notation{double sharp} or @notation{double flat}
324 is made by adding @code{isis} or @code{eses}.  This syntax is
325 derived from Dutch note naming conventions.  To use other names
326 for accidentals, see @ref{Note names in other languages}.
327
328 @lilypond[verbatim,quote,relative=2]
329 ais1 aes aisis aeses
330 @end lilypond
331
332 A natural will cancel the effect of an accidental or key
333 signature.  However, naturals are not encoded into the note name
334 syntax with a suffix; a natural pitch is shown as a simple note
335 name:
336
337 @lilypond[verbatim,quote,relative=2]
338 a4 aes a2
339 @end lilypond
340
341 @cindex quarter tones
342 @cindex semi-flats
343 @cindex semi-sharps
344
345 Quarter tones may be added; the following is a series of Cs with
346 increasing pitches:
347
348 @lilypond[verbatim,quote,relative=2]
349 ceseh1 ces ceh c cih cis cisih
350 @end lilypond
351
352
353
354 @cindex accidental, reminder
355 @cindex accidental, cautionary
356 @cindex accidental, parenthesized
357 @cindex reminder accidental
358 @cindex cautionary accidental
359 @cindex parenthesized accidental
360
361 @funindex ?
362 @funindex !
363
364
365 Normally accidentals are printed automatically, but you may also
366 print them manually.  A reminder accidental can be forced by
367 adding an exclamation mark@tie{}@code{!} after the pitch.  A
368 cautionary accidental (i.e., an accidental within parentheses) can
369 be obtained by adding the question mark@tie{}@code{?} after the
370 pitch.  These extra accidentals can also be used to produce
371 natural signs.
372
373 @lilypond[verbatim,quote,relative=2]
374 cis cis cis! cis? c c c! c?
375 @end lilypond
376
377 @cindex accidental on tied note
378 @cindex tied note, accidental
379
380 Accidentals on tied notes are only printed at the beginning of a
381 new system:
382
383 @lilypond[verbatim,quote,relative=2]
384 cis1~ cis~
385 \break
386 cis
387 @end lilypond
388
389
390 @snippets
391
392 @lilypondfile[verbatim,lilyquote,texidoc,doctitle,ragged-right]
393 {hiding-accidentals-on-tied-notes-at-the-start-of-a-new-system.ly}
394
395 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
396 {preventing-extra-naturals-from-being-automatically-added.ly}
397
398 @seealso
399 Music Glossary:
400 @rglos{sharp},
401 @rglos{flat},
402 @rglos{double sharp},
403 @rglos{double flat},
404 @rglos{Pitch names},
405 @rglos{quarter tone}.
406
407 Learning Manual:
408 @rlearning{Accidentals and key signatures}.
409
410 Notation Reference:
411 @ref{Automatic accidentals},
412 @ref{Annotational accidentals (musica ficta)},
413 @ref{Note names in other languages}.
414
415 Snippets:
416 @rlsr{Pitches}.
417
418 Internals Reference:
419 @rinternals{Accidental_engraver},
420 @rinternals{Accidental},
421 @rinternals{AccidentalCautionary},
422 @rinternals{accidental-interface}.
423
424
425 @cindex accidental, quarter-tone
426 @cindex quarter-tone accidental
427
428 @knownissues
429
430 There are no generally accepted standards for denoting
431 quarter-tone accidentals, so LilyPond's symbol does not conform to
432 any standard.
433
434
435
436 @node Note names in other languages
437 @unnumberedsubsubsec Note names in other languages
438
439 @cindex note names, other languages
440 @cindex pitch names, other languages
441 @cindex language, note names in other
442 @cindex language, pitch names in other
443
444 There are predefined sets of note and accidental names for various
445 other languages.  Selecting the note name language is usually done
446 at the beginning of the file; the following example is written
447 using Italian note names:
448
449 @lilypond[quote,verbatim]
450 \language "italiano"
451
452 \relative do' {
453   do re mi sib
454 }
455 @end lilypond
456
457 The available languages and the note names they define are:
458
459 @quotation
460 @multitable {@code{nederlands}} {do re mi fa sol la sib si}
461 @headitem Language
462   @tab Note Names
463 @item @code{nederlands}
464   @tab c d e f g a bes b
465 @item @code{catalan}
466   @tab do re mi fa sol la sib si
467 @item @code{deutsch}
468   @tab c d e f g a b h
469 @item @code{english}
470   @tab c d e f g a bf b
471 @item @code{espanol}
472   @tab do re mi fa sol la sib si
473 @item @code{italiano}
474   @tab do re mi fa sol la sib si
475 @item @code{norsk}
476   @tab c d e f g a b h
477 @item @code{portugues}
478   @tab do re mi fa sol la sib si
479 @item @code{suomi}
480   @tab c d e f g a b h
481 @item @code{svenska}
482   @tab c d e f g a b h
483 @item @code{vlaams}
484   @tab do re mi fa sol la sib si
485 @end multitable
486 @end quotation
487
488 In addition to note names, accidental suffixes may
489 also vary depending on the language:
490
491 @quotation
492 @multitable {@code{nederlands}} {-s/-sharp} {-ess/-es} {-ss/-x/-sharpsharp} {-essess/-eses}
493 @headitem Language
494   @tab sharp @tab flat @tab double sharp @tab double flat
495 @item @code{nederlands}
496   @tab -is @tab -es @tab -isis @tab -eses
497 @item @code{catalan}
498   @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
499 @item @code{deutsch}
500   @tab -is @tab -es @tab -isis @tab -eses
501 @item @code{english}
502   @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
503     @tab -ff/-flatflat
504 @item @code{espanol}
505   @tab -s @tab -b @tab -ss/-x @tab -bb
506 @item @code{italiano}
507   @tab -d @tab -b @tab -dd @tab -bb
508 @item @code{norsk}
509   @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
510     @tab -essess/-eses
511 @item @code{portugues}
512   @tab -s @tab -b @tab -ss @tab -bb
513 @item @code{suomi}
514   @tab -is @tab -es @tab -isis @tab -eses
515 @item @code{svenska}
516   @tab -iss @tab -ess @tab -ississ @tab -essess
517 @item @code{vlaams}
518   @tab -k @tab -b @tab -kk @tab -bb
519 @end multitable
520 @end quotation
521
522 In Dutch, @code{aes} is contracted to @code{as}, but both forms
523 are accepted in LilyPond.  Similarly, both @code{es} and
524 @code{ees} are accepted.  This also applies to
525 @code{aeses}@tie{}/@tie{}@code{ases} and
526 @code{eeses}@tie{}/@tie{}@code{eses}.  Sometimes only these
527 contracted names are defined in the corresponding language files.
528
529 @lilypond[verbatim,quote,relative=2]
530 a2 as e es a ases e eses
531 @end lilypond
532
533
534 @cindex microtones
535 @cindex semi-sharp
536 @cindex semi-flat
537 @cindex sesqui-sharp
538 @cindex sesqui-flat
539
540 Some music uses microtones whose alterations are fractions of a
541 @q{normal} sharp or flat.  The following table lists note names
542 for quarter-tone accidentals in various languages; here the prefixes
543 @notation{semi-} and @notation{sesqui-} respectively
544 mean @q{half} and @q{one and a half}.  Languages that do not
545 appear in this table do not provide special note names yet.
546
547 @quotation
548 @multitable {@code{nederlands}} {@b{semi-sharp}} {@b{semi-flat}} {@b{sesqui-sharp}} {@b{sesqui-flat}}
549 @headitem Language
550   @tab semi-sharp @tab semi-flat @tab sesqui-sharp @tab sesqui-flat
551
552 @item @code{nederlands}
553   @tab -ih @tab -eh @tab -isih @tab -eseh
554 @item @code{deutsch}
555   @tab -ih @tab -eh @tab -isih @tab -eseh
556 @item @code{english}
557   @tab -qs @tab -qf @tab -tqs @tab -tqf
558 @item @code{espanol}
559   @tab -cs @tab -cb @tab -tcs @tab -tcb
560 @item @code{italiano}
561   @tab -sd @tab -sb @tab -dsd @tab -bsb
562 @item @code{portugues}
563   @tab -sqt @tab -bqt @tab -stqt @tab -btqt
564 @end multitable
565 @end quotation
566
567 Most languages presented here are commonly associated with
568 Western classical music, also referred to as
569 @notation{Common Practice Period}.  However, alternate
570 pitches and tuning systems are also supported: see
571 @ref{Common notation for non-Western music}.
572
573
574 @seealso
575 Music Glossary:
576 @rglos{Pitch names},
577 @rglos{Common Practice Period}.
578
579 Notation Reference:
580 @ref{Common notation for non-Western music}.
581
582 Snippets:
583 @rlsr{Pitches}.
584
585
586 @node Changing multiple pitches
587 @subsection Changing multiple pitches
588
589 This section discusses how to modify pitches.
590
591 @menu
592 * Octave checks::
593 * Transpose::
594 @end menu
595
596 @node Octave checks
597 @unnumberedsubsubsec Octave checks
598
599 @cindex octave correction
600 @cindex octave check
601 @cindex control pitch
602
603 @funindex =
604 @funindex \octaveCheck
605 @funindex octaveCheck
606 @funindex controlpitch
607
608 In relative mode, it is easy to forget an octave changing mark.
609 Octave checks make such errors easier to find by displaying a
610 warning and correcting the octave if a note is found in an
611 unexpected octave.
612
613 To check the octave of a note, specify the absolute octave after
614 the @code{=}@tie{}symbol.  This example will generate a warning
615 (and change the pitch) because the second note is the absolute
616 octave @code{d''} instead of @code{d'} as indicated by the octave
617 correction.
618
619 @lilypond[verbatim,quote]
620 \relative c'' {
621   c2 d='4 d
622   e2 f
623 }
624 @end lilypond
625
626 The octave of notes may also be checked with the
627 @code{\octaveCheck@tie{}@var{controlpitch}} command.
628 @code{@var{controlpitch}} is specified in absolute mode.  This
629 checks that the interval between the previous note and the
630 @code{@var{controlpitch}} is within a fourth (i.e., the normal
631 calculation of relative mode).  If this check fails, a warning is
632 printed, but the previous note is not changed.  Future notes are
633 relative to the @code{@var{controlpitch}}.
634
635 @lilypond[verbatim,quote]
636 \relative c'' {
637   c2 d
638   \octaveCheck c'
639   e2 f
640 }
641 @end lilypond
642
643 Compare the two bars below.  The first and third @code{\octaveCheck}
644 checks fail, but the second one does not fail.
645
646 @lilypond[verbatim,quote]
647 \relative c'' {
648   c4 f g f
649
650   c4
651   \octaveCheck c'
652   f
653   \octaveCheck c'
654   g
655   \octaveCheck c'
656   f
657 }
658 @end lilypond
659
660
661 @seealso
662 Snippets:
663 @rlsr{Pitches}.
664
665 Internals Reference:
666 @rinternals{RelativeOctaveCheck}.
667
668
669 @node Transpose
670 @unnumberedsubsubsec Transpose
671
672 @cindex transpose
673 @cindex transposing
674 @cindex transposition
675 @cindex transposition of pitches
676 @cindex transposition of notes
677 @cindex pitches, transposition of
678 @cindex notes, transposition of
679
680 @funindex \transpose
681 @funindex transpose
682
683 A music expression can be transposed with @code{\transpose}.  The
684 syntax is
685
686 @example
687 \transpose @var{frompitch} @var{topitch} @var{musicexpr}
688 @end example
689
690 @noindent
691 This means that @code{@var{musicexpr}} is transposed by the
692 interval between the pitches @code{@var{frompitch}} and
693 @code{@var{topitch}}: any note with pitch @code{@var{frompitch}}
694 is changed to @code{@var{topitch}} and any other note is
695 transposed by the same interval.  Both pitches are entered in
696 absolute mode.
697
698 @warning{Music inside a @code{@bs{}transpose} block is absolute
699 unless a @code{@bs{}relative} is included in the block.}
700
701 Consider a piece written in the key of D-major.  It can be
702 transposed up to E-major; note that the key signature is
703 automatically transposed as well.
704
705 @lilypond[verbatim,quote]
706 \transpose d e {
707   \relative c' {
708     \key d \major
709     d4 fis a d
710   }
711 }
712 @end lilypond
713
714 @cindex transposing instruments
715 @cindex instruments, transposing
716
717 If a part written in C (normal @notation{concert pitch}) is to be
718 played on the A clarinet (for which an A is notated as a C and
719 thus sounds a minor third lower than notated), the appropriate
720 part will be produced with:
721
722 @lilypond[verbatim,quote]
723 \transpose a c' {
724   \relative c' {
725     \key c \major
726     c4 d e g
727   }
728 }
729 @end lilypond
730
731 @noindent
732 Note that we specify @w{@code{\key c \major}} explicitly.  If we
733 do not specify a key signature, the notes will be transposed but
734 no key signature will be printed.
735
736 @code{\transpose} distinguishes between enharmonic pitches: both
737 @w{@code{\transpose c cis}} or @w{@code{\transpose c des}} will
738 transpose up a semitone.  The first version will print sharps and
739 the notes will remain on the same scale step, the second version
740 will print flats on the scale step above.
741
742 @lilypond[verbatim,quote]
743 music = \relative c' { c d e f }
744 \new Staff {
745   \transpose c cis { \music }
746   \transpose c des { \music }
747 }
748 @end lilypond
749
750
751 @code{\transpose} may also be used in a different way, to input
752 written notes for a transposing instrument.  The previous examples
753 show how to enter pitches in C (or @notation{concert pitch}) and
754 typeset them for a transposing instrument, but the opposite is
755 also possible if you for example have a set of instrumental parts
756 and want to print a conductor's score.  For example, when entering
757 music for a B-flat trumpet that begins on a notated E (concert D),
758 one would write:
759
760 @example
761 musicInBflat = @{ e4 @dots{} @}
762 \transpose c bes, \musicInBflat
763 @end example
764
765 @noindent
766 To print this music in F (e.g., rearranging to a French horn) you
767 could wrap the existing music with another @code{\transpose}:
768
769 @example
770 musicInBflat = @{ e4 @dots{} @}
771 \transpose f c' @{ \transpose c bes, \musicInBflat @}
772 @end example
773
774 @noindent
775 For more information about transposing instruments,
776 see @ref{Instrument transpositions}.
777
778
779 @snippets
780
781 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
782 {transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
783
784
785 @seealso
786 Notation Reference:
787 @ref{Relative octave entry},
788 @ref{Instrument transpositions}.
789
790 Snippets:
791 @rlsr{Pitches}.
792
793 Internals Reference:
794 @rinternals{TransposedMusic}.
795
796
797 @funindex \transpose
798 @funindex transpose
799 @funindex \chordmode
800 @funindex chordmode
801 @funindex \relative
802 @funindex relative
803
804 @knownissues
805
806 The relative conversion will not affect @code{\transpose},
807 @code{\chordmode} or @code{\relative} sections in its argument.
808 To use relative mode within transposed music, an additional
809 @code{\relative} must be placed inside @code{\transpose}.
810
811 @node Displaying pitches
812 @subsection Displaying pitches
813
814 This section discusses how to alter the output of pitches.
815
816 @menu
817 * Clef::
818 * Key signature::
819 * Ottava brackets::
820 * Instrument transpositions::
821 * Automatic accidentals::
822 * Ambitus::
823 @end menu
824
825
826 @node Clef
827 @unnumberedsubsubsec Clef
828
829 @cindex G clef
830 @cindex C clef
831 @cindex F clef
832 @cindex treble clef
833 @cindex violin clef
834 @cindex alto clef
835 @cindex tenor clef
836 @cindex bass clef
837 @cindex french clef
838 @cindex soprano clef
839 @cindex mezzosoprano clef
840 @cindex baritone clef
841 @cindex varbaritone clef
842 @cindex subbass clef
843 @cindex clef
844 @cindex ancient clef
845 @cindex clef, ancient
846 @cindex clef, G
847 @cindex clef, C
848 @cindex clef, F
849 @cindex clef, treble
850 @cindex clef, violin
851 @cindex clef, alto
852 @cindex clef, tenor
853 @cindex clef, bass
854 @cindex clef, french
855 @cindex clef, soprano
856 @cindex clef, mezzosoprano
857 @cindex clef, baritone
858 @cindex clef, varbaritone
859 @cindex clef, subbass
860
861
862 @funindex \clef
863 @funindex clef
864
865 The clef may be altered.  Middle C is shown in every example.  The
866 following clef names can (but do not need to) be enclosed in quotes.
867
868 @lilypond[verbatim,quote,relative=1]
869 \clef treble
870 c2 c
871 \clef alto
872 c2 c
873 \clef tenor
874 c2 c
875 \clef bass
876 c2 c
877 @end lilypond
878
879 Other clefs include:
880
881 @lilypond[verbatim,quote,relative=1]
882 \clef french
883 c2 c
884 \clef soprano
885 c2 c
886 \clef mezzosoprano
887 c2 c
888 \clef baritone
889 c2 c
890
891 \break
892
893 \clef varbaritone
894 c2 c
895 \clef subbass
896 c2 c
897 \clef percussion
898 c2 c
899
900 \break
901
902 \clef G   % synonym for treble
903 c2 c
904 \clef F   % synonym for bass
905 c2 c
906 \clef C   % synonym for alto
907 c2 c
908 @end lilypond
909
910 @cindex transposing clef
911 @cindex clef, transposing
912 @cindex octave transposition
913 @cindex choral tenor clef
914 @cindex tenor clef, choral
915
916 By adding@tie{}@code{_8} or@tie{}@code{^8} to the clef name, the
917 clef is transposed one octave down or up respectively,
918 and@tie{}@code{_15} and@tie{}@code{^15} transpose by two octaves.
919 Other integers can be used if required.  Clef names containing
920 non-alphabetic characters must be enclosed in quotes
921
922 @lilypond[verbatim,quote,relative=1]
923 \clef treble
924 c2 c
925 \clef "treble_8"
926 c2 c
927 \clef "bass^15"
928 c2 c
929 \clef "alto_2"
930 c2 c
931 \clef "G_8"
932 c2 c
933 \clef "F^5"
934 c2 c
935 @end lilypond
936
937 Some special purpose clefs are described in @ref{Mensural clefs},
938 @ref{Gregorian clefs}, @ref{Default tablatures}, and @ref{Custom
939 tablatures}.
940
941 @snippets
942
943 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
944 {tweaking-clef-properties.ly}
945
946
947 @seealso
948 Notation Reference:
949 @ref{Mensural clefs},
950 @ref{Gregorian clefs},
951 @ref{Default tablatures},
952 @ref{Custom tablatures}.
953
954 Snippets:
955 @rlsr{Pitches}.
956
957 Internals Reference:
958 @rinternals{Clef_engraver},
959 @rinternals{Clef},
960 @rinternals{OctavateEight},
961 @rinternals{clef-interface}.
962
963
964 @node Key signature
965 @unnumberedsubsubsec Key signature
966
967 @cindex key signature
968
969 @funindex \key
970 @funindex key
971
972 @c duplicated in Key signature and Accidentals
973 @warning{New users are sometimes confused about accidentals and
974 key signatures.  In LilyPond, note names are the raw input; key
975 signatures and clefs determine how this raw input is displayed.
976 An unaltered note like@tie{}@code{c} means @q{C natural},
977 regardless of the key signature or clef.  For more information,
978 see @rlearning{Accidentals and key signatures}.}
979
980 The key signature indicates the tonality in which a piece is
981 played.  It is denoted by a set of alterations (flats or sharps)
982 at the start of the staff.  The key signature may be altered:
983
984 @example
985 \key @var{pitch} @var{mode}
986 @end example
987
988 @funindex \major
989 @funindex major
990 @funindex \minor
991 @funindex minor
992 @funindex \ionian
993 @funindex ionian
994 @funindex \locrian
995 @funindex locrian
996 @funindex \aeolian
997 @funindex aeolian
998 @funindex \mixolydian
999 @funindex mixolydian
1000 @funindex \lydian
1001 @funindex lydian
1002 @funindex \phrygian
1003 @funindex phrygian
1004 @funindex \dorian
1005 @funindex dorian
1006
1007 @cindex church modes
1008 @cindex modes
1009 @cindex major
1010 @cindex minor
1011 @cindex ionian
1012 @cindex locrian
1013 @cindex aeolian
1014 @cindex mixolydian
1015 @cindex lydian
1016 @cindex phrygian
1017 @cindex dorian
1018
1019 @noindent
1020 Here, @code{@var{mode}} should be @code{\major} or @code{\minor}
1021 to get a key signature of @code{@var{pitch}}-major or
1022 @code{@var{pitch}}-minor, respectively.  You may also use the
1023 standard mode names, also called @notation{church modes}:
1024 @code{\ionian}, @code{\dorian}, @code{\phrygian}, @code{\lydian},
1025 @code{\mixolydian}, @code{\aeolian}, and @code{\locrian}.
1026
1027 @lilypond[verbatim,quote,relative=2]
1028 \key g \major
1029 fis1
1030 f
1031 fis
1032 @end lilypond
1033
1034
1035 @snippets
1036
1037 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1038 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
1039
1040 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1041 {non-traditional-key-signatures.ly}
1042
1043
1044 @seealso
1045 Music Glossary:
1046 @rglos{church mode},
1047 @rglos{scordatura}.
1048
1049 Learning Manual:
1050 @rlearning{Accidentals and key signatures}.
1051
1052 Snippets:
1053 @rlsr{Pitches}.
1054
1055 Internals Reference:
1056 @rinternals{KeyChangeEvent},
1057 @rinternals{Key_engraver},
1058 @rinternals{Key_performer},
1059 @rinternals{KeyCancellation},
1060 @rinternals{KeySignature},
1061 @rinternals{key-cancellation-interface},
1062 @rinternals{key-signature-interface}.
1063
1064
1065 @node Ottava brackets
1066 @unnumberedsubsubsec Ottava brackets
1067
1068 @cindex ottava
1069 @cindex 15ma
1070 @cindex 8va
1071 @cindex 8ve
1072 @cindex octavation
1073
1074 @funindex set-octavation
1075 @funindex \ottava
1076 @funindex ottava
1077
1078 @notation{Ottava brackets} introduce an extra transposition of an
1079 octave for the staff:
1080
1081 @lilypond[verbatim,quote,relative=2]
1082 a2 b
1083 \ottava #-2
1084 a2 b
1085 \ottava #-1
1086 a2 b
1087 \ottava #0
1088 a2 b
1089 \ottava #1
1090 a2 b
1091 \ottava #2
1092 a2 b
1093 @end lilypond
1094
1095 @snippets
1096
1097 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1098 {ottava-text.ly}
1099
1100
1101 @seealso
1102 Music Glossary:
1103 @rglos{octavation}.
1104
1105 Snippets:
1106 @rlsr{Pitches}.
1107
1108 Internals Reference:
1109 @rinternals{Ottava_spanner_engraver},
1110 @rinternals{OttavaBracket},
1111 @rinternals{ottava-bracket-interface}.
1112
1113
1114 @node Instrument transpositions
1115 @unnumberedsubsubsec Instrument transpositions
1116
1117 @cindex transposition, MIDI
1118 @cindex transposition, instrument
1119 @cindex transposing instrument
1120 @cindex MIDI
1121 @cindex MIDI transposition
1122
1123 @funindex \transposition
1124 @funindex transposition
1125
1126 When typesetting scores that involve transposing instruments, some
1127 parts can be typeset in a different pitch than the
1128 @notation{concert pitch}.  In these cases, the key of the
1129 @notation{transposing instrument} should be specified; otherwise
1130 the MIDI output and cues in other parts will produce incorrect
1131 pitches.  For more information about quotations, see
1132 @ref{Quoting other voices}.
1133
1134 @example
1135 \transposition @var{pitch}
1136 @end example
1137
1138 The pitch to use for @code{\transposition} should correspond to
1139 the real sound heard when a@tie{}@code{c'} written on the staff is
1140 played by the transposing instrument.  This pitch is entered in
1141 absolute mode, so an instrument that produces a real sound which
1142 is one tone higher than the printed music should use
1143 @w{@code{\transposition d'}}.  @code{\transposition} should
1144 @emph{only} be used if the pitches are @emph{not} being entered in
1145 concert pitch.
1146
1147 Here are a few notes for violin and B-flat clarinet where the
1148 parts have been entered using the notes and key as they appear in
1149 each part of the conductor's score.  The two instruments are
1150 playing in unison.
1151
1152 @lilypond[verbatim,quote]
1153 \new GrandStaff <<
1154   \new Staff = "violin" {
1155     \relative c'' {
1156       \set Staff.instrumentName = #"Vln"
1157       \set Staff.midiInstrument = #"violin"
1158       % not strictly necessary, but a good reminder
1159       \transposition c'
1160
1161       \key c \major
1162       g4( c8) r c r c4
1163     }
1164   }
1165   \new Staff = "clarinet" {
1166     \relative c'' {
1167       \set Staff.instrumentName = \markup { Cl (B\flat) }
1168       \set Staff.midiInstrument = #"clarinet"
1169       \transposition bes
1170
1171       \key d \major
1172       a4( d8) r d r d4
1173     }
1174   }
1175 >>
1176 @end lilypond
1177
1178 The @code{\transposition} may be changed during a piece.  For
1179 example, a clarinetist may switch from an A clarinet to a B-flat
1180 clarinet.
1181
1182 @lilypond[verbatim,quote,relative=2]
1183 \set Staff.instrumentName = #"Cl (A)"
1184 \key a \major
1185 \transposition a
1186 c d e f
1187 \textLengthOn
1188 s1*0^\markup { Switch to B\flat clarinet }
1189 R1
1190
1191 \key bes \major
1192 \transposition bes
1193 c2 g
1194 @end lilypond
1195
1196
1197 @seealso
1198 Music Glossary:
1199 @rglos{concert pitch},
1200 @rglos{transposing instrument}.
1201
1202 Notation Reference:
1203 @ref{Quoting other voices},
1204 @ref{Transpose}.
1205
1206 Snippets:
1207 @rlsr{Pitches}.
1208
1209
1210 @node Automatic accidentals
1211 @unnumberedsubsubsec Automatic accidentals
1212
1213 @cindex accidental style
1214 @cindex accidental style, default
1215 @cindex accidentals
1216 @cindex accidentals, automatic
1217 @cindex automatic accidentals
1218 @cindex default accidental style
1219
1220 @funindex set-accidental-style
1221 @funindex voice
1222 @funindex default
1223
1224 There are many different conventions on how to typeset
1225 accidentals.  LilyPond provides a function to specify which
1226 accidental style to use.  This function is called as follows:
1227
1228 @example
1229 \new Staff <<
1230   #(set-accidental-style 'voice)
1231   @{ @dots{} @}
1232 >>
1233 @end example
1234
1235 The accidental style applies to the current @code{Staff} by
1236 default (with the exception of the styles @code{piano} and
1237 @code{piano-cautionary}, which are explained below).  Optionally,
1238 the function can take a second argument that determines in which
1239 scope the style should be changed.  For example, to use the same
1240 style in all staves of the current @code{StaffGroup}, use:
1241
1242 @example
1243 #(set-accidental-style 'voice 'StaffGroup)
1244 @end example
1245
1246 The following accidental styles are supported.  To demonstrate
1247 each style, we use the following example:
1248
1249
1250 @lilypond[verbatim,quote]
1251 musicA = {
1252   <<
1253     \relative c' {
1254       cis'8 fis, d'4 <a cis>8 f bis4 |
1255       cis2. <c, g'>4 |
1256     }
1257     \\
1258     \relative c' {
1259       ais'2 cis, |
1260       fis8 b a4 cis2 |
1261     }
1262   >>
1263 }
1264
1265 musicB = {
1266   \clef bass
1267   \new Voice {
1268     \voiceTwo \relative c' {
1269       <fis, a cis>8 <fis a cis>
1270       \change Staff = up
1271       cis' cis
1272       \change Staff = down
1273       <fis, a> <fis a>
1274       \showStaffSwitch
1275       \change Staff = up
1276       dis'4 |
1277       \change Staff = down
1278       <fis, a cis>4 gis <f a d>2 |
1279     }
1280   }
1281 }
1282
1283 \new PianoStaff {
1284   <<
1285     \context Staff = "up" {
1286       #(set-accidental-style 'default)
1287       \musicA
1288     }
1289     \context Staff = "down" {
1290       #(set-accidental-style 'default)
1291       \musicB
1292     }
1293   >>
1294 }
1295 @end lilypond
1296
1297 Note that the last lines of this example can be replaced by the
1298 following, as long as the same accidental style should be used in
1299 both staves.
1300
1301 @example
1302 \new PianoStaff @{
1303   <<
1304     \context Staff = "up" @{
1305       %%% change the next line as desired:
1306       #(set-accidental-style 'default 'Score)
1307       \musicA
1308     @}
1309     \context Staff = "down" @{
1310       \musicB
1311     @}
1312   >>
1313 @}
1314 @end example
1315
1316
1317 @c don't use verbatim in this table.
1318 @table @code
1319 @item default
1320
1321 @cindex default accidental style
1322 @cindex accidental style, default
1323
1324 @funindex default
1325
1326 This is the default typesetting behavior.  It corresponds to
1327 eighteenth-century common practice: accidentals are remembered to
1328 the end of the measure in which they occur and only in their own
1329 octave.  Thus, in the example below, no natural signs are printed
1330 before the@tie{}@code{b} in the second measure or the
1331 last@tie{}@code{c}:
1332
1333 @lilypond[quote]
1334 musicA = {
1335   <<
1336     \relative c' {
1337       cis'8 fis, d'4 <a cis>8 f bis4 |
1338       cis2. <c, g'>4 |
1339     }
1340     \\
1341     \relative c' {
1342       ais'2 cis, |
1343       fis8 b a4 cis2 |
1344     }
1345   >>
1346 }
1347
1348 musicB = {
1349   \clef bass
1350   \new Voice {
1351     \voiceTwo \relative c' {
1352       <fis, a cis>8 <fis a cis>
1353       \change Staff = up
1354       cis' cis
1355       \change Staff = down
1356       <fis, a> <fis a>
1357       \showStaffSwitch
1358       \change Staff = up
1359       dis'4 |
1360       \change Staff = down
1361       <fis, a cis>4 gis <f a d>2 |
1362     }
1363   }
1364 }
1365
1366 \new PianoStaff {
1367   <<
1368     \context Staff = "up" {
1369       #(set-accidental-style 'default)
1370       \musicA
1371     }
1372     \context Staff = "down" {
1373       #(set-accidental-style 'default)
1374       \musicB
1375     }
1376   >>
1377 }
1378 @end lilypond
1379
1380 @item voice
1381
1382 @cindex accidental style, voice
1383 @cindex voice accidental style
1384 @cindex accidental style, modern
1385 @cindex modern accidental style
1386 @cindex accidental style, modern-cautionary
1387 @cindex modern-cautionary accidental style
1388
1389 @funindex voice
1390
1391 The normal behavior is to remember the accidentals at
1392 @code{Staff}-level.  In this style, however, accidentals are
1393 typeset individually for each voice.  Apart from that, the rule is
1394 similar to @code{default}.
1395
1396 As a result, accidentals from one voice do not get canceled in
1397 other voices, which is often an unwanted result: in the following
1398 example, it is hard to determine whether the second@tie{}@code{a}
1399 should be played natural or sharp.  The @code{voice} option should
1400 therefore be used only if the voices are to be read solely by
1401 individual musicians.  If the staff is to be used by one musician
1402 (e.g., a conductor or in a piano score) then @code{modern} or
1403 @code{modern-cautionary} should be used instead.
1404
1405
1406 @lilypond[quote]
1407 musicA = {
1408   <<
1409     \relative c' {
1410       cis'8 fis, d'4 <a cis>8 f bis4 |
1411       cis2. <c, g'>4 |
1412     }
1413     \\
1414     \relative c' {
1415       ais'2 cis, |
1416       fis8 b a4 cis2 |
1417     }
1418   >>
1419 }
1420
1421 musicB = {
1422   \clef bass
1423   \new Voice {
1424     \voiceTwo \relative c' {
1425       <fis, a cis>8 <fis a cis>
1426       \change Staff = up
1427       cis' cis
1428       \change Staff = down
1429       <fis, a> <fis a>
1430       \showStaffSwitch
1431       \change Staff = up
1432       dis'4 |
1433       \change Staff = down
1434       <fis, a cis>4 gis <f a d>2 |
1435     }
1436   }
1437 }
1438
1439 \new PianoStaff {
1440   <<
1441     \context Staff = "up" {
1442       #(set-accidental-style 'voice)
1443       \musicA
1444     }
1445     \context Staff = "down" {
1446       #(set-accidental-style 'voice)
1447       \musicB
1448     }
1449   >>
1450 }
1451 @end lilypond
1452
1453 @item modern
1454
1455 @cindex accidentals, modern style
1456 @cindex modern style accidentals
1457
1458 @funindex modern
1459
1460 This rule corresponds to the common practice in the twentieth
1461 century.  It prints the same accidentals as @code{default}, with
1462 two exceptions that serve to avoid ambiguity: after temporary
1463 accidentals, cancellation marks are printed also in the following
1464 measure (for notes in the same octave) and, in the same measure,
1465 for notes in other octaves.  Hence the naturals before
1466 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1467 the upper staff:
1468
1469 @lilypond[quote]
1470 musicA = {
1471   <<
1472     \relative c' {
1473       cis'8 fis, d'4 <a cis>8 f bis4 |
1474       cis2. <c, g'>4 |
1475     }
1476     \\
1477     \relative c' {
1478       ais'2 cis, |
1479       fis8 b a4 cis2 |
1480     }
1481   >>
1482 }
1483
1484 musicB = {
1485   \clef bass
1486   \new Voice {
1487     \voiceTwo \relative c' {
1488       <fis, a cis>8 <fis a cis>
1489       \change Staff = up
1490       cis' cis
1491       \change Staff = down
1492       <fis, a> <fis a>
1493       \showStaffSwitch
1494       \change Staff = up
1495       dis'4 |
1496       \change Staff = down
1497       <fis, a cis>4 gis <f a d>2 |
1498     }
1499   }
1500 }
1501
1502 \new PianoStaff {
1503   <<
1504     \context Staff = "up" {
1505       #(set-accidental-style 'modern)
1506       \musicA
1507     }
1508     \context Staff = "down" {
1509       #(set-accidental-style 'modern)
1510       \musicB
1511     }
1512   >>
1513 }
1514 @end lilypond
1515
1516 @item modern-cautionary
1517
1518 @cindex accidentals, modern cautionary style
1519 @cindex modern accidental style
1520 @cindex modern cautionary accidental style
1521 @cindex modern style accidentals
1522 @cindex modern style cautionary accidentals
1523
1524 @funindex modern-cautionary
1525
1526 This rule is similar to @code{modern}, but the @q{extra}
1527 accidentals (the ones not typeset by @code{default}) are typeset
1528 as cautionary accidentals.  They are by default printed with
1529 parentheses, but they can also be printed in reduced size by
1530 defining the @code{cautionary-style} property of
1531 @code{AccidentalSuggestion}.
1532
1533 @lilypond[quote]
1534 musicA = {
1535   <<
1536     \relative c' {
1537       cis'8 fis, d'4 <a cis>8 f bis4 |
1538       cis2. <c, g'>4 |
1539     }
1540     \\
1541     \relative c' {
1542       ais'2 cis, |
1543       fis8 b a4 cis2 |
1544     }
1545   >>
1546 }
1547
1548 musicB = {
1549   \clef bass
1550   \new Voice {
1551     \voiceTwo \relative c' {
1552       <fis, a cis>8 <fis a cis>
1553       \change Staff = up
1554       cis' cis
1555       \change Staff = down
1556       <fis, a> <fis a>
1557       \showStaffSwitch
1558       \change Staff = up
1559       dis'4 |
1560       \change Staff = down
1561       <fis, a cis>4 gis <f a d>2 |
1562     }
1563   }
1564 }
1565
1566 \new PianoStaff {
1567   <<
1568     \context Staff = "up" {
1569       #(set-accidental-style 'modern-cautionary)
1570       \musicA
1571     }
1572     \context Staff = "down" {
1573       #(set-accidental-style 'modern-cautionary)
1574       \musicB
1575     }
1576   >>
1577 }
1578 @end lilypond
1579
1580 @item modern-voice
1581
1582 @cindex accidental style, modern
1583 @cindex accidentals, modern
1584 @cindex accidentals, multivoice
1585 @cindex modern accidental style
1586 @cindex modern accidentals
1587 @cindex multivoice accidentals
1588
1589 @funindex modern-voice
1590
1591 This rule is used for multivoice accidentals to be read both by
1592 musicians playing one voice and musicians playing all voices.
1593 Accidentals are typeset for each voice, but they @emph{are}
1594 canceled across voices in the same @code{Staff}.  Hence,
1595 the@tie{}@code{a} in the last measure is canceled because the
1596 previous cancellation was in a different voice, and
1597 the@tie{}@code{d} in the lower staff is canceled because of the
1598 accidental in a different voice in the previous measure:
1599
1600 @lilypond[quote]
1601 musicA = {
1602   <<
1603     \relative c' {
1604       cis'8 fis, d'4 <a cis>8 f bis4 |
1605       cis2. <c, g'>4 |
1606     }
1607     \\
1608     \relative c' {
1609       ais'2 cis, |
1610       fis8 b a4 cis2 |
1611     }
1612   >>
1613 }
1614
1615 musicB = {
1616   \clef bass
1617   \new Voice {
1618     \voiceTwo \relative c' {
1619       <fis, a cis>8 <fis a cis>
1620       \change Staff = up
1621       cis' cis
1622       \change Staff = down
1623       <fis, a> <fis a>
1624       \showStaffSwitch
1625       \change Staff = up
1626       dis'4 |
1627       \change Staff = down
1628       <fis, a cis>4 gis <f a d>2 |
1629     }
1630   }
1631 }
1632
1633 \new PianoStaff {
1634   <<
1635     \context Staff = "up" {
1636       #(set-accidental-style 'modern-voice)
1637       \musicA
1638     }
1639     \context Staff = "down" {
1640       #(set-accidental-style 'modern-voice)
1641       \musicB
1642     }
1643   >>
1644 }
1645 @end lilypond
1646
1647 @cindex accidental style, cautionary, modern voice
1648 @cindex accidental style, modern voice cautionary
1649 @cindex accidental style, voice, modern cautionary
1650
1651 @funindex modern-voice-cautionary
1652
1653 @item modern-voice-cautionary
1654
1655 This rule is the same as @code{modern-voice}, but with the extra
1656 accidentals (the ones not typeset by @code{voice}) typeset as
1657 cautionaries.  Even though all accidentals typeset by
1658 @code{default} @emph{are} typeset with this rule, some of them are
1659 typeset as cautionaries.
1660
1661 @lilypond[quote]
1662 musicA = {
1663   <<
1664     \relative c' {
1665       cis'8 fis, d'4 <a cis>8 f bis4 |
1666       cis2. <c, g'>4 |
1667     }
1668     \\
1669     \relative c' {
1670       ais'2 cis, |
1671       fis8 b a4 cis2 |
1672     }
1673   >>
1674 }
1675
1676 musicB = {
1677   \clef bass
1678   \new Voice {
1679     \voiceTwo \relative c' {
1680       <fis, a cis>8 <fis a cis>
1681       \change Staff = up
1682       cis' cis
1683       \change Staff = down
1684       <fis, a> <fis a>
1685       \showStaffSwitch
1686       \change Staff = up
1687       dis'4 |
1688       \change Staff = down
1689       <fis, a cis>4 gis <f a d>2 |
1690     }
1691   }
1692 }
1693
1694 \new PianoStaff {
1695   <<
1696     \context Staff = "up" {
1697       #(set-accidental-style 'modern-voice-cautionary)
1698       \musicA
1699     }
1700     \context Staff = "down" {
1701       #(set-accidental-style 'modern-voice-cautionary)
1702       \musicB
1703     }
1704   >>
1705 }
1706 @end lilypond
1707
1708 @item piano
1709
1710 @cindex accidental style, piano
1711 @cindex accidentals, piano
1712 @cindex piano accidental style
1713 @cindex piano accidentals
1714
1715 @funindex piano
1716
1717 This rule reflects twentieth-century practice for piano notation.
1718 Its behavior is very similar to @code{modern} style, but here
1719 accidentals also get canceled across the staves in the same
1720 @code{GrandStaff} or @code{PianoStaff}, hence all the
1721 cancellations of the final notes.
1722
1723 This accidental style applies to the current @code{GrandStaff} or
1724 @code{PianoStaff} by default.
1725
1726 @lilypond[quote]
1727 musicA = {
1728   <<
1729     \relative c' {
1730       cis'8 fis, d'4 <a cis>8 f bis4 |
1731       cis2. <c, g'>4 |
1732     }
1733     \\
1734     \relative c' {
1735       ais'2 cis, |
1736       fis8 b a4 cis2 |
1737     }
1738   >>
1739 }
1740
1741 musicB = {
1742   \clef bass
1743   \new Voice {
1744     \voiceTwo \relative c' {
1745       <fis, a cis>8 <fis a cis>
1746       \change Staff = up
1747       cis' cis
1748       \change Staff = down
1749       <fis, a> <fis a>
1750       \showStaffSwitch
1751       \change Staff = up
1752       dis'4 |
1753       \change Staff = down
1754       <fis, a cis>4 gis <f a d>2 |
1755     }
1756   }
1757 }
1758
1759 \new PianoStaff {
1760   <<
1761     \context Staff = "up" {
1762       #(set-accidental-style 'piano)
1763       \musicA
1764     }
1765     \context Staff = "down" {
1766       \musicB
1767     }
1768   >>
1769 }
1770 @end lilypond
1771
1772 @item piano-cautionary
1773
1774 @cindex accidentals, piano cautionary
1775 @cindex cautionary accidentals, piano
1776 @cindex piano cautionary accidentals
1777 @cindex accidental style, piano cautionary
1778 @cindex cautionary accidental style, piano
1779 @cindex piano cautionary accidental style
1780
1781 @funindex piano-cautionary
1782
1783 This is the same as @code{piano} but with the extra accidentals
1784 typeset as cautionaries.
1785
1786 @lilypond[quote]
1787 musicA = {
1788   <<
1789     \relative c' {
1790       cis'8 fis, d'4 <a cis>8 f bis4 |
1791       cis2. <c, g'>4 |
1792     }
1793     \\
1794     \relative c' {
1795       ais'2 cis, |
1796       fis8 b a4 cis2 |
1797     }
1798   >>
1799 }
1800
1801 musicB = {
1802   \clef bass
1803   \new Voice {
1804     \voiceTwo \relative c' {
1805       <fis, a cis>8 <fis a cis>
1806       \change Staff = up
1807       cis' cis
1808       \change Staff = down
1809       <fis, a> <fis a>
1810       \showStaffSwitch
1811       \change Staff = up
1812       dis'4 |
1813       \change Staff = down
1814       <fis, a cis>4 gis <f a d>2 |
1815     }
1816   }
1817 }
1818
1819 \new PianoStaff {
1820   <<
1821     \context Staff = "up" {
1822       #(set-accidental-style 'piano-cautionary)
1823       \musicA
1824     }
1825     \context Staff = "down" {
1826       \musicB
1827     }
1828   >>
1829 }
1830 @end lilypond
1831
1832
1833 @item neo-modern
1834
1835 @cindex neo-modern accidental style
1836 @cindex accidental style, neo-modern
1837
1838 @funindex neo-modern
1839
1840 This rule reproduces a common practice in contemporary music:
1841 accidentals are printed like with @code{modern}, but they are printed
1842 again if the same note appears later in the same measure -- except
1843 if the note is immediately repeated.
1844
1845 @lilypond[quote]
1846 musicA = {
1847   <<
1848     \relative c' {
1849       cis'8 fis, d'4 <a cis>8 f bis4 |
1850       cis2. <c, g'>4 |
1851     }
1852     \\
1853     \relative c' {
1854       ais'2 cis, |
1855       fis8 b a4 cis2 |
1856     }
1857   >>
1858 }
1859
1860 musicB = {
1861   \clef bass
1862   \new Voice {
1863     \voiceTwo \relative c' {
1864       <fis, a cis>8 <fis a cis>
1865       \change Staff = up
1866       cis' cis
1867       \change Staff = down
1868       <fis, a> <fis a>
1869       \showStaffSwitch
1870       \change Staff = up
1871       dis'4 |
1872       \change Staff = down
1873       <fis, a cis>4 gis <f a d>2 |
1874     }
1875   }
1876 }
1877
1878 \new PianoStaff {
1879   <<
1880     \context Staff = "up" {
1881       #(set-accidental-style 'neo-modern)
1882       \musicA
1883     }
1884     \context Staff = "down" {
1885       #(set-accidental-style 'neo-modern)
1886       \musicB
1887     }
1888   >>
1889 }
1890 @end lilypond
1891
1892 @item neo-modern-cautionary
1893
1894 @cindex neo-modern-cautionary accidental style
1895 @cindex accidental style, neo-modern-cautionary
1896
1897 @funindex neo-modern-cautionary
1898
1899 This rule is similar to @code{neo-modern}, but the extra
1900 accidentals are printed as cautionary accidentals.
1901
1902 @lilypond[quote]
1903 musicA = {
1904   <<
1905     \relative c' {
1906       cis'8 fis, d'4 <a cis>8 f bis4 |
1907       cis2. <c, g'>4 |
1908     }
1909     \\
1910     \relative c' {
1911       ais'2 cis, |
1912       fis8 b a4 cis2 |
1913     }
1914   >>
1915 }
1916
1917 musicB = {
1918   \clef bass
1919   \new Voice {
1920     \voiceTwo \relative c' {
1921       <fis, a cis>8 <fis a cis>
1922       \change Staff = up
1923       cis' cis
1924       \change Staff = down
1925       <fis, a> <fis a>
1926       \showStaffSwitch
1927       \change Staff = up
1928       dis'4 |
1929       \change Staff = down
1930       <fis, a cis>4 gis <f a d>2 |
1931     }
1932   }
1933 }
1934
1935 \new PianoStaff {
1936   <<
1937     \context Staff = "up" {
1938       #(set-accidental-style 'neo-modern-cautionary)
1939       \musicA
1940     }
1941     \context Staff = "down" {
1942       #(set-accidental-style 'neo-modern-cautionary)
1943       \musicB
1944     }
1945   >>
1946 }
1947 @end lilypond
1948
1949
1950 @item neo-modern-voice
1951
1952 @cindex neo-modern-voice accidental style
1953 @cindex accidental style, neo-modern-voice
1954
1955 @funindex neo-modern-voice
1956
1957 This rule is used for multivoice accidentals to be read both by
1958 musicians playing one voice and musicians playing all voices.
1959 Accidentals are typeset for each voice as with @code{neo-modern},
1960 but they are canceled across voices in the same @code{Staff}.
1961
1962 @lilypond[quote]
1963 musicA = {
1964   <<
1965     \relative c' {
1966       cis'8 fis, d'4 <a cis>8 f bis4 |
1967       cis2. <c, g'>4 |
1968     }
1969     \\
1970     \relative c' {
1971       ais'2 cis, |
1972       fis8 b a4 cis2 |
1973     }
1974   >>
1975 }
1976
1977 musicB = {
1978   \clef bass
1979   \new Voice {
1980     \voiceTwo \relative c' {
1981       <fis, a cis>8 <fis a cis>
1982       \change Staff = up
1983       cis' cis
1984       \change Staff = down
1985       <fis, a> <fis a>
1986       \showStaffSwitch
1987       \change Staff = up
1988       dis'4 |
1989       \change Staff = down
1990       <fis, a cis>4 gis <f a d>2 |
1991     }
1992   }
1993 }
1994
1995 \new PianoStaff {
1996   <<
1997     \context Staff = "up" {
1998       #(set-accidental-style 'neo-modern-voice)
1999       \musicA
2000     }
2001     \context Staff = "down" {
2002       #(set-accidental-style 'neo-modern-voice)
2003       \musicB
2004     }
2005   >>
2006 }
2007 @end lilypond
2008
2009 @item neo-modern-voice-cautionary
2010
2011 @cindex neo-modern-voice-cautionary accidental style
2012 @cindex accidental style, neo-modern-voice-cautionary
2013
2014 @funindex neo-modern-voice-cautionary
2015
2016 This rule is similar to @code{neo-modern-voice}, but the extra
2017 accidentals are printed as cautionary accidentals.
2018
2019 @lilypond[quote]
2020 musicA = {
2021   <<
2022     \relative c' {
2023       cis'8 fis, d'4 <a cis>8 f bis4 |
2024       cis2. <c, g'>4 |
2025     }
2026     \\
2027     \relative c' {
2028       ais'2 cis, |
2029       fis8 b a4 cis2 |
2030     }
2031   >>
2032 }
2033
2034 musicB = {
2035   \clef bass
2036   \new Voice {
2037     \voiceTwo \relative c' {
2038       <fis, a cis>8 <fis a cis>
2039       \change Staff = up
2040       cis' cis
2041       \change Staff = down
2042       <fis, a> <fis a>
2043       \showStaffSwitch
2044       \change Staff = up
2045       dis'4 |
2046       \change Staff = down
2047       <fis, a cis>4 gis <f a d>2 |
2048     }
2049   }
2050 }
2051
2052 \new PianoStaff {
2053   <<
2054     \context Staff = "up" {
2055       #(set-accidental-style 'neo-modern-voice-cautionary)
2056       \musicA
2057     }
2058     \context Staff = "down" {
2059       #(set-accidental-style 'neo-modern-voice-cautionary)
2060       \musicB
2061     }
2062   >>
2063 }
2064 @end lilypond
2065
2066 @item dodecaphonic
2067
2068 @cindex dodecaphonic accidental style
2069 @cindex dodecaphonic style, neo-modern
2070
2071 @funindex dodecaphonic
2072
2073 This rule reflects a practice introduced by composers at
2074 the beginning of the 20th century, in an attempt to
2075 abolish the hierarchy between natural and non-natural notes.
2076 With this style, @emph{every} note gets an accidental sign,
2077 including natural signs.
2078
2079 @lilypond[quote]
2080 musicA = {
2081   <<
2082     \relative c' {
2083       cis'8 fis, d'4 <a cis>8 f bis4 |
2084       cis2. <c, g'>4 |
2085     }
2086     \\
2087     \relative c' {
2088       ais'2 cis, |
2089       fis8 b a4 cis2 |
2090     }
2091   >>
2092 }
2093
2094 musicB = {
2095   \clef bass
2096   \new Voice {
2097     \voiceTwo \relative c' {
2098       <fis, a cis>8 <fis a cis>
2099       \change Staff = up
2100       cis' cis
2101       \change Staff = down
2102       <fis, a> <fis a>
2103       \showStaffSwitch
2104       \change Staff = up
2105       dis'4 |
2106       \change Staff = down
2107       <fis, a cis>4 gis <f a d>2 |
2108     }
2109   }
2110 }
2111
2112 \new PianoStaff {
2113   <<
2114     \context Staff = "up" {
2115       #(set-accidental-style 'dodecaphonic)
2116       \musicA
2117     }
2118     \context Staff = "down" {
2119       #(set-accidental-style 'dodecaphonic)
2120       \musicB
2121     }
2122   >>
2123 }
2124 @end lilypond
2125
2126
2127 @item teaching
2128
2129 @cindex teaching accidental style
2130 @cindex accidental style, teaching
2131
2132 @funindex teaching
2133
2134 This rule is intended for students, and makes it easy to create
2135 scale sheets with automagically created cautionary accidentals.
2136 Accidentals are printed like with @code{modern}, but cautionary
2137 accidentals are added for all sharp or flat tones specified by the
2138 key signature, except if the note is immediately repeated.
2139
2140 @lilypond[quote]
2141 musicA = {
2142   <<
2143     \relative c' {
2144       cis'8 fis, d'4 <a cis>8 f bis4 |
2145       cis2. <c, g'>4 |
2146     }
2147     \\
2148     \relative c' {
2149       ais'2 cis, |
2150       fis8 b a4 cis2 |
2151     }
2152   >>
2153 }
2154
2155 musicB = {
2156   \clef bass
2157   \new Voice {
2158     \voiceTwo \relative c' {
2159       <fis, a cis>8 <fis a cis>
2160       \change Staff = up
2161       cis' cis
2162       \change Staff = down
2163       <fis, a> <fis a>
2164       \showStaffSwitch
2165       \change Staff = up
2166       dis'4 |
2167       \change Staff = down
2168       <fis, a cis>4 gis <f a d>2 |
2169     }
2170   }
2171 }
2172
2173 \new PianoStaff {
2174   <<
2175     \context Staff = "up" {
2176       \key fis \minor
2177       #(set-accidental-style 'teaching)
2178       \musicA
2179     }
2180     \context Staff = "down" {
2181       \key fis \minor
2182       #(set-accidental-style 'teaching)
2183       \musicB
2184     }
2185   >>
2186 }
2187 @end lilypond
2188
2189
2190
2191 @item no-reset
2192
2193 @cindex accidental style, no reset
2194 @cindex no reset accidental style
2195
2196 @funindex no-reset
2197
2198 This is the same as @code{default} but with accidentals lasting
2199 @q{forever} and not only within the same measure:
2200
2201 @lilypond[quote]
2202 musicA = {
2203   <<
2204     \relative c' {
2205       cis'8 fis, d'4 <a cis>8 f bis4 |
2206       cis2. <c, g'>4 |
2207     }
2208     \\
2209     \relative c' {
2210       ais'2 cis, |
2211       fis8 b a4 cis2 |
2212     }
2213   >>
2214 }
2215
2216 musicB = {
2217   \clef bass
2218   \new Voice {
2219     \voiceTwo \relative c' {
2220       <fis, a cis>8 <fis a cis>
2221       \change Staff = up
2222       cis' cis
2223       \change Staff = down
2224       <fis, a> <fis a>
2225       \showStaffSwitch
2226       \change Staff = up
2227       dis'4 |
2228       \change Staff = down
2229       <fis, a cis>4 gis <f a d>2 |
2230     }
2231   }
2232 }
2233
2234 \new PianoStaff {
2235   <<
2236     \context Staff = "up" {
2237       #(set-accidental-style 'no-reset)
2238       \musicA
2239     }
2240     \context Staff = "down" {
2241       #(set-accidental-style 'no-reset)
2242       \musicB
2243     }
2244   >>
2245 }
2246 @end lilypond
2247
2248 @item forget
2249
2250 @cindex forget accidental style
2251 @cindex accidental style, forget
2252
2253 @funindex forget
2254
2255 This is the opposite of @code{no-reset}: Accidentals are not
2256 remembered at all -- and hence all accidentals are typeset
2257 relative to the key signature, regardless of what came before in
2258 the music.  Unlike @code{dodecaphonic}, this rule never prints
2259 any naturals.
2260
2261 @lilypond[quote]
2262 musicA = {
2263   <<
2264     \relative c' {
2265       cis'8 fis, d'4 <a cis>8 f bis4 |
2266       cis2. <c, g'>4 |
2267     }
2268     \\
2269     \relative c' {
2270       ais'2 cis, |
2271       fis8 b a4 cis2 |
2272     }
2273   >>
2274 }
2275
2276 musicB = {
2277   \clef bass
2278   \new Voice {
2279     \voiceTwo \relative c' {
2280       <fis, a cis>8 <fis a cis>
2281       \change Staff = up
2282       cis' cis
2283       \change Staff = down
2284       <fis, a> <fis a>
2285       \showStaffSwitch
2286       \change Staff = up
2287       dis'4 |
2288       \change Staff = down
2289       <fis, a cis>4 gis <f a d>2 |
2290     }
2291   }
2292 }
2293
2294 \new PianoStaff {
2295   <<
2296     \context Staff = "up" {
2297       #(set-accidental-style 'forget)
2298       \musicA
2299     }
2300     \context Staff = "down" {
2301       #(set-accidental-style 'forget)
2302       \musicB
2303     }
2304   >>
2305 }
2306 @end lilypond
2307 @end table
2308
2309 @snippets
2310
2311 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2312 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
2313
2314
2315 @seealso
2316 Snippets:
2317 @rlsr{Pitches}.
2318
2319 Internals Reference:
2320 @rinternals{Accidental},
2321 @rinternals{Accidental_engraver},
2322 @rinternals{GrandStaff},
2323 @rinternals{PianoStaff},
2324 @rinternals{Staff},
2325 @rinternals{AccidentalSuggestion},
2326 @rinternals{AccidentalPlacement},
2327 @rinternals{accidental-suggestion-interface}.
2328
2329
2330 @cindex accidentals and simultaneous notes
2331 @cindex simultaneous notes and accidentals
2332 @cindex accidentals in chords
2333 @cindex chords, accidentals in
2334
2335 @knownissues
2336
2337 Simultaneous notes are considered to be entered in sequential
2338 mode.  This means that in a chord the accidentals are typeset as
2339 if the notes in the chord happen one at a time, in the order in
2340 which they appear in the input file.  This is a problem when
2341 accidentals in a chord depend on each other, which does not happen
2342 for the default accidental style.  The problem can be solved by
2343 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
2344 problematic notes.
2345
2346
2347 Cautionary cancellation of accidentals is done by looking at previous measure.
2348 However, in the @code{\alternative} block following a @code{\repeat volta N}
2349 section, one would expect the cancellation being calculated using the previous
2350 @emph{played} measure, not previous @emph{printed} measure.
2351 In the following example, the natural @code{c} in the second alternative does
2352 not need a natural sign:
2353
2354 @lilypond[quote]
2355 {
2356   #(set-accidental-style 'modern)
2357   \time 2/4
2358   \repeat volta 2 {
2359     c'2
2360   }
2361   \alternative {
2362      cis'
2363      c'
2364   }
2365 }
2366 @end lilypond
2367
2368 The following work-around can be used: define a function that locally changes
2369 the accidental style to @code{forget}:
2370
2371 @lilypond[verbatim,quote]
2372 forget = #(define-music-function (parser location music) (ly:music?) #{
2373   #(set-accidental-style 'forget)
2374   $music
2375   #(set-accidental-style 'modern)
2376 #})
2377 {
2378   #(set-accidental-style 'modern)
2379   \time 2/4
2380   \repeat volta 2 {
2381     c'2
2382   }
2383   \alternative {
2384      cis'
2385      \forget c'
2386   }
2387 }
2388 @end lilypond
2389
2390 @node Ambitus
2391 @unnumberedsubsubsec Ambitus
2392
2393 @cindex ambitus
2394 @cindex range of pitches
2395 @cindex pitch range
2396
2397 The term @notation{ambitus} (pl. ambitus) denotes a range of
2398 pitches for a given voice in a part of music.  It may also denote
2399 the pitch range that a musical instrument is capable of playing.
2400 Ambitus are printed on vocal parts so that performers can easily
2401 determine if it matches their capabilities.
2402
2403 Ambitus are denoted at the beginning of a piece near the initial
2404 clef.  The range is graphically specified by two note heads that
2405 represent the lowest and highest pitches.  Accidentals are only
2406 printed if they are not part of the key signature.
2407
2408 @lilypond[verbatim,quote]
2409 \layout {
2410   \context {
2411     \Voice
2412     \consists "Ambitus_engraver"
2413   }
2414 }
2415
2416 \relative c'' {
2417   aes c e2
2418   cis,1
2419 }
2420 @end lilypond
2421
2422
2423 @snippets
2424
2425 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2426 {adding-ambitus-per-voice.ly}
2427
2428 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2429 {ambitus-with-multiple-voices.ly}
2430
2431 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2432 {changing-the-ambitus-gap.ly}
2433
2434
2435 @seealso
2436 Music Glossary:
2437 @rglos{ambitus}.
2438
2439 Snippets:
2440 @rlsr{Pitches}.
2441
2442 Internals Reference:
2443 @rinternals{Ambitus_engraver},
2444 @rinternals{Voice},
2445 @rinternals{Staff},
2446 @rinternals{Ambitus},
2447 @rinternals{AmbitusAccidental},
2448 @rinternals{AmbitusLine},
2449 @rinternals{AmbitusNoteHead},
2450 @rinternals{ambitus-interface}.
2451
2452
2453 @knownissues
2454
2455 There is no collision handling in the case of multiple per-voice
2456 ambitus.
2457
2458
2459 @node Note heads
2460 @subsection Note heads
2461
2462 This section suggests ways of altering note heads.
2463
2464 @menu
2465 * Special note heads::
2466 * Easy notation note heads::
2467 * Shape note heads::
2468 * Improvisation::
2469 @end menu
2470
2471 @node Special note heads
2472 @unnumberedsubsubsec Special note heads
2473
2474 @cindex note heads, special
2475 @cindex note heads, cross
2476 @cindex note heads, diamond
2477 @cindex note heads, parlato
2478 @cindex note heads, harmonic
2479 @cindex note heads, guitar
2480 @cindex special note heads
2481 @cindex cross note heads
2482 @cindex diamond note heads
2483 @cindex parlato note heads
2484 @cindex harmonic note heads
2485 @cindex guitar note heads
2486 @cindex note head styles
2487 @cindex styles, note heads
2488
2489 @funindex cross
2490
2491 The appearance of note heads may be altered:
2492
2493 @lilypond[verbatim,quote,relative=2]
2494 c4 b
2495 \override NoteHead #'style = #'cross
2496 c4 b
2497 \revert NoteHead #'style
2498 a b
2499 \override NoteHead #'style = #'harmonic
2500 a b
2501 \revert NoteHead #'style
2502 c4 d e f
2503 @end lilypond
2504
2505 To see all note head styles, see @ref{Note head styles}.
2506
2507 The @code{cross} style is used to represent a variety of musical
2508 intentions.  The following generic predefined commands modify the
2509 note head in both staff and tablature contexts and can be used to
2510 represent any musical meaning:
2511
2512 @lilypond[verbatim,quote,relative=2]
2513 c4 b
2514 \xNotesOn
2515  a b c4 b
2516 \xNotesOff
2517 c4 d
2518 @end lilypond
2519
2520 The music function form of this predefined command may be used
2521 inside and outside chords to generate crossed note heads in both
2522 staff and tablature contexts:
2523
2524 @lilypond[verbatim,quote,relative=2]
2525 c4 b
2526 \xNote { e f }
2527 c b < g \xNote c f > b
2528 @end lilypond
2529
2530 As synonyms for @code{\xNote}, @code{\xNotesOn} and @code{\xNotesOff},
2531 @code{\deadNote}, @code{\deadNotesOn} and @code{\deadNotesOff} can
2532 be used.  The term @notation{dead note} is commonly used by guitarists.
2533
2534 There is also a shorthand for diamond shapes which can be used
2535 only inside chords:
2536
2537 @lilypond[verbatim,quote,relative=2]
2538 <c f\harmonic>2 <d a'\harmonic>4 <c g'\harmonic>
2539 @end lilypond
2540
2541 @predefined
2542 @code{\harmonic},
2543 @code{\xNotesOn},
2544 @code{\xNotesOff},
2545 @code{\xNote}.
2546 @endpredefined
2547
2548 @seealso
2549 Snippets:
2550 @rlsr{Pitches}.
2551
2552 Notation Reference:
2553 @ref{Note head styles},
2554 @ref{Chorded notes},
2555 @ref{Indicating harmonics and dampened notes}.
2556
2557 Internals Reference:
2558 @rinternals{note-event},
2559 @rinternals{Note_heads_engraver},
2560 @rinternals{Ledger_line_engraver},
2561 @rinternals{NoteHead},
2562 @rinternals{LedgerLineSpanner},
2563 @rinternals{note-head-interface},
2564 @rinternals{ledger-line-spanner-interface}.
2565
2566
2567 @node Easy notation note heads
2568 @unnumberedsubsubsec Easy notation note heads
2569
2570 @cindex note heads, practice
2571 @cindex practice note heads
2572 @cindex note heads, easy notation
2573 @cindex easy notation
2574 @cindex beginners' music
2575 @cindex music, beginners'
2576 @cindex easy play note heads
2577 @cindex note heads, easy play
2578
2579 @funindex \easyHeadsOn
2580 @funindex easyHeadsOn
2581 @funindex \easyHeadsOff
2582 @funindex easyHeadsOff
2583
2584 The @q{easy play} note head includes a note name inside the head.
2585 It is used in music for beginners.  To make the letters readable,
2586 it should be printed in a large font size.  To print with a larger
2587 font, see @ref{Setting the staff size}.
2588
2589 @lilypond[verbatim,quote]
2590 #(set-global-staff-size 26)
2591 \relative c' {
2592   \easyHeadsOn
2593   c2 e4 f
2594   g1
2595   \easyHeadsOff
2596   c,1
2597 }
2598 @end lilypond
2599
2600
2601 @predefined
2602 @code{\easyHeadsOn},
2603 @code{\easyHeadsOff}.
2604 @endpredefined
2605
2606
2607 @snippets
2608
2609 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2610 {numbers-as-easy-note-heads.ly}
2611
2612
2613 @seealso
2614 Notation Reference:
2615 @ref{Setting the staff size}.
2616
2617 Snippets:
2618 @rlsr{Pitches}.
2619
2620 Internals Reference:
2621 @rinternals{note-event},
2622 @rinternals{Note_heads_engraver},
2623 @rinternals{NoteHead},
2624 @rinternals{note-head-interface}.
2625
2626
2627 @node Shape note heads
2628 @unnumberedsubsubsec Shape note heads
2629
2630 @cindex note heads, shape
2631 @cindex note heads, Aiken
2632 @cindex note heads, sacred harp
2633 @cindex shape notes
2634 @cindex Aiken shape note heads
2635 @cindex sacred harp note heads
2636 @cindex note heads, Southern Harmony
2637 @cindex Southern Harmony note heads
2638 @cindex Funk shape note heads
2639 @cindex note heads, Funk
2640 @cindex note heads, Harmonica Sacra
2641 @cindex Harmonica Sacra note heads
2642 @cindex Christian Harmony note heads
2643 @cindex note heads, Christian Harmony
2644 @cindex Walker shape note heads
2645 @cindex note heads, Walker
2646
2647 @funindex \aikenHeads
2648 @funindex aikenHeads
2649 @funindex \sacredHarpHeads
2650 @funindex sacredHarpHeads
2651 @funindex \southernHarmonyHeads
2652 @funindex southernHarmonyHeads
2653 @funindex \funkHeads
2654 @funindex funkHeads
2655 @funindex \walkerHeads
2656 @funindex walkerHeads
2657
2658 In shape note head notation, the shape of the note head
2659 corresponds to the harmonic function of a note in the scale.  This
2660 notation was popular in nineteenth-century American song books.
2661 Shape note heads can be produced in Sacred Harp, Southern Harmony,
2662 Funk (Harmonica Sacra), Walker, and Aiken (Christian Harmony) styles:
2663
2664 @lilypond[verbatim,quote,relative=2]
2665 \aikenHeads
2666 c, d e f g2 a b1 c \break
2667 \sacredHarpHeads
2668 c,4 d e f g2 a b1 c \break
2669 \southernHarmonyHeads
2670 c,4 d e f g2 a b1 c \break
2671 \funkHeads
2672 c,4 d e f g2 a b1 c \break
2673 \walkerHeads
2674 c,4 d e f g2 a b1 c \break
2675 @end lilypond
2676
2677 @funindex \key
2678 @funindex key
2679 @funindex \aikenHeadsMinor
2680 @funindex aikenHeadsMinor
2681 @funindex \sacredHarpHeadsMinor
2682 @funindex sacredHarpHeadsMinor
2683 @funindex \southernHarmonyHeadsMinor
2684 @funindex southernHarmonyHeadsMinor
2685 @funindex \funkHeadsMinor
2686 @funindex funkHeadsMinor
2687 @funindex \walkerHeadsMinor
2688 @funindex walkerHeadsMinor
2689
2690 Shapes are typeset according to the step in the scale, where the base
2691 of the scale is determined by the @code{\key} command.  When writing
2692 in a minor key, the scale step can be determined from the relative
2693 major:
2694
2695 @lilypond[verbatim,quote,relative=2]
2696 \key a \minor
2697 \aikenHeads
2698 a b c d e2 f g1 a \break
2699 \aikenHeadsMinor
2700 a,4 b c d e2 f g1 a \break
2701 \sacredHarpHeadsMinor
2702 a,2 b c d \break
2703 \southernHarmonyHeadsMinor
2704 a2 b c d \break
2705 \funkHeadsMinor
2706 a2 b c d \break
2707 \walkerHeadsMinor
2708 a2 b c d \break
2709
2710 @end lilypond
2711
2712
2713 @predefined
2714 @code{\aikenHeads},
2715 @code{\aikenHeadsMinor},
2716 @code{\funkHeads},
2717 @code{\funkHeadsMinor},
2718 @code{\sacredHarpHeads},
2719 @code{\sacredHarpHeadsMinor},
2720 @code{\southernHarmonyHeads},
2721 @code{\southernHarmonyHeadsMinor},
2722 @code{\walkerHeads},
2723 @code{\walkerHeadsMinor}.
2724 @endpredefined
2725
2726
2727 @snippets
2728
2729 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2730 {applying-note-head-styles-depending-on-the-step-of-the-scale.ly}
2731
2732 To see all note head styles, see @ref{Note head styles}.
2733
2734
2735 @seealso
2736 Snippets:
2737 @rlsr{Pitches}.
2738
2739 Notation Reference:
2740 @ref{Note head styles}.
2741
2742 Internals Reference:
2743 @rinternals{note-event},
2744 @rinternals{Note_heads_engraver},
2745 @rinternals{NoteHead},
2746 @rinternals{note-head-interface}.
2747
2748
2749 @node Improvisation
2750 @unnumberedsubsubsec Improvisation
2751
2752 @cindex improvisation
2753 @cindex slashed note heads
2754 @cindex note heads, improvisation
2755 @cindex note heads, slashed
2756
2757 @funindex \improvisationOn
2758 @funindex improvisationOn
2759 @funindex \improvisationOff
2760 @funindex improvisationOff
2761
2762 Improvisation is sometimes denoted with slashed note heads, where
2763 the performer may choose any pitch but should play the specified
2764 rhythm.  Such note heads can be created:
2765
2766 @lilypond[verbatim,quote,relative=2]
2767 \new Voice \with {
2768   \consists "Pitch_squash_engraver"
2769 } {
2770   e8 e g a a16( bes) a8 g
2771   \improvisationOn
2772   e8 ~
2773   e2 ~ e8 f4 f8 ~
2774   f2
2775   \improvisationOff
2776   a16( bes) a8 g e
2777 }
2778 @end lilypond
2779
2780
2781 @predefined
2782 @code{\improvisationOn},
2783 @code{\improvisationOff}.
2784 @endpredefined
2785
2786
2787 @seealso
2788 Snippets:
2789 @rlsr{Pitches}.
2790
2791 Internals Reference:
2792 @rinternals{Pitch_squash_engraver},
2793 @rinternals{Voice},
2794 @rinternals{RhythmicStaff}.
2795
2796