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