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