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