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