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