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