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