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