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