]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/pitches.itely
514287d10a140ddf24d536d3c8a367049f60476c
[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 @c \version "2.12.0"
10
11
12 @node Pitches
13 @section Pitches
14
15 @lilypondfile[quote]{pitches-headword.ly}
16
17 This section discusses how to specify the pitch of notes.  There
18 are three steps to this process: input, modification, and output.
19
20 @menu
21 * Writing pitches::
22 * Changing multiple pitches::
23 * Displaying pitches::
24 * Note heads::
25 @end menu
26
27
28 @node Writing pitches
29 @subsection Writing pitches
30
31 This section discusses how to input pitches.  There are two
32 different ways to place notes in octaves: absolute and relative
33 mode.  In most cases, relative mode will be more convenient.
34
35 @menu
36 * Absolute octave entry::
37 * Relative octave entry::
38 * Accidentals::
39 * Note names in other languages::
40 @end menu
41
42
43 @node Absolute octave entry
44 @unnumberedsubsubsec Absolute octave entry
45
46 @cindex pitch names
47 @cindex pitches
48 @cindex absolute
49 @cindex absolute octave specification
50 @cindex octave specification, absolute
51 @cindex absolute octave entry
52 @cindex octave entry, absolute
53
54 A pitch name is specified using lowercase letters@tie{}@code{a}
55 through@tie{}@code{g}.  The note names @code{c} to @code{b} are
56 engraved in the octave below middle C.
57
58 @c don't use c' here.
59 @lilypond[verbatim,quote,fragment]
60 \clef bass
61 c d e f
62 g a b c
63 d e f g
64 @end lilypond
65
66 @cindex octave changing mark
67
68 @funindex '
69 @funindex ,
70
71 Other octaves may be specified with a single quote@tie{}(@code{'})
72 or comma@tie{}(@code{,}) character.  Each@tie{}@code{'} raises the
73 pitch by one octave; each@tie{}@code{,} lowers the pitch by an
74 octave.
75
76 @lilypond[verbatim,quote,fragment]
77 \clef treble
78 c' c'' e' g
79 d'' d' d c
80 \clef bass
81 c, c,, e, g
82 d,, d, d c
83 @end lilypond
84
85
86 @seealso
87 Music Glossary:
88 @rglos{Pitch names}.
89
90 Snippets:
91 @rlsr{Pitches}.
92
93
94 @node Relative octave entry
95 @unnumberedsubsubsec Relative octave entry
96
97 @cindex relative
98 @cindex relative octave entry
99 @cindex octave entry, relative
100 @cindex relative octave specification
101 @cindex ocatve specification, relative
102
103 @funindex relative
104 @funindex \relative
105
106 When octaves are specified in absolute mode it is easy to
107 accidentally put a pitch in the wrong octave.  Relative octave
108 mode reduces these errors since most of the time it is not
109 necessary to indicate any octaves at all.  Furthermore, in
110 absolute mode a single mistake may be difficult to spot, while in
111 relative mode a single error puts the rest of the piece off by one
112 octave.
113
114 @example
115 \relative @var{startpitch} @var{musicexpr}
116 @end example
117
118 In relative mode, each note is assumed to be as close to the
119 previous note as possible.  This means that the octave of each
120 pitch inside @var{musicexpr} is calculated as follows:
121
122 @itemize
123 @item
124 If no octave changing mark is used on a pitch, its octave is
125 calculated so that the interval with the previous note is less
126 than a fifth.  This interval is determined without considering
127 accidentals.
128
129 @item
130 An octave changing mark@tie{}@code{'} or@tie{}@code{,} can be
131 added to respectively raise or lower a pitch by an extra octave,
132 relative to the pitch calculated without an octave mark.
133
134 @item
135 Multiple octave changing marks can be used.  For example,
136 @code{''}@tie{}and@tie{}@code{,,} will alter the pitch by two
137 octaves.
138
139 @item
140 The pitch of the first note is relative to
141 @code{@var{startpitch}}.  @var{startpitch} is specified in
142 absolute octave mode, and it is recommended that it be a octave of
143 @code{c}.
144
145 @end itemize
146
147 Here is the relative mode shown in action:
148
149 @lilypond[verbatim,quote]
150 \relative c {
151   \clef bass
152   c d e f
153   g a b c
154   d e f g
155 }
156 @end lilypond
157
158 Octave changing marks are used for intervals greater than a
159 fourth:
160
161 @lilypond[verbatim,quote]
162 \relative c'' {
163   c g c f,
164   c' a, e'' c
165 }
166 @end lilypond
167
168 A note sequence without a single octave mark can nevertheless span
169 large intervals:
170
171 @lilypond[verbatim,quote]
172 \relative c {
173   c f b e
174   a d g c
175 }
176 @end lilypond
177
178 @cindex chords and relative octave entry
179 @cindex relative octave entry and chords
180
181 If the preceding item is a chord, the first note of the chord is
182 used as the reference point for the octave placement of a
183 following note or chord.  Inside chords, the next note is always
184 relative to the preceding one.  Examine the next example
185 carefully, paying attention to the @code{c} notes.
186
187 @lilypond[verbatim,quote]
188 \relative c' {
189   c
190   <c e g>
191   <c' e g'>
192   <c, e, g''>
193 }
194 @end lilypond
195
196 As explained above, the octave of pitches is calculated only with
197 the note names, regardless of any alterations.  Therefore, an
198 E-double-sharp following a B will be placed higher, while an
199 F-double-flat will be placed lower.  In other words, a
200 double-augmented fourth is considered a smaller interval than a
201 double-diminished fifth, regardless of the number of semitones
202 that each interval contains.
203
204 @lilypond[verbatim,quote]
205 \relative c'' {
206   c2 fis
207   c2 ges
208   b2 eisis
209   b2 feses
210 }
211 @end lilypond
212
213
214 @seealso
215 Music Glossary:
216 @rglos{fifth},
217 @rglos{interval},
218 @rglos{Pitch names}.
219
220 Notation Reference:
221 @ref{Octave checks}.
222
223 Snippets:
224 @rlsr{Pitches}.
225
226 Internals Reference:
227 @rinternals{RelativeOctaveMusic}.
228
229
230 @cindex relative octave entry and transposition
231 @cindex transposition and relative octave entry
232
233 @funindex \transpose
234 @funindex transpose
235 @funindex \chordmode
236 @funindex chordmode
237 @funindex \relative
238 @funindex relative
239
240
241 @knownissues
242
243 The relative conversion will not affect @code{\transpose},
244 @code{\chordmode} or @code{\relative} sections in its argument.
245 To use relative mode within transposed music, an additional
246 @code{\relative} must be placed inside @code{\transpose}.
247
248 @c DEPRECATED
249 If no @var{startpitch} is specified for @code{\relative},
250 then@tie{}@code{c'} is assumed.  However, this is a deprecated
251 option and may disappear in future versions, so its use is
252 discouraged.
253
254
255
256 @node Accidentals
257 @unnumberedsubsubsec Accidentals
258
259 @cindex accidental
260 @cindex key signature
261 @cindex clef
262
263 @c duplicated in Key signature and Accidentals
264 @warning{New users are sometimes confused about accidentals and
265 key signatures.  In LilyPond, note names are the raw input; key
266 signatures and clefs determine how this raw input is displayed.
267 An unaltered note like@tie{}@code{c} means @q{C natural},
268 regardless of the key signature or clef.  For more information,
269 see @rlearning{Accidentals and key signatures}.}
270
271 @cindex note names, Dutch
272 @cindex note names, default
273 @cindex default note names
274 @cindex sharp
275 @cindex flat
276 @cindex double sharp
277 @cindex sharp, double
278 @cindex double flat
279 @cindex flat, double
280 @cindex natural sign
281 @cindex natural pitch
282
283 A @notation{sharp} pitch is made by adding @code{is} to the note
284 name, and a @notation{flat} pitch by adding @code{es}.  As you
285 might expect, a @notation{double sharp} or @notation{double flat}
286 is made by adding @code{isis} or @code{eses}.  This syntax is
287 derived from Dutch note naming conventions.  To use other names
288 for accidentals, see @ref{Note names in other languages}.
289
290 @lilypond[verbatim,quote,relative=2]
291 ais1 aes aisis aeses
292 @end lilypond
293
294 A natural will cancel the effect of an accidental or key
295 signature.  However, naturals are not encoded into the note name
296 syntax with a suffix; a natural pitch is shown as a simple note
297 name:
298
299 @lilypond[verbatim,quote,relative=2]
300 a4 aes a2
301 @end lilypond
302
303 @cindex quarter tones
304 @cindex semi-flats
305 @cindex semi-sharps
306
307 Quarter tones may be added; the following is a series of Cs with
308 increasing pitches:
309
310 @lilypond[verbatim,quote,relative=2]
311 ceseh1 ces ceh c cih cis cisih
312 @end lilypond
313
314
315
316 @cindex accidental, reminder
317 @cindex accidental, cautionary
318 @cindex accidental, parenthesized
319 @cindex reminder accidental
320 @cindex cautionary accidental
321 @cindex parenthesized accidental
322
323 @funindex ?
324 @funindex !
325
326
327 Normally accidentals are printed automatically, but you may also
328 print them manually.  A reminder accidental can be forced by
329 adding an exclamation mark@tie{}@code{!} after the pitch.  A
330 cautionary accidental (i.e., an accidental within parentheses) can
331 be obtained by adding the question mark@tie{}@code{?} after the
332 pitch.  These extra accidentals can also be used to produce
333 natural signs.
334
335 @lilypond[verbatim,quote,relative=2]
336 cis cis cis! cis? c c c! c?
337 @end lilypond
338
339 @cindex accidental on tied note
340 @cindex tied note, accidental
341
342 Accidentals on tied notes are only printed at the beginning of a
343 new system:
344
345 @lilypond[verbatim,quote,relative=2]
346 cis1 ~ cis ~
347 \break
348 cis
349 @end lilypond
350
351
352 @snippets
353
354 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
355 {preventing-extra-naturals-from-being-automatically-added.ly}
356
357 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
358 {makam-example.ly}
359
360
361 @seealso
362 Music Glossary:
363 @rglos{sharp},
364 @rglos{flat},
365 @rglos{double sharp},
366 @rglos{double flat},
367 @rglos{Pitch names},
368 @rglos{quarter tone}.
369
370 Learning Manual:
371 @rlearning{Accidentals and key signatures}.
372
373 Notation Reference:
374 @ref{Automatic accidentals},
375 @ref{Annotational accidentals (musica ficta)},
376 @ref{Note names in other languages}.
377
378 Snippets:
379 @rlsr{Pitches}.
380
381 Internals Reference:
382 @rinternals{Accidental_engraver},
383 @rinternals{Accidental},
384 @rinternals{AccidentalCautionary},
385 @rinternals{accidental-interface}.
386
387
388 @cindex accidental, quarter-tone
389 @cindex quarter-tone accidental
390
391 @knownissues
392
393 There are no generally accepted standards for denoting
394 quarter-tone accidentals, so LilyPond's symbol does not conform to
395 any standard.
396
397
398
399 @node Note names in other languages
400 @unnumberedsubsubsec Note names in other languages
401
402 @cindex note names, other languages
403 @cindex pitch names, other languages
404 @cindex language, note names in other
405 @cindex language, pitch names in other
406
407 There are predefined sets of note and accidental names for various
408 other languages.  To use them, include the language-specific init
409 file listed below.  For example, to use English note names, add
410 @code{@w{\include "english.ly"}} to the input file.  Because some
411 other include files (such as @code{@w{predefined-fretboards.ly}}) use
412 default (Nederlands) note names, the @code{\include} command for the
413 language file should be placed after all other LilyPond distribution
414 files.  The available language files and the note names they define
415 are:
416
417 @quotation
418 @multitable {@file{nederlands.ly}} {do re mi fa sol la sib si}
419 @headitem Language File
420   @tab Note Names
421 @item @file{nederlands.ly}
422   @tab c d e f g a bes b
423 @item @file{arabic.ly}
424   @tab do re mi fa sol la sib si
425 @item @file{catalan.ly}
426   @tab do re mi fa sol la sib si
427 @item @file{deutsch.ly}
428   @tab c d e f g a b h
429 @item @file{english.ly}
430   @tab c d e f g a bf b
431 @item @file{espanol.ly}
432   @tab do re mi fa sol la sib si
433 @item @file{italiano.ly}
434   @tab do re mi fa sol la sib si
435 @item @file{norsk.ly}
436   @tab c d e f g a b h
437 @item @file{portugues.ly}
438   @tab do re mi fa sol la sib si
439 @item @file{suomi.ly}
440   @tab c d e f g a b h
441 @item @file{svenska.ly}
442   @tab c d e f g a b h
443 @item @file{vlaams.ly}
444   @tab do re mi fa sol la sib si
445 @end multitable
446 @end quotation
447
448 @noindent
449 and the accidental suffixes they define are:
450
451 @quotation
452 @multitable {@file{nederlands.ly}} {-s/-sharp} {-ess/-es} {-ss/-x/-sharpsharp} {-essess/-eses}
453 @headitem Language File
454   @tab sharp @tab flat @tab double sharp @tab double flat
455 @item @file{nederlands.ly}
456   @tab -is @tab -es @tab -isis @tab -eses
457 @item @file{arabic.ly}
458   @tab -d @tab -b @tab -dd @tab -bb
459 @item @file{catalan.ly}
460   @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
461 @item @file{deutsch.ly}
462   @tab -is @tab -es @tab -isis @tab -eses
463 @item @file{english.ly}
464   @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
465     @tab -ff/-flatflat
466 @item @file{espanol.ly}
467   @tab -s @tab -b @tab -ss @tab -bb
468 @item @file{italiano.ly}
469   @tab -d @tab -b @tab -dd @tab -bb
470 @item @file{norsk.ly}
471   @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
472     @tab -essess/-eses
473 @item @file{portugues.ly}
474   @tab -s @tab -b @tab -ss @tab -bb
475 @item @file{suomi.ly}
476   @tab -is @tab -es @tab -isis @tab -eses
477 @item @file{svenska.ly}
478   @tab -iss @tab -ess @tab -ississ @tab -essess
479 @item @file{vlaams.ly}
480   @tab -k @tab -b @tab -kk @tab -bb
481 @end multitable
482 @end quotation
483
484 In Dutch, @code{aes} is contracted to @code{as}, but both forms
485 are accepted in LilyPond.  Similarly, both @code{es} and
486 @code{ees} are accepted.  This also applies to
487 @code{aeses}@tie{}/@tie{}@code{ases} and
488 @code{eeses}@tie{}/@tie{}@code{eses}.  Sometimes only these
489 contracted names are defined in the corresponding language files.
490
491 @lilypond[verbatim,quote,relative=2]
492 a2 as e es a ases e eses
493 @end lilypond
494
495
496 @cindex microtones
497 @cindex semi-sharp
498 @cindex semi-flat
499 @cindex sesqui-sharp
500 @cindex sesqui-flat
501
502 Some music uses microtones whose alterations are fractions of a
503 @q{normal} sharp or flat.  The note names for quarter-tones
504 defined in the various language files are listed in the following
505 table.  Here the prefixes @notation{semi-} and @notation{sesqui-}
506 mean @q{half} and @q{one and a half}, respectively.  For the other
507 languages, no special names have been defined yet.
508
509 @quotation
510 @multitable {@file{nederlands.ly}} {@b{semi-sharp}} {@b{semi-flat}} {@b{sesqui-sharp}} {@b{sesqui-flat}}
511 @headitem Language File
512   @tab semi-sharp @tab semi-flat @tab sesqui-sharp @tab sesqui-flat
513
514 @item @file{nederlands.ly}
515   @tab -ih @tab -eh @tab -isih @tab -eseh
516 @item @file{arabic.ly}
517   @tab -sd @tab -sb @tab -dsd @tab -bsb
518 @item @file{deutsch.ly}
519   @tab -ih @tab -eh @tab -isih @tab -eseh
520 @item @file{english.ly}
521   @tab -qs @tab -qf @tab -tqs @tab -tqf
522 @item @file{italiano.ly}
523   @tab -sd @tab -sb @tab -dsd @tab -bsb
524 @item @file{portugues.ly}
525   @tab -sqt @tab -bqt @tab -stqt @tab -btqt
526 @end multitable
527 @end quotation
528
529
530 @seealso
531 Music Glossary:
532 @rglos{Pitch names}.
533
534 Snippets:
535 @rlsr{Pitches}.
536
537
538 @node Changing multiple pitches
539 @subsection Changing multiple pitches
540
541 This section discusses how to modify pitches.
542
543 @menu
544 * Octave checks::
545 * Transpose::
546 @end menu
547
548 @node Octave checks
549 @unnumberedsubsubsec Octave checks
550
551 @cindex octave correction
552 @cindex octave check
553 @cindex control pitch
554
555 @funindex =
556 @funindex \octaveCheck
557 @funindex octaveCheck
558 @funindex controlpitch
559
560 In relative mode, it is easy to forget an octave changing mark.
561 Octave checks make such errors easier to find by displaying a
562 warning and correcting the octave if a note is found in an
563 unexpected octave.
564
565 To check the octave of a note, specify the absolute octave after
566 the @code{=}@tie{}symbol.  This example will generate a warning
567 (and change the pitch) because the second note is the absolute
568 octave @code{d''} instead of @code{d'} as indicated by the octave
569 correction.
570
571 @lilypond[verbatim,quote]
572 \relative c'' {
573   c2 d='4 d
574   e2 f
575 }
576 @end lilypond
577
578 The octave of notes may also be checked with the
579 @code{\octaveCheck}@tie{}@var{controlpitch} command.
580 @var{controlpitch} is specified in absolute mode.  This checks
581 that the interval between the previous note and the
582 @var{controlpitch} is within a fourth (i.e., the normal
583 calculation of relative mode).  If this check fails, a warning is
584 printed, but the previous note is not changed.  Future notes are
585 relative to the @var{controlpitch}.
586
587 @lilypond[verbatim,quote]
588 \relative c'' {
589   c2 d
590   \octaveCheck c'
591   e2 f
592 }
593 @end lilypond
594
595 Compare the two bars below.  The first and third @code{\octaveCheck}
596 checks fail, but the second one does not fail.
597
598 @lilypond[verbatim,quote]
599 \relative c'' {
600   c4 f g f
601
602   c4
603   \octaveCheck c'
604   f
605   \octaveCheck c'
606   g
607   \octaveCheck c'
608   f
609 }
610 @end lilypond
611
612
613 @seealso
614 Snippets:
615 @rlsr{Pitches}.
616
617 Internals Reference:
618 @rinternals{RelativeOctaveCheck}.
619
620
621 @node Transpose
622 @unnumberedsubsubsec Transpose
623
624 @cindex transpose
625 @cindex transposing
626 @cindex transposition
627 @cindex transposition of pitches
628 @cindex transposition of notes
629 @cindex pitches, transposition of
630 @cindex notes, transposition of
631
632 @funindex \transpose
633 @funindex transpose
634
635 A music expression can be transposed with @code{\transpose}.  The
636 syntax is
637
638 @example
639 \transpose @var{frompitch} @var{topitch} @var{musicexpr}
640 @end example
641
642 @noindent
643 This means that @var{musicexpr} is transposed by the interval
644 between the pitches @var{frompitch} and @var{topitch}: any note
645 with pitch @var{frompitch} is changed to @var{topitch} and any
646 other note is transposed by the same interval.  Both pitches are
647 entered in absolute mode.
648
649 Consider a piece written in the key of D-major.  It can be
650 transposed up to E-major; note that the key signature is
651 automatically transposed as well.
652
653 @lilypond[verbatim,quote]
654 \transpose d e {
655   \relative c' {
656     \key d \major
657     d4 fis a d
658   }
659 }
660 @end lilypond
661
662 @cindex transposing instruments
663 @cindex instruments, transposing
664
665 If a part written in C (normal @notation{concert pitch}) is to be
666 played on the A clarinet (for which an A is notated as a C and
667 thus sounds a minor third lower than notated), the appropriate
668 part will be produced with:
669
670 @lilypond[verbatim,quote]
671 \transpose a c' {
672   \relative c' {
673     \key c \major
674     c4 d e g
675   }
676 }
677 @end lilypond
678
679 @noindent
680 Note that we specify @w{@code{\key c \major}} explicitly.  If we
681 do not specify a key signature, the notes will be transposed but
682 no key signature will be printed.
683
684 @code{\transpose} distinguishes between enharmonic pitches: both
685 @w{@code{\transpose c cis}} or @w{@code{\transpose c des}} will
686 transpose up a semitone.  The first version will print sharps and
687 the notes will remain on the same scale step, the second version
688 will print flats on the scale step above.
689
690 @lilypond[verbatim,quote]
691 music = \relative c' { c d e f }
692 \new Staff {
693   \transpose c cis { \music }
694   \transpose c des { \music }
695 }
696 @end lilypond
697
698
699 @code{\transpose} may also be used in a different way, to input
700 written notes for a transposing instrument.  The previous examples
701 show how to enter pitches in C (or @notation{concert pitch}) and
702 typeset them for a transposing instrument, but the opposite is
703 also possible if you for example have a set of instrumental parts
704 and want to print a conductor's score.  For example, when entering
705 music for a B-flat trumpet that begins on a notated E (concert D),
706 one would write:
707
708 @example
709 musicInBflat = @{ e4 @dots{} @}
710 \transpose c bes, \musicInBflat
711 @end example
712
713 @noindent
714 To print this music in F (e.g., rearranging to a French horn) you
715 could wrap the existing music with another @code{\transpose}:
716
717 @example
718 musicInBflat = @{ e4 @dots{} @}
719 \transpose f c' @{ \transpose c bes, \musicInBflat @}
720 @end example
721
722 @noindent
723 For more information about transposing instruments,
724 see @ref{Instrument transpositions}.
725
726
727 @snippets
728
729 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
730 {transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
731
732
733 @seealso
734 Notation Reference:
735 @ref{Instrument transpositions}.
736
737 Snippets:
738 @rlsr{Pitches}.
739
740 Internals Reference:
741 @rinternals{TransposedMusic}.
742
743
744 @funindex \transpose
745 @funindex transpose
746 @funindex \chordmode
747 @funindex chordmode
748 @funindex \relative
749 @funindex relative
750
751 @knownissues
752
753 The relative conversion will not affect @code{\transpose},
754 @code{\chordmode} or @code{\relative} sections in its argument.
755 To use relative mode within transposed music, an additional
756 @code{\relative} must be placed inside @code{\transpose}.
757
758
759 @node Displaying pitches
760 @subsection Displaying pitches
761
762 This section discusses how to alter the output of pitches.
763
764 @menu
765 * Clef::
766 * Key signature::
767 * Ottava brackets::
768 * Instrument transpositions::
769 * Automatic accidentals::
770 * Ambitus::
771 @end menu
772
773
774 @node Clef
775 @unnumberedsubsubsec Clef
776
777 @cindex G clef
778 @cindex C clef
779 @cindex F clef
780 @cindex treble clef
781 @cindex violin clef
782 @cindex alto clef
783 @cindex tenor clef
784 @cindex bass clef
785 @cindex french clef
786 @cindex soprano clef
787 @cindex mezzosoprano clef
788 @cindex baritone clef
789 @cindex varbaritone clef
790 @cindex subbass clef
791 @cindex clef
792 @cindex ancient clef
793 @cindex clef, ancient
794 @cindex clef, G
795 @cindex clef, C
796 @cindex clef, F
797 @cindex clef, treble
798 @cindex clef, violin
799 @cindex clef, alto
800 @cindex clef, tenor
801 @cindex clef, bass
802 @cindex clef, french
803 @cindex clef, soprano
804 @cindex clef, mezzosoprano
805 @cindex clef, baritone
806 @cindex clef, varbaritone
807 @cindex subbass clef, subbass
808
809 @funindex \clef
810 @funindex clef
811
812 The clef may be altered.  Middle C is shown in every example.
813
814 @lilypond[verbatim,quote,relative=1]
815 \clef treble
816 c2 c
817 \clef alto
818 c2 c
819 \clef tenor
820 c2 c
821 \clef bass
822 c2 c
823 @end lilypond
824
825 Other clefs include:
826
827 @lilypond[verbatim,quote,relative=1]
828 \clef french
829 c2 c
830 \clef soprano
831 c2 c
832 \clef mezzosoprano
833 c2 c
834 \clef baritone
835 c2 c
836
837 \break
838
839 \clef varbaritone
840 c2 c
841 \clef subbass
842 c2 c
843 \clef percussion
844 c2 c
845 \clef tab
846 c2 c
847 @end lilypond
848
849 Further supported clefs are described under @ref{Mensural clefs}
850 and @ref{Gregorian clefs}.
851
852 @cindex transposing clefs
853 @cindex clef, transposing
854 @cindex octave transposition
855 @cindex choral tenor clef
856 @cindex tenor clef, choral
857
858 By adding@tie{}@code{_8} or@tie{}@code{^8} to the clef name, the
859 clef is transposed one octave down or up, respectively,
860 and@tie{}@code{_15} and@tie{}@code{^15} transpose by two octaves.
861 The clef name must be enclosed in quotes when it contains
862 underscores or digits.
863
864 @lilypond[verbatim,quote,relative=2]
865 \clef treble
866 c2 c
867 \clef "treble_8"
868 c2 c
869 \clef "bass^15"
870 c2 c
871 @end lilypond
872
873
874 @snippets
875
876 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
877 {tweaking-clef-properties.ly}
878
879
880 @seealso
881 Notation Reference:
882 @ref{Mensural clefs}, @ref{Gregorian clefs}.
883
884 Snippets:
885 @rlsr{Pitches}.
886
887 Internals Reference:
888 @rinternals{Clef_engraver},
889 @rinternals{Clef},
890 @rinternals{OctavateEight},
891 @rinternals{clef-interface}.
892
893
894 @node Key signature
895 @unnumberedsubsubsec Key signature
896
897 @cindex key signature
898
899 @funindex \key
900 @funindex key
901
902 @c duplicated in Key signature and Accidentals
903 @warning{New users are sometimes confused about accidentals and
904 key signatures.  In LilyPond, note names are the raw input; key
905 signatures and clefs determine how this raw input is displayed.
906 An unaltered note like@tie{}@code{c} means @q{C natural},
907 regardless of the key signature or clef.  For more information,
908 see @rlearning{Accidentals and key signatures}.}
909
910 The key signature indicates the tonality in which a piece is
911 played.  It is denoted by a set of alterations (flats or sharps)
912 at the start of the staff.  The key signature may be altered:
913
914 @example
915 \key @var{pitch} @var{mode}
916 @end example
917
918 @funindex \major
919 @funindex major
920 @funindex \minor
921 @funindex minor
922 @funindex \ionian
923 @funindex ionian
924 @funindex \locrian
925 @funindex locrian
926 @funindex \aeolian
927 @funindex aeolian
928 @funindex \mixolydian
929 @funindex mixolydian
930 @funindex \lydian
931 @funindex lydian
932 @funindex \phrygian
933 @funindex phrygian
934 @funindex \dorian
935 @funindex dorian
936
937 @cindex church modes
938 @cindex modes
939 @cindex major
940 @cindex minor
941 @cindex ionian
942 @cindex locrian
943 @cindex aeolian
944 @cindex mixolydian
945 @cindex lydian
946 @cindex phrygian
947 @cindex dorian
948
949 Here, @var{mode} should be @code{\major} or @code{\minor} to get a
950 key signature of @var{pitch}-major or @var{pitch}-minor,
951 respectively.  You may also use the standard mode names, also
952 called @notation{church modes}: @code{\ionian}, @code{\dorian},
953 @code{\phrygian}, @code{\lydian}, @code{\mixolydian},
954 @code{\aeolian}, and @code{\locrian}.
955
956 @lilypond[verbatim,quote,relative=2]
957 \key g \major
958 fis1
959 f
960 fis
961 @end lilypond
962
963
964 @snippets
965
966 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
967 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
968
969 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
970 {non-traditional-key-signatures.ly}
971
972
973 @seealso
974 Music Glossary:
975 @rglos{church mode},
976 @rglos{scordatura}.
977
978 Learning Manual:
979 @rlearning{Accidentals and key signatures}.
980
981 Snippets:
982 @rlsr{Pitches}.
983
984 Internals Reference:
985 @rinternals{KeyChangeEvent},
986 @rinternals{Key_engraver},
987 @rinternals{Key_performer},
988 @rinternals{KeyCancellation},
989 @rinternals{KeySignature},
990 @rinternals{key-cancellation-interface},
991 @rinternals{key-signature-interface}.
992
993
994 @node Ottava brackets
995 @unnumberedsubsubsec Ottava brackets
996
997 @cindex ottava
998 @cindex 15ma
999 @cindex 8va
1000 @cindex 8ve
1001 @cindex octavation
1002
1003 @funindex set-octavation
1004 @funindex \ottava
1005 @funindex ottava
1006
1007 @notation{Ottava brackets} introduce an extra transposition of an
1008 octave for the staff:
1009
1010 @lilypond[verbatim,quote,relative=2]
1011 a'2 b
1012 \ottava #1
1013 a b
1014 \ottava #0
1015 a b
1016 @end lilypond
1017
1018 The @code{ottava} function also takes -1 (for 8va bassa),
1019 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
1020
1021
1022 @snippets
1023
1024 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1025 {ottava-text.ly}
1026
1027
1028 @seealso
1029 Music Glossary:
1030 @rglos{octavation}.
1031
1032 Snippets:
1033 @rlsr{Pitches}.
1034
1035 Internals Reference:
1036 @rinternals{Ottava_spanner_engraver},
1037 @rinternals{OttavaBracket},
1038 @rinternals{ottava-bracket-interface}.
1039
1040
1041 @node Instrument transpositions
1042 @unnumberedsubsubsec Instrument transpositions
1043
1044 @cindex transposition, MIDI
1045 @cindex transposition, instrument
1046 @cindex transposing instrument
1047 @cindex MIDI
1048 @cindex MIDI transposition
1049
1050 @funindex \transposition
1051 @funindex transposition
1052
1053 When typesetting scores that involve transposing instruments, some
1054 parts can be typeset in a different pitch than the
1055 @notation{concert pitch}.  In these cases, the key of the
1056 @notation{transposing instrument} should be specified; otherwise
1057 the MIDI output and cues in other parts will produce incorrect
1058 pitches.  For more information about quotations, see
1059 @ref{Quoting other voices}.
1060
1061 @example
1062 \transposition @var{pitch}
1063 @end example
1064
1065 The pitch to use for @code{\transposition} should correspond to
1066 the real sound heard when a@tie{}@code{c'} written on the staff is
1067 played by the transposing instrument.  This pitch is entered in
1068 absolute mode, so an instrument that produces a real sound which
1069 is one tone higher than the printed music should use
1070 @w{@code{\transposition d'}}.  @code{\transposition} should
1071 @emph{only} be used if the pitches are @emph{not} being entered in
1072 concert pitch.
1073
1074 Here are a few notes for violin and B-flat clarinet where the
1075 parts have been entered using the notes and key as they appear in
1076 each part of the conductor's score.  The two instruments are
1077 playing in unison.
1078
1079 @lilypond[verbatim,quote]
1080 \new GrandStaff <<
1081   \new Staff = "violin" {
1082     \relative c'' {
1083       \set Staff.instrumentName = #"Vln"
1084       \set Staff.midiInstrument = #"violin"
1085       % not strictly necessary, but a good reminder
1086       \transposition c'
1087
1088       \key c \major
1089       g4( c8) r c r c4
1090     }
1091   }
1092   \new Staff = "clarinet" {
1093     \relative c'' {
1094       \set Staff.instrumentName = \markup { Cl (B\flat) }
1095       \set Staff.midiInstrument = #"clarinet"
1096       \transposition bes
1097
1098       \key d \major
1099       a4( d8) r d r d4
1100     }
1101   }
1102 >>
1103 @end lilypond
1104
1105 The @code{\transposition} may be changed during a piece.  For
1106 example, a clarinetist may switch from an A clarinet to a B-flat
1107 clarinet.
1108
1109 @lilypond[verbatim,quote,relative=2]
1110 \set Staff.instrumentName = #"Cl (A)"
1111 \key a \major
1112 \transposition a
1113 c d e f
1114 \textLengthOn
1115 s1*0^\markup { Switch to B\flat clarinet }
1116 R1
1117
1118 \key bes \major
1119 \transposition bes
1120 c2 g
1121 @end lilypond
1122
1123
1124 @seealso
1125 Music Glossary:
1126 @rglos{concert pitch},
1127 @rglos{transposing instrument}.
1128
1129 Notation Reference:
1130 @ref{Quoting other voices}, @ref{Transpose}.
1131
1132 Snippets:
1133 @rlsr{Pitches}.
1134
1135
1136 @node Automatic accidentals
1137 @unnumberedsubsubsec Automatic accidentals
1138
1139 @cindex accidental style
1140 @cindex accidental style, default
1141 @cindex accidentals
1142 @cindex accidentals, automatic
1143 @cindex automatic accidentals
1144 @cindex default accidental style
1145
1146 @funindex set-accidental-style
1147 @funindex voice
1148 @funindex default
1149
1150 There are many different conventions on how to typeset
1151 accidentals.  LilyPond provides a function to specify which
1152 accidental style to use.  This function is called as follows:
1153
1154 @example
1155 \new Staff <<
1156   #(set-accidental-style 'voice)
1157   @{ @dots{} @}
1158 >>
1159 @end example
1160
1161 The accidental style applies to the current @code{Staff} by
1162 default (with the exception of the styles @code{piano} and
1163 @code{piano-cautionary}, which are explained below).  Optionally,
1164 the function can take a second argument that determines in which
1165 scope the style should be changed.  For example, to use the same
1166 style in all staves of the current @code{StaffGroup}, use:
1167
1168 @example
1169 #(set-accidental-style 'voice 'StaffGroup)
1170 @end example
1171
1172 The following accidental styles are supported.  To demonstrate
1173 each style, we use the following example:
1174
1175
1176 @lilypond[verbatim,quote]
1177 musicA = {
1178   <<
1179     \relative c' {
1180       cis'8 fis, d'4 <a cis>8 f bis4 |
1181       cis2. <c, g'>4 |
1182     }
1183     \\
1184     \relative c' {
1185       ais'2 cis, |
1186       fis8 b a4 cis2 |
1187     }
1188   >>
1189 }
1190
1191 musicB = {
1192   \clef bass
1193   \new Voice {
1194     \voiceTwo \relative c' {
1195       <fis, a cis>4
1196       \change Staff = up
1197       cis'
1198       \change Staff = down
1199       <fis, a>
1200       \change Staff = up
1201       dis' |
1202       \change Staff = down
1203       <fis, a cis>4 gis <f a d>2 |
1204     }
1205   }
1206 }
1207
1208 \new PianoStaff {
1209   <<
1210     \context Staff = "up" {
1211       #(set-accidental-style 'default)
1212       \musicA
1213     }
1214     \context Staff = "down" {
1215       #(set-accidental-style 'default)
1216       \musicB
1217     }
1218   >>
1219 }
1220 @end lilypond
1221
1222 Note that the last lines of this example can be replaced by the
1223 following, as long as the same accidental style should be used in
1224 both staves.
1225
1226 @example
1227 \new PianoStaff @{
1228   <<
1229     \context Staff = "up" @{
1230       %%% change the next line as desired:
1231       #(set-accidental-style 'default 'Score)
1232       \musicA
1233     @}
1234     \context Staff = "down" @{
1235       \musicB
1236     @}
1237   >>
1238 @}
1239 @end example
1240
1241
1242 @c don't use verbatim in this table.
1243 @table @code
1244 @item default
1245
1246 @cindex default accidental style
1247 @cindex accidental style, default
1248
1249 @funindex default
1250
1251 This is the default typesetting behavior.  It corresponds to
1252 eighteenth-century common practice: accidentals are remembered to
1253 the end of the measure in which they occur and only in their own
1254 octave.  Thus, in the example below, no natural signs are printed
1255 before the@tie{}@code{b} in the second measure or the
1256 last@tie{}@code{c}:
1257
1258 @lilypond[quote]
1259 musicA = {
1260   <<
1261     \relative c' {
1262       cis'8 fis, d'4 <a cis>8 f bis4 |
1263       cis2. <c, g'>4 |
1264     }
1265     \\
1266     \relative c' {
1267       ais'2 cis, |
1268       fis8 b a4 cis2 |
1269     }
1270   >>
1271 }
1272
1273 musicB = {
1274   \clef bass
1275   \new Voice {
1276     \voiceTwo \relative c' {
1277       <fis, a cis>4
1278       \change Staff = up
1279       cis'
1280       \change Staff = down
1281       <fis, a>
1282       \change Staff = up
1283       dis' |
1284       \change Staff = down
1285       <fis, a cis>4 gis <f a d>2 |
1286     }
1287   }
1288 }
1289
1290 \new PianoStaff {
1291   <<
1292     \context Staff = "up" {
1293       #(set-accidental-style 'default)
1294       \musicA
1295     }
1296     \context Staff = "down" {
1297       #(set-accidental-style 'default)
1298       \musicB
1299     }
1300   >>
1301 }
1302 @end lilypond
1303
1304 @item voice
1305
1306 @cindex accidental style, voice
1307 @cindex voice accidental style
1308 @cindex accidental style, modern
1309 @cindex modern accidental style
1310 @cindex accidental style, modern-cautionary
1311 @cindex modern-cautionary accidental style
1312
1313 @funindex voice
1314
1315 The normal behavior is to remember the accidentals at
1316 @code{Staff}-level.  In this style, however, accidentals are
1317 typeset individually for each voice.  Apart from that, the rule is
1318 similar to @code{default}.
1319
1320 As a result, accidentals from one voice do not get canceled in
1321 other voices, which is often an unwanted result: in the following
1322 example, it is hard to determine whether the second@tie{}@code{a}
1323 should be played natural or sharp.  The @code{voice} option should
1324 therefore be used only if the voices are to be read solely by
1325 individual musicians.  If the staff is to be used by one musician
1326 (e.g., a conductor or in a piano score) then @code{modern} or
1327 @code{modern-cautionary} should be used instead.
1328
1329
1330 @lilypond[quote]
1331 musicA = {
1332   <<
1333     \relative c' {
1334       cis'8 fis, d'4 <a cis>8 f bis4 |
1335       cis2. <c, g'>4 |
1336     }
1337     \\
1338     \relative c' {
1339       ais'2 cis, |
1340       fis8 b a4 cis2 |
1341     }
1342   >>
1343 }
1344
1345 musicB = {
1346   \clef bass
1347   \new Voice {
1348     \voiceTwo \relative c' {
1349       <fis, a cis>4
1350       \change Staff = up
1351       cis'
1352       \change Staff = down
1353       <fis, a>
1354       \change Staff = up
1355       dis' |
1356       \change Staff = down
1357       <fis, a cis>4 gis <f a d>2 |
1358     }
1359   }
1360 }
1361
1362 \new PianoStaff {
1363   <<
1364     \context Staff = "up" {
1365       #(set-accidental-style 'voice)
1366       \musicA
1367     }
1368     \context Staff = "down" {
1369       #(set-accidental-style 'voice)
1370       \musicB
1371     }
1372   >>
1373 }
1374 @end lilypond
1375
1376 @item modern
1377
1378 @cindex accidentals, modern style
1379 @cindex modern style accidentals
1380
1381 @funindex modern
1382
1383 This rule corresponds to the common practice in the twentieth
1384 century.  It prints the same accidentals as @code{default}, with
1385 two exceptions that serve to avoid ambiguity: after temporary
1386 accidentals, cancellation marks are printed also in the following
1387 measure (for notes in the same octave) and, in the same measure,
1388 for notes in other octaves.  Hence the naturals before
1389 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1390 the upper staff:
1391
1392 @lilypond[quote]
1393 musicA = {
1394   <<
1395     \relative c' {
1396       cis'8 fis, d'4 <a cis>8 f bis4 |
1397       cis2. <c, g'>4 |
1398     }
1399     \\
1400     \relative c' {
1401       ais'2 cis, |
1402       fis8 b a4 cis2 |
1403     }
1404   >>
1405 }
1406
1407 musicB = {
1408   \clef bass
1409   \new Voice {
1410     \voiceTwo \relative c' {
1411       <fis, a cis>4
1412       \change Staff = up
1413       cis'
1414       \change Staff = down
1415       <fis, a>
1416       \change Staff = up
1417       dis' |
1418       \change Staff = down
1419       <fis, a cis>4 gis <f a d>2 |
1420     }
1421   }
1422 }
1423
1424 \new PianoStaff {
1425   <<
1426     \context Staff = "up" {
1427       #(set-accidental-style 'modern)
1428       \musicA
1429     }
1430     \context Staff = "down" {
1431       #(set-accidental-style 'modern)
1432       \musicB
1433     }
1434   >>
1435 }
1436 @end lilypond
1437
1438 @item modern-cautionary
1439
1440 @cindex accidentals, modern cautionary style
1441 @cindex modern accidental style
1442 @cindex modern cautionary accidental style
1443 @cindex modern style accidentals
1444 @cindex modern style cautionary accidentals
1445
1446 @funindex modern-cautionary
1447
1448 This rule is similar to @code{modern}, but the @q{extra}
1449 accidentals (the ones not typeset by @code{default}) are typeset
1450 as cautionary accidentals.  They are by default printed with
1451 parentheses, but they can also be printed in reduced size by
1452 defining the @code{cautionary-style} property of
1453 @code{AccidentalSuggestion}.
1454
1455 @lilypond[quote]
1456 musicA = {
1457   <<
1458     \relative c' {
1459       cis'8 fis, d'4 <a cis>8 f bis4 |
1460       cis2. <c, g'>4 |
1461     }
1462     \\
1463     \relative c' {
1464       ais'2 cis, |
1465       fis8 b a4 cis2 |
1466     }
1467   >>
1468 }
1469
1470 musicB = {
1471   \clef bass
1472   \new Voice {
1473     \voiceTwo \relative c' {
1474       <fis, a cis>4
1475       \change Staff = up
1476       cis'
1477       \change Staff = down
1478       <fis, a>
1479       \change Staff = up
1480       dis' |
1481       \change Staff = down
1482       <fis, a cis>4 gis <f a d>2 |
1483     }
1484   }
1485 }
1486
1487 \new PianoStaff {
1488   <<
1489     \context Staff = "up" {
1490       #(set-accidental-style 'modern-cautionary)
1491       \musicA
1492     }
1493     \context Staff = "down" {
1494       #(set-accidental-style 'modern-cautionary)
1495       \musicB
1496     }
1497   >>
1498 }
1499 @end lilypond
1500
1501 @item modern-voice
1502
1503 @cindex accidental style, modern
1504 @cindex accidentals, modern
1505 @cindex accidentals, multivoice
1506 @cindex modern accidental style
1507 @cindex modern accidentals
1508 @cindex multivoice accidentals
1509
1510 @funindex modern-voice
1511
1512 This rule is used for multivoice accidentals to be read both by
1513 musicians playing one voice and musicians playing all voices.
1514 Accidentals are typeset for each voice, but they @emph{are}
1515 canceled across voices in the same @code{Staff}.  Hence,
1516 the@tie{}@code{a} in the last measure is canceled because the
1517 previous cancellation was in a different voice, and
1518 the@tie{}@code{d} in the lower staff is canceled because of the
1519 accidental in a different voice in the previous measure:
1520
1521 @lilypond[quote]
1522 musicA = {
1523   <<
1524     \relative c' {
1525       cis'8 fis, d'4 <a cis>8 f bis4 |
1526       cis2. <c, g'>4 |
1527     }
1528     \\
1529     \relative c' {
1530       ais'2 cis, |
1531       fis8 b a4 cis2 |
1532     }
1533   >>
1534 }
1535
1536 musicB = {
1537   \clef bass
1538   \new Voice {
1539     \voiceTwo \relative c' {
1540       <fis, a cis>4
1541       \change Staff = up
1542       cis'
1543       \change Staff = down
1544       <fis, a>
1545       \change Staff = up
1546       dis' |
1547       \change Staff = down
1548       <fis, a cis>4 gis <f a d>2 |
1549     }
1550   }
1551 }
1552
1553 \new PianoStaff {
1554   <<
1555     \context Staff = "up" {
1556       #(set-accidental-style 'modern-voice)
1557       \musicA
1558     }
1559     \context Staff = "down" {
1560       #(set-accidental-style 'modern-voice)
1561       \musicB
1562     }
1563   >>
1564 }
1565 @end lilypond
1566
1567 @cindex accidental style, cautionary, modern voice
1568 @cindex accidental style, modern voice cautionary
1569 @cindex accidental style, voice, modern cautionary
1570
1571 @funindex modern-voice-cautionary
1572
1573 @item modern-voice-cautionary
1574
1575 This rule is the same as @code{modern-voice}, but with the extra
1576 accidentals (the ones not typeset by @code{voice}) typeset as
1577 cautionaries.  Even though all accidentals typeset by
1578 @code{default} @emph{are} typeset with this rule, some of them are
1579 typeset as cautionaries.
1580
1581 @lilypond[quote]
1582 musicA = {
1583   <<
1584     \relative c' {
1585       cis'8 fis, d'4 <a cis>8 f bis4 |
1586       cis2. <c, g'>4 |
1587     }
1588     \\
1589     \relative c' {
1590       ais'2 cis, |
1591       fis8 b a4 cis2 |
1592     }
1593   >>
1594 }
1595
1596 musicB = {
1597   \clef bass
1598   \new Voice {
1599     \voiceTwo \relative c' {
1600       <fis, a cis>4
1601       \change Staff = up
1602       cis'
1603       \change Staff = down
1604       <fis, a>
1605       \change Staff = up
1606       dis' |
1607       \change Staff = down
1608       <fis, a cis>4 gis <f a d>2 |
1609     }
1610   }
1611 }
1612
1613 \new PianoStaff {
1614   <<
1615     \context Staff = "up" {
1616       #(set-accidental-style 'modern-voice-cautionary)
1617       \musicA
1618     }
1619     \context Staff = "down" {
1620       #(set-accidental-style 'modern-voice-cautionary)
1621       \musicB
1622     }
1623   >>
1624 }
1625 @end lilypond
1626
1627 @item piano
1628
1629 @cindex accidental style, piano
1630 @cindex accidentals, piano
1631 @cindex piano accidental style
1632 @cindex piano accidentals
1633
1634 @funindex piano
1635
1636 This rule reflects twentieth-century practice for piano notation.
1637 Its behavior is very similar to @code{modern} style, but here
1638 accidentals also get canceled across the staves in the same
1639 @code{GrandStaff} or @code{PianoStaff}, hence all the
1640 cancellations of the final notes.
1641
1642 This accidental style applies to the current @code{GrandStaff} or
1643 @code{PianoStaff} by default.
1644
1645 @lilypond[quote]
1646 musicA = {
1647   <<
1648     \relative c' {
1649       cis'8 fis, d'4 <a cis>8 f bis4 |
1650       cis2. <c, g'>4 |
1651     }
1652     \\
1653     \relative c' {
1654       ais'2 cis, |
1655       fis8 b a4 cis2 |
1656     }
1657   >>
1658 }
1659
1660 musicB = {
1661   \clef bass
1662   \new Voice {
1663     \voiceTwo \relative c' {
1664       <fis, a cis>4
1665       \change Staff = up
1666       cis'
1667       \change Staff = down
1668       <fis, a>
1669       \change Staff = up
1670       dis' |
1671       \change Staff = down
1672       <fis, a cis>4 gis <f a d>2 |
1673     }
1674   }
1675 }
1676
1677 \new PianoStaff {
1678   <<
1679     \context Staff = "up" {
1680       #(set-accidental-style 'piano)
1681       \musicA
1682     }
1683     \context Staff = "down" {
1684       \musicB
1685     }
1686   >>
1687 }
1688 @end lilypond
1689
1690 @item piano-cautionary
1691
1692 @cindex accidentals, piano cautionary
1693 @cindex cautionary accidentals, piano
1694 @cindex piano cautionary accidentals
1695 @cindex accidental style, piano cautionary
1696 @cindex cautionary accidental style, piano
1697 @cindex piano cautionary accidental style
1698
1699 @funindex piano-cautionary
1700
1701 This is the same as @code{piano} but with the extra accidentals
1702 typeset as cautionaries.
1703
1704 @lilypond[quote]
1705 musicA = {
1706   <<
1707     \relative c' {
1708       cis'8 fis, d'4 <a cis>8 f bis4 |
1709       cis2. <c, g'>4 |
1710     }
1711     \\
1712     \relative c' {
1713       ais'2 cis, |
1714       fis8 b a4 cis2 |
1715     }
1716   >>
1717 }
1718
1719 musicB = {
1720   \clef bass
1721   \new Voice {
1722     \voiceTwo \relative c' {
1723       <fis, a cis>4
1724       \change Staff = up
1725       cis'
1726       \change Staff = down
1727       <fis, a>
1728       \change Staff = up
1729       dis' |
1730       \change Staff = down
1731       <fis, a cis>4 gis <f a d>2 |
1732     }
1733   }
1734 }
1735
1736 \new PianoStaff {
1737   <<
1738     \context Staff = "up" {
1739       #(set-accidental-style 'piano-cautionary)
1740       \musicA
1741     }
1742     \context Staff = "down" {
1743       \musicB
1744     }
1745   >>
1746 }
1747 @end lilypond
1748
1749
1750 @item neo-modern
1751
1752 @cindex neo-modern accidental style
1753 @cindex accidental style, neo-modern
1754
1755 @funindex neo-modern
1756
1757 This rule reproduces a common practice in contemporary music:
1758 accidentals are printed like with @code{modern}, but they are printed
1759 again if the same note appears later in the same measure -- except
1760 if the note is immediately repeated.
1761
1762 @lilypond[quote]
1763 musicA = {
1764   <<
1765     \relative c' {
1766       cis'8 fis, d'4 <a cis>8 f bis4 |
1767       cis2. <c, g'>4 |
1768     }
1769     \\
1770     \relative c' {
1771       ais'2 cis, |
1772       fis8 b a4 cis2 |
1773     }
1774   >>
1775 }
1776
1777 musicB = {
1778   \clef bass
1779   \new Voice {
1780     \voiceTwo \relative c' {
1781       <fis, a cis>4
1782       \change Staff = up
1783       cis'
1784       \change Staff = down
1785       <fis, a>
1786       \change Staff = up
1787       dis' |
1788       \change Staff = down
1789       <fis, a cis>4 gis <f a d>2 |
1790     }
1791   }
1792 }
1793
1794 \new PianoStaff {
1795   <<
1796     \context Staff = "up" {
1797       #(set-accidental-style 'neo-modern)
1798       \musicA
1799     }
1800     \context Staff = "down" {
1801       #(set-accidental-style 'neo-modern)
1802       \musicB
1803     }
1804   >>
1805 }
1806 @end lilypond
1807
1808 @item neo-modern-cautionary
1809
1810 @cindex neo-modern-cautionary accidental style
1811 @cindex accidental style, neo-modern-cautionary
1812
1813 @funindex neo-modern-cautionary
1814
1815 This rule is similar to @code{neo-modern}, but the extra
1816 accidentals are printed as cautionary accidentals.
1817
1818 @lilypond[quote]
1819 musicA = {
1820   <<
1821     \relative c' {
1822       cis'8 fis, d'4 <a cis>8 f bis4 |
1823       cis2. <c, g'>4 |
1824     }
1825     \\
1826     \relative c' {
1827       ais'2 cis, |
1828       fis8 b a4 cis2 |
1829     }
1830   >>
1831 }
1832
1833 musicB = {
1834   \clef bass
1835   \new Voice {
1836     \voiceTwo \relative c' {
1837       <fis, a cis>4
1838       \change Staff = up
1839       cis'
1840       \change Staff = down
1841       <fis, a>
1842       \change Staff = up
1843       dis' |
1844       \change Staff = down
1845       <fis, a cis>4 gis <f a d>2 |
1846     }
1847   }
1848 }
1849
1850 \new PianoStaff {
1851   <<
1852     \context Staff = "up" {
1853       #(set-accidental-style 'neo-modern-cautionary)
1854       \musicA
1855     }
1856     \context Staff = "down" {
1857       #(set-accidental-style 'neo-modern-cautionary)
1858       \musicB
1859     }
1860   >>
1861 }
1862 @end lilypond
1863
1864
1865 @item dodecaphonic
1866
1867 @cindex dodecaphonic accidental style
1868 @cindex dodecaphonic style, neo-modern
1869
1870 @funindex dodecaphonic
1871
1872 This rule reflects a practice introduced by composers at
1873 the beginning of the 20th century, in an attempt to
1874 abolish the hierarchy between natural and non-natural notes.
1875 With this style, @emph{every} note gets an accidental sign,
1876 including natural signs.
1877
1878 @lilypond[quote]
1879 musicA = {
1880   <<
1881     \relative c' {
1882       cis'8 fis, d'4 <a cis>8 f bis4 |
1883       cis2. <c, g'>4 |
1884     }
1885     \\
1886     \relative c' {
1887       ais'2 cis, |
1888       fis8 b a4 cis2 |
1889     }
1890   >>
1891 }
1892
1893 musicB = {
1894   \clef bass
1895   \new Voice {
1896     \voiceTwo \relative c' {
1897       <fis, a cis>4
1898       \change Staff = up
1899       cis'
1900       \change Staff = down
1901       <fis, a>
1902       \change Staff = up
1903       dis' |
1904       \change Staff = down
1905       <fis, a cis>4 gis <f a d>2 |
1906     }
1907   }
1908 }
1909
1910 \new PianoStaff {
1911   <<
1912     \context Staff = "up" {
1913       #(set-accidental-style 'dodecaphonic)
1914       \musicA
1915     }
1916     \context Staff = "down" {
1917       #(set-accidental-style 'dodecaphonic)
1918       \musicB
1919     }
1920   >>
1921 }
1922 @end lilypond
1923
1924
1925 @item teaching
1926
1927 @cindex teaching accidental style
1928 @cindex accidental style, teaching
1929
1930 @funindex teaching
1931
1932 This rule is intended for students, and makes it easy to create
1933 scale sheets with automagically created cautionary accidentals.
1934 Accidentals are printed like with @code{modern}, but cautionary
1935 accidentals are added for all sharp or flat tones specified by the
1936 key signature, except if the note is immediately repeated.
1937
1938 @lilypond[quote]
1939 musicA = {
1940   <<
1941     \relative c' {
1942       cis'8 fis, d'4 <a cis>8 f bis4 |
1943       cis2. <c, g'>4 |
1944     }
1945     \\
1946     \relative c' {
1947       ais'2 cis, |
1948       fis8 b a4 cis2 |
1949     }
1950   >>
1951 }
1952
1953 musicB = {
1954   \clef bass
1955   \new Voice {
1956     \voiceTwo \relative c' {
1957       <fis, a cis>4
1958       \change Staff = up
1959       cis'
1960       \change Staff = down
1961       <fis, a>
1962       \change Staff = up
1963       dis' |
1964       \change Staff = down
1965       <fis, a cis>4 gis <f a d>2 |
1966     }
1967   }
1968 }
1969
1970 \new PianoStaff {
1971   <<
1972     \context Staff = "up" {
1973       \key fis \minor
1974       #(set-accidental-style 'teaching)
1975       \musicA
1976     }
1977     \context Staff = "down" {
1978       \key fis \minor
1979       #(set-accidental-style 'teaching)
1980       \musicB
1981     }
1982   >>
1983 }
1984 @end lilypond
1985
1986
1987
1988 @item no-reset
1989
1990 @cindex accidental style, no reset
1991 @cindex no reset accidental style
1992
1993 @funindex no-reset
1994
1995 This is the same as @code{default} but with accidentals lasting
1996 @q{forever} and not only within the same measure:
1997
1998 @lilypond[quote]
1999 musicA = {
2000   <<
2001     \relative c' {
2002       cis'8 fis, d'4 <a cis>8 f bis4 |
2003       cis2. <c, g'>4 |
2004     }
2005     \\
2006     \relative c' {
2007       ais'2 cis, |
2008       fis8 b a4 cis2 |
2009     }
2010   >>
2011 }
2012
2013 musicB = {
2014   \clef bass
2015   \new Voice {
2016     \voiceTwo \relative c' {
2017       <fis, a cis>4
2018       \change Staff = up
2019       cis'
2020       \change Staff = down
2021       <fis, a>
2022       \change Staff = up
2023       dis' |
2024       \change Staff = down
2025       <fis, a cis>4 gis <f a d>2 |
2026     }
2027   }
2028 }
2029
2030 \new PianoStaff {
2031   <<
2032     \context Staff = "up" {
2033       #(set-accidental-style 'no-reset)
2034       \musicA
2035     }
2036     \context Staff = "down" {
2037       #(set-accidental-style 'no-reset)
2038       \musicB
2039     }
2040   >>
2041 }
2042 @end lilypond
2043
2044 @item forget
2045
2046 @cindex forget accidental style
2047 @cindex accidental style, forget
2048
2049 @funindex forget
2050
2051 This is the opposite of @code{no-reset}: Accidentals are not
2052 remembered at all -- and hence all accidentals are typeset
2053 relative to the key signature, regardless of what came before in
2054 the music.  Unlike @code{dodecaphonic}, this rule never prints
2055 any naturals.
2056
2057 @lilypond[quote]
2058 musicA = {
2059   <<
2060     \relative c' {
2061       cis'8 fis, d'4 <a cis>8 f bis4 |
2062       cis2. <c, g'>4 |
2063     }
2064     \\
2065     \relative c' {
2066       ais'2 cis, |
2067       fis8 b a4 cis2 |
2068     }
2069   >>
2070 }
2071
2072 musicB = {
2073   \clef bass
2074   \new Voice {
2075     \voiceTwo \relative c' {
2076       <fis, a cis>4
2077       \change Staff = up
2078       cis'
2079       \change Staff = down
2080       <fis, a>
2081       \change Staff = up
2082       dis' |
2083       \change Staff = down
2084       <fis, a cis>4 gis <f a d>2 |
2085     }
2086   }
2087 }
2088
2089 \new PianoStaff {
2090   <<
2091     \context Staff = "up" {
2092       #(set-accidental-style 'forget)
2093       \musicA
2094     }
2095     \context Staff = "down" {
2096       #(set-accidental-style 'forget)
2097       \musicB
2098     }
2099   >>
2100 }
2101 @end lilypond
2102 @end table
2103
2104 @snippets
2105
2106 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2107 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
2108
2109
2110 @seealso
2111 Snippets:
2112 @rlsr{Pitches}.
2113
2114 Internals Reference:
2115 @rinternals{Accidental},
2116 @rinternals{Accidental_engraver},
2117 @rinternals{GrandStaff} and
2118 @rinternals{PianoStaff},
2119 @rinternals{Staff},
2120 @rinternals{AccidentalSuggestion},
2121 @rinternals{AccidentalPlacement},
2122 @rinternals{accidental-suggestion-interface}.
2123
2124
2125 @cindex accidentals and simultaneous notes
2126 @cindex simultaneous notes and accidentals
2127 @cindex accidentals in chords
2128 @cindex chords, accidentals in
2129
2130 @knownissues
2131
2132 Simultaneous notes are considered to be entered in sequential
2133 mode.  This means that in a chord the accidentals are typeset as
2134 if the notes in the chord happen one at a time, in the order in
2135 which they appear in the input file.  This is a problem when
2136 accidentals in a chord depend on each other, which does not happen
2137 for the default accidental style.  The problem can be solved by
2138 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
2139 problematic notes.
2140
2141
2142 @node Ambitus
2143 @unnumberedsubsubsec Ambitus
2144
2145 @cindex ambitus
2146 @cindex range of pitches
2147 @cindex pitch range
2148
2149 The term @notation{ambitus} (pl. ambitus) denotes a range of
2150 pitches for a given voice in a part of music.  It may also denote
2151 the pitch range that a musical instrument is capable of playing.
2152 Ambitus are printed on vocal parts so that performers can easily
2153 determine if it matches their capabilities.
2154
2155 Ambitus are denoted at the beginning of a piece near the initial
2156 clef.  The range is graphically specified by two note heads that
2157 represent the lowest and highest pitches.  Accidentals are only
2158 printed if they are not part of the key signature.
2159
2160 @lilypond[verbatim,quote]
2161 \layout {
2162   \context {
2163     \Voice
2164     \consists "Ambitus_engraver"
2165   }
2166 }
2167
2168 \relative c'' {
2169   aes c e2
2170   cis,1
2171 }
2172 @end lilypond
2173
2174
2175 @snippets
2176
2177 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2178 {adding-ambitus-per-voice.ly}
2179
2180 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2181 {ambitus-with-multiple-voices.ly}
2182
2183
2184 @seealso
2185 Music Glossary:
2186 @rglos{ambitus}.
2187
2188 Snippets:
2189 @rlsr{Pitches}.
2190
2191 Internals Reference:
2192 @rinternals{Ambitus_engraver},
2193 @rinternals{Voice},
2194 @rinternals{Staff},
2195 @rinternals{Ambitus},
2196 @rinternals{AmbitusAccidental},
2197 @rinternals{AmbitusLine},
2198 @rinternals{AmbitusNoteHead},
2199 @rinternals{ambitus-interface}.
2200
2201
2202 @knownissues
2203
2204 There is no collision handling in the case of multiple per-voice
2205 ambitus.
2206
2207
2208 @node Note heads
2209 @subsection Note heads
2210
2211 This section suggests ways of altering note heads.
2212
2213 @menu
2214 * Special note heads::
2215 * Easy notation note heads::
2216 * Shape note heads::
2217 * Improvisation::
2218 @end menu
2219
2220 @node Special note heads
2221 @unnumberedsubsubsec Special note heads
2222
2223 @cindex note heads, special
2224 @cindex note heads, cross
2225 @cindex note heads, diamond
2226 @cindex note heads, parlato
2227 @cindex note heads, harmonic
2228 @cindex note heads, guitar
2229 @cindex special note heads
2230 @cindex cross note heads
2231 @cindex diamond note heads
2232 @cindex parlato note heads
2233 @cindex harmonic note heads
2234 @cindex guitar note heads
2235 @cindex note head styles
2236 @cindex styles, note heads
2237
2238 @funindex cross
2239
2240 Note heads may be altered:
2241
2242 @lilypond[verbatim,quote,relative=2]
2243 c4 b a b
2244 \override NoteHead #'style = #'cross
2245 c4 b a b
2246 \revert NoteHead #'style
2247 c4 d e f
2248 @end lilypond
2249
2250 There is a shorthand for diamond shapes which can only be used
2251 inside chords:
2252
2253 @lilypond[verbatim,quote,relative=2]
2254 <c f\harmonic>2 <d a'\harmonic>4 <c g'\harmonic>
2255 @end lilypond
2256
2257 @noindent
2258 To see all note head styles, see @ref{Note head styles}.
2259
2260
2261 @seealso
2262 Snippets:
2263 @rlsr{Pitches}.
2264
2265 Notation Reference:
2266 @ref{Note head styles},
2267 @ref{Chorded notes}.
2268
2269 Internals Reference:
2270 @rinternals{note-event},
2271 @rinternals{Note_heads_engraver},
2272 @rinternals{Ledger_line_engraver},
2273 @rinternals{NoteHead},
2274 @rinternals{LedgerLineSpanner},
2275 @rinternals{note-head-interface},
2276 @rinternals{ledger-line-spanner-interface}.
2277
2278
2279 @node Easy notation note heads
2280 @unnumberedsubsubsec Easy notation note heads
2281
2282 @cindex note heads, practice
2283 @cindex practice note heads
2284 @cindex note heads, easy notation
2285 @cindex easy notation
2286 @cindex Hal Leonard
2287 @cindex beginners' music
2288 @cindex music, beginners'
2289 @cindex easy play note heads
2290 @cindex note heads, easy play
2291
2292 @funindex \easyHeadsOn
2293 @funindex easyHeadsOn
2294 @funindex \easyHeadsOff
2295 @funindex easyHeadsOff
2296
2297 The @q{easy play} note head includes a note name inside the head.
2298 It is used in music for beginners.  To make the letters readable,
2299 it should be printed in a large font size.  To print with a larger
2300 font, see @ref{Setting the staff size}.
2301
2302 @lilypond[verbatim,quote]
2303 #(set-global-staff-size 26)
2304 \relative c' {
2305   \easyHeadsOn
2306   c2 e4 f
2307   g1
2308   \easyHeadsOff
2309   c,1
2310 }
2311 @end lilypond
2312
2313
2314 @predefined
2315 @code{\easyHeadsOn},
2316 @code{\easyHeadsOff}.
2317 @endpredefined
2318
2319
2320 @seealso
2321 Notation Reference:
2322 @ref{Setting the staff size}.
2323
2324 Snippets:
2325 @rlsr{Pitches}.
2326
2327 Internals Reference:
2328 @rinternals{note-event},
2329 @rinternals{Note_heads_engraver},
2330 @rinternals{NoteHead},
2331 @rinternals{note-head-interface}.
2332
2333
2334 @node Shape note heads
2335 @unnumberedsubsubsec Shape note heads
2336
2337 @cindex note heads, shape
2338 @cindex note heads, Aiken
2339 @cindex note heads, sacred harp
2340 @cindex shape notes
2341 @cindex Aiken shape note heads
2342 @cindex sacred harp note heads
2343
2344 @funindex \key
2345 @funindex key
2346 @funindex \aikenHeads
2347 @funindex aikenHeads
2348 @funindex \sacredHarpHeads
2349 @funindex sacredHarpHeads
2350
2351 In shape note head notation, the shape of the note head
2352 corresponds to the harmonic function of a note in the scale.  This
2353 notation was popular in nineteenth-century American song books.
2354 Shape note heads can be produced:
2355
2356 @lilypond[verbatim,quote,relative=2]
2357 \aikenHeads
2358 c, d e f g a b c
2359 \sacredHarpHeads
2360 c, d e f g a b c
2361 @end lilypond
2362
2363 Shapes are typeset according to the step in the scale, where the
2364 base of the scale is determined by the @code{\key} command.
2365
2366
2367 @predefined
2368 @code{\aikenHeads},
2369 @code{\sacredHarpHeads}.
2370 @endpredefined
2371
2372
2373 @snippets
2374
2375 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2376 {applying-note-head-styles-depending-on-the-step-of-the-scale.ly}
2377
2378 @noindent
2379 To see all note head styles, see @ref{Note head styles}.
2380
2381
2382 @seealso
2383 Snippets:
2384 @rlsr{Pitches}.
2385
2386 Notation Reference:
2387 @ref{Note head styles}.
2388
2389 Internals Reference:
2390 @rinternals{note-event},
2391 @rinternals{Note_heads_engraver},
2392 @rinternals{NoteHead},
2393 @rinternals{note-head-interface}.
2394
2395
2396 @node Improvisation
2397 @unnumberedsubsubsec Improvisation
2398
2399 @cindex improvisation
2400 @cindex slashed note heads
2401 @cindex note heads, improvisation
2402 @cindex note heads, slashed
2403
2404 @funindex \improvisationOn
2405 @funindex improvisationOn
2406 @funindex \improvisationOff
2407 @funindex improvisationOff
2408
2409 Improvisation is sometimes denoted with slashed note heads, where
2410 the performer may choose any pitch but should play the specified
2411 rhythm.  Such note heads can be created:
2412
2413 @lilypond[verbatim,quote,relative=2]
2414 \new Voice \with {
2415   \consists "Pitch_squash_engraver"
2416 } {
2417   e8 e g a a16( bes) a8 g
2418   \improvisationOn
2419   e8 ~
2420   e2 ~ e8 f4 f8 ~
2421   f2
2422   \improvisationOff
2423   a16( bes) a8 g e
2424 }
2425 @end lilypond
2426
2427
2428 @predefined
2429 @code{\improvisationOn},
2430 @code{\improvisationOff}.
2431 @endpredefined
2432
2433
2434 @seealso
2435 Snippets:
2436 @rlsr{Pitches}.
2437
2438 Internals Reference:
2439 @rinternals{Pitch_squash_engraver},
2440 @rinternals{Voice},
2441 @rinternals{RhythmicStaff}.
2442
2443