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