]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/pitches.itely
Merge branch 'master' of ssh://jeancharlesm@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / user / 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.  See TRANSLATION for details.
7 @end ignore
8
9 @c \version "2.11.51"
10
11
12 @node Pitches
13 @section Pitches
14
15 @lilypondfile[quote]{pitches-headword.ly}
16
17 This section discusses how to specify the pitch of notes.  There
18 are three steps to this process: input, modification, and output.
19
20 @menu
21 * Writing pitches::             
22 * Changing multiple pitches::   
23 * Displaying pitches::          
24 * Note heads::                  
25 @end menu
26
27
28 @node Writing pitches
29 @subsection Writing pitches
30
31 This section discusses how to input pitches.  There are two
32 different ways to place notes in octaves: absolute and relative
33 mode.  In most cases, relative mode will be more convenient.
34
35 @menu
36 * Absolute octave entry::       
37 * Relative octave entry::       
38 * Accidentals::                 
39 * Note names in other languages::  
40 @end menu
41
42
43 @node Absolute octave entry
44 @unnumberedsubsubsec Absolute octave entry
45
46 @cindex pitch names
47 @cindex pitches
48 @cindex absolute
49 @cindex absolute octave specification
50
51 A pitch name is specified using lowercase letters@tie{}@code{a}
52 through@tie{}@code{g}.  The note names @code{c} to @code{b} are
53 engraved in the octave below middle C.
54
55 @c don't use c' here.
56 @lilypond[verbatim,quote,fragment]
57 \clef bass
58 c d e f
59 g a b c
60 d e f g
61 @end lilypond
62
63 @funindex '
64 @funindex ,
65
66 Other octaves may be specified with a single quote@tie{}(@code{'})
67 or comma@tie{}(@code{,}) character.  Each@tie{}@code{'} raises the
68 pitch by one octave; each@tie{}@code{,} lowers the pitch by an
69 octave.
70
71 @lilypond[verbatim,quote,fragment]
72 \clef treble
73 c' c'' e' g
74 d'' d' d c
75 \clef bass
76 c, c,, e, g
77 d,, d, d c
78 @end lilypond
79
80 @seealso
81
82 Music Glossary:
83 @rglos{Pitch names}.
84
85 Snippets:
86 @rlsr{Pitches}.
87
88
89 @node Relative octave entry
90 @unnumberedsubsubsec Relative octave entry
91
92 @cindex relative
93 @cindex relative octave specification
94 @funindex \relative
95
96 When octaves are specified in absolute mode it is easy to
97 accidentally put a pitch in the wrong octave.  Relative octave
98 mode reduces these errors since most of the time it is not
99 necessary to indicate any octaves at all.  Furthermore, in
100 absolute mode a single mistake may be difficult to spot, while in
101 relative mode a single error puts the rest of the piece off by one
102 octave.
103
104 @example
105 \relative @var{startpitch} @var{musicexpr}
106 @end example
107
108 In relative mode, each note is assumed to be as close to the
109 previous note as possible.  This means that the octave of each
110 pitch inside @var{musicexpr} is calculated as follows:
111
112 @itemize
113 @item
114 If no octave changing mark is used on a pitch, its octave is
115 calculated so that the interval with the previous note is less
116 than a fifth.  This interval is determined without considering
117 accidentals.
118
119 @item
120 An octave changing mark@tie{}@code{'} or@tie{}@code{,} can be
121 added to respectively raise or lower a pitch by an extra octave,
122 relative to the pitch calculated without an octave mark.
123
124 @item
125 Multiple octave changing marks can be used.  For example,
126 @code{''}@tie{}and@tie{}@code{,,} will alter the pitch by two
127 octaves.
128
129 @item
130 The pitch of the first note is relative to
131 @code{@var{startpitch}}.  @var{startpitch} is specified in
132 absolute octave mode, and it is recommended that it be a octave of
133 @code{c}.
134
135 @end itemize
136
137 Here is the relative mode shown in action:
138
139 @lilypond[verbatim,quote]
140 \relative c {
141   \clef bass
142   c d e f
143   g a b c
144   d e f g
145 }
146 @end lilypond
147
148 Octave changing marks are used for intervals greater than a
149 fourth:
150
151 @lilypond[verbatim,quote]
152 \relative c'' {
153   c g c f,
154   c' a, e'' c
155 }
156 @end lilypond
157
158 A note sequence without a single octave mark can nevertheless span
159 large intervals:
160
161 @lilypond[verbatim,quote]
162 \relative c {
163   c f b e
164   a d g c
165 }
166 @end lilypond
167
168 If the preceding item is a chord, the first note of the chord is
169 used as the reference point for the octave placement of a
170 following note or chord.  Inside chords, the next note is always
171 relative to the preceding one.  Examine the next example
172 carefully, paying attention to the @code{c} notes.
173
174 @lilypond[verbatim,quote]
175 \relative c' {
176   c
177   <c e g>
178   <c' e g'>
179   <c, e, g''>
180 }
181 @end lilypond
182
183 As explained above, the octave of pitches is calculated only with
184 the note names, regardless of any alterations.  Therefore, an
185 E-double-sharp following a B will be placed higher, while an
186 F-double-flat will be placed lower.  In other words, a
187 double-augmented fourth is considered a smaller interval than a
188 double-diminished fifth, regardless of the number of semitones
189 that each interval contains.
190
191 @lilypond[verbatim,quote]
192 \relative c'' {
193   c2 fis
194   c2 ges
195   b2 eisis
196   b2 feses
197 }
198 @end lilypond
199
200
201 @seealso
202
203 Music Glossary:
204 @rglos{fifth},
205 @rglos{interval},
206 @rglos{Pitch names}.
207
208 Notation Reference:
209 @ref{Octave checks}.
210
211 Snippets:
212 @rlsr{Pitches}.
213
214 Internals Reference:
215 @rinternals{RelativeOctaveMusic}.
216
217
218 @funindex \transpose
219 @funindex \chordmode
220 @funindex \relative
221
222 @knownissues
223
224 The relative conversion will not affect @code{\transpose},
225 @code{\chordmode} or @code{\relative} sections in its argument.
226 To use relative mode within transposed music, an additional
227 @code{\relative} must be placed inside @code{\transpose}.
228
229 @c DEPRECATED
230 If no @var{startpitch} is specified for @code{\relative},
231 then@tie{}@code{c'} is assumed.  However, this is a deprecated
232 option and may disappear in future versions, so its use is
233 discouraged.
234
235
236
237 @node Accidentals
238 @unnumberedsubsubsec Accidentals
239
240 @cindex accidental
241 @cindex key signature
242 @cindex clef
243
244 @c duplicated in Key signature and Accidentals
245 @warning{New users are sometimes confused about accidentals and
246 key signatures.  In LilyPond, note names are the raw input; key
247 signatures and clefs determine how this raw input is displayed.
248 An unaltered note like@tie{}@code{c} means @q{C natural},
249 regardless of the key signature or clef.  For more information,
250 see @rlearning{Accidentals and key signatures}.}
251
252 @cindex note names, Dutch
253 @cindex note names, default
254 @cindex sharp
255 @cindex flat
256 @cindex double sharp
257 @cindex sharp, double
258 @cindex double flat
259 @cindex flat, double
260 @cindex natural sign
261
262 A @notation{sharp} pitch is made by adding @code{is} to the note
263 name, and a @notation{flat} pitch by adding @code{es}.  As you
264 might expect, a @notation{double sharp} or @notation{double flat}
265 is made by adding @code{isis} or @code{eses}.  This syntax is
266 derived from Dutch note naming conventions.  To use other names
267 for accidentals, see @ref{Note names in other languages}.
268
269 @lilypond[verbatim,quote,relative=2]
270 ais1 aes aisis aeses
271 @end lilypond
272
273 A natural will cancel the effect of an accidental or key
274 signature.  However, naturals are not encoded into the note name
275 syntax with a suffix; a natural pitch is shown as a simple note
276 name:
277
278 @lilypond[verbatim,quote,relative=2]
279 a4 aes a2
280 @end lilypond
281
282 @cindex quarter tones
283 @cindex semi-flats, semi-sharps
284
285 Quarter tones may be added; the following is a series of Cs with
286 increasing pitches:
287
288 @lilypond[verbatim,quote,relative=2]
289 ceseh1 ces ceh c cih cis cisih
290 @end lilypond
291
292
293
294 @cindex accidental, reminder
295 @cindex accidental, cautionary
296 @cindex accidental, parenthesized
297 @cindex reminder accidental
298 @funindex ?
299 @cindex cautionary accidental
300 @cindex parenthesized accidental
301 @funindex !
302
303 Normally accidentals are printed automatically, but you may also
304 print them manually.  A reminder accidental can be forced by
305 adding an exclamation mark@tie{}@code{!} after the pitch.  A
306 cautionary accidental (i.e., an accidental within parentheses) can
307 be obtained by adding the question mark@tie{}@code{?} after the
308 pitch.  These extra accidentals can also be used to produce
309 natural signs.
310
311 @lilypond[verbatim,quote,relative=2]
312 cis cis cis! cis? c c c! c?
313 @end lilypond
314
315 Accidentals on tied notes are only printed at the beginning of a
316 new system:
317
318 @lilypond[verbatim,quote,relative=2]
319 cis1 ~ cis ~
320 \break
321 cis
322 @end lilypond
323
324
325 @snippets
326
327 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
328 {preventing-extra-naturals-from-being-automatically-added.ly}
329
330 @seealso
331
332 Music Glossary:
333 @rglos{sharp},
334 @rglos{flat},
335 @rglos{double sharp},
336 @rglos{double flat},
337 @rglos{Pitch names},
338 @rglos{quarter tone}.
339
340 Learning Manual:
341 @rlearning{Accidentals and key signatures}.
342
343 Notation Reference:
344 @ref{Automatic accidentals},
345 @ref{Annotational accidentals},
346 @ref{Note names in other languages}.
347
348 Snippets:
349 @rlsr{Pitches}.
350
351 Internals Reference:
352 @rinternals{Accidental_engraver}, 
353 @rinternals{Accidental},
354 @rinternals{AccidentalCautionary},
355 @rinternals{accidental-interface}.
356
357
358 @knownissues
359
360 There are no generally accepted standards for denoting
361 quarter-tone accidentals, so LilyPond's symbol does not conform to
362 any standard.
363
364
365
366 @node Note names in other languages
367 @unnumberedsubsubsec Note names in other languages
368
369 There are predefined sets of note names for various other
370 languages.  To use them, include the language-specific init file.
371 For example, to use English notes names, add
372 @w{@code{\include "english.ly"}} to the top of the input file.
373 The available language files and the note names they define are:
374
375 @cindex note names, other languages
376 @cindex pitch names, other languages
377
378 @smallexample
379 @multitable {nederlands.ly} {do re mi fa sol la sib si} {-iss/-is} {-ess/-es} {-ss/-x/-sharpsharp} {-essess/-eses}
380 @headitem Language
381   @tab Note names
382   @tab sharp @tab flat @tab double sharp @tab double flat
383 @item nederlands.ly
384   @tab c d e f g a bes b
385   @tab -is @tab -es @tab -isis @tab -eses
386 @item arabic.ly
387   @tab do re mi fa sol la sib si
388   @tab -d @tab -b @tab -dd @tab -bb
389 @item catalan.ly
390   @tab do re mi fa sol la sib si
391   @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
392 @item deutsch.ly
393   @tab c d e f g a b h
394   @tab -is @tab -es @tab -isis @tab -eses
395 @item english.ly
396   @tab c d e f g a bf b
397   @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
398     @tab -ff/-flatflat
399 @item espanol.ly
400   @tab do re mi fa sol la sib si
401   @tab -s @tab -b @tab -ss @tab -bb
402 @item italiano.ly
403   @tab do re mi fa sol la sib si
404   @tab -d @tab -b @tab -dd @tab -bb
405 @item norsk.ly
406   @tab c d e f g a b h
407   @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
408     @tab -essess/-eses
409 @item portugues.ly
410   @tab do re mi fa sol la sib si
411   @tab -s @tab -b @tab -ss @tab -bb
412 @item suomi.ly
413   @tab c d e f g a b h
414   @tab -is @tab -es @tab -isis @tab -eses
415 @item svenska.ly
416   @tab c d e f g a b h
417   @tab -iss @tab -ess @tab -ississ @tab -essess
418 @item vlaams.ly
419   @tab do re mi fa sol la sib si
420   @tab -k @tab -b @tab -kk @tab -bb
421 @end multitable
422 @end smallexample
423
424 In Dutch, @code{aes} is contracted to @code{as}, but both forms
425 are accepted in LilyPond.  Similarly, both @code{es} and
426 @code{ees} are accepted.  This also applies to
427 @code{aeses}@tie{}/@tie{}@code{ases} and
428 @code{eeses}@tie{}/@tie{}@code{eses}.  Sometimes only these
429 contracted names are defined in the corresponding language files.
430
431 @lilypond[verbatim,quote,relative=2]
432 a2 as e es a ases e eses
433 @end lilypond
434
435
436 Some music uses microtones whose alterations are fractions of a
437 @q{normal} sharp or flat.  The note names for quarter-tones
438 defined in the various language files are listed in the following
439 table.  Here the prefixes @notation{semi-} and @notation{sesqui-}
440 mean @q{half} and @q{one and a half}, respectively.  For the other
441 languages, no special names have been defined yet.
442
443 @smallexample
444 @multitable {nederlands.ly} {do re mi fa sol la sib si} {-iss/-is} {-ess/-es} {-ississ/-isis} {-ississ/-isis}
445 @headitem Language
446   @tab Note names
447   @tab semi-sharp @tab semi-flat @tab sesqui-sharp @tab sesqui-flat
448
449 @item nederlands.ly
450   @tab c d e f g a bes b
451   @tab -ih @tab -eh @tab -isih @tab -eseh
452 @item arabic.ly
453   @tab do re mi fa sol la sib si
454   @tab -sd @tab -sb @tab -dsd @tab -bsb
455 @item deutsch.ly
456   @tab c d e f g a b h
457   @tab -ih @tab -eh @tab -isih @tab -eseh
458 @item english.ly
459   @tab c d e f g a bf b
460   @tab -qs @tab -qf @tab -tqs @tab -tqf
461 @item italiano.ly
462   @tab do re mi fa sol la sib si
463   @tab -sd @tab -sb @tab -dsd @tab -bsb
464 @item portugues.ly
465   @tab do re mi fa sol la sib si
466   @tab -sqt @tab -bqt @tab -stqt @tab -btqt
467 @end multitable
468 @end smallexample
469
470
471 @seealso
472
473 Music Glossary:
474 @rglos{Pitch names}.
475
476 Snippets:
477 @rlsr{Pitches}.
478
479
480 @node Changing multiple pitches
481 @subsection Changing multiple pitches
482
483 This section discusses how to modify pitches.
484
485 @menu
486 * Octave checks::               
487 * Transpose::                   
488 @end menu
489
490 @node Octave checks
491 @unnumberedsubsubsec Octave checks
492
493 @cindex octave correction
494 @cindex octave check
495 @funindex =
496 @funindex \octaveCheck
497
498 In relative mode, it is easy to forget an octave changing mark.
499 Octave checks make such errors easier to find by displaying a
500 warning and correcting the octave if a note is found in an
501 unexpected octave.
502
503 To check the octave of a note, specify the absolute octave after
504 the @code{=}@tie{}symbol.  This example will generate a warning
505 (and change the pitch) because the second note is the absolute
506 octave @code{d''} instead of @code{d'} as indicated by the octave
507 correction.
508
509 @lilypond[verbatim,quote]
510 \relative c'' {
511   c2 d='4 d
512   e2 f
513 }
514 @end lilypond
515
516 The octave of notes may also be checked with the
517 @code{\octaveCheck}@tie{}@var{controlpitch} command.
518 @var{controlpitch} is specified in absolute mode.  This checks
519 that the interval between the previous note and the
520 @var{controlpitch} is within a fourth (i.e., the normal
521 calculation of relative mode).  If this check fails, a warning is
522 printed, but the previous note is not changed.  Future notes are
523 relative to the @var{controlpitch}.
524
525 @lilypond[verbatim,quote]
526 \relative c'' {
527   c2 d
528   \octaveCheck c'
529   e2 f
530 }
531 @end lilypond
532
533 Compare the two bars below.  The first and third @code{\octaveCheck}
534 checks fail, but the second one does not fail.
535
536 @lilypond[verbatim,quote]
537 \relative c'' {
538   c4 f g f
539
540   c4
541   \octaveCheck c'
542   f
543   \octaveCheck c'
544   g
545   \octaveCheck c'
546   f
547 }
548 @end lilypond
549
550
551 @seealso
552
553 Snippets:
554 @rlsr{Pitches}.
555
556 Internals Reference:
557 @rinternals{RelativeOctaveCheck}.
558
559
560 @node Transpose
561 @unnumberedsubsubsec Transpose
562
563 @cindex transpose
564 @cindex transposition
565 @cindex transposition of pitches
566 @funindex \transpose
567
568 A music expression can be transposed with @code{\transpose}.  The
569 syntax is
570
571 @example
572 \transpose @var{frompitch} @var{topitch} @var{musicexpr}
573 @end example
574
575 @noindent
576 This means that @var{musicexpr} is transposed by the interval
577 between the pitches @var{frompitch} and @var{topitch}: any note
578 with pitch @var{frompitch} is changed to @var{topitch} and any
579 other note is transposed by the same interval.  Both pitches are
580 entered in absolute mode.
581
582 Consider a piece written in the key of D-major.  It can be
583 transposed up to E-major; note that the key signature is
584 automatically transposed as well.
585
586 @lilypond[verbatim,quote]
587 \transpose d e {
588   \relative c' {
589     \key d \major
590     d4 fis a d
591   }
592 }
593 @end lilypond
594
595 If a part written in C (normal @notation{concert pitch}) is to be
596 played on the A clarinet (for which an A is notated as a C and
597 thus sounds a minor third lower than notated), the appropriate
598 part will be produced with:
599
600 @lilypond[verbatim,quote]
601 \transpose a c' {
602   \relative c' {
603     \key c \major
604     c4 d e g
605   }
606 }
607 @end lilypond
608
609 @noindent
610 Note that we specify @w{@code{\key c \major}} explicitly.  If we
611 do not specify a key signature, the notes will be transposed but
612 no key signature will be printed.
613
614 @code{\transpose} distinguishes between enharmonic pitches: both
615 @w{@code{\transpose c cis}} or @w{@code{\transpose c des}} will
616 transpose up a semitone.  The first version will print sharps and
617 the notes will remain on the same scale step, the second version
618 will print flats on the scale step above.
619
620 @lilypond[verbatim,quote]
621 music = \relative c' { c d e f }
622 \new Staff {
623   \transpose c cis { \music }
624   \transpose c des { \music }
625 }
626 @end lilypond
627
628 @cindex transposing instruments
629
630 @code{\transpose} may also be used in a different way, to input
631 written notes for a transposing instrument.  The previous examples
632 show how to enter pitches in C (or @notation{concert pitch}) and
633 typeset them for a transposing instrument, but the opposite is
634 also possible if you for example have a set of instrumental parts
635 and want to print a conductor's score.  For example, when entering
636 music for a B-flat trumpet that begins on a notated E (concert D),
637 one would write:
638
639 @example
640 musicInBflat = @{ e4 @dots{} @}
641 \transpose c bes, \musicInBflat
642 @end example
643
644 @noindent
645 To print this music in F (e.g., rearranging to a French horn) you
646 could wrap the existing music with another @code{\transpose}:
647
648 @example
649 musicInBflat = @{ e4 @dots{} @}
650 \transpose f c' @{ \transpose c bes, \musicInBflat @}
651 @end example
652
653 @noindent
654 For more information about transposing instruments,
655 see @ref{Instrument transpositions}.
656
657
658 @snippets
659
660 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
661 {transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
662
663
664 @seealso
665
666 Notation Reference:
667 @ref{Instrument transpositions}.
668
669 Snippets:
670 @rlsr{Pitches}.
671
672 Internals Reference:
673 @rinternals{TransposedMusic}.
674
675 @funindex \transpose
676 @funindex \chordmode
677 @funindex \relative
678
679 @knownissues
680
681 The relative conversion will not affect @code{\transpose},
682 @code{\chordmode} or @code{\relative} sections in its argument.
683 To use relative mode within transposed music, an additional
684 @code{\relative} must be placed inside @code{\transpose}.
685
686
687 @node Displaying pitches
688 @subsection Displaying pitches
689
690 This section discusses how to alter the output of pitches.
691
692 @menu
693 * Clef::                        
694 * Key signature::               
695 * Ottava brackets::             
696 * Instrument transpositions::   
697 * Automatic accidentals::       
698 * Ambitus::                     
699 @end menu
700
701
702 @node Clef
703 @unnumberedsubsubsec Clef
704
705 @funindex \clef
706 @cindex G clef
707 @cindex C clef
708 @cindex F clef
709 @cindex treble clef
710 @cindex violin clef
711 @cindex alto clef
712 @cindex tenor clef
713 @cindex bass clef
714 @cindex french clef
715 @cindex soprano clef
716 @cindex mezzosoprano clef
717 @cindex baritone clef
718 @cindex varbaritone clef
719 @cindex subbass clef
720 @cindex clef
721 @cindex ancient clef
722 @cindex clef, ancient
723 @cindex clef, G
724 @cindex clef, C
725 @cindex clef, F
726 @cindex clef, treble
727 @cindex clef, violin 
728 @cindex clef, alto 
729 @cindex clef, tenor
730 @cindex clef, bass 
731 @cindex clef, french 
732 @cindex clef, soprano 
733 @cindex clef, mezzosoprano 
734 @cindex clef, baritone 
735 @cindex clef, varbaritone 
736 @cindex subbass clef, subbass 
737
738 The clef may be altered.  Middle C is shown in every example.
739
740 @lilypond[verbatim,quote,relative=1]
741 \clef treble
742 c2 c
743 \clef alto
744 c2 c
745 \clef tenor
746 c2 c
747 \clef bass
748 c2 c
749 @end lilypond
750
751 Other clefs include:
752
753 @lilypond[verbatim,quote,relative=1]
754 \clef french
755 c2 c
756 \clef soprano
757 c2 c
758 \clef mezzosoprano
759 c2 c
760 \clef baritone
761 c2 c
762
763 \break
764
765 \clef varbaritone
766 c2 c
767 \clef subbass
768 c2 c
769 \clef percussion
770 c2 c
771 \clef tab
772 c2 c
773 @end lilypond
774
775 Further supported clefs are described under @ref{Ancient clefs}.
776
777 @cindex transposing clefs
778 @cindex clef, transposing
779 @cindex octave transposition
780 @cindex choral tenor clef
781
782 By adding@tie{}@code{_8} or@tie{}@code{^8} to the clef name, the
783 clef is transposed one octave down or up, respectively,
784 and@tie{}@code{_15} and@tie{}@code{^15} transpose by two octaves.
785 The clef name must be enclosed in quotes when it contains
786 underscores or digits.
787
788 @lilypond[verbatim,quote,relative=2]
789 \clef treble
790 c2 c
791 \clef "treble_8"
792 c2 c
793 \clef "bass^15"
794 c2 c
795 @end lilypond
796
797
798 @snippets
799
800 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
801 {tweaking-clef-properties.ly}
802
803
804 @seealso
805
806 Notation Reference:
807 @ref{Ancient clefs}.
808
809 Snippets:
810 @rlsr{Pitches}.
811
812 Internals Reference:
813 @rinternals{Clef_engraver},
814 @rinternals{Clef},
815 @rinternals{OctavateEight},
816 @rinternals{clef-interface}.
817
818
819 @node Key signature
820 @unnumberedsubsubsec Key signature
821
822 @cindex key signature
823 @funindex \key
824
825 @c duplicated in Key signature and Accidentals
826 @warning{New users are sometimes confused about accidentals and
827 key signatures.  In LilyPond, note names are the raw input; key
828 signatures and clefs determine how this raw input is displayed.
829 An unaltered note like@tie{}@code{c} means @q{C natural},
830 regardless of the key signature or clef.  For more information,
831 see @rlearning{Accidentals and key signatures}.}
832
833 The key signature indicates the tonality in which a piece is
834 played.  It is denoted by a set of alterations (flats or sharps)
835 at the start of the staff.  The key signature may be altered:
836
837 @example
838 \key @var{pitch} @var{mode}
839 @end example
840
841 @funindex \major
842 @funindex \minor
843 @funindex \ionian
844 @funindex \locrian
845 @funindex \aeolian
846 @funindex \mixolydian
847 @funindex \lydian
848 @funindex \phrygian
849 @funindex \dorian
850 @cindex church modes
851 @cindex modes
852
853 Here, @var{mode} should be @code{\major} or @code{\minor} to get a
854 key signature of @var{pitch}-major or @var{pitch}-minor,
855 respectively.  You may also use the standard mode names, also
856 called @notation{church modes}: @code{\ionian}, @code{\dorian},
857 @code{\phrygian}, @code{\lydian}, @code{\mixolydian},
858 @code{\aeolian}, and @code{\locrian}.
859
860 @lilypond[verbatim,quote,relative=2]
861 \key g \major
862 fis1
863 f
864 fis
865 @end lilypond
866
867
868 @snippets
869
870 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
871 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
872
873 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
874 {non-traditional-key-signatures.ly}
875
876
877 @seealso
878
879 Music Glossary:
880 @rglos{church mode},
881 @rglos{scordatura}.
882
883 Learning Manual:
884 @rlearning{Accidentals and key signatures}.
885
886 Snippets:
887 @rlsr{Pitches}.
888
889 Internals Reference:
890 @rinternals{KeyChangeEvent},
891 @rinternals{Key_engraver},
892 @rinternals{Key_performer},
893 @rinternals{KeyCancellation},
894 @rinternals{KeySignature},
895 @rinternals{key-cancellation-interface},
896 @rinternals{key-signature-interface}.
897
898
899 @node Ottava brackets
900 @unnumberedsubsubsec Ottava brackets
901
902 @cindex ottava
903 @cindex 15ma
904 @cindex 8va
905 @cindex 8ve
906 @cindex octavation
907
908 @notation{Ottava brackets} introduce an extra transposition of an
909 octave for the staff:
910
911 @lilypond[verbatim,quote,relative=2]
912 a'2 b
913 #(set-octavation 1)
914 a b
915 #(set-octavation 0)
916 a b
917 @end lilypond
918
919 The @code{set-octavation} function also takes -1 (for 8va bassa),
920 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
921
922
923 @snippets
924
925 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
926 {ottava-text.ly}
927
928
929 @seealso
930
931 Music Glossary:
932 @rglos{octavation}.
933
934 Snippets:
935 @rlsr{Pitches}.
936
937 Internals Reference:
938 @rinternals{Ottava_spanner_engraver},
939 @rinternals{OttavaBracket},
940 @rinternals{ottava-bracket-interface}.
941
942
943
944 @node Instrument transpositions
945 @unnumberedsubsubsec Instrument transpositions
946
947 @cindex transposition, MIDI
948 @cindex transposition, instrument
949 @cindex transposing instrument
950 @cindex MIDI
951 @funindex \transposition
952
953 When typesetting scores that involve transposing instruments, some
954 parts can be typeset in a different pitch than the
955 @notation{concert pitch}.  In these cases, the key of the
956 @notation{transposing instrument} should be specified; otherwise
957 the MIDI output and cues in other parts will produce incorrect
958 pitches.  For more information about quotations, see
959 @ref{Quoting other voices}.
960
961 @example
962 \transposition @var{pitch}
963 @end example
964
965 The pitch to use for @code{\transposition} should correspond to
966 the real sound heard when a@tie{}@code{c'} written on the staff is
967 played by the transposing instrument.  This pitch is entered in
968 absolute mode, so an instrument that produces a real sound which
969 is one tone higher than the printed music should use
970 @w{@code{\transposition d'}}.  @code{\transposition} should
971 @emph{only} be used if the pitches are @emph{not} being entered in
972 concert pitch.
973
974 Here are a few notes for violin and B-flat clarinet where the
975 parts have been entered using the notes and key as they appear in
976 each part of the conductor's score.  The two instruments are
977 playing in unison.
978
979 @lilypond[verbatim,quote]
980 \new GrandStaff <<
981   \new Staff = "violin" {
982     \relative c'' {
983       \set Staff.instrumentName = "Vln"
984       \set Staff.midiInstrument = "violin"
985       % not strictly necessary, but a good reminder
986       \transposition c'
987
988       \key c \major
989       g4( c8) r c r c4
990     }
991   }
992   \new Staff = "clarinet" {
993     \relative c'' {
994       \set Staff.instrumentName = \markup { Cl (B\flat) }
995       \set Staff.midiInstrument = "clarinet"
996       \transposition bes
997
998       \key d \major
999       a4( d8) r d r d4
1000     }
1001   }
1002 >>
1003 @end lilypond
1004
1005 The @code{\transposition} may be changed during a piece.  For
1006 example, a clarinetist may switch from an A clarinet to a B-flat
1007 clarinet.
1008
1009 @lilypond[verbatim,quote,relative=2]
1010 \set Staff.instrumentName = "Cl (A)"
1011 \key a \major
1012 \transposition a
1013 c d e f
1014 \textLengthOn
1015 s1*0^\markup { Switch to B\flat clarinet }
1016 R1
1017
1018 \key bes \major
1019 \transposition bes
1020 c2 g
1021 @end lilypond
1022
1023
1024 @seealso
1025
1026 Music Glossary:
1027 @rglos{concert pitch},
1028 @rglos{transposing instrument}.
1029
1030 Notation Reference:
1031 @ref{Quoting other voices}, @ref{Transpose}.
1032
1033 Snippets:
1034 @rlsr{Pitches}.
1035
1036
1037 @node Automatic accidentals
1038 @unnumberedsubsubsec Automatic accidentals
1039
1040 @cindex accidental style
1041 @cindex accidental style, default
1042 @cindex accidentals
1043 @cindex accidentals, automatic
1044 @cindex automatic accidentals
1045 @cindex default accidental style
1046 @funindex set-accidental-style
1047
1048 There are many different conventions on how to typeset
1049 accidentals.  LilyPond provides a function to specify which
1050 accidental style to use.  This function is called as follows:
1051
1052 @example
1053 \new Staff <<
1054   #(set-accidental-style 'voice)
1055   @{ @dots{} @}
1056 >>
1057 @end example
1058
1059 The accidental style applies to the current @code{Staff} by
1060 default (with the exception of the styles @code{piano} and
1061 @code{piano-cautionary}, which are explained below).  Optionally,
1062 the function can take a second argument that determines in which
1063 scope the style should be changed.  For example, to use the same
1064 style in all staves of the current @code{StaffGroup}, use:
1065
1066 @example
1067 #(set-accidental-style 'voice 'StaffGroup)
1068 @end example
1069
1070 The following accidental styles are supported.  To demonstrate
1071 each style, we use the following example:
1072
1073 @lilypond[verbatim,quote]
1074 musicA = {
1075   <<
1076     \relative c' {
1077       cis'8 fis, d'4 <a cis>8 f bis4 |
1078       cis2. <c, g'>4 |
1079     }
1080     \\
1081     \relative c' {
1082       ais'2 cis, |
1083       fis8 b a4 cis2 |
1084     }
1085   >>
1086 }
1087
1088 musicB = {
1089   \clef bass
1090   \new Voice {
1091     \voiceTwo \relative c' {
1092       <fis, a cis>4
1093       \change Staff = up
1094       cis'
1095       \change Staff = down
1096       <fis, a>
1097       \change Staff = up
1098       dis' |
1099       \change Staff = down
1100       <fis, a cis>4 gis <f a d>2 |
1101     }
1102   }
1103 }
1104
1105 \new PianoStaff {
1106   <<
1107     \context Staff = "up" {
1108       #(set-accidental-style 'default)
1109       \musicA
1110     }
1111     \context Staff = "down" {
1112       #(set-accidental-style 'default)
1113       \musicB
1114     }
1115   >>
1116 }
1117 @end lilypond
1118
1119 Note that the last lines of this example can be replaced by the
1120 following, as long as the same accidental style should be used in
1121 both staves.
1122
1123 @example
1124 \new PianoStaff @{
1125   <<
1126     \context Staff = "up" @{
1127       %%% change the next line as desired:
1128       #(set-accidental-style 'default 'Score)
1129       \musicA
1130     @}
1131     \context Staff = "down" @{
1132       \musicB
1133     @}
1134   >>
1135 @}
1136 @end example
1137
1138
1139 @c don't use verbatim in this table.
1140 @table @code
1141 @item default
1142 This is the default typesetting behavior.  It corresponds to
1143 eighteenth-century common practice: accidentals are remembered to
1144 the end of the measure in which they occur and only in their own
1145 octave.  Thus, in the example below, no natural signs are printed
1146 before the@tie{}@code{b} in the second measure or the
1147 last@tie{}@code{c}:
1148
1149 @lilypond[quote]
1150 musicA = {
1151   <<
1152     \relative c' {
1153       cis'8 fis, d'4 <a cis>8 f bis4 |
1154       cis2. <c, g'>4 |
1155     }
1156     \\
1157     \relative c' {
1158       ais'2 cis, |
1159       fis8 b a4 cis2 |
1160     }
1161   >>
1162 }
1163
1164 musicB = {
1165   \clef bass
1166   \new Voice {
1167     \voiceTwo \relative c' {
1168       <fis, a cis>4
1169       \change Staff = up
1170       cis'
1171       \change Staff = down
1172       <fis, a>
1173       \change Staff = up
1174       dis' |
1175       \change Staff = down
1176       <fis, a cis>4 gis <f a d>2 |
1177     }
1178   }
1179 }
1180
1181 \new PianoStaff {
1182   <<
1183     \context Staff = "up" {
1184       #(set-accidental-style 'default)
1185       \musicA
1186     }
1187     \context Staff = "down" {
1188       #(set-accidental-style 'default)
1189       \musicB
1190     }
1191   >>
1192 }
1193 @end lilypond
1194
1195 @item voice
1196 The normal behavior is to remember the accidentals at
1197 @code{Staff}-level.  In this style, however, accidentals are
1198 typeset individually for each voice.  Apart from that, the rule is
1199 similar to @code{default}.
1200
1201 As a result, accidentals from one voice do not get canceled in
1202 other voices, which is often an unwanted result: in the following
1203 example, it is hard to determine whether the second@tie{}@code{a}
1204 should be played natural or sharp.  The @code{voice} option should
1205 therefore be used only if the voices are to be read solely by
1206 individual musicians.  If the staff is to be used by one musician
1207 (e.g., a conductor or in a piano score) then @code{modern} or
1208 @code{modern-cautionary} should be used instead.
1209
1210
1211 @lilypond[quote]
1212 musicA = {
1213   <<
1214     \relative c' {
1215       cis'8 fis, d'4 <a cis>8 f bis4 |
1216       cis2. <c, g'>4 |
1217     }
1218     \\
1219     \relative c' {
1220       ais'2 cis, |
1221       fis8 b a4 cis2 |
1222     }
1223   >>
1224 }
1225
1226 musicB = {
1227   \clef bass
1228   \new Voice {
1229     \voiceTwo \relative c' {
1230       <fis, a cis>4
1231       \change Staff = up
1232       cis'
1233       \change Staff = down
1234       <fis, a>
1235       \change Staff = up
1236       dis' |
1237       \change Staff = down
1238       <fis, a cis>4 gis <f a d>2 |
1239     }
1240   }
1241 }
1242
1243 \new PianoStaff {
1244   <<
1245     \context Staff = "up" {
1246       #(set-accidental-style 'voice)
1247       \musicA
1248     }
1249     \context Staff = "down" {
1250       #(set-accidental-style 'voice)
1251       \musicB
1252     }
1253   >>
1254 }
1255 @end lilypond
1256
1257 @item modern
1258 @cindex accidentals, modern style
1259 @cindex modern style accidentals
1260 @funindex modern style accidentals
1261
1262 This rule corresponds to the common practice in the twentieth
1263 century.  It prints the same accidentals as @code{default}, with
1264 two exceptions that serve to avoid ambiguity: after temporary
1265 accidentals, cancellation marks are printed also in the following
1266 measure (for notes in the same octave) and, in the same measure,
1267 for notes in other octaves.  Hence the naturals before
1268 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1269 the upper staff:
1270
1271 @lilypond[quote]
1272 musicA = {
1273   <<
1274     \relative c' {
1275       cis'8 fis, d'4 <a cis>8 f bis4 |
1276       cis2. <c, g'>4 |
1277     }
1278     \\
1279     \relative c' {
1280       ais'2 cis, |
1281       fis8 b a4 cis2 |
1282     }
1283   >>
1284 }
1285
1286 musicB = {
1287   \clef bass
1288   \new Voice {
1289     \voiceTwo \relative c' {
1290       <fis, a cis>4
1291       \change Staff = up
1292       cis'
1293       \change Staff = down
1294       <fis, a>
1295       \change Staff = up
1296       dis' |
1297       \change Staff = down
1298       <fis, a cis>4 gis <f a d>2 |
1299     }
1300   }
1301 }
1302
1303 \new PianoStaff {
1304   <<
1305     \context Staff = "up" {
1306       #(set-accidental-style 'modern)
1307       \musicA
1308     }
1309     \context Staff = "down" {
1310       #(set-accidental-style 'modern)
1311       \musicB
1312     }
1313   >>
1314 }
1315 @end lilypond
1316
1317 @item modern-cautionary
1318 @cindex accidentals, modern cautionary style
1319 @cindex modern accidental style
1320 @cindex modern cautionary accidental style
1321 @cindex modern style accidentals
1322 @cindex modern style cautionary accidentals
1323 @funindex modern-cautionary
1324
1325 This rule is similar to @code{modern}, but the @q{extra}
1326 accidentals (the ones not typeset by @code{default}) are typeset
1327 as cautionary accidentals.  They are by default printed with
1328 parentheses, but they can also be printed in reduced size by
1329 defining the @code{cautionary-style} property of
1330 @code{AccidentalSuggestion}.
1331
1332 @lilypond[quote]
1333 musicA = {
1334   <<
1335     \relative c' {
1336       cis'8 fis, d'4 <a cis>8 f bis4 |
1337       cis2. <c, g'>4 |
1338     }
1339     \\
1340     \relative c' {
1341       ais'2 cis, |
1342       fis8 b a4 cis2 |
1343     }
1344   >>
1345 }
1346
1347 musicB = {
1348   \clef bass
1349   \new Voice {
1350     \voiceTwo \relative c' {
1351       <fis, a cis>4
1352       \change Staff = up
1353       cis'
1354       \change Staff = down
1355       <fis, a>
1356       \change Staff = up
1357       dis' |
1358       \change Staff = down
1359       <fis, a cis>4 gis <f a d>2 |
1360     }
1361   }
1362 }
1363
1364 \new PianoStaff {
1365   <<
1366     \context Staff = "up" {
1367       #(set-accidental-style 'modern-cautionary)
1368       \musicA
1369     }
1370     \context Staff = "down" {
1371       #(set-accidental-style 'modern-cautionary)
1372       \musicB
1373     }
1374   >>
1375 }
1376 @end lilypond
1377
1378 @item modern-voice
1379 @cindex accidental style, modern
1380 @cindex accidentals, modern
1381 @cindex accidentals, multivoice
1382 @cindex modern accidental style
1383 @cindex modern accidentals
1384 @cindex multivoice accidentals
1385 @funindex modern-voice
1386
1387 This rule is used for multivoice accidentals to be read both by
1388 musicians playing one voice and musicians playing all voices.
1389 Accidentals are typeset for each voice, but they @emph{are}
1390 canceled across voices in the same @code{Staff}.  Hence,
1391 the@tie{}@code{a} in the last measure is canceled because the
1392 previous cancellation was in a different voice, and
1393 the@tie{}@code{d} in the lower staff is canceled because of the
1394 accidental in a different voice in the previous measure:
1395
1396 @lilypond[quote]
1397 musicA = {
1398   <<
1399     \relative c' {
1400       cis'8 fis, d'4 <a cis>8 f bis4 |
1401       cis2. <c, g'>4 |
1402     }
1403     \\
1404     \relative c' {
1405       ais'2 cis, |
1406       fis8 b a4 cis2 |
1407     }
1408   >>
1409 }
1410
1411 musicB = {
1412   \clef bass
1413   \new Voice {
1414     \voiceTwo \relative c' {
1415       <fis, a cis>4
1416       \change Staff = up
1417       cis'
1418       \change Staff = down
1419       <fis, a>
1420       \change Staff = up
1421       dis' |
1422       \change Staff = down
1423       <fis, a cis>4 gis <f a d>2 |
1424     }
1425   }
1426 }
1427
1428 \new PianoStaff {
1429   <<
1430     \context Staff = "up" {
1431       #(set-accidental-style 'modern-voice)
1432       \musicA
1433     }
1434     \context Staff = "down" {
1435       #(set-accidental-style 'modern-voice)
1436       \musicB
1437     }
1438   >>
1439 }
1440 @end lilypond
1441
1442 @cindex accidental style, cautionary, modern voice
1443 @cindex accidental style, modern voice cautionary
1444 @cindex accidental style, voice, modern cautionary
1445 @funindex modern-voice-cautionary
1446 @item modern-voice-cautionary
1447
1448 This rule is the same as @code{modern-voice}, but with the extra
1449 accidentals (the ones not typeset by @code{voice}) typeset as
1450 cautionaries.  Even though all accidentals typeset by
1451 @code{default} @emph{are} typeset with this rule, some of them are
1452 typeset as cautionaries.
1453
1454 @lilypond[quote]
1455 musicA = {
1456   <<
1457     \relative c' {
1458       cis'8 fis, d'4 <a cis>8 f bis4 |
1459       cis2. <c, g'>4 |
1460     }
1461     \\
1462     \relative c' {
1463       ais'2 cis, |
1464       fis8 b a4 cis2 |
1465     }
1466   >>
1467 }
1468
1469 musicB = {
1470   \clef bass
1471   \new Voice {
1472     \voiceTwo \relative c' {
1473       <fis, a cis>4
1474       \change Staff = up
1475       cis'
1476       \change Staff = down
1477       <fis, a>
1478       \change Staff = up
1479       dis' |
1480       \change Staff = down
1481       <fis, a cis>4 gis <f a d>2 |
1482     }
1483   }
1484 }
1485
1486 \new PianoStaff {
1487   <<
1488     \context Staff = "up" {
1489       #(set-accidental-style 'modern-voice-cautionary)
1490       \musicA
1491     }
1492     \context Staff = "down" {
1493       #(set-accidental-style 'modern-voice-cautionary)
1494       \musicB
1495     }
1496   >>
1497 }
1498 @end lilypond
1499
1500 @item piano
1501 @cindex accidental style, piano
1502 @cindex accidentals, piano
1503 @cindex piano accidental style
1504 @cindex piano accidentals
1505
1506 This rule reflects twentieth-century practice for piano notation.
1507 Its behavior is very similar to @code{modern} style, but here
1508 accidentals also get canceled across the staves in the same
1509 @code{GrandStaff} or @code{PianoStaff}, hence all the
1510 cancellations of the final notes.
1511
1512 This accidental style applies to the current @code{GrandStaff} or
1513 @code{PianoStaff} by default.
1514
1515 @lilypond[quote]
1516 musicA = {
1517   <<
1518     \relative c' {
1519       cis'8 fis, d'4 <a cis>8 f bis4 |
1520       cis2. <c, g'>4 |
1521     }
1522     \\
1523     \relative c' {
1524       ais'2 cis, |
1525       fis8 b a4 cis2 |
1526     }
1527   >>
1528 }
1529
1530 musicB = {
1531   \clef bass
1532   \new Voice {
1533     \voiceTwo \relative c' {
1534       <fis, a cis>4
1535       \change Staff = up
1536       cis'
1537       \change Staff = down
1538       <fis, a>
1539       \change Staff = up
1540       dis' |
1541       \change Staff = down
1542       <fis, a cis>4 gis <f a d>2 |
1543     }
1544   }
1545 }
1546
1547 \new PianoStaff {
1548   <<
1549     \context Staff = "up" {
1550       #(set-accidental-style 'piano)
1551       \musicA
1552     }
1553     \context Staff = "down" {
1554       \musicB
1555     }
1556   >>
1557 }
1558 @end lilypond
1559
1560 @item piano-cautionary
1561 @funindex #(set-accidental-style 'piano-cautionary)
1562 @cindex accidentals, piano cautionary
1563 @cindex cautionary accidentals, piano
1564 @cindex piano cautionary accidentals
1565 @cindex accidental style, piano cautionary
1566 @cindex cautionary accidental style, piano
1567 @cindex piano cautionary accidental style
1568
1569 This is the same as @code{piano} but with the extra accidentals
1570 typeset as cautionaries.
1571
1572 @lilypond[quote]
1573 musicA = {
1574   <<
1575     \relative c' {
1576       cis'8 fis, d'4 <a cis>8 f bis4 |
1577       cis2. <c, g'>4 |
1578     }
1579     \\
1580     \relative c' {
1581       ais'2 cis, |
1582       fis8 b a4 cis2 |
1583     }
1584   >>
1585 }
1586
1587 musicB = {
1588   \clef bass
1589   \new Voice {
1590     \voiceTwo \relative c' {
1591       <fis, a cis>4
1592       \change Staff = up
1593       cis'
1594       \change Staff = down
1595       <fis, a>
1596       \change Staff = up
1597       dis' |
1598       \change Staff = down
1599       <fis, a cis>4 gis <f a d>2 |
1600     }
1601   }
1602 }
1603
1604 \new PianoStaff {
1605   <<
1606     \context Staff = "up" {
1607       #(set-accidental-style 'piano-cautionary)
1608       \musicA
1609     }
1610     \context Staff = "down" {
1611       \musicB
1612     }
1613   >>
1614 }
1615 @end lilypond
1616
1617 @item no-reset
1618 @funindex no-reset accidental style
1619 @cindex accidental style, no reset
1620 @cindex no reset accidental style
1621
1622 This is the same as @code{default} but with accidentals lasting
1623 @q{forever} and not only within the same measure:
1624
1625 @lilypond[quote]
1626 musicA = {
1627   <<
1628     \relative c' {
1629       cis'8 fis, d'4 <a cis>8 f bis4 |
1630       cis2. <c, g'>4 |
1631     }
1632     \\
1633     \relative c' {
1634       ais'2 cis, |
1635       fis8 b a4 cis2 |
1636     }
1637   >>
1638 }
1639
1640 musicB = {
1641   \clef bass
1642   \new Voice {
1643     \voiceTwo \relative c' {
1644       <fis, a cis>4
1645       \change Staff = up
1646       cis'
1647       \change Staff = down
1648       <fis, a>
1649       \change Staff = up
1650       dis' |
1651       \change Staff = down
1652       <fis, a cis>4 gis <f a d>2 |
1653     }
1654   }
1655 }
1656
1657 \new PianoStaff {
1658   <<
1659     \context Staff = "up" {
1660       #(set-accidental-style 'no-reset)
1661       \musicA
1662     }
1663     \context Staff = "down" {
1664       #(set-accidental-style 'no-reset)
1665       \musicB
1666     }
1667   >>
1668 }
1669 @end lilypond
1670
1671 @item forget
1672 @funindex forget accidental style
1673 @cindex forget accidental style
1674 @cindex accidental style, forget
1675
1676 This is the opposite of @code{no-reset}: Accidentals are not
1677 remembered at all -- and hence all accidentals are typeset
1678 relative to the key signature, regardless of what came before in
1679 the music:
1680
1681 @lilypond[quote]
1682 musicA = {
1683   <<
1684     \relative c' {
1685       cis'8 fis, d'4 <a cis>8 f bis4 |
1686       cis2. <c, g'>4 |
1687     }
1688     \\
1689     \relative c' {
1690       ais'2 cis, |
1691       fis8 b a4 cis2 |
1692     }
1693   >>
1694 }
1695
1696 musicB = {
1697   \clef bass
1698   \new Voice {
1699     \voiceTwo \relative c' {
1700       <fis, a cis>4
1701       \change Staff = up
1702       cis'
1703       \change Staff = down
1704       <fis, a>
1705       \change Staff = up
1706       dis' |
1707       \change Staff = down
1708       <fis, a cis>4 gis <f a d>2 |
1709     }
1710   }
1711 }
1712
1713 \new PianoStaff {
1714   <<
1715     \context Staff = "up" {
1716       #(set-accidental-style 'forget)
1717       \musicA
1718     }
1719     \context Staff = "down" {
1720       #(set-accidental-style 'forget)
1721       \musicB
1722     }
1723   >>
1724 }
1725 @end lilypond
1726 @end table
1727
1728 @snippets
1729
1730 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1731 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
1732
1733
1734 @seealso
1735
1736 Snippets:
1737 @rlsr{Pitches}.
1738
1739 Internals Reference:
1740 @rinternals{Accidental},
1741 @rinternals{Accidental_engraver},
1742 @rinternals{GrandStaff} and
1743 @rinternals{PianoStaff},
1744 @rinternals{Staff},
1745 @rinternals{AccidentalSuggestion},
1746 @rinternals{AccidentalPlacement},
1747 @rinternals{accidental-suggestion-interface}.
1748
1749
1750 @cindex accidentals and simultaneous notes
1751 @cindex simultaneous notes and accidentals
1752 @cindex accidentals in chords
1753 @cindex chords, accidentals in
1754
1755 @knownissues
1756
1757 Simultaneous notes are considered to be entered in sequential
1758 mode.  This means that in a chord the accidentals are typeset as
1759 if the notes in the chord happen one at a time, in the order in
1760 which they appear in the input file.  This is a problem when
1761 accidentals in a chord depend on each other, which does not happen
1762 for the default accidental style.  The problem can be solved by
1763 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
1764 problematic notes.
1765
1766
1767 @node Ambitus
1768 @unnumberedsubsubsec Ambitus
1769
1770 @cindex ambitus
1771 @cindex range of pitches
1772 @cindex pitch range
1773
1774 The term @notation{ambitus} (pl. ambitus) denotes a range of
1775 pitches for a given voice in a part of music.  It may also denote
1776 the pitch range that a musical instrument is capable of playing.
1777 Ambitus are printed on vocal parts so that performers can easily
1778 determine if it matches their capabilities.
1779
1780 Ambitus are denoted at the beginning of a piece near the initial
1781 clef.  The range is graphically specified by two note heads that
1782 represent the lowest and highest pitches.  Accidentals are only
1783 printed if they are not part of the key signature.
1784
1785 @lilypond[verbatim,quote]
1786 \layout {
1787   \context {
1788     \Voice
1789     \consists "Ambitus_engraver"
1790   }
1791 }
1792
1793 \relative c'' {
1794   aes c e2
1795   cis,1
1796 }
1797 @end lilypond
1798
1799
1800 @snippets
1801
1802 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1803 {adding-ambitus-per-voice.ly}
1804
1805 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1806 {ambitus-with-multiple-voices.ly}
1807
1808
1809 @seealso
1810
1811 Music Glossary:
1812 @rglos{ambitus}.
1813
1814 Snippets:
1815 @rlsr{Pitches}.
1816
1817 Internals Reference:
1818 @rinternals{Ambitus_engraver},
1819 @rinternals{Voice},
1820 @rinternals{Staff},
1821 @rinternals{Ambitus},
1822 @rinternals{AmbitusAccidental},
1823 @rinternals{AmbitusLine},
1824 @rinternals{AmbitusNoteHead},
1825 @rinternals{ambitus-interface}.
1826
1827
1828 @knownissues
1829
1830 There is no collision handling in the case of multiple per-voice
1831 ambitus.
1832
1833
1834 @node Note heads
1835 @subsection Note heads
1836
1837 This section suggests ways of altering note heads.
1838
1839 @menu
1840 * Special note heads::          
1841 * Easy notation note heads::    
1842 * Shape note heads::            
1843 * Improvisation::               
1844 @end menu
1845
1846 @node Special note heads
1847 @unnumberedsubsubsec Special note heads
1848
1849 @cindex note heads, special
1850 @cindex note heads, cross
1851 @cindex note heads, diamond
1852 @cindex note heads, parlato
1853 @cindex note heads, harmonic
1854 @cindex note heads, guitar
1855 @cindex special note heads
1856 @cindex cross note heads
1857 @cindex diamond note heads
1858 @cindex parlato note heads
1859 @cindex harmonic note heads
1860 @cindex guitar note heads
1861
1862 Note heads may be altered:
1863
1864 @lilypond[verbatim,quote,relative=2]
1865 c4 b a b
1866 \override NoteHead #'style = #'cross
1867 c4 b a b
1868 \revert NoteHead #'style
1869 c4 d e f
1870 @end lilypond
1871
1872 There is a shorthand for diamond shapes which can only be used
1873 inside chords:
1874
1875 @lilypond[verbatim,quote,relative=2]
1876 <c f\harmonic>2 <d a'\harmonic>4 <c g'\harmonic>
1877 @end lilypond
1878
1879 @noindent
1880 To see all note head styles, see @ref{Note head styles}.
1881
1882 @seealso
1883
1884 Snippets:
1885 @rlsr{Pitches}.
1886
1887 Notation Reference:
1888 @ref{Note head styles},
1889 @ref{Chorded notes}.
1890
1891 Internals Reference:
1892 @rinternals{note-event},
1893 @rinternals{Note_heads_engraver},
1894 @rinternals{Ledger_line_engraver},
1895 @rinternals{NoteHead},
1896 @rinternals{LedgerLineSpanner},
1897 @rinternals{note-head-interface},
1898 @rinternals{ledger-line-spanner-interface}.
1899
1900
1901 @node Easy notation note heads
1902 @unnumberedsubsubsec Easy notation note heads
1903
1904 @cindex note heads, practice
1905 @cindex note heads, easy notation
1906 @cindex easy notation
1907 @cindex Hal Leonard
1908 @cindex beginners' music
1909 @cindex music, beginners'
1910 @cindex easy play note heads
1911 @cindex note heads, easy play
1912
1913 The @q{easy play} note head includes a note name inside the head.
1914 It is used in music for beginners.  To make the letters readable,
1915 it should be printed in a large font size.  To print with a larger
1916 font, see @ref{Setting the staff size}.
1917
1918 @lilypond[verbatim,quote]
1919 #(set-global-staff-size 26)
1920 \relative c' {
1921   \easyHeadsOn
1922   c2 e4 f
1923   g1
1924   \easyHeadsOff
1925   c,1
1926 }
1927 @end lilypond
1928
1929 @predefined
1930
1931 @funindex \easyHeadsOn
1932 @funindex \easyHeadsOff
1933 @code{\easyHeadsOn}, @code{\easyHeadsOff}
1934
1935 @seealso
1936
1937 Notation Reference:
1938 @ref{Setting the staff size}.
1939
1940 Snippets:
1941 @rlsr{Pitches}.
1942
1943 Internals Reference:
1944 @rinternals{note-event},
1945 @rinternals{Note_heads_engraver},
1946 @rinternals{NoteHead},
1947 @rinternals{note-head-interface}.
1948
1949
1950 @node Shape note heads
1951 @unnumberedsubsubsec Shape note heads
1952
1953 @cindex note heads, shape
1954 @cindex note heads, Aiken
1955 @cindex note heads, sacred harp
1956 @cindex shape notes
1957 @cindex Aiken shape note heads
1958 @cindex sacred harp note heads
1959 @funindex \key
1960 @funindex shapeNoteStyles
1961 @funindex \aikenHeads
1962 @funindex \sacredHarpHeads
1963
1964 In shape note head notation, the shape of the note head
1965 corresponds to the harmonic function of a note in the scale.  This
1966 notation was popular in nineteenth-century American song books.
1967 Shape note heads can be produced:
1968
1969 @lilypond[verbatim,quote,relative=2]
1970 \aikenHeads
1971 c, d e f g a b c
1972 \sacredHarpHeads
1973 c, d e f g a b c
1974 @end lilypond
1975
1976 Shapes are typeset according to the step in the scale, where the
1977 base of the scale is determined by the @code{\key} command.
1978
1979 @predefined
1980
1981 @funindex \aikenHeads
1982 @funindex \sacredHarpHeads
1983 @code{\aikenHeads}, @code{\sacredHarpHeads}
1984
1985 @snippets
1986
1987 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1988 {applying-note-head-styles-depending-on-the-step-of-the-scale.ly}
1989
1990 @noindent
1991 To see all note head styles, see @ref{Note head styles}.
1992
1993 @seealso
1994
1995 Snippets:
1996 @rlsr{Pitches}.
1997
1998 Notation Reference:
1999 @ref{Note head styles}.
2000
2001 Internals Reference:
2002 @rinternals{note-event},
2003 @rinternals{Note_heads_engraver},
2004 @rinternals{NoteHead},
2005 @rinternals{note-head-interface}.
2006
2007
2008 @node Improvisation
2009 @unnumberedsubsubsec Improvisation
2010
2011 @cindex improvisation
2012 @cindex slashed note heads
2013 @cindex note heads, improvisation
2014 @cindex note heads, slashed
2015
2016 Improvisation is sometimes denoted with slashed note heads, where
2017 the performer may choose any pitch but should play the specified
2018 rhythm.  Such note heads can be created:
2019
2020 @lilypond[verbatim,quote,relative=2]
2021 \new Voice \with {
2022   \consists "Pitch_squash_engraver"
2023 } {
2024   e8 e g a a16( bes) a8 g
2025   \improvisationOn
2026   e8 ~
2027   e2 ~ e8 f4 f8 ~
2028   f2
2029   \improvisationOff
2030   a16( bes) a8 g e
2031 }
2032 @end lilypond
2033
2034
2035 @predefined
2036
2037 @funindex \improvisationOn
2038 @funindex \improvisationOff
2039
2040 @code{\improvisationOn}, @code{\improvisationOff}
2041
2042 @seealso
2043
2044 Snippets:
2045 @rlsr{Pitches}.
2046
2047 Internals Reference:
2048 @rinternals{Pitch_squash_engraver},
2049 @rinternals{Voice},
2050 @rinternals{RhythmicStaff}.
2051
2052