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