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