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