]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/pitches.itely
f20b9f4dd4c2cc7d578502d6d86e6398e28f3abe
[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 clef, subbass
912
913
914 @funindex \clef
915 @funindex clef
916
917 The clef may be altered.  Middle C is shown in every example. The
918 following clef names can (but do not need to) be enclosed in quotes.
919
920 @lilypond[verbatim,quote,relative=1]
921 \clef treble
922 c2 c
923 \clef alto
924 c2 c
925 \clef tenor
926 c2 c
927 \clef bass
928 c2 c
929 @end lilypond
930
931 Other clefs include:
932
933 @lilypond[verbatim,quote,relative=1]
934 \clef french
935 c2 c
936 \clef soprano
937 c2 c
938 \clef mezzosoprano
939 c2 c
940 \clef baritone
941 c2 c
942 \clef varbaritone
943 c2 c
944 \clef subbass
945 c2 c
946
947 \break
948
949 \clef G   % synonym for treble
950 c2 c
951 \clef F   % synonym for bass
952 c2 c
953 \clef C   % synonym for alto
954 c2 c
955 @end lilypond
956
957 @cindex transposing clef
958 @cindex clef, transposing
959 @cindex octave transposition
960 @cindex choral tenor clef
961 @cindex tenor clef, choral
962
963 By adding@tie{}@code{_8} or@tie{}@code{^8} to the clef name, the
964 clef is transposed one octave down or up, respectively,
965 and@tie{}@code{_15} and@tie{}@code{^15} transpose by two octaves.
966 Clef names containing non-alphabetic characters must be enclosed
967 in quotes.
968
969 @lilypond[verbatim,quote,relative=1]
970 \clef treble
971 c2 c
972 \clef "treble_8"
973 c2 c
974 \clef "G_8"
975 c2 c
976 \clef "bass^15"
977 c2 c
978 \clef "F^15"
979 c2 c
980 @end lilypond
981
982 Some special purpose clefs are described in @ref{Mensural clefs},
983 @ref{Gregorian clefs}, @ref{Default tablatures}, @ref{Custom
984 tablatures}, and @ref{Basic percussion notation}.
985
986 @snippets
987
988 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
989 {tweaking-clef-properties.ly}
990
991
992 @seealso
993 Notation Reference:
994 @ref{Mensural clefs},
995 @ref{Gregorian clefs},
996 @ref{Default tablatures},
997 @ref{Custom tablatures},
998 @ref{Basic percussion notation}.
999
1000 Snippets:
1001 @rlsr{Pitches}.
1002
1003 Internals Reference:
1004 @rinternals{Clef_engraver},
1005 @rinternals{Clef},
1006 @rinternals{OctavateEight},
1007 @rinternals{clef-interface}.
1008
1009
1010 @node Key signature
1011 @unnumberedsubsubsec Key signature
1012
1013 @cindex key signature
1014
1015 @funindex \key
1016 @funindex key
1017
1018 @c duplicated in Key signature and Accidentals
1019 @warning{New users are sometimes confused about accidentals and
1020 key signatures.  In LilyPond, note names are the raw input; key
1021 signatures and clefs determine how this raw input is displayed.
1022 An unaltered note like@tie{}@code{c} means @q{C natural},
1023 regardless of the key signature or clef.  For more information,
1024 see @rlearning{Accidentals and key signatures}.}
1025
1026 The key signature indicates the tonality in which a piece is
1027 played.  It is denoted by a set of alterations (flats or sharps)
1028 at the start of the staff.  The key signature may be altered:
1029
1030 @example
1031 \key @var{pitch} @var{mode}
1032 @end example
1033
1034 @funindex \major
1035 @funindex major
1036 @funindex \minor
1037 @funindex minor
1038 @funindex \ionian
1039 @funindex ionian
1040 @funindex \locrian
1041 @funindex locrian
1042 @funindex \aeolian
1043 @funindex aeolian
1044 @funindex \mixolydian
1045 @funindex mixolydian
1046 @funindex \lydian
1047 @funindex lydian
1048 @funindex \phrygian
1049 @funindex phrygian
1050 @funindex \dorian
1051 @funindex dorian
1052
1053 @cindex church modes
1054 @cindex modes
1055 @cindex major
1056 @cindex minor
1057 @cindex ionian
1058 @cindex locrian
1059 @cindex aeolian
1060 @cindex mixolydian
1061 @cindex lydian
1062 @cindex phrygian
1063 @cindex dorian
1064
1065 @noindent
1066 Here, @var{mode} should be @code{\major} or @code{\minor} to get a
1067 key signature of @var{pitch}-major or @var{pitch}-minor,
1068 respectively.  You may also use the standard mode names, also
1069 called @notation{church modes}: @code{\ionian}, @code{\dorian},
1070 @code{\phrygian}, @code{\lydian}, @code{\mixolydian},
1071 @code{\aeolian}, and @code{\locrian}.
1072
1073 @lilypond[verbatim,quote,relative=2]
1074 \key g \major
1075 fis1
1076 f
1077 fis
1078 @end lilypond
1079
1080
1081 @snippets
1082
1083 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1084 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
1085
1086 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1087 {non-traditional-key-signatures.ly}
1088
1089
1090 @seealso
1091 Music Glossary:
1092 @rglos{church mode},
1093 @rglos{scordatura}.
1094
1095 Learning Manual:
1096 @rlearning{Accidentals and key signatures}.
1097
1098 Snippets:
1099 @rlsr{Pitches}.
1100
1101 Internals Reference:
1102 @rinternals{KeyChangeEvent},
1103 @rinternals{Key_engraver},
1104 @rinternals{Key_performer},
1105 @rinternals{KeyCancellation},
1106 @rinternals{KeySignature},
1107 @rinternals{key-cancellation-interface},
1108 @rinternals{key-signature-interface}.
1109
1110
1111 @node Ottava brackets
1112 @unnumberedsubsubsec Ottava brackets
1113
1114 @cindex ottava
1115 @cindex 15ma
1116 @cindex 8va
1117 @cindex 8ve
1118 @cindex octavation
1119
1120 @funindex set-octavation
1121 @funindex \ottava
1122 @funindex ottava
1123
1124 @notation{Ottava brackets} introduce an extra transposition of an
1125 octave for the staff:
1126
1127 @lilypond[verbatim,quote,relative=2]
1128 a'2 b
1129 \ottava #1
1130 a b
1131 \ottava #0
1132 a b
1133 @end lilypond
1134
1135 The @code{ottava} function also takes -1 (for 8va bassa),
1136 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
1137
1138
1139 @snippets
1140
1141 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1142 {ottava-text.ly}
1143
1144
1145 @seealso
1146 Music Glossary:
1147 @rglos{octavation}.
1148
1149 Snippets:
1150 @rlsr{Pitches}.
1151
1152 Internals Reference:
1153 @rinternals{Ottava_spanner_engraver},
1154 @rinternals{OttavaBracket},
1155 @rinternals{ottava-bracket-interface}.
1156
1157
1158 @node Instrument transpositions
1159 @unnumberedsubsubsec Instrument transpositions
1160
1161 @cindex transposition, MIDI
1162 @cindex transposition, instrument
1163 @cindex transposing instrument
1164 @cindex MIDI
1165 @cindex MIDI transposition
1166
1167 @funindex \transposition
1168 @funindex transposition
1169
1170 When typesetting scores that involve transposing instruments, some
1171 parts can be typeset in a different pitch than the
1172 @notation{concert pitch}.  In these cases, the key of the
1173 @notation{transposing instrument} should be specified; otherwise
1174 the MIDI output and cues in other parts will produce incorrect
1175 pitches.  For more information about quotations, see
1176 @ref{Quoting other voices}.
1177
1178 @example
1179 \transposition @var{pitch}
1180 @end example
1181
1182 The pitch to use for @code{\transposition} should correspond to
1183 the real sound heard when a@tie{}@code{c'} written on the staff is
1184 played by the transposing instrument.  This pitch is entered in
1185 absolute mode, so an instrument that produces a real sound which
1186 is one tone higher than the printed music should use
1187 @w{@code{\transposition d'}}.  @code{\transposition} should
1188 @emph{only} be used if the pitches are @emph{not} being entered in
1189 concert pitch.
1190
1191 Here are a few notes for violin and B-flat clarinet where the
1192 parts have been entered using the notes and key as they appear in
1193 each part of the conductor's score.  The two instruments are
1194 playing in unison.
1195
1196 @lilypond[verbatim,quote]
1197 \new GrandStaff <<
1198   \new Staff = "violin" {
1199     \relative c'' {
1200       \set Staff.instrumentName = #"Vln"
1201       \set Staff.midiInstrument = #"violin"
1202       % not strictly necessary, but a good reminder
1203       \transposition c'
1204
1205       \key c \major
1206       g4( c8) r c r c4
1207     }
1208   }
1209   \new Staff = "clarinet" {
1210     \relative c'' {
1211       \set Staff.instrumentName = \markup { Cl (B\flat) }
1212       \set Staff.midiInstrument = #"clarinet"
1213       \transposition bes
1214
1215       \key d \major
1216       a4( d8) r d r d4
1217     }
1218   }
1219 >>
1220 @end lilypond
1221
1222 The @code{\transposition} may be changed during a piece.  For
1223 example, a clarinetist may switch from an A clarinet to a B-flat
1224 clarinet.
1225
1226 @lilypond[verbatim,quote,relative=2]
1227 \set Staff.instrumentName = #"Cl (A)"
1228 \key a \major
1229 \transposition a
1230 c d e f
1231 \textLengthOn
1232 s1*0^\markup { Switch to B\flat clarinet }
1233 R1
1234
1235 \key bes \major
1236 \transposition bes
1237 c2 g
1238 @end lilypond
1239
1240
1241 @seealso
1242 Music Glossary:
1243 @rglos{concert pitch},
1244 @rglos{transposing instrument}.
1245
1246 Notation Reference:
1247 @ref{Quoting other voices},
1248 @ref{Transpose}.
1249
1250 Snippets:
1251 @rlsr{Pitches}.
1252
1253
1254 @node Automatic accidentals
1255 @unnumberedsubsubsec Automatic accidentals
1256
1257 @cindex accidental style
1258 @cindex accidental style, default
1259 @cindex accidentals
1260 @cindex accidentals, automatic
1261 @cindex automatic accidentals
1262 @cindex default accidental style
1263
1264 @funindex set-accidental-style
1265 @funindex voice
1266 @funindex default
1267
1268 There are many different conventions on how to typeset
1269 accidentals.  LilyPond provides a function to specify which
1270 accidental style to use.  This function is called as follows:
1271
1272 @example
1273 \new Staff <<
1274   #(set-accidental-style 'voice)
1275   @{ @dots{} @}
1276 >>
1277 @end example
1278
1279 The accidental style applies to the current @code{Staff} by
1280 default (with the exception of the styles @code{piano} and
1281 @code{piano-cautionary}, which are explained below).  Optionally,
1282 the function can take a second argument that determines in which
1283 scope the style should be changed.  For example, to use the same
1284 style in all staves of the current @code{StaffGroup}, use:
1285
1286 @example
1287 #(set-accidental-style 'voice 'StaffGroup)
1288 @end example
1289
1290 The following accidental styles are supported.  To demonstrate
1291 each style, we use the following example:
1292
1293
1294 @lilypond[verbatim,quote]
1295 musicA = {
1296   <<
1297     \relative c' {
1298       cis'8 fis, d'4 <a cis>8 f bis4 |
1299       cis2. <c, g'>4 |
1300     }
1301     \\
1302     \relative c' {
1303       ais'2 cis, |
1304       fis8 b a4 cis2 |
1305     }
1306   >>
1307 }
1308
1309 musicB = {
1310   \clef bass
1311   \new Voice {
1312     \voiceTwo \relative c' {
1313       <fis, a cis>8 <fis a cis>
1314       \change Staff = up
1315       cis' cis
1316       \change Staff = down
1317       <fis, a> <fis a>
1318       \showStaffSwitch
1319       \change Staff = up
1320       dis'4 |
1321       \change Staff = down
1322       <fis, a cis>4 gis <f a d>2 |
1323     }
1324   }
1325 }
1326
1327 \new PianoStaff {
1328   <<
1329     \context Staff = "up" {
1330       #(set-accidental-style 'default)
1331       \musicA
1332     }
1333     \context Staff = "down" {
1334       #(set-accidental-style 'default)
1335       \musicB
1336     }
1337   >>
1338 }
1339 @end lilypond
1340
1341 Note that the last lines of this example can be replaced by the
1342 following, as long as the same accidental style should be used in
1343 both staves.
1344
1345 @example
1346 \new PianoStaff @{
1347   <<
1348     \context Staff = "up" @{
1349       %%% change the next line as desired:
1350       #(set-accidental-style 'default 'Score)
1351       \musicA
1352     @}
1353     \context Staff = "down" @{
1354       \musicB
1355     @}
1356   >>
1357 @}
1358 @end example
1359
1360
1361 @c don't use verbatim in this table.
1362 @table @code
1363 @item default
1364
1365 @cindex default accidental style
1366 @cindex accidental style, default
1367
1368 @funindex default
1369
1370 This is the default typesetting behavior.  It corresponds to
1371 eighteenth-century common practice: accidentals are remembered to
1372 the end of the measure in which they occur and only in their own
1373 octave.  Thus, in the example below, no natural signs are printed
1374 before the@tie{}@code{b} in the second measure or the
1375 last@tie{}@code{c}:
1376
1377 @lilypond[quote]
1378 musicA = {
1379   <<
1380     \relative c' {
1381       cis'8 fis, d'4 <a cis>8 f bis4 |
1382       cis2. <c, g'>4 |
1383     }
1384     \\
1385     \relative c' {
1386       ais'2 cis, |
1387       fis8 b a4 cis2 |
1388     }
1389   >>
1390 }
1391
1392 musicB = {
1393   \clef bass
1394   \new Voice {
1395     \voiceTwo \relative c' {
1396       <fis, a cis>8 <fis a cis>
1397       \change Staff = up
1398       cis' cis
1399       \change Staff = down
1400       <fis, a> <fis a>
1401       \showStaffSwitch
1402       \change Staff = up
1403       dis'4 |
1404       \change Staff = down
1405       <fis, a cis>4 gis <f a d>2 |
1406     }
1407   }
1408 }
1409
1410 \new PianoStaff {
1411   <<
1412     \context Staff = "up" {
1413       #(set-accidental-style 'default)
1414       \musicA
1415     }
1416     \context Staff = "down" {
1417       #(set-accidental-style 'default)
1418       \musicB
1419     }
1420   >>
1421 }
1422 @end lilypond
1423
1424 @item voice
1425
1426 @cindex accidental style, voice
1427 @cindex voice accidental style
1428 @cindex accidental style, modern
1429 @cindex modern accidental style
1430 @cindex accidental style, modern-cautionary
1431 @cindex modern-cautionary accidental style
1432
1433 @funindex voice
1434
1435 The normal behavior is to remember the accidentals at
1436 @code{Staff}-level.  In this style, however, accidentals are
1437 typeset individually for each voice.  Apart from that, the rule is
1438 similar to @code{default}.
1439
1440 As a result, accidentals from one voice do not get canceled in
1441 other voices, which is often an unwanted result: in the following
1442 example, it is hard to determine whether the second@tie{}@code{a}
1443 should be played natural or sharp.  The @code{voice} option should
1444 therefore be used only if the voices are to be read solely by
1445 individual musicians.  If the staff is to be used by one musician
1446 (e.g., a conductor or in a piano score) then @code{modern} or
1447 @code{modern-cautionary} should be used instead.
1448
1449
1450 @lilypond[quote]
1451 musicA = {
1452   <<
1453     \relative c' {
1454       cis'8 fis, d'4 <a cis>8 f bis4 |
1455       cis2. <c, g'>4 |
1456     }
1457     \\
1458     \relative c' {
1459       ais'2 cis, |
1460       fis8 b a4 cis2 |
1461     }
1462   >>
1463 }
1464
1465 musicB = {
1466   \clef bass
1467   \new Voice {
1468     \voiceTwo \relative c' {
1469       <fis, a cis>8 <fis a cis>
1470       \change Staff = up
1471       cis' cis
1472       \change Staff = down
1473       <fis, a> <fis a>
1474       \showStaffSwitch
1475       \change Staff = up
1476       dis'4 |
1477       \change Staff = down
1478       <fis, a cis>4 gis <f a d>2 |
1479     }
1480   }
1481 }
1482
1483 \new PianoStaff {
1484   <<
1485     \context Staff = "up" {
1486       #(set-accidental-style 'voice)
1487       \musicA
1488     }
1489     \context Staff = "down" {
1490       #(set-accidental-style 'voice)
1491       \musicB
1492     }
1493   >>
1494 }
1495 @end lilypond
1496
1497 @item modern
1498
1499 @cindex accidentals, modern style
1500 @cindex modern style accidentals
1501
1502 @funindex modern
1503
1504 This rule corresponds to the common practice in the twentieth
1505 century.  It prints the same accidentals as @code{default}, with
1506 two exceptions that serve to avoid ambiguity: after temporary
1507 accidentals, cancellation marks are printed also in the following
1508 measure (for notes in the same octave) and, in the same measure,
1509 for notes in other octaves.  Hence the naturals before
1510 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1511 the upper staff:
1512
1513 @lilypond[quote]
1514 musicA = {
1515   <<
1516     \relative c' {
1517       cis'8 fis, d'4 <a cis>8 f bis4 |
1518       cis2. <c, g'>4 |
1519     }
1520     \\
1521     \relative c' {
1522       ais'2 cis, |
1523       fis8 b a4 cis2 |
1524     }
1525   >>
1526 }
1527
1528 musicB = {
1529   \clef bass
1530   \new Voice {
1531     \voiceTwo \relative c' {
1532       <fis, a cis>8 <fis a cis>
1533       \change Staff = up
1534       cis' cis
1535       \change Staff = down
1536       <fis, a> <fis a>
1537       \showStaffSwitch
1538       \change Staff = up
1539       dis'4 |
1540       \change Staff = down
1541       <fis, a cis>4 gis <f a d>2 |
1542     }
1543   }
1544 }
1545
1546 \new PianoStaff {
1547   <<
1548     \context Staff = "up" {
1549       #(set-accidental-style 'modern)
1550       \musicA
1551     }
1552     \context Staff = "down" {
1553       #(set-accidental-style 'modern)
1554       \musicB
1555     }
1556   >>
1557 }
1558 @end lilypond
1559
1560 @item modern-cautionary
1561
1562 @cindex accidentals, modern cautionary style
1563 @cindex modern accidental style
1564 @cindex modern cautionary accidental style
1565 @cindex modern style accidentals
1566 @cindex modern style cautionary accidentals
1567
1568 @funindex modern-cautionary
1569
1570 This rule is similar to @code{modern}, but the @q{extra}
1571 accidentals (the ones not typeset by @code{default}) are typeset
1572 as cautionary accidentals.  They are by default printed with
1573 parentheses, but they can also be printed in reduced size by
1574 defining the @code{cautionary-style} property of
1575 @code{AccidentalSuggestion}.
1576
1577 @lilypond[quote]
1578 musicA = {
1579   <<
1580     \relative c' {
1581       cis'8 fis, d'4 <a cis>8 f bis4 |
1582       cis2. <c, g'>4 |
1583     }
1584     \\
1585     \relative c' {
1586       ais'2 cis, |
1587       fis8 b a4 cis2 |
1588     }
1589   >>
1590 }
1591
1592 musicB = {
1593   \clef bass
1594   \new Voice {
1595     \voiceTwo \relative c' {
1596       <fis, a cis>8 <fis a cis>
1597       \change Staff = up
1598       cis' cis
1599       \change Staff = down
1600       <fis, a> <fis a>
1601       \showStaffSwitch
1602       \change Staff = up
1603       dis'4 |
1604       \change Staff = down
1605       <fis, a cis>4 gis <f a d>2 |
1606     }
1607   }
1608 }
1609
1610 \new PianoStaff {
1611   <<
1612     \context Staff = "up" {
1613       #(set-accidental-style 'modern-cautionary)
1614       \musicA
1615     }
1616     \context Staff = "down" {
1617       #(set-accidental-style 'modern-cautionary)
1618       \musicB
1619     }
1620   >>
1621 }
1622 @end lilypond
1623
1624 @item modern-voice
1625
1626 @cindex accidental style, modern
1627 @cindex accidentals, modern
1628 @cindex accidentals, multivoice
1629 @cindex modern accidental style
1630 @cindex modern accidentals
1631 @cindex multivoice accidentals
1632
1633 @funindex modern-voice
1634
1635 This rule is used for multivoice accidentals to be read both by
1636 musicians playing one voice and musicians playing all voices.
1637 Accidentals are typeset for each voice, but they @emph{are}
1638 canceled across voices in the same @code{Staff}.  Hence,
1639 the@tie{}@code{a} in the last measure is canceled because the
1640 previous cancellation was in a different voice, and
1641 the@tie{}@code{d} in the lower staff is canceled because of the
1642 accidental in a different voice in the previous measure:
1643
1644 @lilypond[quote]
1645 musicA = {
1646   <<
1647     \relative c' {
1648       cis'8 fis, d'4 <a cis>8 f bis4 |
1649       cis2. <c, g'>4 |
1650     }
1651     \\
1652     \relative c' {
1653       ais'2 cis, |
1654       fis8 b a4 cis2 |
1655     }
1656   >>
1657 }
1658
1659 musicB = {
1660   \clef bass
1661   \new Voice {
1662     \voiceTwo \relative c' {
1663       <fis, a cis>8 <fis a cis>
1664       \change Staff = up
1665       cis' cis
1666       \change Staff = down
1667       <fis, a> <fis a>
1668       \showStaffSwitch
1669       \change Staff = up
1670       dis'4 |
1671       \change Staff = down
1672       <fis, a cis>4 gis <f a d>2 |
1673     }
1674   }
1675 }
1676
1677 \new PianoStaff {
1678   <<
1679     \context Staff = "up" {
1680       #(set-accidental-style 'modern-voice)
1681       \musicA
1682     }
1683     \context Staff = "down" {
1684       #(set-accidental-style 'modern-voice)
1685       \musicB
1686     }
1687   >>
1688 }
1689 @end lilypond
1690
1691 @cindex accidental style, cautionary, modern voice
1692 @cindex accidental style, modern voice cautionary
1693 @cindex accidental style, voice, modern cautionary
1694
1695 @funindex modern-voice-cautionary
1696
1697 @item modern-voice-cautionary
1698
1699 This rule is the same as @code{modern-voice}, but with the extra
1700 accidentals (the ones not typeset by @code{voice}) typeset as
1701 cautionaries.  Even though all accidentals typeset by
1702 @code{default} @emph{are} typeset with this rule, some of them are
1703 typeset as cautionaries.
1704
1705 @lilypond[quote]
1706 musicA = {
1707   <<
1708     \relative c' {
1709       cis'8 fis, d'4 <a cis>8 f bis4 |
1710       cis2. <c, g'>4 |
1711     }
1712     \\
1713     \relative c' {
1714       ais'2 cis, |
1715       fis8 b a4 cis2 |
1716     }
1717   >>
1718 }
1719
1720 musicB = {
1721   \clef bass
1722   \new Voice {
1723     \voiceTwo \relative c' {
1724       <fis, a cis>8 <fis a cis>
1725       \change Staff = up
1726       cis' cis
1727       \change Staff = down
1728       <fis, a> <fis a>
1729       \showStaffSwitch
1730       \change Staff = up
1731       dis'4 |
1732       \change Staff = down
1733       <fis, a cis>4 gis <f a d>2 |
1734     }
1735   }
1736 }
1737
1738 \new PianoStaff {
1739   <<
1740     \context Staff = "up" {
1741       #(set-accidental-style 'modern-voice-cautionary)
1742       \musicA
1743     }
1744     \context Staff = "down" {
1745       #(set-accidental-style 'modern-voice-cautionary)
1746       \musicB
1747     }
1748   >>
1749 }
1750 @end lilypond
1751
1752 @item piano
1753
1754 @cindex accidental style, piano
1755 @cindex accidentals, piano
1756 @cindex piano accidental style
1757 @cindex piano accidentals
1758
1759 @funindex piano
1760
1761 This rule reflects twentieth-century practice for piano notation.
1762 Its behavior is very similar to @code{modern} style, but here
1763 accidentals also get canceled across the staves in the same
1764 @code{GrandStaff} or @code{PianoStaff}, hence all the
1765 cancellations of the final notes.
1766
1767 This accidental style applies to the current @code{GrandStaff} or
1768 @code{PianoStaff} by default.
1769
1770 @lilypond[quote]
1771 musicA = {
1772   <<
1773     \relative c' {
1774       cis'8 fis, d'4 <a cis>8 f bis4 |
1775       cis2. <c, g'>4 |
1776     }
1777     \\
1778     \relative c' {
1779       ais'2 cis, |
1780       fis8 b a4 cis2 |
1781     }
1782   >>
1783 }
1784
1785 musicB = {
1786   \clef bass
1787   \new Voice {
1788     \voiceTwo \relative c' {
1789       <fis, a cis>8 <fis a cis>
1790       \change Staff = up
1791       cis' cis
1792       \change Staff = down
1793       <fis, a> <fis a>
1794       \showStaffSwitch
1795       \change Staff = up
1796       dis'4 |
1797       \change Staff = down
1798       <fis, a cis>4 gis <f a d>2 |
1799     }
1800   }
1801 }
1802
1803 \new PianoStaff {
1804   <<
1805     \context Staff = "up" {
1806       #(set-accidental-style 'piano)
1807       \musicA
1808     }
1809     \context Staff = "down" {
1810       \musicB
1811     }
1812   >>
1813 }
1814 @end lilypond
1815
1816 @item piano-cautionary
1817
1818 @cindex accidentals, piano cautionary
1819 @cindex cautionary accidentals, piano
1820 @cindex piano cautionary accidentals
1821 @cindex accidental style, piano cautionary
1822 @cindex cautionary accidental style, piano
1823 @cindex piano cautionary accidental style
1824
1825 @funindex piano-cautionary
1826
1827 This is the same as @code{piano} but with the extra accidentals
1828 typeset as cautionaries.
1829
1830 @lilypond[quote]
1831 musicA = {
1832   <<
1833     \relative c' {
1834       cis'8 fis, d'4 <a cis>8 f bis4 |
1835       cis2. <c, g'>4 |
1836     }
1837     \\
1838     \relative c' {
1839       ais'2 cis, |
1840       fis8 b a4 cis2 |
1841     }
1842   >>
1843 }
1844
1845 musicB = {
1846   \clef bass
1847   \new Voice {
1848     \voiceTwo \relative c' {
1849       <fis, a cis>8 <fis a cis>
1850       \change Staff = up
1851       cis' cis
1852       \change Staff = down
1853       <fis, a> <fis a>
1854       \showStaffSwitch
1855       \change Staff = up
1856       dis'4 |
1857       \change Staff = down
1858       <fis, a cis>4 gis <f a d>2 |
1859     }
1860   }
1861 }
1862
1863 \new PianoStaff {
1864   <<
1865     \context Staff = "up" {
1866       #(set-accidental-style 'piano-cautionary)
1867       \musicA
1868     }
1869     \context Staff = "down" {
1870       \musicB
1871     }
1872   >>
1873 }
1874 @end lilypond
1875
1876
1877 @item neo-modern
1878
1879 @cindex neo-modern accidental style
1880 @cindex accidental style, neo-modern
1881
1882 @funindex neo-modern
1883
1884 This rule reproduces a common practice in contemporary music:
1885 accidentals are printed like with @code{modern}, but they are printed
1886 again if the same note appears later in the same measure -- except
1887 if the note is immediately repeated.
1888
1889 @lilypond[quote]
1890 musicA = {
1891   <<
1892     \relative c' {
1893       cis'8 fis, d'4 <a cis>8 f bis4 |
1894       cis2. <c, g'>4 |
1895     }
1896     \\
1897     \relative c' {
1898       ais'2 cis, |
1899       fis8 b a4 cis2 |
1900     }
1901   >>
1902 }
1903
1904 musicB = {
1905   \clef bass
1906   \new Voice {
1907     \voiceTwo \relative c' {
1908       <fis, a cis>8 <fis a cis>
1909       \change Staff = up
1910       cis' cis
1911       \change Staff = down
1912       <fis, a> <fis a>
1913       \showStaffSwitch
1914       \change Staff = up
1915       dis'4 |
1916       \change Staff = down
1917       <fis, a cis>4 gis <f a d>2 |
1918     }
1919   }
1920 }
1921
1922 \new PianoStaff {
1923   <<
1924     \context Staff = "up" {
1925       #(set-accidental-style 'neo-modern)
1926       \musicA
1927     }
1928     \context Staff = "down" {
1929       #(set-accidental-style 'neo-modern)
1930       \musicB
1931     }
1932   >>
1933 }
1934 @end lilypond
1935
1936 @item neo-modern-cautionary
1937
1938 @cindex neo-modern-cautionary accidental style
1939 @cindex accidental style, neo-modern-cautionary
1940
1941 @funindex neo-modern-cautionary
1942
1943 This rule is similar to @code{neo-modern}, but the extra
1944 accidentals are printed as cautionary accidentals.
1945
1946 @lilypond[quote]
1947 musicA = {
1948   <<
1949     \relative c' {
1950       cis'8 fis, d'4 <a cis>8 f bis4 |
1951       cis2. <c, g'>4 |
1952     }
1953     \\
1954     \relative c' {
1955       ais'2 cis, |
1956       fis8 b a4 cis2 |
1957     }
1958   >>
1959 }
1960
1961 musicB = {
1962   \clef bass
1963   \new Voice {
1964     \voiceTwo \relative c' {
1965       <fis, a cis>8 <fis a cis>
1966       \change Staff = up
1967       cis' cis
1968       \change Staff = down
1969       <fis, a> <fis a>
1970       \showStaffSwitch
1971       \change Staff = up
1972       dis'4 |
1973       \change Staff = down
1974       <fis, a cis>4 gis <f a d>2 |
1975     }
1976   }
1977 }
1978
1979 \new PianoStaff {
1980   <<
1981     \context Staff = "up" {
1982       #(set-accidental-style 'neo-modern-cautionary)
1983       \musicA
1984     }
1985     \context Staff = "down" {
1986       #(set-accidental-style 'neo-modern-cautionary)
1987       \musicB
1988     }
1989   >>
1990 }
1991 @end lilypond
1992
1993
1994 @item neo-modern-voice
1995
1996 @cindex neo-modern-voice accidental style
1997 @cindex accidental style, neo-modern-voice
1998
1999 @funindex neo-modern-voice
2000
2001 This rule is used for multivoice accidentals to be read both by
2002 musicians playing one voice and musicians playing all voices.
2003 Accidentals are typeset for each voice as with @code{neo-modern},
2004 but they are canceled across voices in the same @code{Staff}.
2005
2006 @lilypond[quote]
2007 musicA = {
2008   <<
2009     \relative c' {
2010       cis'8 fis, d'4 <a cis>8 f bis4 |
2011       cis2. <c, g'>4 |
2012     }
2013     \\
2014     \relative c' {
2015       ais'2 cis, |
2016       fis8 b a4 cis2 |
2017     }
2018   >>
2019 }
2020
2021 musicB = {
2022   \clef bass
2023   \new Voice {
2024     \voiceTwo \relative c' {
2025       <fis, a cis>8 <fis a cis>
2026       \change Staff = up
2027       cis' cis
2028       \change Staff = down
2029       <fis, a> <fis a>
2030       \showStaffSwitch
2031       \change Staff = up
2032       dis'4 |
2033       \change Staff = down
2034       <fis, a cis>4 gis <f a d>2 |
2035     }
2036   }
2037 }
2038
2039 \new PianoStaff {
2040   <<
2041     \context Staff = "up" {
2042       #(set-accidental-style 'neo-modern-voice)
2043       \musicA
2044     }
2045     \context Staff = "down" {
2046       #(set-accidental-style 'neo-modern-voice)
2047       \musicB
2048     }
2049   >>
2050 }
2051 @end lilypond
2052
2053 @item neo-modern-voice-cautionary
2054
2055 @cindex neo-modern-voice-cautionary accidental style
2056 @cindex accidental style, neo-modern-voice-cautionary
2057
2058 @funindex neo-modern-voice-cautionary
2059
2060 This rule is similar to @code{neo-modern-voice}, but the extra
2061 accidentals are printed as cautionary accidentals.
2062
2063 @lilypond[quote]
2064 musicA = {
2065   <<
2066     \relative c' {
2067       cis'8 fis, d'4 <a cis>8 f bis4 |
2068       cis2. <c, g'>4 |
2069     }
2070     \\
2071     \relative c' {
2072       ais'2 cis, |
2073       fis8 b a4 cis2 |
2074     }
2075   >>
2076 }
2077
2078 musicB = {
2079   \clef bass
2080   \new Voice {
2081     \voiceTwo \relative c' {
2082       <fis, a cis>8 <fis a cis>
2083       \change Staff = up
2084       cis' cis
2085       \change Staff = down
2086       <fis, a> <fis a>
2087       \showStaffSwitch
2088       \change Staff = up
2089       dis'4 |
2090       \change Staff = down
2091       <fis, a cis>4 gis <f a d>2 |
2092     }
2093   }
2094 }
2095
2096 \new PianoStaff {
2097   <<
2098     \context Staff = "up" {
2099       #(set-accidental-style 'neo-modern-voice-cautionary)
2100       \musicA
2101     }
2102     \context Staff = "down" {
2103       #(set-accidental-style 'neo-modern-voice-cautionary)
2104       \musicB
2105     }
2106   >>
2107 }
2108 @end lilypond
2109
2110 @item dodecaphonic
2111
2112 @cindex dodecaphonic accidental style
2113 @cindex dodecaphonic style, neo-modern
2114
2115 @funindex dodecaphonic
2116
2117 This rule reflects a practice introduced by composers at
2118 the beginning of the 20th century, in an attempt to
2119 abolish the hierarchy between natural and non-natural notes.
2120 With this style, @emph{every} note gets an accidental sign,
2121 including natural signs.
2122
2123 @lilypond[quote]
2124 musicA = {
2125   <<
2126     \relative c' {
2127       cis'8 fis, d'4 <a cis>8 f bis4 |
2128       cis2. <c, g'>4 |
2129     }
2130     \\
2131     \relative c' {
2132       ais'2 cis, |
2133       fis8 b a4 cis2 |
2134     }
2135   >>
2136 }
2137
2138 musicB = {
2139   \clef bass
2140   \new Voice {
2141     \voiceTwo \relative c' {
2142       <fis, a cis>8 <fis a cis>
2143       \change Staff = up
2144       cis' cis
2145       \change Staff = down
2146       <fis, a> <fis a>
2147       \showStaffSwitch
2148       \change Staff = up
2149       dis'4 |
2150       \change Staff = down
2151       <fis, a cis>4 gis <f a d>2 |
2152     }
2153   }
2154 }
2155
2156 \new PianoStaff {
2157   <<
2158     \context Staff = "up" {
2159       #(set-accidental-style 'dodecaphonic)
2160       \musicA
2161     }
2162     \context Staff = "down" {
2163       #(set-accidental-style 'dodecaphonic)
2164       \musicB
2165     }
2166   >>
2167 }
2168 @end lilypond
2169
2170
2171 @item teaching
2172
2173 @cindex teaching accidental style
2174 @cindex accidental style, teaching
2175
2176 @funindex teaching
2177
2178 This rule is intended for students, and makes it easy to create
2179 scale sheets with automagically created cautionary accidentals.
2180 Accidentals are printed like with @code{modern}, but cautionary
2181 accidentals are added for all sharp or flat tones specified by the
2182 key signature, except if the note is immediately repeated.
2183
2184 @lilypond[quote]
2185 musicA = {
2186   <<
2187     \relative c' {
2188       cis'8 fis, d'4 <a cis>8 f bis4 |
2189       cis2. <c, g'>4 |
2190     }
2191     \\
2192     \relative c' {
2193       ais'2 cis, |
2194       fis8 b a4 cis2 |
2195     }
2196   >>
2197 }
2198
2199 musicB = {
2200   \clef bass
2201   \new Voice {
2202     \voiceTwo \relative c' {
2203       <fis, a cis>8 <fis a cis>
2204       \change Staff = up
2205       cis' cis
2206       \change Staff = down
2207       <fis, a> <fis a>
2208       \showStaffSwitch
2209       \change Staff = up
2210       dis'4 |
2211       \change Staff = down
2212       <fis, a cis>4 gis <f a d>2 |
2213     }
2214   }
2215 }
2216
2217 \new PianoStaff {
2218   <<
2219     \context Staff = "up" {
2220       \key fis \minor
2221       #(set-accidental-style 'teaching)
2222       \musicA
2223     }
2224     \context Staff = "down" {
2225       \key fis \minor
2226       #(set-accidental-style 'teaching)
2227       \musicB
2228     }
2229   >>
2230 }
2231 @end lilypond
2232
2233
2234
2235 @item no-reset
2236
2237 @cindex accidental style, no reset
2238 @cindex no reset accidental style
2239
2240 @funindex no-reset
2241
2242 This is the same as @code{default} but with accidentals lasting
2243 @q{forever} and not only within the same measure:
2244
2245 @lilypond[quote]
2246 musicA = {
2247   <<
2248     \relative c' {
2249       cis'8 fis, d'4 <a cis>8 f bis4 |
2250       cis2. <c, g'>4 |
2251     }
2252     \\
2253     \relative c' {
2254       ais'2 cis, |
2255       fis8 b a4 cis2 |
2256     }
2257   >>
2258 }
2259
2260 musicB = {
2261   \clef bass
2262   \new Voice {
2263     \voiceTwo \relative c' {
2264       <fis, a cis>8 <fis a cis>
2265       \change Staff = up
2266       cis' cis
2267       \change Staff = down
2268       <fis, a> <fis a>
2269       \showStaffSwitch
2270       \change Staff = up
2271       dis'4 |
2272       \change Staff = down
2273       <fis, a cis>4 gis <f a d>2 |
2274     }
2275   }
2276 }
2277
2278 \new PianoStaff {
2279   <<
2280     \context Staff = "up" {
2281       #(set-accidental-style 'no-reset)
2282       \musicA
2283     }
2284     \context Staff = "down" {
2285       #(set-accidental-style 'no-reset)
2286       \musicB
2287     }
2288   >>
2289 }
2290 @end lilypond
2291
2292 @item forget
2293
2294 @cindex forget accidental style
2295 @cindex accidental style, forget
2296
2297 @funindex forget
2298
2299 This is the opposite of @code{no-reset}: Accidentals are not
2300 remembered at all -- and hence all accidentals are typeset
2301 relative to the key signature, regardless of what came before in
2302 the music.  Unlike @code{dodecaphonic}, this rule never prints
2303 any naturals.
2304
2305 @lilypond[quote]
2306 musicA = {
2307   <<
2308     \relative c' {
2309       cis'8 fis, d'4 <a cis>8 f bis4 |
2310       cis2. <c, g'>4 |
2311     }
2312     \\
2313     \relative c' {
2314       ais'2 cis, |
2315       fis8 b a4 cis2 |
2316     }
2317   >>
2318 }
2319
2320 musicB = {
2321   \clef bass
2322   \new Voice {
2323     \voiceTwo \relative c' {
2324       <fis, a cis>8 <fis a cis>
2325       \change Staff = up
2326       cis' cis
2327       \change Staff = down
2328       <fis, a> <fis a>
2329       \showStaffSwitch
2330       \change Staff = up
2331       dis'4 |
2332       \change Staff = down
2333       <fis, a cis>4 gis <f a d>2 |
2334     }
2335   }
2336 }
2337
2338 \new PianoStaff {
2339   <<
2340     \context Staff = "up" {
2341       #(set-accidental-style 'forget)
2342       \musicA
2343     }
2344     \context Staff = "down" {
2345       #(set-accidental-style 'forget)
2346       \musicB
2347     }
2348   >>
2349 }
2350 @end lilypond
2351 @end table
2352
2353 @snippets
2354
2355 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2356 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
2357
2358
2359 @seealso
2360 Snippets:
2361 @rlsr{Pitches}.
2362
2363 Internals Reference:
2364 @rinternals{Accidental},
2365 @rinternals{Accidental_engraver},
2366 @rinternals{GrandStaff},
2367 @rinternals{PianoStaff},
2368 @rinternals{Staff},
2369 @rinternals{AccidentalSuggestion},
2370 @rinternals{AccidentalPlacement},
2371 @rinternals{accidental-suggestion-interface}.
2372
2373
2374 @cindex accidentals and simultaneous notes
2375 @cindex simultaneous notes and accidentals
2376 @cindex accidentals in chords
2377 @cindex chords, accidentals in
2378
2379 @knownissues
2380
2381 Simultaneous notes are considered to be entered in sequential
2382 mode.  This means that in a chord the accidentals are typeset as
2383 if the notes in the chord happen one at a time, in the order in
2384 which they appear in the input file.  This is a problem when
2385 accidentals in a chord depend on each other, which does not happen
2386 for the default accidental style.  The problem can be solved by
2387 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
2388 problematic notes.
2389
2390
2391 Cautionary cancellation of accidentals is done by looking at previous measure.
2392 However, in the @code{\alternative} block following a @code{\repeat volta N}
2393 section, one would expect the cancellation being calculated using the previous
2394 @emph{played} measure, not previous @emph{printed} measure.
2395 In the following example, the natural @code{c} in the second alternative does
2396 not need a natural sign:
2397
2398 @lilypond[quote]
2399 {
2400   #(set-accidental-style 'modern)
2401   \time 2/4
2402   \repeat volta 2 {
2403     c'2
2404   }
2405   \alternative {
2406      cis'
2407      c'
2408   }
2409 }
2410 @end lilypond
2411
2412 The following work-around can be used: define a function that locally changes
2413 the accidental style to @code{forget}:
2414
2415 @lilypond[verbatim,quote]
2416 forget = #(define-music-function (parser location music) (ly:music?) #{
2417   #(set-accidental-style 'forget)
2418   $music
2419   #(set-accidental-style 'modern)
2420 #})
2421 {
2422   #(set-accidental-style 'modern)
2423   \time 2/4
2424   \repeat volta 2 {
2425     c'2
2426   }
2427   \alternative {
2428      cis'
2429      \forget c'
2430   }
2431 }
2432 @end lilypond
2433
2434 @node Ambitus
2435 @unnumberedsubsubsec Ambitus
2436
2437 @cindex ambitus
2438 @cindex range of pitches
2439 @cindex pitch range
2440
2441 The term @notation{ambitus} (pl. ambitus) denotes a range of
2442 pitches for a given voice in a part of music.  It may also denote
2443 the pitch range that a musical instrument is capable of playing.
2444 Ambitus are printed on vocal parts so that performers can easily
2445 determine if it matches their capabilities.
2446
2447 Ambitus are denoted at the beginning of a piece near the initial
2448 clef.  The range is graphically specified by two note heads that
2449 represent the lowest and highest pitches.  Accidentals are only
2450 printed if they are not part of the key signature.
2451
2452 @lilypond[verbatim,quote]
2453 \layout {
2454   \context {
2455     \Voice
2456     \consists "Ambitus_engraver"
2457   }
2458 }
2459
2460 \relative c'' {
2461   aes c e2
2462   cis,1
2463 }
2464 @end lilypond
2465
2466
2467 @snippets
2468
2469 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2470 {adding-ambitus-per-voice.ly}
2471
2472 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2473 {ambitus-with-multiple-voices.ly}
2474
2475
2476 @seealso
2477 Music Glossary:
2478 @rglos{ambitus}.
2479
2480 Snippets:
2481 @rlsr{Pitches}.
2482
2483 Internals Reference:
2484 @rinternals{Ambitus_engraver},
2485 @rinternals{Voice},
2486 @rinternals{Staff},
2487 @rinternals{Ambitus},
2488 @rinternals{AmbitusAccidental},
2489 @rinternals{AmbitusLine},
2490 @rinternals{AmbitusNoteHead},
2491 @rinternals{ambitus-interface}.
2492
2493
2494 @knownissues
2495
2496 There is no collision handling in the case of multiple per-voice
2497 ambitus.
2498
2499
2500 @node Note heads
2501 @subsection Note heads
2502
2503 This section suggests ways of altering note heads.
2504
2505 @menu
2506 * Special note heads::
2507 * Easy notation note heads::
2508 * Shape note heads::
2509 * Improvisation::
2510 @end menu
2511
2512 @node Special note heads
2513 @unnumberedsubsubsec Special note heads
2514
2515 @cindex note heads, special
2516 @cindex note heads, cross
2517 @cindex note heads, diamond
2518 @cindex note heads, parlato
2519 @cindex note heads, harmonic
2520 @cindex note heads, guitar
2521 @cindex special note heads
2522 @cindex cross note heads
2523 @cindex diamond note heads
2524 @cindex parlato note heads
2525 @cindex harmonic note heads
2526 @cindex guitar note heads
2527 @cindex note head styles
2528 @cindex styles, note heads
2529
2530 @funindex cross
2531
2532 The appearance of note heads may be altered:
2533
2534 @lilypond[verbatim,quote,relative=2]
2535 c4 b
2536 \override NoteHead #'style = #'cross
2537 c4 b
2538 \revert NoteHead #'style
2539 a b
2540 \override NoteHead #'style = #'harmonic
2541 a b
2542 \revert NoteHead #'style
2543 c4 d e f
2544 @end lilypond
2545
2546 To see all note head styles, see @ref{Note head styles}.
2547
2548 The @code{cross} style is used to represent a variety of musical
2549 intentions.  The following generic predefined commands modify the
2550 note head in both staff and tablature contexts and can be used to
2551 represent any musical meaning:
2552
2553 @lilypond[verbatim,quote,relative=2]
2554 c4 b
2555 \xNotesOn
2556  a b c4 b
2557 \xNotesOff
2558 c4 d
2559 @end lilypond
2560
2561 The music function form of this predefined command may be used
2562 inside and outside chords to generate crossed note heads in both
2563 staff and tablature contexts:
2564
2565 @lilypond[verbatim,quote,relative=2]
2566 c4 b
2567 \xNote { e f }
2568 c b < g \xNote c f > b
2569 @end lilypond
2570
2571 There is also a shorthand for diamond shapes which can be used
2572 only inside chords:
2573
2574 @lilypond[verbatim,quote,relative=2]
2575 <c f\harmonic>2 <d a'\harmonic>4 <c g'\harmonic>
2576 @end lilypond
2577
2578 @predefined
2579 @code{\harmonic},
2580 @code{\xNotesOn},
2581 @code{\xNotesOff},
2582 @code{\xNote}.
2583 @endpredefined
2584
2585 @seealso
2586 Snippets:
2587 @rlsr{Pitches}.
2588
2589 Notation Reference:
2590 @ref{Note head styles},
2591 @ref{Chorded notes}.
2592
2593 Internals Reference:
2594 @rinternals{note-event},
2595 @rinternals{Note_heads_engraver},
2596 @rinternals{Ledger_line_engraver},
2597 @rinternals{NoteHead},
2598 @rinternals{LedgerLineSpanner},
2599 @rinternals{note-head-interface},
2600 @rinternals{ledger-line-spanner-interface}.
2601
2602
2603 @node Easy notation note heads
2604 @unnumberedsubsubsec Easy notation note heads
2605
2606 @cindex note heads, practice
2607 @cindex practice note heads
2608 @cindex note heads, easy notation
2609 @cindex easy notation
2610 @cindex Hal Leonard
2611 @cindex beginners' music
2612 @cindex music, beginners'
2613 @cindex easy play note heads
2614 @cindex note heads, easy play
2615
2616 @funindex \easyHeadsOn
2617 @funindex easyHeadsOn
2618 @funindex \easyHeadsOff
2619 @funindex easyHeadsOff
2620
2621 The @q{easy play} note head includes a note name inside the head.
2622 It is used in music for beginners.  To make the letters readable,
2623 it should be printed in a large font size.  To print with a larger
2624 font, see @ref{Setting the staff size}.
2625
2626 @lilypond[verbatim,quote]
2627 #(set-global-staff-size 26)
2628 \relative c' {
2629   \easyHeadsOn
2630   c2 e4 f
2631   g1
2632   \easyHeadsOff
2633   c,1
2634 }
2635 @end lilypond
2636
2637
2638 @predefined
2639 @code{\easyHeadsOn},
2640 @code{\easyHeadsOff}.
2641 @endpredefined
2642
2643
2644 @snippets
2645
2646 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2647 {numbers-as-easy-note-heads.ly}
2648
2649
2650 @seealso
2651 Notation Reference:
2652 @ref{Setting the staff size}.
2653
2654 Snippets:
2655 @rlsr{Pitches}.
2656
2657 Internals Reference:
2658 @rinternals{note-event},
2659 @rinternals{Note_heads_engraver},
2660 @rinternals{NoteHead},
2661 @rinternals{note-head-interface}.
2662
2663
2664 @node Shape note heads
2665 @unnumberedsubsubsec Shape note heads
2666
2667 @cindex note heads, shape
2668 @cindex note heads, Aiken
2669 @cindex note heads, sacred harp
2670 @cindex shape notes
2671 @cindex Aiken shape note heads
2672 @cindex sacred harp note heads
2673
2674 @funindex \key
2675 @funindex key
2676 @funindex \aikenHeads
2677 @funindex aikenHeads
2678 @funindex \sacredHarpHeads
2679 @funindex sacredHarpHeads
2680
2681 In shape note head notation, the shape of the note head
2682 corresponds to the harmonic function of a note in the scale.  This
2683 notation was popular in nineteenth-century American song books.
2684 Shape note heads can be produced:
2685
2686 @lilypond[verbatim,quote,relative=2]
2687 \aikenHeads
2688 c, d e f g a b c
2689 \sacredHarpHeads
2690 c, d e f g a b c
2691 @end lilypond
2692
2693 Shapes are typeset according to the step in the scale, where the
2694 base of the scale is determined by the @code{\key} command.
2695
2696
2697 @predefined
2698 @code{\aikenHeads},
2699 @code{\sacredHarpHeads}.
2700 @endpredefined
2701
2702
2703 @snippets
2704
2705 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2706 {applying-note-head-styles-depending-on-the-step-of-the-scale.ly}
2707
2708 To see all note head styles, see @ref{Note head styles}.
2709
2710
2711 @seealso
2712 Snippets:
2713 @rlsr{Pitches}.
2714
2715 Notation Reference:
2716 @ref{Note head styles}.
2717
2718 Internals Reference:
2719 @rinternals{note-event},
2720 @rinternals{Note_heads_engraver},
2721 @rinternals{NoteHead},
2722 @rinternals{note-head-interface}.
2723
2724
2725 @node Improvisation
2726 @unnumberedsubsubsec Improvisation
2727
2728 @cindex improvisation
2729 @cindex slashed note heads
2730 @cindex note heads, improvisation
2731 @cindex note heads, slashed
2732
2733 @funindex \improvisationOn
2734 @funindex improvisationOn
2735 @funindex \improvisationOff
2736 @funindex improvisationOff
2737
2738 Improvisation is sometimes denoted with slashed note heads, where
2739 the performer may choose any pitch but should play the specified
2740 rhythm.  Such note heads can be created:
2741
2742 @lilypond[verbatim,quote,relative=2]
2743 \new Voice \with {
2744   \consists "Pitch_squash_engraver"
2745 } {
2746   e8 e g a a16( bes) a8 g
2747   \improvisationOn
2748   e8 ~
2749   e2 ~ e8 f4 f8 ~
2750   f2
2751   \improvisationOff
2752   a16( bes) a8 g e
2753 }
2754 @end lilypond
2755
2756
2757 @predefined
2758 @code{\improvisationOn},
2759 @code{\improvisationOff}.
2760 @endpredefined
2761
2762
2763 @seealso
2764 Snippets:
2765 @rlsr{Pitches}.
2766
2767 Internals Reference:
2768 @rinternals{Pitch_squash_engraver},
2769 @rinternals{Voice},
2770 @rinternals{RhythmicStaff}.
2771
2772