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