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