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