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