]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/pitches.itely
Merge branch 'master' of /home/lilycvs/git/lily/
[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 Micro tones are also exported to the MIDI file.
310
311
312 @commonprop
313
314 @lilypondfile[lilyquote,ragged-right,texidoc]
315 {preventing-extra-naturals-from-being-automatically-added.ly}
316
317 @lilypondfile[lilyquote,ragged-right,texidoc]
318 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
319
320 @lilypondfile[lilyquote,ragged-right,texidoc]{makam.ly}
321
322 @seealso
323
324 Music Glossary: @rglos{sharp}, @rglos{flat}, @rglos{double sharp},
325 @rglos{double flat}.
326
327 Learning Manual: @rlearning{Accidentals and key signatures}.
328
329 Notation Reference: @ref{Automatic accidentals},
330 @ref{Musica ficta accidentals},
331 @ref{Note names in other languages}.
332
333 Snippets: @lsrdir{pitches}.
334
335
336 @refbugs
337
338 There are no generally accepted standards for denoting
339 three-quarter flats, so LilyPond's symbol does not conform to any
340 standard.
341
342
343
344 @node Note names in other languages
345 @unnumberedsubsubsec Note names in other languages
346
347 There are predefined sets of note names for various other
348 languages.  To use them, include the language specific init file.
349 For example, add @code{\include "english.ly"} to the top of the
350 input file.  The available language files and the note names they
351 define are:
352
353 @cindex note names, other languages
354
355 @example
356 @multitable @columnfractions .2 .6 .05 .05 .05 .05
357 @headitem Language
358   @tab Note names
359   @tab sharp @tab flat @tab double sharp @tab double flat
360 @item nederlands.ly
361   @tab c d e f g a bes b
362   @tab -is @tab -es @tab -isis @tab -eses
363 @item english.ly
364   @tab c d e f g a bf b
365   @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
366     @tab -ff/-flatflat
367 @item deutsch.ly
368   @tab c d e f g a b h
369   @tab -is @tab -es @tab -isis @tab -eses
370 @item norsk.ly
371   @tab c d e f g a b h
372   @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
373     @tab -essess/-eses
374 @item svenska.ly
375   @tab c d e f g a b h
376   @tab -iss @tab -ess @tab -ississ @tab -essess
377 @item suomi.ly
378   @tab c d e f g a b h
379   @tab -is @tab -es @tab -isis @tab -eses
380 @item italiano.ly
381   @tab do re mi fa sol la sib si
382   @tab -d @tab -b @tab -dd @tab -bb
383 @item catalan.ly
384   @tab do re mi fa sol la sib si
385   @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
386 @item espanol.ly
387   @tab do re mi fa sol la sib si
388   @tab -s @tab -b @tab -ss @tab -bb
389 @item portugues.ly
390   @tab do re mi fa sol la sib si
391   @tab -s @tab -b @tab -ss @tab -bb
392 @item vlaams.ly
393   @tab do re mi fa sol la sib si
394   @tab -k @tab -b @tab -kk @tab -bb
395 @end multitable
396 @end example
397
398 @noindent
399 Note that in Dutch, German, Norwegian, and Swedish, the flat
400 alterations of@tie{}@code{a} like for example @code{aes} and
401 @code{aeses} are usually contracted to @code{as} and @code{ases}
402 (or more commonly @code{asas}).  Sometimes only these contracted
403 names are defined in the corresponding language files (this also
404 applies to the suffixes for quartertones below).
405
406 @noindent
407 Some music uses microtones whose alterations are fractions of a
408 @q{normal} sharp or flat.  The note names for quartertones defined
409 in the various language files are listed in the following table.
410 Here the prefixes @q{semi-} and @q{sesqui-} mean @q{half} and
411 @q{one and a half}, respectively.  For the other languages no
412 special names have been defined yet.
413
414
415 @example
416 @multitable @columnfractions .2 .6 .05 .05 .05 .05
417 @headitem Language
418   @tab Note names
419   @tab semi- @tab semi- @tab sesqui- @tab sesqui-
420
421 @item nederlands.ly
422   @tab c d e f g a bes b
423   @tab -ih @tab -eh @tab -isih @tab -eseh
424 @item english.ly
425   @tab c d e f g a bf b
426   @tab -qs @tab -qf @tab -tqs @tab -tqf
427 @item deutsch.ly
428   @tab c d e f g a b h
429   @tab -ih @tab -eh @tab -isih @tab -eseh
430 @c @item norsk.ly
431 @c   @tab c d e f g a b h
432 @c @item svenska.ly
433 @c   @tab c d e f g a b h
434 @item italiano.ly
435   @tab do re mi fa sol la sib si
436   @tab -sd @tab -sb @tab -dsd @tab -bsb
437 @c @item catalan.ly
438 @c   @tab do re mi fa sol la sib si
439 @c @item  espanol.ly
440 @c   @tab do re mi fa sol la sib si
441 @item portugues.ly
442   @tab do re mi fa sol la sib si
443   @tab -sqt @tab -bqt @tab -stqt @tab -btqt
444 @end multitable
445 @end example
446
447 @seealso
448
449 Snippets: @lsrdir{pitches}.
450
451
452 @node Changing multiple pitches
453 @subsection Changing multiple pitches
454
455 This section discusses how to modify pitches.
456
457 @menu
458 * Octave check::
459 * Transpose::
460 @end menu
461
462 @node Octave check
463 @unnumberedsubsubsec Octave check
464
465 @cindex octave check
466
467 In relative mode, it is easy to forget an octave changing mark.
468 Octave checks make such errors easier to correct.  A note may be
469 followed by @code{=}@var{quotes} to indicate what its absolute
470 octave should be.  In the following example,
471
472 @example
473 \relative c'' @{ c g d='' @}
474 @end example
475
476 @noindent
477 the@tie{}@code{d} will generate a warning, because
478 a@tie{}@code{d''} is expected, as indicated by the octave check
479 @code{=''}, but a@tie{}@code{d'} is found, since both
480 @code{c}-@code{g} and @code{g}-@code{d} without octavation marks
481 are descending fourths.  In the output, the octave is corrected to
482 be a@tie{}@code{d''} and the next note is calculated relative
483 to@tie{}@code{d''} instead of@tie{}@code{d'}.
484
485 There is also an octave check that produces no visible output.
486 The syntax is:
487
488 @example
489 @var{pitch} \octave @var{controlpitch}
490 @end example
491
492 @noindent
493 where @var{pitch} is a regular note within a music expression in
494 relative mode and @var{controlpitch} is a pitch in absolute mode.
495 This checks that @var{pitch} lies within the octave surrounding
496 @var{controlpitch}, i.e. not more than a fourth above or below it.
497 If this is not the case, a warning is printed and the octave is
498 corrected.  The @var{controlpitch} is not printed as a note.
499
500 In the example below, the first check passes without incident,
501 since the@tie{}@code{e} (in @code{relative} mode) is within the
502 octave range of@tie{}@code{a'}.  However, the second check
503 produces a warning, since the@tie{}@code{e} is not within the
504 octave range of@tie{}@code{b'}.  The warning message is printed,
505 and the octave is adjusted so that the following notes are in the
506 correct octave once again.
507
508 @example
509 \relative c' @{
510   e
511   \octave a'
512   \octave b'
513 @}
514 @end example
515
516
517 The octave of a note following an @code{\octave} check is
518 determined with respect to the note preceding it, as modified by
519 the outcome of the octave check.  In the next fragment, the first
520 note, an@tie{}@code{e'}, lies within the octave of@tie{}@code{b},
521 and the @code{\octave} check passes successfully.  The second note
522 is then calculated relative to (absolute)@tie{}@code{e'}, which
523 yields an@tie{}@code{a'}, above middle@tie{}C.  In this case, the
524 check had no influence on the output of the piece.
525
526 The second @code{\octave} check fails: @code{a'}@tie{}is not
527 within the range of@tie{}@code{b}.  A warning is issued, and the
528 last note is calculated relative to@tie{}@code{a}, not
529 to@tie{}@code{a'}, and we get a@tie{}@code{d'}.  Without the last
530 @code{\octave} check, the last note would have been
531 a@tie{}@code{d''}.
532
533 @lilypond[verbatim,quote,ragged-right,fragment]
534 \relative c' {
535   e
536   \octave b
537   a
538   \octave b
539   d
540 }
541 @end lilypond
542
543 @seealso
544
545 Snippets: @lsrdir{pitches}.
546
547
548 @node Transpose
549 @unnumberedsubsubsec Transpose
550
551 @cindex transpose
552 @cindex transposition of pitches
553 @cindex transposing instruments
554 @funindex \transpose
555
556 A music expression can be transposed with @code{\transpose}.  The
557 syntax is
558
559 @example
560 \transpose @var{from} @var{to} @var{musicexpr}
561 @end example
562
563 @noindent
564 This means that @var{musicexpr} is transposed by the interval
565 between the pitches @var{from} and @var{to}: any note with pitch
566 @var{from} is changed to @var{to} and any other note is transposed
567 by the same interval.
568
569 Consider a piece written in the key of D-major.  If this piece is
570 a little too low for its performer, it can be transposed up to
571 E-major with
572
573 @example
574 \transpose d e @dots{}
575 @end example
576
577 Consider a part written for violin (a C instrument).  If this part
578 is to be played on the A clarinet (for which an A is notated as a
579 C, and thus sounds a minor third lower than notated), the
580 following transposition will produce the appropriate part:
581
582 @example
583 \transpose a c @dots{}
584 @end example
585
586 @code{\transpose} will also transpose key signatures:
587
588 @lilypond[verbatim,quote,ragged-right]
589 mus = { \key d \major cis d fis g }
590 \new Staff {
591   \clef "F" \mus
592   \clef "G"
593   \transpose c g' \mus
594   \transpose c f' \mus
595 }
596 @end lilypond
597
598 @code{\transpose} distinguishes between enharmonic pitches: both
599 @code{\transpose c cis} or @code{\transpose c des} will transpose
600 up half a tone.  The first version will print sharps and the notes
601 will remain on the same scale step, the second version will print
602 flats on the scale step above.
603
604 @lilypond[verbatim,quote,ragged-right]
605 mus = \relative c' { c d e f }
606 \new Staff {
607   \transpose c cis { \mus }
608   \transpose c des { \mus }
609 }
610 @end lilypond
611
612 @code{\transpose} may also be used to input written notes for a
613 transposing instrument.  The previous examples show how to enter
614 pitches in C (or @notation{concert pitch}) and typeset them for a
615 transposing instrument, but the opposite is also possible if you
616 for example have a set of instrumental parts and want to print a
617 conductor's score.  For example, when entering music for a B-flat
618 trumpet which begins on a notated E (concert D), one would write:
619
620 @example
621 musicInBflat = @{ e4 @dots{} @}
622 \transpose c bes \musicInBflat
623 @end example
624
625 To print this music in F (e.g., rearranging to a french horn) you
626 would wrap the existing music with another @code{\transpose}
627
628 @example
629 musicInBflat = @{ e4 @dots{} @}
630 \transpose f c @{ \transpose c bes \musicInBflat @}
631 @end example
632
633 @commonprop
634
635 @lilypondfile[lilyquote,ragged-right,texidoc]
636 {transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
637
638
639 @seealso
640
641 Snippets: @lsrdir{pitches}.
642
643 Internals Reference: @internalsref{TransposedMusic}.
644
645 @refbugs
646
647 If you want to use both @code{\transpose} and @code{\relative},
648 you must put @code{\transpose} outside of @code{\relative}, since
649 @code{\relative} will have no effect on music that appears inside
650 a @code{\transpose}.  See the previous example.
651
652
653 @node Displaying pitches
654 @subsection Displaying pitches
655
656 This section discusses how to alter the output of pitches.
657
658 @menu
659 * Clef::
660 * Key signature::
661 * Ottava brackets::
662 * Instrument transpositions::
663 * Automatic accidentals::
664 * Ambitus::
665 @end menu
666
667 @node Clef
668 @unnumberedsubsubsec Clef
669
670 @funindex \clef
671
672 @cindex G clef
673 @cindex C clef
674 @cindex F clef
675 @cindex treble clef
676 @cindex violin clef
677 @cindex alto clef
678 @cindex tenor clef
679 @cindex bass clef
680 @cindex french clef
681 @cindex soprano clef
682 @cindex mezzosoprano clef
683 @cindex baritone clef
684 @cindex varbaritone clef
685 @cindex subbass clef
686
687 The clef is set with the @code{\clef} @var{clefname} command:
688
689 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
690 \clef treble
691 c2 c
692 \clef alto
693 c2 c
694 \clef tenor
695 c2 c
696 \clef bass
697 c2 c
698 @end lilypond
699
700 The clef can also be changed inside the staff:
701
702 @lilypond[verbatim,quote,ragged-right,fragment]
703 \new PianoStaff <<
704   \new Staff {
705     \time 2/4
706     \clef treble
707     r16
708     \clef bass
709     e g c' e' e g c'
710   }
711   \new Staff {
712     \clef bass
713     c,8 r
714     \clef treble
715     g''4
716   }
717 >>
718 @end lilypond
719
720 These same clef symbols are used in different positions on the
721 staff to change the range of notes shown by that staff.  The
722 treble (alto, bass) clef is always positioned to show the line on
723 which a@tie{}@code{g'} (@code{c'}, @code{f}) note is printed.
724
725 Supported clefs include
726
727 @multitable @columnfractions .4 .6
728 @headitem Clef @tab Position
729 @item @code{treble, violin, G, G2} @tab
730 G clef (g') on 2nd line
731 @item @code{alto, C} @tab
732 C clef (c') on 3rd line
733 @item @code{tenor} @tab
734 C clef (c') on 4th line
735 @item @code{bass, F} @tab
736 F clef (f) on 4th line
737 @item @code{french} @tab
738 G clef (g') on 1st line, so-called French violin clef
739 @item @code{soprano} @tab
740 C clef (c') on 1st line
741 @item @code{mezzosoprano} @tab
742 C clef (c') on 2nd line
743 @item @code{baritone} @tab
744 C clef (c') on 5th line
745 @item @code{varbaritone} @tab
746 F clef (f) on 3rd line
747 @item @code{subbass} @tab
748 F clef (f) on 5th line
749 @item @code{percussion} @tab
750 percussion clef
751 @item @code{tab} @tab
752 tablature clef
753 @end multitable
754
755 Further supported clefs are described under @ref{Ancient clefs}.
756
757 By adding @code{_8} or @code{^8} to the clef name, the clef is
758 transposed one octave down or up, respectively, and @code{_15} and
759 @code{^15} transposes by two octaves.  The argument @var{clefname}
760 must be enclosed in quotes when it contains underscores or digits.
761 For example,
762
763 @cindex choral tenor clef
764
765 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
766 \clef "G_8" c4
767 @end lilypond
768
769
770 @commonprop
771
772 @lilypondfile[lilyquote,ragged-right,texidoc]
773 {clefs-commonly-tweaked-properties.ly}
774
775
776 @seealso
777
778 Notation Reference: @ref{Ancient clefs}.
779
780 Snippets: @lsrdir{pitches}.
781
782 Internals Reference: @internalsref{Clef}.
783
784
785 @node Key signature
786 @unnumberedsubsubsec Key signature
787
788 @cindex key signature
789 @funindex \key
790
791 @warning{New users are sometimes confused about accidentals and
792 key signatures.  In LilyPond, note names are the raw input; key
793 signatures and clefs determine how this raw input is displayed.
794 An unaltered note like@tie{}@code{c} means @q{C natural},
795 regardless of the key signature or clef.  For more information,
796 see @rlearning{Accidentals and key signatures}.}
797
798 The key signature indicates the tonality in which a piece is
799 played.  It is denoted by a set of alterations (flats or sharps)
800 at the start of the staff.
801
802 Setting or changing the key signature is done with the @code{\key}
803 command:
804
805 @example
806 \key @var{pitch} @var{type}
807 @end example
808
809 @funindex \minor
810 @funindex \major
811 @funindex \minor
812 @funindex \ionian
813 @funindex \locrian
814 @funindex \aeolian
815 @funindex \mixolydian
816 @funindex \lydian
817 @funindex \phrygian
818 @funindex \dorian
819 @cindex church modes
820
821 Here, @var{type} should be @code{\major} or @code{\minor} to get
822 @var{pitch}-major or @var{pitch}-minor, respectively.  You may
823 also use the standard mode names (also called @q{church modes}):
824 @code{\ionian}, @code{\locrian}, @code{\aeolian},
825 @code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and
826 @code{\dorian}.
827
828 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
829 \key g \major
830 f1
831 fis
832 @end lilypond
833
834
835 @commonprop
836
837 @lilypondfile[lilyquote,ragged-right,texidoc]
838 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
839
840 @lilypondfile[lilyquote,ragged-right,texidoc]
841 {non-traditional-key-signatures.ly}
842
843 @lilypondfile[lilyquote,ragged-right,texidoc]
844 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
845
846
847 @seealso
848
849 Music Glossary: @rglos{church mode}, @rglos{scordatura}.
850
851 Learning Manual: @rlearning{Accidentals and key signatures}.
852
853 Snippets: @lsrdir{pitches}.
854
855 Internals Reference: @internalsref{KeyCancellation},
856 @internalsref{KeySignature}, @internalsref{Key_engraver}.
857
858
859 @node Ottava brackets
860 @unnumberedsubsubsec Ottava brackets
861
862 @cindex ottava
863 @cindex 15ma
864 @cindex 8va
865 @cindex 8ve
866 @cindex octavation
867
868 @notation{Ottava brackets} introduce an extra transposition of an
869 octave for the staff:
870
871 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
872 a'2 b
873 #(set-octavation 1)
874 a b
875 #(set-octavation 0)
876 a b
877 @end lilypond
878
879 The @code{set-octavation} function also takes -1 (for 8va bassa),
880 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
881 Internally the function sets the properties @code{ottavation}
882 (e.g., to @code{"8va"} or @code{"8vb"}) and
883 @code{middleCPosition}.  To override the text of the bracket, set
884 @code{ottavation} after invoking @code{set-octavation}, i.e.,
885
886 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
887 #(set-octavation 1)
888 \set Staff.ottavation = #"8"
889 c'
890 @end lilypond
891
892
893 @seealso
894
895 Music Glossary: @rglos{ottava}.
896
897 Snippets: @lsrdir{pitches}.
898
899 Internals Reference: @internalsref{OttavaBracket}.
900
901
902 @refbugs
903
904 @code{set-octavation} will get confused when clef changes happen
905 during an octavation bracket.
906
907
908 @node Instrument transpositions
909 @unnumberedsubsubsec Instrument transpositions
910
911 @cindex transposition, MIDI
912 @cindex transposition, instrument
913
914 The key of a @notation{transposing instrument} can be specified.
915 This applies to many wind instruments, for example, clarinets
916 (B-flat, A, and E-flat), horn (F) and trumpet (B-flat, C, D, and
917 E-flat).
918
919 The transposition is entered with the command
920
921 @example
922 \transposition @var{pitch}
923 @end example
924
925 @noindent
926 where @var{pitch} specifies the key in which the instrument plays.
927 For example, a part for B-flat clarinet would include
928
929 @example
930 \transposition bes
931 @end example
932
933 This command sets the property @code{instrumentTransposition}.
934 The value of this property is used for MIDI output and quotations.
935 MIDI output is transposed to play at concert pitch, and cue notes
936 and quotations are automatically transposed to the key of the
937 instrument in which they are quoted.  For more information about
938 quotations, see @ref{Quoting other voices}.
939
940 The pitch to use for @code{\transposition} should correspond to
941 the real sound heard when a@tie{}@code{c'} written on the staff is
942 played by the transposing instrument.  @code{\transposition}
943 should be used when the music is entered from an orchestral part
944 written for the instrument.  For example, in classical horn parts,
945 the tuning of the instrument is often changed during a piece.
946 Here are a few notes for a violin and a B-flat clarinet where the
947 parts have been entered using the notes and key as they appear in
948 each part or the conductor's score:
949
950 @lilypond[verbatim,quote,ragged-right]
951 \new GrandStaff <<
952   \new Staff = "Violin I" {
953     \set Staff.instrumentName = "Vln"
954     \set Staff.midiInstrument="violin"
955     \key c \major
956     \transposition c
957     g'4( c''8) r c'' r c''4
958   }
959   \new Staff = "Clarinet" {
960     \set Staff.instrumentName = "Cl"
961     \set Staff.midiInstrument="clarinet"
962     \key d \major
963     \transposition bes
964     a'4( d''8) r d'' r d''4
965   }
966 >>
967 @end lilypond
968
969 Without the @code{\transposition} command the MIDI output of this
970 music would play the notes a tone apart; with it the notes are
971 played correctly in unison.
972
973 However, when entering the notes of a score in concert pitch, when
974 all voices are entered in C, they may be prefaced by (the default)
975 @code{\transposition c'}:
976
977 @example
978 clarinet = @{
979   \transposition c'
980   ...
981 @}
982 saxophone = @{
983   \transposition c'
984   ...
985 @}
986 @end example
987
988 @noindent
989 to serve as a reminder that these parts are written in C.
990
991
992 @seealso
993
994 Notation Reference: @ref{Quoting other voices}, @ref{Transpose}.
995
996 Snippets: @lsrdir{pitches}.
997
998
999 @node Automatic accidentals
1000 @unnumberedsubsubsec Automatic accidentals
1001 @cindex automatic accidentals
1002
1003 @funindex set-accidental-style
1004
1005 There are many different conventions on how to typeset
1006 accidentals.  LilyPond provides a function to specify which such
1007 accidental style to use.  This function is called as follows
1008
1009 @example
1010 \new Staff <<
1011   #(set-accidental-style 'voice)
1012   @{ @dots{} @}
1013 >>
1014 @end example
1015
1016 The accidental style applies to the current @code{Staff} by
1017 default (with the exception of the styles @code{piano} and
1018 @code{piano-cautionary}, see below.  Optionally, the function can
1019 take a second argument which determines in which scope the style
1020 should be changed.  For example, to use the same style in all
1021 staves of the current @code{StaffGroup}, use
1022
1023 @example
1024 #(set-accidental-style 'voice 'StaffGroup)
1025 @end example
1026
1027 The following accidental styles are supported.  To demonstrate
1028 each style, we use the following example:
1029
1030 @lilypond[verbatim,quote,ragged-right]
1031 musicA = {
1032   <<
1033     \relative c' {
1034       cis'8 fis, d'4 <a cis>8 f bis4 |
1035       cis2. <c, g'>4 |
1036     }
1037     \\
1038     \relative c' {
1039       ais'2 cis, |
1040       fis8 b a4 cis2 |
1041     }
1042   >>
1043 }
1044
1045 musicB = {
1046   \clef bass
1047   \new Voice {
1048     \voiceTwo \relative c' {
1049       <fis, a cis>4
1050       \change Staff = up
1051       cis'
1052       \change Staff = down
1053       <fis, a>
1054       \change Staff = up
1055       dis' |
1056       \change Staff = down
1057       <fis, a cis>4 gis <f a d>2 |
1058     }
1059   }
1060 }
1061
1062 \new PianoStaff {
1063   <<
1064     \context Staff = "up" {
1065       %%% change the next line as desired:
1066       #(set-accidental-style 'default)
1067       \musicA
1068     }
1069     \context Staff = "down" {
1070       %%% change the next line as desired:
1071       #(set-accidental-style 'default)
1072       \musicB
1073     }
1074   >>
1075 }
1076 @end lilypond
1077
1078 Note that the last lines of this example can be replaced by the
1079 following, as long as the same accidental style should be used in
1080 both staves.
1081 @example
1082 \new PianoStaff @{
1083   <<
1084     \context Staff = "up" @{
1085       %%% change the next line as desired:
1086       #(set-accidental-style 'default 'Score)
1087       \musicA
1088     @}
1089     \context Staff = "down" @{
1090       \musicB
1091     @}
1092   >>
1093 @}
1094 @end example
1095
1096
1097 @c don't use verbatim in this table.
1098 @table @code
1099 @item default
1100 This is the default typesetting behavior.  It corresponds to
1101 eighteenth-century common practice: accidentals are remembered to
1102 the end of the measure in which they occur and only on their own
1103 octave.  Thus, in the example below, no natural signs are printed
1104 before the@tie{}@code{b} in the second measure or the
1105 last@tie{}@code{c}:
1106
1107 @lilypond[quote,ragged-right]
1108 musicA = {
1109   <<
1110     \relative c' {
1111       cis'8 fis, d'4 <a cis>8 f bis4 |
1112       cis2. <c, g'>4 |
1113     }
1114     \\
1115     \relative c' {
1116       ais'2 cis, |
1117       fis8 b a4 cis2 |
1118     }
1119   >>
1120 }
1121
1122 musicB = {
1123   \clef bass
1124   \new Voice {
1125     \voiceTwo \relative c' {
1126       <fis, a cis>4
1127       \change Staff = up
1128       cis'
1129       \change Staff = down
1130       <fis, a>
1131       \change Staff = up
1132       dis' |
1133       \change Staff = down
1134       <fis, a cis>4 gis <f a d>2 |
1135     }
1136   }
1137 }
1138
1139 \new PianoStaff {
1140   <<
1141     \context Staff = "up" {
1142       #(set-accidental-style 'default)
1143       \musicA
1144     }
1145     \context Staff = "down" {
1146       #(set-accidental-style 'default)
1147       \musicB
1148     }
1149   >>
1150 }
1151 @end lilypond
1152
1153 @item voice
1154 The normal behavior is to remember the accidentals on Staff-level.
1155 In this style, however, accidentals are typeset individually for
1156 each voice.  Apart from that, the rule is similar to
1157 @code{default}.
1158
1159 As a result, accidentals from one voice do not get canceled in
1160 other voices, which is often an unwanted result: in the following
1161 example, it is hard to determine whether the second@tie{}@code{a}
1162 should be played natural or sharp.  The @code{voice} option should
1163 therefore be used only if the voices are to be read solely by
1164 individual musicians.  If the staff is to be used by one musician
1165 (e.g., a conductor or in a piano score) then @code{modern} or
1166 @code{modern-cautionary} should be used instead.
1167
1168
1169 @lilypond[quote,ragged-right]
1170 musicA = {
1171   <<
1172     \relative c' {
1173       cis'8 fis, d'4 <a cis>8 f bis4 |
1174       cis2. <c, g'>4 |
1175     }
1176     \\
1177     \relative c' {
1178       ais'2 cis, |
1179       fis8 b a4 cis2 |
1180     }
1181   >>
1182 }
1183
1184 musicB = {
1185   \clef bass
1186   \new Voice {
1187     \voiceTwo \relative c' {
1188       <fis, a cis>4
1189       \change Staff = up
1190       cis'
1191       \change Staff = down
1192       <fis, a>
1193       \change Staff = up
1194       dis' |
1195       \change Staff = down
1196       <fis, a cis>4 gis <f a d>2 |
1197     }
1198   }
1199 }
1200
1201 \new PianoStaff {
1202   <<
1203     \context Staff = "up" {
1204       #(set-accidental-style 'voice)
1205       \musicA
1206     }
1207     \context Staff = "down" {
1208       #(set-accidental-style 'voice)
1209       \musicB
1210     }
1211   >>
1212 }
1213 @end lilypond
1214
1215 @item modern
1216 @funindex modern style accidentals
1217
1218 This rule corresponds to the common practice in the twentieth
1219 century.  It prints the same accidentals as @code{default}, with
1220 two exceptions which serve to avoid ambiguity: after temporary
1221 accidentals, cancellation marks are printed also in the following
1222 measure (for notes in the same octave) and, in the same measure,
1223 for notes in other octaves.  Hence the naturals before
1224 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1225 the upper staff:
1226
1227 @lilypond[quote,ragged-right]
1228 musicA = {
1229   <<
1230     \relative c' {
1231       cis'8 fis, d'4 <a cis>8 f bis4 |
1232       cis2. <c, g'>4 |
1233     }
1234     \\
1235     \relative c' {
1236       ais'2 cis, |
1237       fis8 b a4 cis2 |
1238     }
1239   >>
1240 }
1241
1242 musicB = {
1243   \clef bass
1244   \new Voice {
1245     \voiceTwo \relative c' {
1246       <fis, a cis>4
1247       \change Staff = up
1248       cis'
1249       \change Staff = down
1250       <fis, a>
1251       \change Staff = up
1252       dis' |
1253       \change Staff = down
1254       <fis, a cis>4 gis <f a d>2 |
1255     }
1256   }
1257 }
1258
1259 \new PianoStaff {
1260   <<
1261     \context Staff = "up" {
1262       #(set-accidental-style 'modern)
1263       \musicA
1264     }
1265     \context Staff = "down" {
1266       #(set-accidental-style 'modern)
1267       \musicB
1268     }
1269   >>
1270 }
1271 @end lilypond
1272
1273 @item modern-cautionary
1274 @funindex modern-cautionary
1275
1276 This rule is similar to @code{modern}, but the @q{extra}
1277 accidentals (the ones not typeset by @code{default}) are typeset
1278 as cautionary accidentals.  They are by default printed with
1279 parentheses, but they can also be printed in reduced size by
1280 defining the @code{cautionary-style} property of
1281 @code{AccidentalSuggestion}.
1282
1283
1284 @lilypond[quote,ragged-right]
1285 musicA = {
1286   <<
1287     \relative c' {
1288       cis'8 fis, d'4 <a cis>8 f bis4 |
1289       cis2. <c, g'>4 |
1290     }
1291     \\
1292     \relative c' {
1293       ais'2 cis, |
1294       fis8 b a4 cis2 |
1295     }
1296   >>
1297 }
1298
1299 musicB = {
1300   \clef bass
1301   \new Voice {
1302     \voiceTwo \relative c' {
1303       <fis, a cis>4
1304       \change Staff = up
1305       cis'
1306       \change Staff = down
1307       <fis, a>
1308       \change Staff = up
1309       dis' |
1310       \change Staff = down
1311       <fis, a cis>4 gis <f a d>2 |
1312     }
1313   }
1314 }
1315
1316 \new PianoStaff {
1317   <<
1318     \context Staff = "up" {
1319       #(set-accidental-style 'modern-cautionary)
1320       \musicA
1321     }
1322     \context Staff = "down" {
1323       #(set-accidental-style 'modern-cautionary)
1324       \musicB
1325     }
1326   >>
1327 }
1328 @end lilypond
1329
1330 @item modern-voice
1331 @funindex modern-voice
1332
1333 This rule is used for multivoice accidentals to be read both by
1334 musicians playing one voice and musicians playing all voices.
1335 Accidentals are typeset for each voice, but they @emph{are}
1336 canceled across voices in the same @code{Staff}.  Hence,
1337 the@tie{}@code{a} in the last measure is canceled because the
1338 previous cancellation was in a different voice, and
1339 the@tie{}@code{d} in the lower staff is canceled because of the
1340 accidental in a different voice in the previous measure:
1341
1342
1343 @lilypond[quote,ragged-right]
1344 musicA = {
1345   <<
1346     \relative c' {
1347       cis'8 fis, d'4 <a cis>8 f bis4 |
1348       cis2. <c, g'>4 |
1349     }
1350     \\
1351     \relative c' {
1352       ais'2 cis, |
1353       fis8 b a4 cis2 |
1354     }
1355   >>
1356 }
1357
1358 musicB = {
1359   \clef bass
1360   \new Voice {
1361     \voiceTwo \relative c' {
1362       <fis, a cis>4
1363       \change Staff = up
1364       cis'
1365       \change Staff = down
1366       <fis, a>
1367       \change Staff = up
1368       dis' |
1369       \change Staff = down
1370       <fis, a cis>4 gis <f a d>2 |
1371     }
1372   }
1373 }
1374
1375 \new PianoStaff {
1376   <<
1377     \context Staff = "up" {
1378       #(set-accidental-style 'modern-voice)
1379       \musicA
1380     }
1381     \context Staff = "down" {
1382       #(set-accidental-style 'modern-voice)
1383       \musicB
1384     }
1385   >>
1386 }
1387 @end lilypond
1388
1389 @funindex modern-voice-cautionary
1390 @item modern-voice-cautionary
1391
1392 This rule is the same as @code{modern-voice}, but with the extra
1393 accidentals (the ones not typeset by @code{voice}) typeset
1394 as cautionaries.  Even though all accidentals typeset by
1395 @code{default} @emph{are} typeset with this rule,
1396 some of them are typeset as cautionaries.
1397
1398 @lilypond[quote,ragged-right]
1399 musicA = {
1400   <<
1401     \relative c' {
1402       cis'8 fis, d'4 <a cis>8 f bis4 |
1403       cis2. <c, g'>4 |
1404     }
1405     \\
1406     \relative c' {
1407       ais'2 cis, |
1408       fis8 b a4 cis2 |
1409     }
1410   >>
1411 }
1412
1413 musicB = {
1414   \clef bass
1415   \new Voice {
1416     \voiceTwo \relative c' {
1417       <fis, a cis>4
1418       \change Staff = up
1419       cis'
1420       \change Staff = down
1421       <fis, a>
1422       \change Staff = up
1423       dis' |
1424       \change Staff = down
1425       <fis, a cis>4 gis <f a d>2 |
1426     }
1427   }
1428 }
1429
1430 \new PianoStaff {
1431   <<
1432     \context Staff = "up" {
1433       #(set-accidental-style 'modern-voice-cautionary)
1434       \musicA
1435     }
1436     \context Staff = "down" {
1437       #(set-accidental-style 'modern-voice-cautionary)
1438       \musicB
1439     }
1440   >>
1441 }
1442 @end lilypond
1443
1444 @item piano
1445 @funindex piano accidentals
1446
1447 This rule reflects twentieth-century practice for piano notation.
1448 Its behavior is very similar to @code{modern} style, but here
1449 accidentals also get canceled across the staves in the same
1450 GrandStaff or PianoStaff, hence all the cancellations of the final
1451 notes.
1452
1453 This accidental style applies to the current @code{GrandStaff} or
1454 @code{PianoStaff} by default.
1455
1456 @lilypond[quote,ragged-right]
1457 musicA = {
1458   <<
1459     \relative c' {
1460       cis'8 fis, d'4 <a cis>8 f bis4 |
1461       cis2. <c, g'>4 |
1462     }
1463     \\
1464     \relative c' {
1465       ais'2 cis, |
1466       fis8 b a4 cis2 |
1467     }
1468   >>
1469 }
1470
1471 musicB = {
1472   \clef bass
1473   \new Voice {
1474     \voiceTwo \relative c' {
1475       <fis, a cis>4
1476       \change Staff = up
1477       cis'
1478       \change Staff = down
1479       <fis, a>
1480       \change Staff = up
1481       dis' |
1482       \change Staff = down
1483       <fis, a cis>4 gis <f a d>2 |
1484     }
1485   }
1486 }
1487
1488 \new PianoStaff {
1489   <<
1490     \context Staff = "up" {
1491       #(set-accidental-style 'piano)
1492       \musicA
1493     }
1494     \context Staff = "down" {
1495       \musicB
1496     }
1497   >>
1498 }
1499 @end lilypond
1500
1501 @item piano-cautionary
1502 @funindex #(set-accidental-style 'piano-cautionary)
1503
1504 Same as @code{#(set-accidental-style 'piano)} but with the extra
1505 accidentals typeset as cautionaries.
1506
1507 @lilypond[quote,ragged-right]
1508 musicA = {
1509   <<
1510     \relative c' {
1511       cis'8 fis, d'4 <a cis>8 f bis4 |
1512       cis2. <c, g'>4 |
1513     }
1514     \\
1515     \relative c' {
1516       ais'2 cis, |
1517       fis8 b a4 cis2 |
1518     }
1519   >>
1520 }
1521
1522 musicB = {
1523   \clef bass
1524   \new Voice {
1525     \voiceTwo \relative c' {
1526       <fis, a cis>4
1527       \change Staff = up
1528       cis'
1529       \change Staff = down
1530       <fis, a>
1531       \change Staff = up
1532       dis' |
1533       \change Staff = down
1534       <fis, a cis>4 gis <f a d>2 |
1535     }
1536   }
1537 }
1538
1539 \new PianoStaff {
1540   <<
1541     \context Staff = "up" {
1542       #(set-accidental-style 'piano-cautionary)
1543       \musicA
1544     }
1545     \context Staff = "down" {
1546       \musicB
1547     }
1548   >>
1549 }
1550 @end lilypond
1551
1552 @item no-reset
1553 @funindex no-reset accidental style
1554
1555 This is the same as @code{default} but with accidentals lasting
1556 @q{forever} and not only within the same measure:
1557
1558 @lilypond[quote,ragged-right]
1559 musicA = {
1560   <<
1561     \relative c' {
1562       cis'8 fis, d'4 <a cis>8 f bis4 |
1563       cis2. <c, g'>4 |
1564     }
1565     \\
1566     \relative c' {
1567       ais'2 cis, |
1568       fis8 b a4 cis2 |
1569     }
1570   >>
1571 }
1572
1573 musicB = {
1574   \clef bass
1575   \new Voice {
1576     \voiceTwo \relative c' {
1577       <fis, a cis>4
1578       \change Staff = up
1579       cis'
1580       \change Staff = down
1581       <fis, a>
1582       \change Staff = up
1583       dis' |
1584       \change Staff = down
1585       <fis, a cis>4 gis <f a d>2 |
1586     }
1587   }
1588 }
1589
1590 \new PianoStaff {
1591   <<
1592     \context Staff = "up" {
1593       #(set-accidental-style 'no-reset)
1594       \musicA
1595     }
1596     \context Staff = "down" {
1597       #(set-accidental-style 'no-reset)
1598       \musicB
1599     }
1600   >>
1601 }
1602 @end lilypond
1603
1604 @item forget
1605 @funindex forget accidental style
1606
1607 This is the opposite of @code{no-reset}: Accidentals are not
1608 remembered at all -- and hence all accidentals are typeset
1609 relative to the key signature, regardless of what was before in
1610 the music:
1611
1612 @lilypond[quote,ragged-right]
1613 musicA = {
1614   <<
1615     \relative c' {
1616       cis'8 fis, d'4 <a cis>8 f bis4 |
1617       cis2. <c, g'>4 |
1618     }
1619     \\
1620     \relative c' {
1621       ais'2 cis, |
1622       fis8 b a4 cis2 |
1623     }
1624   >>
1625 }
1626
1627 musicB = {
1628   \clef bass
1629   \new Voice {
1630     \voiceTwo \relative c' {
1631       <fis, a cis>4
1632       \change Staff = up
1633       cis'
1634       \change Staff = down
1635       <fis, a>
1636       \change Staff = up
1637       dis' |
1638       \change Staff = down
1639       <fis, a cis>4 gis <f a d>2 |
1640     }
1641   }
1642 }
1643
1644 \new PianoStaff {
1645   <<
1646     \context Staff = "up" {
1647       #(set-accidental-style 'forget)
1648       \musicA
1649     }
1650     \context Staff = "down" {
1651       #(set-accidental-style 'forget)
1652       \musicB
1653     }
1654   >>
1655 }
1656 @end lilypond
1657 @end table
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[lilyquote,ragged-right,texidoc]
1714 {adding-ambiti-per-voice.ly}
1715
1716 @lilypondfile[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[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}.