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