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