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