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