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