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