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