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