]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/notation.itely
* scm/fret-diagrams.scm (label-fret): use cond instead of case for
[lilypond.git] / Documentation / user / notation.itely
1 @c Note: -*-texinfo-*-
2 @c This file is part of lilypond.tely
3
4 @c A menu is needed before every deeper *section nesting of @node's; run
5 @c     M-x texinfo-all-menus-update
6 @c to automatically fill in these menus before saving changes
7
8 @node Notation manual
9 @chapter Notation manual
10
11 This chapter describes all the different types of notation supported
12 by LilyPond. It is intended as a reference for users that are already
13 somewhat familiar with LilyPond.
14
15 @menu
16 * Note entry::                  
17 * Easier music entry::          
18 * Staff notation::              
19 * Polyphony::                   
20 * Beaming::                     
21 * Accidentals::                 
22 * Expressive marks::            
23 * Repeats::                     
24 * Rhythmic music::              
25 * Piano music::                 
26 * Vocal music::                 
27 * Other instrument specific notation::  
28 * Tablatures::                  
29 * Popular music::               
30 * Orchestral music::            
31 * Formatting cue notes::        
32 * Ancient notation::            
33 * Contemporary notation::       
34 * Educational use::             
35 @end menu
36
37 @c FIXME: Note entry vs Music entry at top level menu is confusing.
38
39 @node Note entry
40 @section Note entry
41 @cindex Note entry
42
43 This section is about basic notation elements notes, rests and
44 related constructs, such as stems, tuplets and ties.
45
46 @menu
47 * Notes::                       
48 * Pitches::                     
49 * Chromatic alterations::       
50 * Micro tones::                 
51 * Chords::                      
52 * Rests::                       
53 * Skips::                       
54 * Durations::                   
55 * Augmentation dots::           
56 * Scaling durations::           
57 * Stems::                       
58 * Ties::                        
59 * Tuplets::                     
60 @end menu
61
62
63 @node Notes
64 @subsection Notes
65
66
67 A note is printed by specifying its pitch and then its duration,
68
69 @lilypond[quote,verbatim]
70 { cis'4 d'8 e'16 c'16 }
71 @end lilypond
72
73
74 @node Pitches
75 @subsection Pitches
76
77 @cindex Pitch names
78 @cindex Note specification
79 @cindex pitches
80 @cindex entering notes
81
82 The most common syntax for pitch entry is used in standard notes and
83 @code{\chords} mode.  In these modes, pitches may be designated by
84 names.  The notes are specified by the letters @code{a} through
85 @code{g}, while the octave is formed with notes ranging from @code{c}
86 to @code{b}.  The pitch @code{c} is an octave below middle C and the
87 letters span the octave above that C
88
89 @lilypond[fragment,verbatim,noindent]
90 \clef bass
91 a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c''
92 @end lilypond
93
94 @cindex note names, Dutch
95
96 A sharp is formed by adding @code{-is} to the end of a pitch name and
97 a flat is formed by adding @code{-es}.  Double sharps and double flats
98 are obtained by adding @code{-isis} or @code{-eses}.  These
99 names are the Dutch note names.  In Dutch, @code{aes} is contracted to
100 @code{as}, but both forms are accepted. Similarly, both
101 @code{es} and @code{ees} are accepted.
102
103 @lilypond[fragment,quote,verbatim,relative=2]
104 ceses4
105 ces
106 c
107 cis 
108 cisis
109 @end lilypond
110
111 There are predefined sets of note names for various other languages.
112 To use them,  include the language specific init file.  For
113 example: @code{\include "english.ly"}.  The available language files
114 and the note names they define are
115
116 @anchor{note name}
117 @anchor{note names}
118 @example 
119                         Note Names               sharp       flat
120 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
121 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
122                                                -x (double)
123 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
124 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
125 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
126 italiano.ly    do  re  mi  fa  sol la  sib si  -d          -b
127 catalan.ly     do  re  mi  fa  sol la  sib si  -d/-s       -b 
128 espanol.ly     do  re  mi  fa  sol la  sib si  -s          -b 
129
130 @end example 
131
132 @cindex @code{'}
133 @cindex @code{,}
134
135
136
137 The optional octave specification takes the form of a series of
138 single quote (`@code{'}') characters or a series of comma
139 (`@code{,}') characters.  Each @code{'} raises the pitch by one
140 octave; each @code{,} lowers the pitch by an octave
141
142 @lilypond[quote,fragment,verbatim]
143 c' c'' es' g' as' gisis' ais'
144 @end lilypond
145
146
147 @refcommands
148
149 Notes can be hidden and unhidden with the following commands
150
151 @cindex @code{\hideNotes}
152 @code{\hideNotes}, 
153 @cindex @code{\unHideNotes}
154 @code{\unHideNotes}.
155
156
157 @seealso
158
159 Program reference: @internalsref{NoteEvent}, and @internalsref{NoteHead}.
160
161
162
163 @node Chromatic alterations
164 @subsection Chromatic alterations
165
166 Normally accidentals are printed automatically, but you may also
167 print them manually.  A reminder accidental
168 @cindex reminder accidental
169 @cindex @code{?}
170 can be forced by adding an exclamation mark @code{!}
171 after the pitch.  A cautionary accidental
172 @cindex cautionary accidental
173 @cindex parenthesized accidental
174 (i.e. an accidental within parentheses) can be obtained by adding the
175 question mark `@code{?}' after the pitch
176
177 @lilypond[quote,fragment,verbatim]
178 cis' cis' cis'! cis'?
179 @end lilypond
180
181
182 @seealso
183
184 The automatic production of accidentals can be tuned in many
185 ways. For more information, refer to @ref{Accidentals}.
186
187
188
189 @node Micro tones
190 @subsection Micro tones
191
192 Half-flats and half-sharps are formed by adding @code{-eh} and
193 @code{-ih}; the following is a series of Cs with increasing pitches
194
195 @cindex quarter tones
196 @cindex semi-flats, semi-sharps
197
198 @lilypond[verbatim,quote,relative=2,fragment]
199 { ceseh ceh cih cisih }
200 @end lilypond
201
202 Micro tones are also exported to the MIDI file 
203
204
205 @refbugs
206
207 There are no generally accepted standards for denoting three quarter
208 flats, so LilyPond's symbol does not conform to any standard.
209
210 @node Chords
211 @subsection Chords
212
213 A chord is formed by a enclosing a set of pitches in @code{<} and
214 @code{>}. A chord may be followed by  a duration, and a set of
215 articulations, just like simple notes.
216
217 @lilypond[verbatim,fragment,quote,relative=1]
218 <c e g>4 <c>8 
219 @end lilypond
220
221 @node Rests
222 @subsection Rests
223 @cindex Rests
224
225
226
227
228 Rests are entered like notes, with the note name @code{r}
229
230 @lilypond[fragment,quote,raggedright,verbatim]
231 r1 r2 r4 r8
232 @end lilypond
233
234 Whole bar rests, centered in middle of the bar,
235 must be done  with multi-measure rests. They are discussed in
236 @ref{Multi measure rests}.
237
238
239 A rest's vertical position may be explicitly specified by entering a
240 note with the @code{\rest} keyword appended. This makes manual
241 formatting in polyphonic music easier.  Automatic rest collision
242 formatting will leave these rests alone
243
244 @cindex @code{\rest}
245  
246 @lilypond[fragment,quote,raggedright,verbatim]
247 a'4\rest d'4\rest
248 @end lilypond
249
250 @seealso
251
252 Program reference: @internalsref{RestEvent}, and @internalsref{Rest}.
253
254
255 @c FIXME: naming.
256 @node Skips
257 @subsection Skips
258 @cindex Skip
259 @cindex Invisible rest
260 @cindex Space note
261
262 An invisible rest (also called a `skip') can be entered like a note
263 with note name `@code{s}' or with @code{\skip @var{duration}}
264
265 @lilypond[fragment,quote,raggedright,verbatim,relative=2]
266 a2 s4 a4 \skip 1 a4 
267 @end lilypond
268
269 The @code{s} syntax is only available in note mode and chord mode.  In
270 other situations, for example, when entering lyrics, you should use
271 the @code{\skip} command
272
273 @lilypond[quote,raggedright,verbatim]
274 <<
275   \relative { a'2 a1 }
276   \new Lyrics \lyrics { \skip 2 bla1 }
277 >>
278 @end lilypond
279
280 The skip command is merely an empty musical placeholder.  It does not
281 produce any output, not even transparent output.
282
283 The @code{s} skip command does create @internalsref{Staff} and
284 @internalsref{Voice} when necessary, similar to note and rest
285 commands. For example, the following results in an empty staff.
286
287 @lilypond[quote,raggedright,verbatim]
288 { s4 } 
289 @end lilypond
290
291 The fragment @code{@{ \skip 4 @} } would produce an empty page.
292
293 @seealso
294
295 Program reference: @internalsref{SkipEvent}, @internalsref{SkipMusic}.
296
297
298
299 @node Durations
300 @subsection Durations
301
302
303 @cindex duration
304 @cindex @code{\longa}
305 @cindex @code{\breve}
306 @cindex @code{\maxima}
307
308
309 In Note, Chord, and Lyrics mode, durations are designated by numbers
310 and dots: durations are entered as their reciprocal values.  For example,
311 a quarter note is entered using a @code{4} (since it is a 1/4 note), while
312 a half note is entered using a @code{2} (since it is a 1/2 note).  For notes
313 longer than a whole you must use variables
314
315 @example 
316 c'\breve  
317 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
318 r\longa r\breve  
319 r1 r2 r4 r8 r16 r32 r64 r64 
320 @end example 
321
322 @lilypond[quote,noindent]
323 \score {
324  \relative c'' {
325     a\breve*1/2  \autoBeamOff
326     a1 a2 a4 a8 a16 a32 a64 a64 
327    \bar "empty"
328    \break
329     r\longa*1/4 r\breve  *1/2
330     r1 r2 r4 r8 r16 r32 r64 r64 
331   }
332   \paper {
333     raggedright = ##t
334     \context {
335       \Staff
336         \remove "Clef_engraver"
337         \override StaffSymbol #'transparent = ##t 
338         \override TimeSignature #'transparent = ##t
339         \override BarLine #'transparent = ##t
340         \consists "Pitch_squash_engraver"
341     }
342   }
343 }
344 @end lilypond
345
346
347 @node Augmentation dots
348 @subsection Augmentation dots
349
350 If the duration is omitted then it is set to the previously entered
351 duration. The default for the first note is a quarter note.  The duration
352 can be followed by dots (`@code{.}')  to obtain dotted note
353 lengths
354 @cindex @code{.}
355
356 @lilypond[quote,fragment,verbatim]
357 a' b' c''8 b' a'4 a'4. b'4.. c'8.
358 @end lilypond
359 @cindex @code{r}
360 @cindex @code{s}
361
362 @refcommands
363
364 Dots are normally moved up to avoid staff lines, except in polyphonic
365 situations. The following commands may be used to force a particular
366 direction manually
367
368 @cindex @code{\dotsUp}
369 @code{\dotsUp}, 
370 @cindex @code{\dotsDown}
371 @code{\dotsDown}, 
372 @cindex @code{\dotsBoth}
373 @code{\dotsBoth}.
374
375 @seealso
376
377 Program reference: @internalsref{Dots}, and @internalsref{DotColumn}. 
378
379 @node Scaling durations
380 @subsection Scaling durations
381
382 You can alter the length of duration by a fraction @var{N/M}
383 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
384 will not affect the appearance of the notes or rests produced.
385
386 In the following example, the first three notes take up exactly two
387 beats, but no triplet bracket is printed.
388 @lilypond[quote,fragment,relative=2,verbatim]
389 \time 2/4
390 a4*2/3 gis4*2/3 a4*2/3
391 a4
392 @end lilypond
393
394
395 @seealso
396
397 This manual: @ref{Tuplets}
398
399
400 @node Stems
401 @subsection Stems
402
403 Whenever a note is found, a @internalsref{Stem} object is created
404 automatically. For whole notes and rests, they are also created but
405 made invisible.
406
407 @refcommands
408
409 @cindex @code{\stemUp}
410 @code{\stemUp}, 
411 @cindex @code{\stemDown}
412 @code{\stemDown}, 
413 @cindex @code{\stemBoth}
414 @code{\stemBoth}. 
415
416
417 @node Ties
418 @subsection Ties
419
420 @cindex Tie
421 @cindex ties
422 @cindex @code{~}
423
424 A tie connects two adjacent note heads of the same pitch.  The tie in
425 effect extends the length of a note.  Ties should not be confused with
426 slurs, which indicate articulation, or phrasing slurs, which indicate
427 musical phrasing.  A tie is entered using the tilde symbol `@code{~}'
428
429 @lilypond[quote,fragment,verbatim]
430 e' ~ e' <c' e' g'> ~ <c' e' g'>
431 @end lilypond
432
433 When a tie is applied to a chord, all note heads whose pitches match
434 are connected.  When no note heads match, no ties will be created.
435
436 A tie is just a way of extending a note duration, similar to the
437 augmentation dot. The following example shows two ways of notating
438 exactly the same concept
439 @c
440 @lilypond[quote,fragment,raggedright]
441 \time 3/4 c'2. c'2 ~ c'4
442 @end lilypond
443
444 @noindent
445 Ties are used either when the note crosses a bar line, or when dots
446 cannot be used to denote the rhythm.  When using ties, larger note
447 values should be aligned to subdivisions of the measure, eg.
448
449 @lilypond[fragment]
450 \relative {
451   r8 c8 ~ c2 r4 | r8^"not" c2 ~ c8 r4  
452 }
453 @end lilypond
454
455 If you need to tie a lot of notes over bars, it may be easier to use
456 automatic note splitting (see @ref{Automatic note splitting}). This
457 mechanism automatically splits long notes, and ties them across bar
458 lines.
459
460 @refcommands
461
462
463 @cindex @code{\tieUp}
464 @code{\tieUp}, 
465 @cindex @code{\tieDown}
466 @code{\tieDown}, 
467 @cindex @code{\tieBoth}
468 @code{\tieBoth}, 
469 @cindex @code{\tieDotted}
470 @code{\tieDotted}, 
471 @cindex @code{\tieSolid}
472 @code{\tieSolid}.
473
474 @seealso 
475
476 In this manual: @ref{Automatic note splitting}.
477
478 Program reference: @internalsref{TieEvent}, @internalsref{Tie}.
479
480 @refbugs
481
482
483 Switching staves when a tie is active will not produce a slanted tie.
484
485 Formatting of ties is a difficult subject. The results are often not
486 optimal. 
487
488 @node Tuplets
489 @subsection Tuplets
490
491 @cindex tuplets
492 @cindex triplets
493 @cindex @code{\times}
494
495 Tuplets are made out of a music expression by multiplying all durations
496 with a fraction
497
498 @cindex @code{\times}
499 @example
500 \times @var{fraction} @var{musicexpr}
501 @end example
502
503 @noindent
504 The duration of @var{musicexpr} will be multiplied by the fraction.
505 The fraction's denominator will be printed over the notes, optionally
506 with a bracket.  The most common tuplet is the triplet in which 3
507 notes have the length of 2, so the notes are 2/3 of their written
508 length
509
510 @lilypond[quote,fragment,verbatim]
511 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
512 @end lilypond
513
514 The property @code{tupletSpannerDuration} specifies how long each
515 bracket should last.  With this, you can make lots of tuplets while
516 typing @code{\times} only once, thus saving lots of typing. In the next
517 example, there are two triplets shown, while @code{\times} was only
518 used once
519
520 @lilypond[quote,fragment,relative=1,raggedright,verbatim]
521 \set tupletSpannerDuration = #(ly:make-moment 1 4)
522 \times 2/3 { c'8 c c c c c }
523 @end lilypond
524
525 The format of the number is determined by the property
526 @code{tupletNumberFormatFunction}.  The default prints only the
527 denominator, but if it is set to the Scheme function
528 @code{fraction-tuplet-formatter}, @var{num}:@var{den} will be printed
529 instead.
530
531
532 @cindex @code{tupletNumberFormatFunction}
533 @cindex tuplet formatting 
534
535
536 @refcommands
537
538 @cindex @code{\tupletUp}
539 @code{\tupletUp}, 
540 @cindex @code{\tupletDown}
541 @code{\tupletDown}, 
542 @cindex @code{\tupletBoth}
543 @code{\tupletBoth}.
544
545 @seealso
546
547 User manual: @ref{Changing context properties on the fly} for the
548 @code{\set} command.
549
550
551 Program reference: @internalsref{TupletBracket}, and @internalsref{TimeScaledMusic}.
552
553 Examples: @inputfileref{input/regression,tuplet-nest.ly}.
554
555 @refbugs
556
557 Nested tuplets are not formatted automatically.  In this case, outer
558 tuplet brackets should be moved manually, which is demonstrated in
559 @inputfileref{input/regression,tuplet-nest.ly}.
560
561
562
563 @node Easier music entry
564 @section Easier music entry
565 @cindex Music entry
566
567 This section deals with tricks and features of the input language that
568 were added solely to help entering music and finding and correcting
569 mistakes.  There are also external tools that make debugging easier.
570 See @ref{Point and click} for more information.
571
572 It is also possible to enter and edit music using other programs.  For
573 example, GUI interfaces, or MIDI sequencers. Refer to the LilyPond
574 website for more information.
575
576
577 @menu
578 * Relative octaves::            
579 * Octave check::                
580 * Bar check::                   
581 * Skipping corrected music::    
582 * Automatic note splitting::    
583 @end menu
584
585
586
587
588 @node Relative octaves
589 @subsection Relative octaves
590 @cindex Relative
591 @cindex relative octave specification
592
593 Octaves are specified by adding @code{'} and @code{,} to pitch names.
594 When you copy existing music, it is easy to accidentally put a pitch
595 in the wrong octave and hard to find such an error. The relative
596 octave mode prevents these errors: a single error puts the rest of the
597 piece off by one octave
598
599 @cindex @code{\relative}
600 @example
601   \relative @var{startpitch} @var{musicexpr}
602 @end example
603 or
604 @example
605   \relative @var{musicexpr}
606 @end example
607  
608 The octave of notes that appear in @var{musicexpr} are calculated as
609 follows: If no octave changing marks are used, the basic interval
610 between this and the last note is always taken to be a fourth or
611 less. This distance is determined without regarding alterations; a
612 @code{fisis} following a @code{ceses} will be put above the
613 @code{ceses}.
614
615 The octave changing marks @code{'} and @code{,} can be added to raise
616 or lower the pitch by an extra octave.  Upon entering relative mode,
617 an absolute starting pitch can be specified that will act as the
618 predecessor of the first note of @var{musicexpr}. If no starting pitch
619 is specified, then middle C is used as a start.
620
621 Here is the relative mode shown in action
622 @lilypond[quote,fragment,raggedright,verbatim]
623 \relative c'' {
624   b c d c b c bes a 
625 }
626 @end lilypond
627
628 Octave changing marks are used for intervals greater than a fourth
629 @lilypond[quote,fragment,verbatim]
630 \relative c'' {
631   c g c f, c' a, e''
632 }
633 @end lilypond
634
635 If the preceding item is a chord, the first note of the chord is used
636 to determine the first note of the next chord
637
638 @lilypond[quote,fragment,verbatim]
639 \relative c' {
640   c <c e g> 
641   <c' e g>
642   <c, e' g>
643 }
644 @end lilypond
645
646 The pitch after the @code{\relative} contains a note name.
647
648
649 The relative conversion will not affect @code{\transpose},
650 @code{\chords} or @code{\relative} sections in its argument.  To use
651 relative within transposed music, an additional @code{\relative} must
652 be placed inside @code{\transpose}.
653
654 @node Octave check
655 @subsection Octave check
656
657
658 Octave checks make octave errors easier to correct:  a note may be
659 followed by @code{=}@var{quotes} which indicates what its absolute
660 octave should be.  In the following example,
661 @example
662 \relative c'' @{ c='' b=' d,='' @}        
663 @end example
664
665 @noindent
666 @c take care with @code, adds confusing quotes.
667 the d will generate a warning, because a d'' is expected, but a d' is
668 found.  In the output, the octave is corrected for this and the
669 following notes.
670
671
672
673 There is also a syntax that is separate from the notes. The syntax
674
675 @example
676 \octave @var{pitch}
677 @end example
678
679 This checks that @var{pitch} (without quotes) yields @var{pitch} (with
680 quotes) in \relative mode. If not, a warning is printed, and the
681 octave is corrected, for example, the first check is passed
682 successfully.  The second check fails with an error message.  The
683 octave is adjusted so the following notes are in the correct octave
684 once again.
685 @example
686 \relative c' @{
687   e
688   \octave a'
689   \octave b'
690 @}
691 @end example
692
693
694 The octave of a note following an octave check is determined with
695 respect to the note preceding it. In the next fragment, the last note
696 is a @code{a'}, above middle C. Hence, the @code{\octave} check may
697 be deleted without changing the meaning of the piece.
698
699 @lilypond[quote,verbatim,fragment] 
700 \relative c' {
701   e
702   \octave b
703   a        
704 }
705 @end lilypond
706
707 @node Bar check
708 @subsection Bar check
709 @cindex Bar check
710
711 @cindex bar check
712 @cindex @code{barCheckSynchronize}
713 @cindex @code{|}
714
715 Bar checks help detect errors in the durations.  A bar check is
716 entered using the bar symbol, `@code{|}'.  Whenever it is encountered
717 during interpretation, it should fall on a measure boundary.  If it
718 does not, a warning is printed.  In the next example, the second bar
719 check will signal an error
720 @example
721 \time 3/4 c2 e4 | g2 | 
722 @end example
723
724 Bar checks can also be used in lyrics, for example 
725
726 @example
727 \lyrics @{
728   \time 2/4
729   Twin -- kle | Twin -- kle
730 @} 
731 @end example
732
733
734 @cindex @code{skipTypesetting}
735
736 Failed bar checks are caused by entering incorrect
737 durations. Incorrect durations often completely garble up the score,
738 especially if it is polyphonic, so a good place to correcting input is
739 by scanning for failed bar checks and incorrect durations.  To speed
740 up this process, the @code{skipTypesetting} feature may be used. It is
741 described in the next section.
742
743 @cindex @code{|}
744 @cindex @code{pipeSymbol}
745
746 It is also possible to redefine the meaning of @code{|}. This is done
747 by assigning a music expression to @code{pipeSymbol},
748
749 @lilypond
750 pipeSymbol = \bar "||"
751
752 { c'2 c'2 | c'2 c'2 | }
753 @end lilypond 
754
755
756 @node Skipping corrected music
757 @subsection Skipping corrected music
758
759 The property @code{Score.skipTypesetting} can be used to switch on and
760 off typesetting completely during the interpretation phase. When
761 typesetting is switched off, the music is processed much more quickly.
762 This can be used to skip over the parts of a score that have already
763 been checked for errors
764
765 @lilypond[quote,fragment,raggedright,verbatim]
766 \relative c'' {
767   c8 d
768   \set Score.skipTypesetting = ##t
769   e e e e e e e e
770   \set Score.skipTypesetting = ##f
771   c d b bes a g c2 }
772 @end lilypond
773
774 @node Automatic note splitting
775 @subsection Automatic note splitting
776
777 Long notes can be converted automatically to tied notes.  This is done
778 by replacing the @internalsref{Note_heads_engraver} by the
779 @internalsref{Completion_heads_engraver}.
780 In the following examples, notes crossing the bar line are split and tied.
781
782
783 @lilypond[quote,fragment,verbatim,relative=1,raggedright]
784 \new Voice \with {
785   \remove "Note_heads_engraver"
786   \consists "Completion_heads_engraver"
787 } {
788   c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 
789 }
790 @end lilypond
791
792 This engraver splits all running notes at the bar line, and inserts
793 ties.  One of its uses is to debug complex scores: if the measures are
794 not entirely filled, then the ties exactly show how much each measure
795 is off.
796
797 @refbugs
798
799 Not all durations (especially those containing tuplets) can be
800 represented exactly with normal notes and dots, but the engraver will
801 not insert tuplets.
802
803 @seealso
804
805 Examples: @inputfileref{input/regression,completion-heads.ly}.
806
807 @noindent
808
809 Program reference: @internalsref{Completion_heads_engraver}.
810
811
812 @node Staff notation
813 @section Staff notation
814
815 This section describes music notation that occurs on staff level,
816 such as key signatures, clefs and time signatures.
817
818 @cindex Staff notation
819
820 @menu
821 * Staff symbol::                
822 * Key signature::               
823 * Clef::                        
824 * Ottava brackets::             
825 * Time signature::              
826 * Partial measures::            
827 * Unmetered music::             
828 * Bar lines::                   
829 * Time administration::         
830 * Controlling formatting of  prefatory matter::  
831 @end menu
832
833 @node Staff symbol
834 @subsection Staff symbol
835
836 @cindex adjusting staff symbol
837
838 Notes, dynamic signs, etc. are grouped
839 with a set of horizontal lines, into a staff (plural `staves'). In our
840 system, these lines are drawn using a separate layout object called
841 staff symbol.  
842
843
844 @cindex staff lines, setting number of
845 @cindex staff lines, setting thickness of
846 @cindex thickness of staff lines, setting 
847 @cindex number of staff lines, setting 
848
849 @seealso
850
851 Program reference: @internalsref{StaffSymbol}.
852
853 Examples: @inputfileref{input/test,staff-lines.ly},
854 @inputfileref{input/test,staff-size.ly}.
855
856 @refbugs
857
858 If a staff is ended halfway a piece, the staff symbol may not end
859 exactly on the bar line.
860
861
862 @node Key signature
863 @subsection Key signature
864 @cindex Key signature
865
866 @cindex @code{\key}
867
868 The key signature indicates the scale in which a piece is played. It
869 is denoted by a set of alterations (flats or sharps) at the start of
870 the staff.
871
872
873 Setting or changing the key signature is done with the @code{\key}
874 command
875 @example
876   @code{\key} @var{pitch} @var{type}
877 @end example
878
879 @cindex @code{\minor}
880 @cindex @code{\major}
881 @cindex @code{\minor}
882 @cindex @code{\ionian}
883 @cindex @code{\locrian}
884 @cindex @code{\aeolian}
885 @cindex @code{\mixolydian}
886 @cindex @code{\lydian}
887 @cindex @code{\phrygian}
888 @cindex @code{\dorian}
889
890 Here, @var{type} should be @code{\major} or @code{\minor} to get
891 @var{pitch}-major or @var{pitch}-minor, respectively.
892 The standard mode names @code{\ionian},
893 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
894 @code{\phrygian}, and @code{\dorian} are also defined.
895
896 This command sets the context property
897 @internalsref{Staff}.@code{keySignature}.  Non-standard key signatures
898 can be specified by setting this property directly.
899
900 Accidentals and key signatures often confuse new users, because
901 unaltered notes get natural signs depending on the key signature. For
902 more information,   see  @ref{More about pitches}.
903
904 @refbugs
905
906 The ordering of a key cancellation is wrong when it is combined with
907 repeat bar lines. The cancellation is also printed after a line break.
908
909 @seealso
910
911 Program reference: @internalsref{KeyChangeEvent}, and @internalsref{KeySignature}.
912
913 @cindex @code{keySignature}
914
915
916 @node Clef
917 @subsection Clef
918 @cindex @code{\clef}
919
920 The clef indicates which lines of the staff correspond to which
921 pitches.
922
923
924 The clef can be set with the @code{\clef} command
925 @lilypond[quote,fragment,verbatim]
926 { c''2 \clef alto g'2 }
927 @end lilypond
928
929 Supported clef-names include
930 @c Moved standard clefs to the top /MB
931 @table @code
932 @cindex treble clef
933 @cindex violin clef
934 @item treble, violin, G, G2
935 G clef on 2nd line
936 @item alto, C
937 @cindex alto clef 
938  C clef on 3rd line
939 @item tenor
940 @cindex tenor clef 
941  C clef on 4th line. 
942 @item bass, F
943 @cindex bass clef
944  F clef on 4th line
945 @item french
946 @cindex french clef
947  G clef on 1st line, so-called French violin clef
948 @item soprano
949 @cindex soprano clef
950  C clef on 1st line
951 @item mezzosoprano
952 @cindex mezzosoprano clef
953  C clef on 2nd line
954 @item baritone
955 @cindex baritone clef
956  C clef on 5th line
957 @item varbaritone
958 @cindex varbaritone clef
959  F clef on 3rd line
960 @item subbass
961 @cindex subbass clef
962  F clef on 5th line
963 @item percussion
964  percussion clef
965 @item tab
966  tablature clef
967 @end table
968
969 By adding @code{_8} or @code{^8} to the clef name, the clef is
970 transposed one octave down or up, respectively, and @code{_15} and
971 @code{^15} transposes by two octaves.  The argument @var{clefname}
972 must be enclosed in quotes when it contains underscores or digits. For
973 example,
974
975
976 @cindex choral tenor clef  
977 @lilypond[quote,verbatim,fragment,relative=1]
978 \clef "G_8" c4
979 @end lilypond
980
981 This command is equivalent to setting @code{clefGlyph},
982 @code{clefPosition} (which controls the Y position of the clef),
983 @code{centralCPosition} and @code{clefOctavation}. A clef is printed
984 when any of these properties are changed.  The following example shows
985 possibilities when setting properties manually.
986
987 @lilypond[verbatim]
988 {
989   \set Staff.clefGlyph = #"clefs-F"
990   \set Staff.clefPosition = #2
991   c'4
992   \set Staff.clefGlyph = #"clefs-G"
993   c'4
994   \set Staff.clefGlyph = #"clefs-C"
995   c'4
996   \set Staff.clefOctavation = #7 
997   c'4
998   \set Staff.clefOctavation = #0 
999   \set Staff.clefPosition = #0
1000   c'4
1001   \clef "bass"
1002   c'4
1003 }
1004 @end lilypond
1005
1006
1007 @seealso
1008
1009 Program reference: @internalsref{Clef}.
1010
1011
1012
1013 @node Ottava brackets
1014 @subsection Ottava brackets
1015
1016 ``Ottava'' brackets introduce an extra transposition of an octave for
1017 the staff. They are created by invoking the function
1018 @code{set-octavation}
1019
1020 @cindex ottava
1021 @cindex 15ma
1022 @cindex octavation
1023
1024 @lilypond[quote,verbatim,fragment]
1025 \relative c''' {
1026   a2 b
1027   #(set-octavation 1)
1028   a b 
1029   #(set-octavation 0)
1030   a b
1031 }
1032 @end lilypond
1033
1034 The @code{set-octavation} function also takes -1 (for 8va bassa) and 2
1035 (for 15ma) as arguments.  Internally the function sets the properties
1036 @code{ottavation} (e.g. to @code{"8va"}) and
1037 @code{centralCPosition}. For overriding the text of the bracket, set
1038 @code{ottavation} after invoking @code{set-octavation}, i.e.,
1039
1040 @lilypond[verbatim]
1041 {
1042   #(set-octavation 1)
1043   \set Staff.ottavation = #"8"
1044   c'''
1045 }
1046 @end lilypond
1047
1048 @seealso
1049
1050 Program reference: @internalsref{OttavaBracket}.
1051
1052 Examples: @inputfileref{input/regression,ottava.ly},
1053 @inputfileref{input/regression,ottava-broken.ly}.
1054
1055 @refbugs
1056
1057 @code{set-octavation} will get confused when clef changes happen
1058 during an octavation bracket.
1059
1060
1061
1062
1063 @node Time signature
1064 @subsection Time signature
1065 @cindex Time signature
1066 @cindex meter
1067 @cindex @code{\time}
1068
1069 Time signature indicates the metrum of a piece: a regular pattern of
1070 strong and weak beats. It is denoted by a fraction at the start of the
1071 staff.
1072
1073
1074 The time signature is set or changed by the @code{\time}
1075 command
1076 @lilypond[quote,fragment,verbatim]
1077 \time 2/4 c'2 \time 3/4 c'2. 
1078 @end lilypond
1079
1080 The symbol that is printed can be customized with the @code{style}
1081 property. Setting it to @code{#'()} uses fraction style for 4/4 and
1082 2/2 time,
1083
1084 @lilypond[fragment,verbatim]
1085 \time 4/4 c'1
1086 \time 2/2 c'1
1087 \override TimeSignature #'style = #'()
1088 \time 4/4 c'1
1089 \time 2/2 c'1
1090 @end lilypond
1091
1092
1093
1094 There are many more options for its layout.  See @ref{Ancient time
1095 signatures} for more examples.
1096
1097
1098 This command sets the property @code{timeSignatureFraction},
1099 @code{beatLength} and @code{measureLength} in the @code{Timing}
1100 context, which is normally aliased to @internalsref{Score}.  The
1101 property @code{measureLength} determines where bar lines should be
1102 inserted, and how automatic beams should be generated.  Changing the
1103 value of @code{timeSignatureFraction} also causes the symbol to be
1104 printed.
1105
1106 More options are available through the Scheme function
1107 @code{set-time-signature}. In combination with the
1108 @internalsref{Measure_grouping_engraver}, it will create
1109 @internalsref{MeasureGrouping} signs. Such signs ease reading
1110 rhythmically complex modern music.  In the following example, the 9/8
1111 measure is subdivided in 2, 2, 2 and 3. This is passed to
1112 @code{set-time-signature} as the third argument @code{(2 2 2 3)}
1113
1114 @lilypond[quote,raggedright,verbatim]
1115 \score {
1116   \relative c'' {
1117     #(set-time-signature 9 8 '(2 2 2 3))
1118     g8[ g] d[ d] g[ g] a8[( bes g]) | 
1119     #(set-time-signature 5 8 '(3 2))
1120     a4. g4
1121   }
1122   \paper {
1123     \context {
1124       \Staff
1125       \consists "Measure_grouping_engraver"
1126     }
1127   }
1128 }
1129 @end lilypond
1130
1131 @seealso
1132
1133 Program reference: @internalsref{TimeSignature}, and @internalsref{Timing_engraver}.
1134
1135
1136 @refbugs
1137
1138 Automatic beaming does not use the measure grouping specified with
1139 @code{set-time-signature}.
1140
1141 @node Partial measures
1142 @subsection Partial measures
1143 @cindex Partial
1144 @cindex anacrusis
1145 @cindex partial measure
1146 @cindex measure, partial
1147 @cindex shorten measures
1148 @cindex @code{\partial}
1149
1150 Partial measures, for example in upsteps, are entered using the
1151 @code{\partial} command
1152 @lilypond[quote,fragment,verbatim,relative=2]
1153 \partial 16*5  c16 cis d dis e | a2. c,4 | b2
1154 @end lilypond
1155
1156 The syntax for this command is 
1157 @example
1158   \partial @var{duration} 
1159 @end example
1160 This is  internally translated into
1161 @example
1162   \set Timing.measurePosition = -@var{length of duration}
1163 @end example
1164 @cindex @code{|}
1165 The property @code{measurePosition} contains a rational number
1166 indicating how much of the measure has passed at this point.
1167
1168 @refbugs
1169
1170 This command does not take into account grace notes at the start of
1171 the music. When a piece starts with graces notes in the pickup, then
1172 the @code{\partial} should follow the grace notes
1173
1174 @lilypond[verbatim,relative,fragment]
1175 {
1176   \grace f16 
1177   \partial 4
1178   g4
1179   a2 g2 
1180 }
1181 @end lilypond
1182
1183
1184 @node Unmetered music
1185 @subsection Unmetered music
1186
1187 @cindex @code{\bar}
1188
1189 Bar lines and bar numbers are calculated automatically. For unmetered
1190 music (e.g. cadenzas), this is not desirable.  By setting
1191 @code{Score.timing} to false, this automatic timing can be switched
1192 off. Empty bar lines,
1193
1194 @example
1195   \bar ""
1196 @end example
1197
1198 @noindent
1199 indicate where line breaks can occur.
1200
1201 @refcommands
1202
1203 @cindex @code{\cadenzaOn}
1204 @code{\cadenzaOn}, 
1205 @cindex @code{\cadenzaOff}
1206 @code{\cadenzaOff}.
1207
1208
1209
1210
1211 @node Bar lines
1212 @subsection Bar lines
1213 @cindex Bar lines
1214
1215 @cindex @code{\bar}
1216 @cindex measure lines
1217 @cindex repeat bars
1218
1219
1220 Bar lines delimit measures, but are also used to indicate repeats.
1221 Normally, they are inserted automatically.  Line breaks may only
1222 happen on bar lines.
1223
1224 Special types of bar lines can be forced with the @code{\bar} command
1225 @c
1226 @lilypond[quote,relative=2,fragment,verbatim]
1227 c4 \bar "|:" c4
1228 @end lilypond
1229
1230 The following bar types are available
1231 @lilypondfile[notexidoc]{bar-lines.ly}
1232
1233 For allowing line breaks, there is a special command,
1234 @example
1235   \bar ""
1236 @end example 
1237 This will insert an invisible bar line, and allow line breaks at this
1238 point.
1239
1240 In scores with many staves, a @code{\bar} command in one staff is
1241 automatically applied to all staves. The resulting bar lines are
1242 connected between different staves of a @internalsref{StaffGroup}
1243 @c
1244 @lilypond[quote,fragment,verbatim]
1245 <<
1246   \context StaffGroup <<
1247     \new Staff {
1248       e'4 d'
1249       \bar "||"
1250       f' e'
1251     }
1252     \new Staff { \clef bass c4 g e g }
1253   >>
1254   \new Staff { \clef bass c2 c2 }
1255 >>
1256 @end lilypond
1257
1258
1259 The command @code{\bar }@var{bartype} is a short cut for doing
1260 @code{\set Timing.whichBar = }@var{bartype}.  Whenever @code{whichBar}
1261 is set to a string, a bar line of that type is created.
1262
1263 A bar line is created whenever the @code{whichBar} property is set.
1264 At the start of a measure it is set to the contents of
1265 @code{defaultBarType}. The contents of @code{repeatCommands} are used
1266 to override default measure bars.
1267
1268 @cindex @code{whichBar}
1269 @cindex @code{repeatCommands}
1270 @cindex @code{defaultBarType}
1271
1272 You are encouraged to use @code{\repeat} for repetitions.  See
1273 @ref{Repeats}.
1274
1275
1276
1277 @seealso
1278
1279 In this manual: @ref{Repeats}, @ref{System start delimiters}
1280
1281
1282 Program reference: @internalsref{BarLine} (created at
1283 @internalsref{Staff} level), @internalsref{SpanBar} (across staves).
1284
1285 @cindex bar lines at start of system
1286 @cindex start of system
1287
1288
1289
1290 Examples: @inputfileref{input/test,bar-lines.ly},
1291
1292
1293 @node Time administration
1294 @subsection Time administration
1295
1296 Time is administered by the @internalsref{Time_signature_engraver},
1297 which usually lives in the @internalsref{Score} context.
1298 The bookkeeping deals with the following  variables
1299
1300 @table @code
1301 @item currentBarNumber
1302  the measure number
1303 @item measureLength
1304   the length of the measures in the current  time signature. For a 4/4
1305   time this is 1, and for 6/8 it is 3/4.
1306 @item measurePosition
1307   the point within the measure where we currently are. This quantity
1308   is reset to 0 whenever it exceeds @code{measureLength}. When that happens,
1309   @code{currentBarNumber} is incremented.
1310 @item timing
1311  if set to true, the above variables are updated for every time
1312  step. When set to false, the engraver stays in the current measure
1313  indefinitely.
1314 @end table
1315
1316 Timing can be changed by setting any of these variables explicitly.
1317 In the next example, the 4/4 time signature is printed, but
1318 @code{measureLength} is set to 5/4. After a while, the measure is
1319 shortened by 1/8, by setting @code{measurePosition} to -3/8 at 2/4 in
1320 the measure, so the next bar line will fall at 2/4 + 3/8. 
1321
1322 @lilypond[verbatim]
1323 \relative {
1324   \set Score.measureLength = #(ly:make-moment 5 4)
1325   c1 c4
1326   c1 c4 
1327   c4 c4
1328   \set Score.measurePosition = #(ly:make-moment -3 8)
1329   b8 b b
1330   c4 c1
1331 }
1332 @end lilypond
1333
1334
1335 @node Controlling formatting of  prefatory matter
1336 @subsection Controlling formatting of  prefatory matter
1337
1338 TODO
1339
1340 @lilypond[verbatim]
1341 \transpose c c' {
1342         \override Staff.Clef  #'break-visibility = #end-of-line-visible
1343         \override Staff.KeySignature  #'break-visibility = #end-of-line-visible
1344         \set Staff.explicitClefVisibility = #end-of-line-visible
1345         \set Staff.explicitKeySignatureVisibility = #end-of-line-visible
1346
1347         % We want the time sig to take space, otherwise there is not
1348         % enough white at the start of the line.
1349         %
1350         
1351         \override Staff.TimeSignature  #'transparent = ##t
1352         \set Score.defaultBarType = #"empty"
1353         
1354         c1 d e f g a b c
1355         \key d \major
1356         \break
1357
1358         % see above.
1359         \time 4/4
1360         
1361         d e fis g a b cis d 
1362         \key g \major
1363         \break
1364         \time 4/4    
1365 }
1366 @end lilypond
1367
1368
1369 @node Polyphony
1370 @section Polyphony
1371 @cindex polyphony
1372
1373 The easiest way to enter fragments with more than one voice on a staff
1374 is to split chords using the separator @code{\\}.  You can use it for
1375 small, short-lived voices or for single chords
1376
1377 @cindex @code{\\}
1378
1379 @lilypond[quote,verbatim,fragment]
1380 \context Staff \relative c'' {
1381   c4 << { f d e  } \\ { b c2 } >>
1382   c4 << g' \\ b, \\  f' \\ d >>
1383 }
1384 @end lilypond
1385
1386 The separator causes @internalsref{Voice} contexts@footnote{Polyphonic
1387 voices are sometimes called "layers" in other notation packages}
1388 @cindex layers
1389 to be instantiated. They bear the names @code{"1"}, @code{"2"}, etc. In
1390 each of these contexts, vertical direction of slurs, stems, etc. is set
1391 appropriately.
1392
1393 @cindex @code{\voiceOne}
1394 @cindex @code{\voiceFour}
1395
1396 This can also be done by instantiating @internalsref{Voice} contexts
1397 by hand, and using @code{\voiceOne}, up to @code{\voiceFour} to assign
1398 a stem directions and horizontal shift for each part
1399 @c
1400
1401 @lilypond[quote,raggedright,verbatim]
1402 \relative c''
1403 \context Staff <<
1404   \new Voice { \voiceOne cis2 b  }
1405   \new Voice { \voiceThree b4 ais ~ ais4 gis4 } 
1406   \new Voice { \voiceTwo fis4~  fis4 f ~ f  } >>
1407 @end lilypond
1408
1409 @noindent
1410 The command @code{\oneVoice} will revert back to the normal setting.
1411 @cindex @code{\oneVoice}
1412
1413
1414 Normally, note heads with a different number of dots are not merged, but
1415 when  the object property @code{merge-differently-dotted} is set in
1416 the @internalsref{NoteCollision} object, they are merged
1417 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
1418 \context Voice << {
1419   g8 g8 
1420   \override Staff.NoteCollision  
1421     #'merge-differently-dotted = ##t
1422   g8 g8
1423 } \\ { g8.[ f16] g8.[ f16] } >>
1424 @end lilypond
1425
1426 Similarly, you can merge half note heads with eighth notes, by setting
1427 @code{merge-differently-headed}
1428 @lilypond[quote,fragment,relative=2,verbatim]
1429 \context Voice << {
1430   c8 c4.
1431   \override Staff.NoteCollision
1432     #'merge-differently-headed = ##t
1433 c8 c4. } \\ { c2 c2 } >>
1434 @end lilypond
1435
1436 LilyPond also vertically shifts rests that are opposite of a stem,
1437 for example
1438
1439 @lilypond[quote,raggedright,fragment,verbatim]
1440 \context Voice << c''4 \\  r4 >>
1441 @end lilypond
1442
1443
1444 @refcommands
1445
1446
1447
1448 @cindex @code{\oneVoice}
1449 @code{\oneVoice}, 
1450 @cindex @code{\voiceOne}
1451 @code{\voiceOne}, 
1452 @cindex @code{\voiceTwo}
1453 @code{\voiceTwo}, 
1454 @cindex @code{\voiceThree}
1455 @code{\voiceThree}, 
1456 @cindex @code{\voiceFour}
1457 @code{\voiceFour}.
1458
1459
1460
1461 @cindex @code{\shiftOn}
1462 @code{\shiftOn}, 
1463 @cindex @code{\shiftOnn}
1464 @code{\shiftOnn}, 
1465 @cindex @code{\shiftOnnn}
1466 @code{\shiftOnnn}, 
1467 @cindex @code{\shiftOff}
1468 @code{\shiftOff}: these commands specify in what chords of the current
1469 voice should be shifted.  The outer voices (normally: voice one and
1470 two) have @code{\shiftOff}, while the inner voices (three and four)
1471 have @code{\shiftOn}.  @code{\shiftOnn} and @code{\shiftOnnn} define
1472 further shift levels.
1473
1474
1475 When LilyPond cannot cope, the @code{force-hshift}
1476 property of the @internalsref{NoteColumn} object and pitched rests can
1477 be used to override typesetting decisions.
1478
1479 @lilypond[verbatim,raggedright]
1480 \relative <<
1481 {
1482   <d g>
1483   <d g>
1484 } \\ {
1485   <b f'>
1486   \once \override NoteColumn  #'force-hshift = #1.7
1487   <b f'>
1488 } >> 
1489 @end lilypond
1490
1491
1492
1493 @seealso
1494
1495 Program reference: the objects responsible for resolving collisions are
1496 @internalsref{NoteCollision} and @internalsref{RestCollision}.
1497
1498 Examples: 
1499 @inputfileref{input/regression,collision-dots.ly},
1500 @inputfileref{input/regression,collision-head-chords.ly},
1501 @inputfileref{input/regression,collision-heads.ly},
1502 @inputfileref{input/regression,collision-mesh.ly}, and
1503 @inputfileref{input/regression,collisions.ly}.
1504
1505
1506 @refbugs
1507
1508
1509 When using @code{merge-differently-headed} with an upstem eighth or a
1510 shorter note, and a downstem half note, the eighth note gets the wrong
1511 offset.
1512
1513 There is no support for clusters where the same note occurs with
1514 different accidentals in the same chord. In this case, it is
1515 recommended to use enharmonic transcription, or to use special cluster
1516 notation (see @ref{Clusters}).
1517
1518 @node Beaming
1519 @section Beaming
1520
1521 Beams are used to group short notes into chunks that are aligned with
1522 the metrum. They are inserted automatically
1523
1524 @lilypond[quote,fragment,verbatim,relative=2]
1525 \time 2/4 c8 c c c \time 6/8 c c c c8. c16  c8
1526 @end lilypond
1527
1528 When these automatic decisions are not good enough, beaming can be
1529 entered explicitly. It is also possible to define beaming patterns
1530 that differ from the defaults.
1531
1532 Individual notes may be marked with @code{\noBeam}, to prevent them
1533 from being beamed
1534
1535 @lilypond[quote,fragment,verbatim,relative=2]
1536 \time 2/4 c8 c\noBeam c c
1537 @end lilypond
1538
1539
1540 @seealso
1541
1542 Program reference: @internalsref{Beam}. 
1543
1544
1545 @cindex Automatic beams
1546 @menu
1547 * Manual beams::                
1548 * Setting automatic beam behavior::  
1549 * Beam formatting::             
1550 @end menu
1551
1552 @node Manual beams
1553 @subsection Manual beams
1554 @cindex beams, manual
1555 @cindex @code{]}
1556 @cindex @code{[}
1557
1558 In some cases it may be necessary to override the automatic beaming
1559 algorithm.  For example, the autobeamer will not put beams over rests
1560 or bar lines. Such beams are specified manually by marking the begin
1561 and end point with @code{[} and @code{]}
1562
1563 @lilypond[quote,fragment,relative=1,verbatim]
1564 {
1565   r4 r8[ g' a r8] r8 g[ | a] r8
1566 }
1567 @end lilypond
1568
1569 @cindex @code{stemLeftBeamCount}
1570
1571 Normally, beaming patterns within a beam are determined automatically.
1572 If necessary, the properties @code{stemLeftBeamCount} and
1573 @code{stemRightBeamCount} can be used to override the defaults.  If
1574 either property is set, its value will be used only once, and then it
1575 is erased
1576
1577 @lilypond[quote,fragment,relative=1,verbatim]
1578 {
1579   f8[ r16 f g a]
1580   f8[ r16 \set stemLeftBeamCount = #1 f g a]
1581 }
1582 @end lilypond
1583 @cindex @code{stemRightBeamCount}
1584
1585
1586 The property @code{subdivideBeams} can be set in order to subdivide
1587 all 16th or shorter beams at beat positions, as defined by the
1588 @code{beatLength} property.
1589
1590
1591 @lilypond[fragment,quote,relative=2,verbatim,noindent]
1592 c16[ c c c c c c c]
1593 \set subdivideBeams = ##t
1594 c16[ c c c c c c c]
1595 \set Score.beatLength = #(ly:make-moment 1 8)
1596 c16[ c c c c c c c]
1597 @end lilypond
1598 @cindex @code{subdivideBeams}
1599
1600 Normally, line breaks are forbidden when beams cross bar lines.  This
1601 behavior can be changed by setting @code{allowBeamBreak}.
1602
1603 @cindex @code{allowBeamBreak}
1604 @cindex beams and line breaks
1605
1606 @cindex beams, kneed
1607 @cindex kneed beams
1608 @cindex auto-knee-gap
1609
1610
1611 @seealso
1612
1613 User manual: @ref{Changing context properties on the fly} for the
1614 @code{\set} command
1615
1616
1617 @refbugs
1618
1619 @cindex Frenched staves
1620 Kneed beams are inserted automatically, when a large gap is detected
1621 between the note heads.  This behavior can be tuned through the object
1622
1623
1624 Automatically kneed cross-staff beams cannot be used together with
1625 hidden staves. See @ref{Hiding staves}.
1626
1627 Beams do not avoid collisions with symbols around the notes, such as
1628 texts and accidentals.
1629
1630 @c FIXME.
1631
1632
1633 @node Setting automatic beam behavior
1634 @subsection Setting automatic beam behavior 
1635
1636 @cindex @code{autoBeamSettings}
1637 @cindex @code{(end * * * *)}
1638 @cindex @code{(begin * * * *)}
1639 @cindex automatic beams, tuning
1640 @cindex tuning automatic beaming
1641
1642 @c [TODO: use \applycontext]
1643
1644 In normal time signatures, automatic beams can start on any note but can
1645 only end in a few positions within the measure: beams can end on a beat,
1646 or at durations specified by the properties in
1647 @code{autoBeamSettings}. The defaults for @code{autoBeamSettings}
1648 are defined in @file{scm/auto-beam.scm}.
1649
1650 The value of @code{autoBeamSettings} is changed with two functions,
1651 @example
1652   #(override-auto-beam-setting
1653      '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b}
1654      [@var{context}])
1655   #(revert-auto-beam-setting '(@var{be} @var{p} @var{q} @var{n} @var{m}))
1656 @end example
1657 Here, @var{be} is the symbol @code{begin} or @code{end}, and
1658 @var{context} is an optional context (default: @code{'Voice}). It
1659 determines whether the rule applies to begin or end-points.  The
1660 quantity @var{p}/@var{q} refers to the length of the beamed notes (and
1661 `@code{* *}' designates notes of any length), @var{n}/@var{M} refers
1662 to a time signature (wildcards `@code{* *}' may be entered to
1663 designate all time signatures), @var{a}/@var{b} is a duration.  By
1664 default, this command changes settings for the current voice. It is
1665 also possible to adjust settings at higher contexts, by adding a
1666 @var{context} argument.
1667
1668 For example, if automatic beams should end on every quarter note, use
1669 the following
1670 @example
1671    #(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
1672 @end example
1673 Since the duration of a quarter note is 1/4 of a whole note, it is
1674 entered as @code{(ly:make-moment 1 4)}.
1675
1676 The same syntax can be used to specify beam starting points. In this
1677 example, automatic beams can only end on a dotted quarter note
1678 @example
1679    #(override-auto-beam-setting '(end * * * *) 3 8)
1680 @end example
1681 In 4/4 time signature, this means that automatic beams could end only on
1682 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
1683 3/8, has passed within the measure).
1684
1685 Rules can also be restricted to specific time signatures. A rule that
1686 should only be applied in @var{N}/@var{M} time signature is formed by
1687 replacing the second asterisks by @var{N} and @var{M}. For example, a
1688 rule for 6/8 time exclusively looks like
1689 @example
1690  #(override-auto-beam-setting '(begin * * 6 8) @dots{})
1691 @end example
1692
1693 If a rule should be to applied only to certain types of beams, use the
1694 first pair of asterisks. Beams are classified according to the
1695 shortest note they contain. For a beam ending rule that only applies
1696 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
1697 *)}.
1698
1699 @cindex automatic beam generation
1700 @cindex autobeam
1701 @cindex @code{autoBeaming}
1702 @cindex lyrics
1703
1704 If beams are used to indicate melismata in songs, then automatic
1705 beaming should be switched off. This is done by setting
1706 @code{autoBeaming} to @code{#f}.
1707
1708 @refcommands
1709
1710 @cindex @code{\autoBeamOff}
1711 @code{\autoBeamOff}, 
1712 @cindex @code{\autoBeamOn}
1713 @code{\autoBeamOn}.
1714
1715
1716 @refbugs
1717
1718 If a score ends while an automatic beam has not been ended and is
1719 still accepting notes, this last beam will not be typeset at all. The
1720 same holds polyphonic voices, entered with @code{<< @dots{} \\ @dots{}
1721 >>}. If a polyphonic voice ends while an automatic beam is still
1722 accepting notes, it is not typeset.
1723
1724 The rules for ending a beam depend on the shortest note in a beam.
1725 So, while it is possible to have different ending rules for eight
1726 beams and sixteenth beams, a beam that contains both eight and
1727 sixteenth notes will use the rules for the sixteenth beam.
1728
1729 In the example below, the autobeamer makes eighth beams and sixteenth
1730 end at three eighths. The third beam can only be corrected by
1731 specifying manual beaming.
1732
1733 @lilypond[quote,raggedright,fragment,relative=1]
1734 #(override-auto-beam-setting '(end * * * *) 3 8)
1735 % rather show case where it goes wrong
1736 %\time 12/8 c'8 c c c16 c c c c c c[ c c c] c8[ c] c4
1737 \time 12/8 c'8 c c c16 c c c c c c c c c c8 c c4
1738 @end lilypond
1739 It is not possible to specify beaming parameters that act differently in
1740 different parts of a measure. This means that it is not possible to use
1741 automatic beaming in irregular meters such as @code{5/8}.
1742
1743 @node Beam formatting
1744 @subsection Beam formatting
1745
1746
1747 When a beam falls in the middle of the staff, the beams point normally
1748 down.  However, this behaviour can be altered with the
1749 @code{neutral-direction} property.
1750
1751
1752 @lilypond
1753 \relative c'' {
1754    b8[ b]
1755   \override Beam  #'neutral-direction = #-1
1756    b[ b]
1757   \override Beam  #'neutral-direction = #1
1758    b[ b]
1759 }
1760 @end lilypond
1761
1762 @node Accidentals
1763 @section Accidentals
1764 @cindex Accidentals
1765
1766 This section describes how to change the way that accidentals are
1767 inserted automatically before the running notes.
1768
1769 Common rules for typesetting accidentals have been canned in a
1770 function. This function is called as follows
1771
1772 @cindex @code{set-accidental-style}
1773 @example
1774   #(set-accidental-style 'modern 'Voice)
1775 @end example
1776
1777 The function takes two arguments: a symbol that denotes the style (in
1778 the example, @code{modern}), and another symbol that denotes the
1779 context name (in this example, @code{Voice}). If no context name is
1780 supplied, @code{Staff} is the default.
1781
1782 The following styles are supported
1783 @table @code
1784 @item default
1785       This is the default typesetting behavior. It should correspond
1786       to 18th century common practice: Accidentals are
1787       remembered to the end of the measure in which they occur and
1788       only on their own octave.
1789
1790 @item voice
1791 @c
1792       The normal behavior is to remember the accidentals on
1793 Staff-level.  This variable, however, typesets accidentals
1794 individually for each voice.  Apart from that, the rule is similar to
1795 @code{code}.
1796
1797       As  a result,
1798        accidentals from one voice do not get canceled in other
1799       voices, which is often unwanted result
1800       @c
1801 @lilypond[quote,raggedright,relative=1,fragment,verbatim]
1802 \context Staff <<
1803   #(set-accidental-style 'voice)
1804   <<
1805     { es g } \\
1806     { c, e }
1807 >> >>
1808 @end lilypond
1809 @c
1810       The @code{voice} option should be used if the voices
1811 are to be read solely by individual musicians. If the staff is to be
1812 used by one musician (e.g. a conductor) then 
1813 @code{modern} or @code{modern-cautionary}
1814 should be used instead.
1815
1816 @item modern
1817 @cindex @code{modern} style accidentals
1818       This rule  corresponds to the common practice in the 20th
1819       century.
1820       This rule prints the same accidentals as @code{default},  but temporary
1821       accidentals also are canceled in other octaves. Furthermore,
1822       in the same octave, they also get canceled in the following
1823       measure
1824
1825 @lilypond[quote,raggedright,fragment,verbatim]
1826 #(set-accidental-style 'modern)
1827 cis' c'' cis'2 | c'' c'
1828 @end lilypond
1829
1830 @item @code{modern-cautionary}
1831       @cindex @code{modern-cautionary}
1832      This rule is similar to @code{modern}, but the
1833      ``extra'' accidentals (the ones not typeset by
1834      @code{default}) are typeset as cautionary accidentals.
1835      They are printed in reduced size or with parentheses
1836 @lilypond[quote,raggedright,fragment,verbatim]
1837 #(set-accidental-style 'modern-cautionary)
1838 cis' c'' cis'2 | c'' c'
1839 @end lilypond
1840
1841       @cindex @code{modern-voice}
1842 @item modern-voice
1843 This rule is used for multivoice accidentals to be read both by musicians
1844 playing one voice and musicians playing all voices.  Accidentals are
1845 typeset for each voice, but they @emph{are} canceled across voices in
1846 the same @internalsref{Staff}.
1847
1848       @cindex @code{modern-voice-cautionary}
1849 @item modern-voice-cautionary
1850 This rule is the same as @code{modern-voice}, but with the extra
1851 accidentals (the ones not typeset by @code{voice}) typeset
1852 as cautionaries.  Even though all accidentals typeset by
1853 @code{default} @emph{are} typeset by this variable then
1854 some of them are typeset as cautionaries.
1855
1856 @item piano
1857       @cindex @code{piano} accidentals
1858 This rule reflects      20th century practice for piano notation. Very similar to
1859       @code{modern} but accidentals also get canceled
1860       across the staves in the same @internalsref{GrandStaff} or
1861       @internalsref{PianoStaff}.
1862
1863 @item piano-cautionary
1864       @cindex @code{#(set-accidental-style 'piano-cautionary)}
1865       As @code{#(set-accidental-style 'piano)} but with the extra accidentals
1866       typeset as cautionaries.
1867
1868 @item no-reset
1869       @cindex @code{no-reset} accidental style
1870       @c
1871       This is the same as @code{default} but with accidentals lasting
1872       ``forever'' and not only until the next measure
1873 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1874 #(set-accidental-style 'no-reset)
1875 c1 cis cis c
1876 @end lilypond
1877
1878 @item forget
1879       This is sort of the opposite of @code{no-reset}: Accidentals
1880       are not remembered at all---and hence all accidentals are
1881       typeset relative to the key signature, regardless of what was
1882       before in the music
1883       
1884 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1885 #(set-accidental-style 'forget)
1886 \key d\major c4 c cis cis d d dis dis
1887 @end lilypond
1888 @end table
1889
1890
1891 @seealso
1892
1893 Program reference: @internalsref{Accidental_engraver},
1894 @internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
1895
1896
1897 @refbugs
1898
1899 Simultaneous notes are considered to be entered in sequential
1900 mode. This means that in a chord the accidentals are typeset as if the
1901 notes in the chord happened once at a time - in the order in which
1902 they appear in the input file.
1903
1904 This is a problem when accidentals in a chord depend on each other,
1905 which does not happen for the default accidental style.  The problem
1906 can be solved by manually inserting @code{!} and @code{?}  for the
1907 problematic notes.
1908
1909
1910 @node Expressive marks
1911 @section Expressive marks
1912
1913
1914 @c todo: should change ordering
1915 @c where to put text spanners, metronome marks,
1916 @c fingering?
1917  
1918 @menu
1919 * Slurs::                       
1920 * Phrasing slurs::              
1921 * Breath marks::                
1922 * Metronome marks::             
1923 * Text spanners::               
1924 * Analysis brackets::           
1925 * Articulations::               
1926 * Running trills::              
1927 * Fingering instructions::      
1928 * Text scripts::                
1929 * Grace notes::                 
1930 * Glissando::                   
1931 * Dynamics::                    
1932 @end menu
1933
1934 @node Slurs
1935 @subsection Slurs
1936 @cindex Slurs
1937
1938 A slur indicates that notes are to be played bound or @emph{legato}.
1939
1940 They are entered using parentheses
1941 @lilypond[quote,relative=2,fragment,verbatim]
1942 f( g a) a8 b( a4 g2 f4)
1943 <c e>2( <b d>2)
1944 @end lilypond
1945
1946 The direction of a slur can be set with the
1947 generic commands
1948
1949 @example
1950   \override Slur #'direction = #UP
1951   \slurUp     % shortcut for the previous line 
1952 @end example
1953
1954 @noindent
1955 However, there is a convenient shorthand for forcing slur
1956 directions. By adding @code{_} or @code{^} before the opening
1957 parentheses, the direction is also set. For example,  
1958
1959 @lilypond[relative=2,verbatim,fragment]
1960    c4_( c)   c^( c)
1961 @end lilypond
1962  
1963 @refcommands
1964
1965
1966 @cindex @code{\slurUp}
1967 @code{\slurUp}, 
1968 @cindex @code{\slurDown}
1969 @code{\slurDown}, 
1970 @cindex @code{\slurBoth}
1971 @code{\slurBoth}, 
1972 @cindex @code{\slurDotted}
1973 @code{\slurDotted}, 
1974 @cindex @code{\slurSolid}
1975 @code{\slurSolid}.
1976
1977 @seealso
1978
1979 Program reference: @seeinternals{Slur}, and @internalsref{SlurEvent}.
1980
1981
1982
1983 @cindex Adjusting slurs
1984
1985 @node Phrasing slurs
1986 @subsection Phrasing slurs
1987
1988 @cindex phrasing slurs
1989 @cindex phrasing marks
1990
1991 A phrasing slur (or phrasing mark) connects chords and is used to
1992 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1993 respectively
1994
1995 @lilypond[quote,fragment,verbatim,relative=1]
1996 \time 6/4 c'\( d( e) f( e)  d\) 
1997 @end lilypond
1998
1999 Typographically, the phrasing slur behaves almost exactly like a
2000 normal slur.  However, they are treated as different objects.  A
2001 @code{\slurUp} will have no effect on a phrasing slur; instead, use
2002 @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
2003 @code{\phrasingSlurBoth}.
2004
2005 The commands @code{\slurUp}, @code{\slurDown}, and @code{\slurBoth}
2006 will only affect normal slurs and not phrasing slurs.
2007
2008 @refcommands
2009
2010 @cindex @code{\phrasingSlurUp}
2011 @code{\phrasingSlurUp}, 
2012 @cindex @code{\phrasingSlurDown}
2013 @code{\phrasingSlurDown}, 
2014 @cindex @code{\phrasingSlurBoth}
2015 @code{\phrasingSlurBoth}.
2016
2017 @seealso
2018
2019 Program reference: see also @internalsref{PhrasingSlur}, and
2020 @internalsref{PhrasingSlurEvent}.
2021
2022 @refbugs
2023
2024 Putting phrasing slurs over rests leads to spurious warnings.
2025
2026 @node Breath marks
2027 @subsection Breath marks
2028
2029 Breath marks are entered using @code{\breathe}
2030
2031
2032 @lilypond[quote,fragment,relative=1,verbatim]
2033 c'4 \breathe d4
2034 @end lilypond
2035
2036 The glyph of the breath mark can be tuned by overriding the
2037 @code{text} property of the @code{BreathingSign} layout object with
2038 any markup text.   For example,
2039 @lilypond[quote,fragment,verbatim,relative=1]
2040 c'4
2041 \override BreathingSign #'text
2042   = #(make-musicglyph-markup "scripts-rvarcomma")
2043 \breathe
2044 d4
2045 @end lilypond
2046
2047 @seealso 
2048
2049 Program reference: @internalsref{BreathingSign},
2050 @internalsref{BreathingSignEvent}.
2051
2052 Examples: @inputfileref{input/regression,breathing-sign.ly}.
2053
2054
2055 @node Metronome marks
2056 @subsection Metronome marks
2057
2058 @cindex Tempo
2059 @cindex beats per minute
2060 @cindex metronome marking
2061
2062 Metronome settings can be entered as follows
2063 @example 
2064  i \tempo @var{duration} = @var{per-minute} 
2065 @end example
2066
2067 In the MIDI output, they are interpreted as a tempo change, and in the
2068 paper output, a metronome marking is printed
2069 @cindex @code{\tempo}
2070 @lilypond[quote,fragment,verbatim]
2071 \tempo 8.=120 c''1
2072 @end lilypond
2073
2074 @seealso
2075
2076 Program reference: @internalsref{MetronomeChangeEvent}.
2077   
2078
2079
2080 @node Text spanners
2081 @subsection Text spanners
2082 @cindex Text spanners
2083
2084 Some performance indications, e.g. @i{rallentando} or @i{accelerando},
2085 are written as texts, and extended over many measures with dotted
2086 lines.  Such texts are created using text spanners: attach
2087 @code{\startTextSpan} and @code{\stopTextSpan} to the start and ending
2088 note of the spanner.
2089
2090 The string to be printed, as well as the style, is set through object
2091 properties
2092
2093 @lilypond[quote,fragment,relative=1,verbatim]
2094 \relative c' {
2095   c1 
2096   \override TextSpanner #'direction = #-1
2097   \override TextSpanner #'edge-text = #'("rall " . "")
2098   c2\startTextSpan b c\stopTextSpan a
2099 }
2100 @end lilypond
2101
2102
2103 @seealso
2104
2105 Internals @internalsref{TextSpanEvent},
2106 @internalsref{TextSpanner}.
2107
2108 Examples: @inputfileref{input/regression,text-spanner.ly}.
2109
2110
2111 @node Analysis brackets
2112 @subsection Analysis brackets
2113 @cindex brackets
2114 @cindex phrasing brackets
2115 @cindex musicological analysis
2116 @cindex note grouping bracket
2117
2118 Brackets are used in musical analysis to indicate structure in musical
2119 pieces. LilyPond supports a simple form of nested horizontal brackets.
2120 To use this, add the @internalsref{Horizontal_bracket_engraver} to
2121 @internalsref{Staff} context.  A bracket is started with
2122 @code{\startGroup} and closed with @code{\stopGroup}
2123
2124 @lilypond[quote,raggedright,verbatim]
2125 \score {
2126   \relative c'' {  
2127     c4\startGroup\startGroup
2128     c4\stopGroup
2129     c4\startGroup
2130     c4\stopGroup\stopGroup
2131   }
2132   \paper {
2133     \context {
2134       \Staff \consists "Horizontal_bracket_engraver"
2135 }}}
2136 @end lilypond
2137
2138 @seealso
2139
2140 Program reference: @internalsref{HorizontalBracket},
2141 @internalsref{NoteGroupingEvent}.
2142
2143 Examples: @inputfileref{input/regression,note-group-bracket.ly}. 
2144
2145
2146 @node Articulations
2147 @subsection Articulations
2148 @cindex Articulations
2149
2150 @cindex articulations
2151 @cindex scripts
2152 @cindex ornaments
2153
2154 A variety of symbols can appear above and below notes to indicate
2155 different characteristics of the performance. They are added to a note
2156 by adding a dash and  the character signifying the
2157 articulation. They are demonstrated here
2158
2159 @lilypondfile[quote,raggedright]{script-abbreviations.ly}
2160
2161 The meanings of these shorthands can be changed. See
2162 @file{ly/script-init.ly} for examples.
2163
2164
2165 The script is automatically placed, but the direction can be forced as
2166 well.  @code{_} will put them down, and @code{^} will put them up,
2167
2168
2169 @lilypond[quote,fragment,verbatim]
2170 c''4^^ c''4_^
2171 @end lilypond
2172
2173 Other symbols can be added using the syntax
2174 @var{note}@code{\}@var{name}, e.g. @code{c4\fermata}. Again, they
2175 can be forced up or down using @code{^} and @code{_},
2176 e.g.
2177
2178 @lilypond[quote,verbatim,fragment,relative=2]
2179 c\fermata c^\fermata c_\fermata
2180 @end lilypond
2181
2182
2183
2184 @cindex accent
2185 @cindex marcato
2186 @cindex staccatissimo
2187 @cindex fermata
2188 @cindex stopped
2189 @cindex staccato
2190 @cindex portato
2191 @cindex tenuto
2192 @cindex upbow
2193 @cindex downbow
2194 @cindex foot marks
2195 @cindex organ pedal marks
2196 @cindex turn
2197 @cindex open
2198 @cindex flageolet
2199 @cindex reverseturn
2200 @cindex trill
2201 @cindex prall
2202 @cindex mordent
2203 @cindex prallprall
2204 @cindex prallmordent
2205 @cindex prall, up
2206 @cindex prall, down
2207 @cindex mordent
2208 @cindex thumb marking
2209 @cindex segno
2210 @cindex coda
2211 @cindex varcoda
2212
2213 Here is a chart showing  all scripts available,
2214
2215 @lilypondfile[quote]{script-chart.ly}
2216
2217
2218 The vertical ordering of scripts is controlled with the
2219 @code{script-priority} property. The lower this number, the closer it
2220 will be put to the note.  In this example, the
2221 @internalsref{TextScript} (the sharp symbol) first has the lowest
2222 priority, so it is put lowest in the first example. In the second, the
2223 prall trill (the @internalsref{Script}) has the lowest, so it on the
2224 inside. When two objects have the same priority, the order in which
2225 they are entered decides which one comes first.
2226
2227
2228 @lilypond[verbatim,raggedright]
2229 \relative g''{
2230     \once \override TextScript #'script-priority = #-100
2231     a4^\prall^\markup { \sharp }
2232     
2233     \once \override Script  #'script-priority = #-100
2234     a4^\prall^\markup { \sharp }
2235 }
2236 @end lilypond
2237
2238
2239
2240
2241 @seealso
2242
2243 Program reference: @internalsref{ScriptEvent}, and @internalsref{Script}.
2244
2245 @refbugs
2246
2247 These signs appear in the printed output but have no effect on the
2248 MIDI rendering of the music.
2249
2250
2251
2252 @node  Running trills
2253 @subsection Running trills
2254
2255 Long running trills are made with @code{\startTrillSpan} and
2256 @code{\stopTrillSpan},
2257
2258
2259 @lilypond[verbatim,raggedright]
2260 \relative \new Voice {
2261     << { c1 \startTrillSpan }
2262        { s2. \grace { d16[\stopTrillSpan e] } } >>
2263     c4 }
2264 @end lilypond
2265
2266 @refcommands
2267
2268 @code{\startTrillSpan},
2269 @cindex @code{\startTrillSpan}
2270 @code{\stopTrillSpan}.
2271 @cindex @code{\stopTrillSpan}
2272
2273 @seealso
2274
2275 Program reference: @internalsref{TrillSpanner},
2276 @internalsref{TrillSpanEvent}.
2277
2278 @node Fingering instructions
2279 @subsection Fingering instructions
2280
2281 @cindex fingering
2282
2283 Fingering instructions can be entered using
2284 @example
2285   @var{note}-@var{digit}
2286 @end example
2287 For finger changes, use markup texts
2288 @c
2289 @lilypond[quote,verbatim,raggedright,fragment]
2290 c'4-1 c'4-2 c'4-3 c'4-4
2291 c'^\markup { \finger "2-3" }
2292 @end lilypond
2293
2294 @cindex finger change
2295 @cindex scripts
2296 @cindex superscript
2297 @cindex subscript
2298
2299 You can use the thumb-script to indicate that a note should be
2300 played with the thumb (e.g. in cello music)
2301
2302 @lilypond[quote,verbatim,raggedright,fragment]
2303 <a'_\thumb a''-3>8 <b'_\thumb b''-3>
2304 @end lilypond
2305
2306 Fingerings for chords can also be added to individual notes
2307 of the chord by adding them after the pitches
2308 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
2309 < c-1 e-2 g-3 b-5 >4
2310 @end lilypond
2311
2312 @noindent
2313 In this case, setting @code{fingeringOrientations} will put  fingerings next
2314 to note heads
2315
2316 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2317 \set fingeringOrientations = #'(left down)
2318 <c-1 es-2 g-4 bes-5 > 4
2319 \set fingeringOrientations = #'(up right down)
2320 <c-1 es-2 g-4 bes-5 > 4
2321 @end lilypond
2322
2323 Using this feature, it is also possible to put fingering instructions
2324 very close to note heads in monophonic music,
2325
2326 @lilypond[verbatim,raggedright]
2327 {
2328   \set fingeringOrientations = #'(right)
2329   <es'-2>4
2330 }
2331 @end lilypond
2332
2333         
2334 @seealso
2335
2336 Program reference: @internalsref{FingerEvent}, and @internalsref{Fingering}.
2337
2338 Examples: @inputfileref{input/regression,finger-chords.ly}.
2339
2340 @node Text scripts
2341 @subsection Text scripts
2342 @cindex Text scripts
2343
2344 @cindex text items, non-empty
2345 @cindex non-empty texts
2346
2347 It is possible to place arbitrary strings of text or markup text (see
2348 @ref{Text markup}) above or below notes by using a string
2349 @code{c^"text"}.  By default, these indications do not influence the
2350 note spacing, but by using the command @code{\fatText}, the widths
2351 will be taken into account
2352 @c
2353 @lilypond[quote,fragment,raggedright,verbatim]
2354 \relative c' {
2355   c4^"longtext" \fatText c4_"longlongtext" c4
2356 }
2357 @end lilypond
2358
2359 More complex formatting  may also be added to a note by using the
2360 markup command,
2361 @lilypond[fragment,raggedright,verbatim]
2362 {
2363   c'4^\markup { bla \bold bla }
2364 }
2365 @end lilypond
2366
2367 The @code{\markup} is described in more detail in
2368 @ref{Text markup}.
2369  
2370
2371 @refcommands
2372
2373 @cindex @code{\fatText}
2374 @code{\fatText}, 
2375 @cindex @code{\emptyText}
2376 @code{\emptyText}.
2377
2378 @seealso
2379
2380 In this manual: @ref{Text markup}.
2381
2382 Program reference: @internalsref{TextScriptEvent}, @internalsref{TextScript}.
2383
2384
2385
2386
2387 @node Grace notes
2388 @subsection Grace notes
2389
2390
2391 @c should have blurb about accaciatura / appogiatura
2392
2393 @cindex @code{\grace}
2394 @cindex ornaments
2395 @cindex grace notes
2396
2397 Grace notes are ornaments that are written out.  The most common ones
2398 are acciaccatura, which should be played as very short.  It is denoted
2399 by a slurred small note with a slashed stem.  The appoggiatura is a
2400 grace note that takes a fixed fraction of the main note, is and
2401 denoted as a slurred note in small print without a slash.
2402 They are entered with the commands @code{\acciaccatura} and
2403 @code{\appoggiatura}, as demonstrated in the following example
2404
2405
2406 @cindex appoggiatura
2407 @cindex acciaccatura
2408
2409 @lilypond[quote,relative=2,verbatim,fragment]
2410 b4 \acciaccatura d8 c4 \appoggiatura e8 d4
2411 \acciaccatura { g16[ f] } e4
2412 @end lilypond
2413
2414 Both are special forms of the @code{\grace} command. By prefixing this
2415 keyword to a music expression, a new one is formed, which will be
2416 printed in a smaller font and takes up no logical time in a measure.
2417
2418 @lilypond[quote,relative=2,verbatim,fragment]
2419 c4 \grace c16 c4
2420 \grace { c16[ d16] } c2 c4
2421 @end lilypond
2422
2423 @noindent
2424 Unlike @code{\acciaccatura} and @code{\appoggiatura}, the
2425 @code{\grace} command does not start a slur.
2426
2427 Internally, timing for grace notes is done using a second, `grace'
2428 time. Every point in time consists of two rational numbers: one
2429 denotes the logical time, one denotes the grace timing. The above
2430 example is shown here with timing tuples
2431
2432 @lilypond[quote,raggedright]
2433 <<
2434   \relative c''{ 
2435     c4 \grace c16  c4  \grace {
2436     c16[  d16] } c2 c4
2437   }
2438   \new Lyrics \lyrics {
2439     \override LyricText #'font-family = #'typewriter
2440     
2441     \markup { (0,0) } 4
2442     \grace { \markup {
2443       ( \fraction 1 4 ,  \fraction -1 16 ) } 16 }
2444     \markup { (\fraction 1 4 , 0 ) } 4
2445     \grace {
2446       \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
2447       \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
2448     } 
2449     \markup { ( \fraction 2 4 , 0 ) }
2450   }
2451 >>
2452 @end lilypond
2453
2454
2455 The placement of grace notes is synchronized between different staves.
2456 In the following example, there are two sixteenth graces notes for
2457 every eighth grace note
2458
2459 @lilypond[quote,relative=2,verbatim,fragment] 
2460 << \new Staff { e4 \grace { c16[ d e f] } e4 }
2461    \new Staff { c4 \grace { g8[ b] } c4 } >>
2462 @end lilypond
2463
2464
2465
2466 If you want to end a note with a grace, the standard trick is to put
2467 the grace notes after a ``space note''
2468
2469 @lilypond[quote,fragment,verbatim,relative=2]
2470 \context Voice {
2471   << { d1^\trill_( }
2472      { s2 \grace { c16[ d] } } >>
2473   c4)
2474 }
2475 @end lilypond
2476
2477 @noindent
2478 By adjusting the duration of the skip note (here it is a half-note),
2479 the space between the main-note and the grace is adjusted.
2480
2481
2482 A @code{\grace} section will introduce special typesetting settings,
2483 for example, to produce smaller type, and set directions. Hence, when
2484 introducing layout tweaks, they should be inside the grace section,
2485 for example,
2486 @lilypond[quote,fragment,verbatim,relative=2]
2487 \new Voice {
2488   \acciaccatura {
2489     \override Stem #'direction = #-1
2490     f16->
2491     \revert Stem #'direction
2492   }
2493   g4
2494 }
2495 @end lilypond
2496
2497 @noindent
2498 The overrides should also be reverted inside the grace section.
2499
2500 The layout of grace sections can be changed throughout the music using
2501 the function @code{add-grace-property}. The following example
2502 undefines the Stem direction for this grace, so stems do not always
2503 point up.
2504
2505 @example
2506 \new Staff @{
2507    #(add-grace-property 'Voice 'Stem 'direction '())
2508    @dots{}
2509 @}
2510 @end example
2511
2512 @noindent
2513 Another option is to change the variables @code{startGraceMusic},
2514 @code{stopGraceMusic}, @code{startAcciaccaturaMusic},
2515 @code{stopAcciaccaturaMusic}, @code{startAppoggiaturaMusic},
2516 @code{stopAppoggiaturaMusic}.  More information is in the file
2517 @file{ly/grace-init.ly}.
2518
2519
2520 @seealso
2521
2522 Program reference: @internalsref{GraceMusic}.
2523
2524 @refbugs
2525
2526 A score that starts with a @code{\grace} section needs an explicit
2527 @code{\context Voice} declaration, otherwise the main note and grace
2528 note end up on different staves.
2529
2530 Grace note synchronization can also lead to surprises. Staff notation,
2531 such as key signatures, bar lines, etc. are also synchronized. Take
2532 care when you mix staves with grace notes and staves without, for example,
2533
2534 @lilypond[quote,relative=2,verbatim,fragment]
2535 << \new Staff { e4 \bar "|:" \grace c16 d4 }
2536    \new Staff { c4  \bar "|:"  d4 } >>
2537 @end lilypond
2538
2539 @noindent
2540 This can be remedied by inserting grace skips, for the above example
2541
2542 @example
2543 \new Staff @{ c4  \bar "|:"  \grace s16 d4 @} 
2544 @end example
2545
2546 Grace sections should only be used within sequential music
2547 expressions.  Nesting or juxtaposing grace sections is not supported,
2548 and might produce crashes or other errors.
2549
2550
2551 @node Glissando
2552 @subsection Glissando
2553 @cindex Glissando 
2554
2555 @cindex @code{\glissando}
2556
2557 A glissando is a smooth change in pitch. It is denoted by a line or a
2558 wavy line between two notes.  It is requested by attaching 
2559 @code{\glissando} to a note
2560
2561 @lilypond[quote,fragment,relative=1,verbatim]
2562 c'\glissando c'
2563 @end lilypond
2564
2565 @seealso
2566
2567 Program reference: @internalsref{Glissando}, and @internalsref{GlissandoEvent}.
2568
2569 Example files: @file{input/regression,glissando.ly}
2570
2571  
2572
2573 @refbugs
2574
2575 Printing text over the line (such as @emph{gliss.}) is not supported.
2576
2577
2578 @node Dynamics
2579 @subsection Dynamics
2580 @cindex Dynamics
2581
2582
2583
2584 @cindex @code{\ppp}
2585 @cindex @code{\pp}
2586 @cindex @code{\p}
2587 @cindex @code{\mp}
2588 @cindex @code{\mf}
2589 @cindex @code{\f}
2590 @cindex @code{\ff}
2591 @cindex @code{\fff}
2592 @cindex @code{\ffff}
2593 @cindex @code{\fp}
2594 @cindex @code{\sf}
2595 @cindex @code{\sff}
2596 @cindex @code{\sp}
2597 @cindex @code{\spp}
2598 @cindex @code{\sfz}
2599 @cindex @code{\rfz}
2600
2601
2602 Absolute dynamic marks are specified using a command after a note
2603 @code{c4\ff}.  The available dynamic marks are @code{\ppp},
2604 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2605 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2606 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}
2607
2608 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2609 c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
2610 c2\sf c\rfz
2611 @end lilypond
2612
2613 @cindex @code{\<}
2614 @cindex @code{\>}
2615 @cindex @code{\"!}
2616
2617
2618
2619 A crescendo mark is started with @code{\<} and terminated with
2620 @code{\!}. A decrescendo is started with @code{\>} and also terminated
2621 with @code{\!}.  Because these marks are bound to notes, if you must
2622 use spacer notes if multiple marks are needed during one note 
2623
2624 @lilypond[quote,fragment,verbatim]
2625 c''\< c''\! d''\> e''\! 
2626 << f''1 { s4 s4\< s4\! \> s4\! } >>
2627 @end lilypond
2628 This may give rise to very short hairpins. Use @code{minimum-length}
2629 in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
2630 example
2631
2632 @example
2633  \override Staff.Hairpin #'minimum-length = #5
2634 @end example
2635
2636 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2637 is an example how to do it
2638
2639 @lilypond[quote,fragment,relative=2,verbatim]
2640 \setTextCresc
2641 c \< d e f\!
2642 \setHairpinCresc
2643 e\> d c b\!
2644 @end lilypond
2645
2646 @cindex crescendo
2647 @cindex decrescendo
2648
2649 You can also supply your own texts
2650 @lilypond[quote,fragment,relative=1,verbatim]
2651 \context Voice {
2652   \set crescendoText = \markup { \italic "cresc. poco" }
2653   \set crescendoSpanner = #'dashed-line
2654   a'2\< a a a\!\mf
2655 }
2656 @end lilypond
2657
2658 @cindex diminuendo
2659
2660
2661 @refcommands
2662
2663 @cindex @code{\dynamicUp}
2664 @code{\dynamicUp}, 
2665 @cindex @code{\dynamicDown}
2666 @code{\dynamicDown}, 
2667 @cindex @code{\dynamicBoth}
2668 @code{\dynamicBoth}.
2669
2670 @cindex direction, of dynamics
2671
2672 @seealso
2673
2674 Program reference: @internalsref{CrescendoEvent},
2675 @internalsref{DecrescendoEvent}, and
2676 @internalsref{AbsoluteDynamicEvent}.
2677
2678 Dynamics are @internalsref{DynamicText} and @internalsref{Hairpin}
2679 objects. Vertical positioning of these symbols is handled by the
2680 @internalsref{DynamicLineSpanner} object.
2681
2682
2683 @node Repeats
2684 @section Repeats
2685
2686
2687 @cindex repeats
2688 @cindex @code{\repeat}
2689
2690
2691 Repetition is a central concept in music, and multiple notations exist
2692 for repetitions. In LilyPond, most of these notations can be captured
2693 in a uniform syntax. One of the advantages is that repeats entered in
2694 this way can be rendered in MIDI accurately.
2695
2696 The following types of repetition are supported
2697
2698 @table @code
2699 @item unfold
2700 Repeated music is fully written (played) out.  Useful for MIDI
2701 output, and entering repetitive music.
2702
2703 @item volta
2704 Repeats are not written out, but alternative endings (volte) are
2705 printed, left to right with brackets. This is the standard notation
2706 for repeats with alternatives.
2707
2708 @ignore
2709 @item fold
2710 Alternative endings are written stacked. This has limited use but may be
2711 used to typeset two lines of lyrics in songs with repeats, see
2712 @inputfileref{input,star-spangled-banner.ly}.
2713 @end ignore
2714
2715 @c tremolo, beamed
2716 @item tremolo
2717 Make tremolo beams.
2718
2719 @item percent
2720 Make beat or measure repeats. These look like percent signs.
2721
2722 @end table  
2723
2724 @menu
2725 * Repeat syntax::               
2726 * Repeats and MIDI::            
2727 * Manual repeat commands::      
2728 * Tremolo repeats::             
2729 * Tremolo subdivisions::        
2730 * Measure repeats::             
2731 @end menu
2732
2733 @node Repeat syntax
2734 @subsection Repeat syntax
2735
2736
2737 LilyPond has one syntactic construct for specifying different types of
2738 repeats.  The syntax is
2739
2740 @example
2741   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2742 @end example
2743
2744 If you have alternative endings, you may add
2745 @cindex @code{\alternative}
2746 @example
2747  \alternative @code{@{} @var{alternative1}
2748             @var{alternative2}
2749             @var{alternative3} @dots{} @code{@}}
2750 @end example
2751 where each @var{alternative} is a music expression.  If you do not
2752 give enough alternatives for all of the repeats, the first alternative
2753 is assumed to be played more than once.
2754
2755 Standard repeats are used like this
2756 @lilypond[quote,fragment,verbatim,relative=2]
2757 c1
2758 \repeat volta 2 { c4 d e f }
2759 \repeat volta 2 { f e d c }
2760 @end lilypond
2761
2762 With alternative endings
2763 @lilypond[quote,fragment,verbatim,relative=2]
2764 c1
2765 \repeat volta 2 {c4 d e f} 
2766 \alternative { {d2 d} {f f,} }
2767 @end lilypond
2768
2769
2770 @lilypond[quote,fragment,verbatim,relative=2]
2771 \context Staff {
2772   \partial 4
2773   \repeat volta 4 { e | c2 d2 | e2 f2 | }
2774   \alternative { { g4 g g } { a | a a a a | b2. } }
2775 }
2776 @end lilypond
2777
2778 It is possible to shorten volta brackets
2779 by setting @code{voltaSpannerDuration}. In the next example, the
2780 bracket only lasts one measure, which is a duration of 3/4. 
2781
2782
2783
2784 @lilypond[verbatim,raggedright]
2785 \relative c''{
2786     \time 3/4
2787     c c c 
2788     \set Staff.voltaSpannerDuration = #(ly:make-moment 3 4)
2789     \repeat "volta" 5 { d d d  }
2790     \alternative { { e e e f f f }
2791     { g g g } }
2792 }
2793 @end lilypond
2794         
2795
2796 @seealso
2797
2798 Examples:
2799
2800 Brackets for the repeat are normally only printed over the topmost
2801 staff. This can be adjusted by setting the @code{voltaOnThisStaff}
2802 property @inputfileref{input/regression,volta-multi-staff.ly},
2803 @inputfileref{input/regression,volta-chord-names.ly}
2804
2805
2806 @refbugs
2807
2808 A nested repeat like
2809
2810 @example 
2811 \repeat @dots{}
2812 \repeat @dots{}
2813 \alternative 
2814 @end example 
2815
2816 @noindent
2817 is ambiguous, since it is is not clear to which @code{\repeat} the
2818 @code{\alternative} belongs. This ambiguity is resolved by always
2819 having the @code{\alternative} belong to the inner @code{\repeat}.
2820 For clarity, it is advisable to use braces in such situations.
2821 @cindex ambiguity
2822
2823
2824
2825 Timing information is not remembered at the start of an alternative,
2826 so after a repeat timing information must be reset by hand, for
2827 example by setting @code{Score.measurePosition} or entering
2828 @code{\partial}.  Similarly, slurs or ties are also not repeated.
2829
2830
2831
2832
2833 @node Repeats and MIDI
2834 @subsection Repeats and MIDI
2835
2836 @cindex expanding repeats
2837
2838 An advantage of the unified syntax for repeats, is that all repeats
2839 may be played out for the MIDI output. This is achieved by
2840 applying the @code{\unfoldrepeats} music function.
2841
2842 @lilypond[verbatim,raggedright]
2843 \new Staff
2844   \unfoldrepeats {
2845     \repeat tremolo 8 {c'32 e' }
2846     \repeat percent 2 { c''8 d'' }
2847     \repeat volta 2 {c'4 d' e' f'} 
2848     \alternative {
2849       { g' a' a' g' }
2850       {f' e' d' c' }
2851     }
2852     \bar "|."
2853   }
2854 @end lilypond
2855
2856 When creating a score file using @code{\unfoldrepeats} for midi, then
2857 it is necessary to make two @code{\score} blocks. One for MIDI, with
2858 unfolded repeats, and one for notation, eg.
2859
2860 @example
2861   \score @{
2862       @var{..music..}
2863       \paper @{ .. @}
2864   @} 
2865   \score @{
2866       \unfoldrepeats @var{..music..}
2867       \midi @{ .. @}
2868   @} 
2869 @end example
2870
2871 @node Manual repeat commands
2872 @subsection Manual repeat commands
2873
2874 @cindex @code{repeatCommands}
2875
2876 The property @code{repeatCommands} can be used to control the layout of
2877 repeats. Its value is a Scheme list of repeat commands, where each repeat
2878 command can be
2879
2880 @table @asis
2881 @item @code{start-repeat},
2882   which prints a @code{|:} bar line;
2883 @item @code{end-repeat},
2884   which prints a @code{:|} bar line;
2885 @item @code{(volta @var{text})},
2886   which prints a volta bracket saying @var{text}: The text can be specified as
2887 a text string or as a markup text, see @ref{Text markup}. Do not
2888 forget to change the font, as the default number font does not contain
2889 alphabetic characters;
2890 @item @code{(volta #f)}, which 
2891   stops a running volta bracket.
2892 @end table
2893
2894 @lilypond[quote,verbatim,fragment,relative=2]
2895 c4
2896   \set Score.repeatCommands = #'((volta "93") end-repeat)
2897 c4 c4
2898   \set Score.repeatCommands = #'((volta #f))
2899 c4 c4
2900 @end lilypond
2901
2902
2903
2904 @seealso
2905
2906 Program reference: @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2907 @internalsref{VoltaRepeatedMusic},
2908 @internalsref{UnfoldedRepeatedMusic}, and
2909 @internalsref{FoldedRepeatedMusic}.
2910
2911 @node Tremolo repeats
2912 @subsection Tremolo repeats
2913 @cindex tremolo beams
2914
2915 To place tremolo marks between notes, use @code{\repeat} with tremolo
2916 style
2917 @lilypond[quote,verbatim,raggedright]
2918   \context Voice \relative c' {
2919     \repeat "tremolo" 8 { c16 d16 }
2920     \repeat "tremolo" 4 { c16 d16 }    
2921     \repeat "tremolo" 2 { c16 d16 }
2922   }
2923 @end lilypond
2924
2925 Tremolo marks can also be put on a single note.  In this case, the
2926 note should not be surrounded by braces.
2927 @lilypond[quote,verbatim,raggedright]
2928 \repeat "tremolo" 4 c'16
2929 @end lilypond
2930
2931 Similar output is obtained using the tremolo subdivision, described in
2932 @ref{Tremolo subdivisions}.
2933
2934 @seealso
2935
2936 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
2937
2938 Program reference: tremolo beams are @internalsref{Beam} objects. Single stem
2939 tremolos are @internalsref{StemTremolo} objects.  The music expression is
2940 @internalsref{TremoloEvent}.
2941
2942 Example files: @inputfileref{input/regression,chord-tremolo.ly},
2943 @inputfileref{input/regression,stem-tremolo.ly}.
2944
2945 @node Tremolo subdivisions
2946 @subsection Tremolo subdivisions
2947 @cindex tremolo marks
2948 @cindex @code{tremoloFlags}
2949
2950 Tremolo marks can be printed on a single note by adding
2951 `@code{:}[@var{number}]' after the note.  The number indicates the
2952 duration of the subdivision, and it must be at least 8.  A
2953 @var{length} value of 8 gives one line across the note stem.  If the
2954 length is omitted, the last value (stored in @code{tremoloFlags}) is
2955 used
2956
2957 @lilypond[quote,verbatim,fragment]
2958 c'2:8 c':32 | c': c': |
2959 @end lilypond
2960
2961 @c [TODO : stok is te kort bij 32en]
2962
2963 @refbugs
2964
2965 Tremolos entered in this way do not carry over into the MIDI output.
2966
2967 @seealso
2968
2969 In this manual: @ref{Tremolo repeats}.
2970
2971 Elsewhere: @internalsref{StemTremolo}, @internalsref{TremoloEvent}.
2972
2973 @node Measure repeats
2974 @subsection Measure repeats
2975
2976 @cindex percent repeats
2977 @cindex measure repeats
2978
2979 In the @code{percent} style, a note pattern can be repeated. It is
2980 printed once, and then the pattern is replaced with a special sign.
2981 Patterns of one and two measures are replaced by percent-like signs,
2982 patterns that divide the measure length are replaced by slashes
2983
2984 @lilypond[quote,verbatim,raggedright]
2985 \new Voice {
2986   \repeat "percent" 4  { c'4 }
2987   \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2988 }
2989 @end lilypond
2990
2991 @seealso
2992
2993 Program reference: @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2994 @internalsref{PercentRepeatedMusic}, and
2995 @internalsref{DoublePercentRepeat}.
2996
2997
2998
2999 @node Rhythmic music
3000 @section Rhythmic music
3001
3002
3003 @menu
3004 * Showing melody rhythms::      
3005 * Entering percussion::         
3006 * Percussion staves::           
3007 @end menu
3008
3009
3010 @node Showing melody rhythms
3011 @subsection Showing melody rhythms
3012
3013 Sometimes you might want to show only the rhythm of a melody.  This
3014 can be done with the rhythmic staff. All pitches of notes on such a
3015 staff are squashed, and the staff itself has a single line
3016
3017 @lilypond[quote,fragment,relative=1,verbatim]
3018 \context RhythmicStaff {
3019   \time 4/4
3020   c4 e8 f  g2 | r4 g r2 | g1:32 | r1 |
3021 }
3022 @end lilypond
3023
3024 @seealso
3025
3026 Program reference: @internalsref{RhythmicStaff}.
3027
3028 Examples: @inputfileref{input/regression,rhythmic-staff.ly}.
3029
3030
3031 @node Entering percussion
3032 @subsection Entering percussion
3033
3034 @cindex percussion
3035 @cindex drums
3036
3037
3038 Percussion notes may be entered in @code{\drums} mode, which is
3039 similar to the standard mode for entering notes.  Each piece of
3040 percussion has a full name and an abbreviated name, and both can be used
3041 in input files
3042
3043 @lilypond[quote,raggedright,verbatim]
3044 \new DrumStaff \drums {
3045   hihat hh bassdrum bd
3046 }
3047 @end lilypond
3048
3049 The complete list of drum names is in the init file
3050 @file{ly/drumpitch-init.ly}.
3051 @c TODO: properly document this.
3052
3053 @seealso
3054
3055 Program reference: @internalsref{DrumNoteEvent}.
3056
3057 @node Percussion staves
3058 @subsection Percussion staves
3059 @cindex percussion
3060 @cindex drums
3061
3062 A percussion part for more than one instrument typically uses a
3063 multi line staff where each position in the staff refers to one piece
3064 of percussion.
3065
3066
3067 To typeset the music, the notes must be interpreted in a
3068 @internalsref{DrumStaff} and @internalsref{DrumVoice} contexts
3069
3070 @c
3071 @lilypond[quote,raggedright,verbatim]
3072 up = \drums { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
3073 down = \drums { bassdrum4 snare8 bd r bd sn4 }
3074   \new DrumStaff <<
3075     \new DrumVoice { \voiceOne \up } 
3076     \new DrumVoice { \voiceTwo \down } 
3077   >>
3078 @end lilypond
3079
3080 The above example shows verbose polyphonic notation. The short
3081 polyphonic notation, described in @ref{Polyphony}, can also be used if
3082 the @internalsref{DrumVoices} are instantiated by hand first. For example, 
3083
3084 @lilypond[quote,fragment,verbatim] 
3085 \new DrumStaff <<
3086   \context DrumVoice = "1" {  s1 *2 }
3087   \context DrumVoice = "2" {  s1 *2 }
3088   \drums {
3089     bd4 sn4 bd4 sn4
3090     <<
3091       { \repeat unfold 16 hh16 }
3092       \\
3093       { bd4 sn4 bd4 sn4 }
3094     >>
3095   }   
3096 >>
3097 @end lilypond
3098
3099
3100 There are also other layout possibilities. To use these, set the
3101 property @code{drumStyleTable} in context @internalsref{DrumVoice}.
3102 The following variables have been predefined
3103
3104 @table @code
3105 @item drums-style
3106 This is the default. It typesets a typical drum kit on a five-line staff
3107
3108 @lilypond[quote,noindent]
3109 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
3110     bd sn ss tomh tommh tomml toml tomfh tomfl }
3111 mus = \drums  { cymc cyms cymr hh | hhc hho hhho hhp | \break cb hc
3112     bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
3113 \score {
3114     << \new DrumStaff\with {
3115             \remove Bar_engraver
3116             \remove Time_signature_engraver
3117             \override Stem #'transparent = ##t
3118             \override Stem #'Y-extent-callback = ##f
3119             minimumVerticalExtent = #'(-4.0 . 5.0)
3120     } \mus
3121         \context Lyrics \nam 
3122     >>
3123     \paper {
3124     %% need to do this, because of indented @itemize
3125     linewidth= 9 \cm 
3126     \context { \Score
3127     \override LyricText #'font-family = #'typewriter
3128     \override BarNumber #'transparent =##T
3129 }}}
3130 @end lilypond
3131
3132 The drum scheme supports six different toms.  When there fewer toms, simply
3133 select the toms that produce the desired result, i.e. to get toms on
3134 the three middle lines you use @code{tommh}, @code{tomml} and
3135 @code{tomfh}.
3136
3137 @item timbales-style
3138 This  typesets timbales on a two line staff
3139
3140 @lilypond[quote,raggedright]
3141 nam = \lyrics { timh ssh timl ssl cb }
3142 mus = \drums  { timh ssh timl ssl cb s16 }
3143
3144 <<
3145         \context DrumStaff \with {
3146             \remove Bar_engraver
3147             \remove Time_signature_engraver
3148             \override Stem #'transparent = ##t
3149             \override Stem #'Y-extent-callback = ##f
3150             \override StaffSymbol #'line-count = #2
3151             \override StaffSymbol #'staff-space = #2
3152             minimumVerticalExtent = #'(-3.0 . 4.0)
3153             drumStyleTable = #timbales-style
3154         } \mus
3155         \context Lyrics {
3156             \override LyricText #'font-family = #'typewriter
3157
3158         \nam  }
3159 >>
3160 @end lilypond
3161 @item congas-style
3162 This typesets congas on a two line staff
3163
3164 @lilypond[quote,raggedright]
3165 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
3166 mus = \drums  { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
3167 <<
3168         \context DrumStaff\with {
3169             \remove Bar_engraver
3170             \remove Time_signature_engraver
3171             drumStyleTable = #congas-style
3172             \override StaffSymbol #'line-count = #2
3173             
3174             %% this sucks; it will lengthen stems.
3175             \override StaffSymbol #'staff-space = #2
3176             \override Stem #'transparent = ##t
3177             \override Stem #'Y-extent-callback = ##f
3178         } \mus
3179         \context Lyrics {
3180                     \override LyricText #'font-family = #'typewriter
3181 \nam  }
3182 >>
3183 @end lilypond
3184 @item bongos-style
3185 This typesets bongos on a two line staff
3186
3187 @lilypond[quote,raggedright]
3188 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
3189 mus = \drums  { boh boho bohm ssh bol bolo bolm ssl s16 }
3190 <<
3191         \context DrumStaff\with {
3192             \remove Bar_engraver
3193             \remove Time_signature_engraver
3194             \override StaffSymbol #'line-count = #2
3195             drumStyleTable = #bongos-style
3196            
3197             %% this sucks; it will lengthen stems.
3198             \override StaffSymbol #'staff-space = #2
3199             \override Stem #'transparent = ##t
3200             \override Stem #'Y-extent-callback = ##f
3201         } \mus
3202         \context Lyrics {
3203                     \override LyricText #'font-family = #'typewriter
3204 \nam  }
3205 >>
3206 @end lilypond
3207
3208 @item percussion-style
3209 to typeset all kinds of simple percussion on one line staves
3210 @lilypond[quote,raggedright]
3211 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
3212 mus = \drums  { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
3213 <<
3214         \context DrumStaff\with{
3215             \remove Bar_engraver
3216             drumStyleTable = #percussion-style
3217             \override StaffSymbol #'line-count = #1
3218             \remove Time_signature_engraver
3219             \override Stem #'transparent = ##t
3220             \override Stem #'Y-extent-callback = ##f
3221         } \mus
3222         \context Lyrics {
3223           \override LyricText #'font-family = #'typewriter
3224           \nam
3225         }
3226 >>
3227 @end lilypond
3228 @end table
3229
3230 If you do not like any of the predefined lists you can define your own
3231 list at the top of your file
3232
3233 @lilypond[quote,raggedright,verbatim]
3234 #(define mydrums '(
3235         (bassdrum     default   #f        -1)
3236         (snare        default   #f        0)
3237         (hihat        cross     #f        1)
3238         (pedalhihat   xcircle   "stopped" 2)
3239         (lowtom       diamond   #f       3)))
3240 up = \drums { hh8 hh hh hh hhp4 hhp }
3241 down = \drums { bd4 sn bd toml8 toml }
3242
3243 \new DrumStaff <<
3244     \set DrumStaff.drumStyleTable
3245        = #(alist->hash-table mydrums)
3246     \new DrumVoice { \voiceOne \up }
3247     \new DrumVoice { \voiceTwo \down }
3248 >>
3249 @end lilypond
3250
3251
3252 @seealso
3253
3254 Init files: @file{ly/drumpitch-init.ly}.
3255
3256 Program reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
3257
3258 @refbugs
3259
3260 Because general MIDI does not contain rim shots, the sidestick is used
3261 for this purpose instead.
3262
3263 @node Piano music
3264 @section Piano music
3265
3266 Piano staves are two normal staves coupled with a brace.  The staves
3267 are largely independent, but sometimes voices can cross between the
3268 two staves.  The same notation is also used for harps and other key
3269 instruments.  The @internalsref{PianoStaff} is especially built to
3270 handle this cross-staffing behavior.  In this section we discuss the
3271 @internalsref{PianoStaff} and some other pianistic peculiarities.
3272
3273
3274 @menu
3275 * Automatic staff changes::     
3276 * Manual staff switches::       
3277 * Pedals::                      
3278 * Arpeggio::                    
3279 * Staff switch lines::          
3280 * Cross staff stems::           
3281 @end menu 
3282
3283 @refbugs
3284
3285 Dynamics are not centered, but  workarounds do exist. See
3286 @inputfileref{input/template,piano-dynamics.ly}.
3287
3288 @cindex cross staff stem
3289 @cindex stem, cross staff
3290 @cindex distance between staves in piano music
3291
3292 The distance between the two staves is the same for all systems in the
3293 score. It is possible to override this per system, but it does require
3294 an arcane command incantation. See
3295 @inputfileref{input/test,piano-staff-distance.ly}.
3296
3297
3298 @node Automatic staff changes
3299 @subsection Automatic staff changes
3300 @cindex Automatic staff changes
3301
3302 Voices can be made to switch automatically between the top and the bottom
3303 staff. The syntax for this is
3304
3305 @quotation
3306 @example
3307 \autochange \context Voice  @dots{}@var{music}@dots{} 
3308 @end example
3309 @end quotation
3310
3311 @noindent
3312 The two staves of the piano staff must be named @code{up} and
3313 @code{down}.
3314
3315 A @code{\relative} section that is outside of @code{\autochange} has
3316 no effect on the pitches of @var{music}, so, if necessary, put
3317 @code{\relative} inside @code{\autochange} like
3318
3319 @quotation
3320 @example
3321 \autochange \relative @dots{} \new Voice @dots{}
3322 @end example
3323 @end quotation
3324
3325
3326 The autochanger switches on basis of pitch (middle C is the turning
3327 point), and it looks ahead skipping over rests to switch in
3328 advance. Here is a practical example
3329         
3330 @lilypond[quote,verbatim,raggedright]
3331 \context PianoStaff <<
3332   \context Staff = "up" {
3333     \autochange \new Voice \relative c' {
3334        g4 a  b c d r4 a g } }
3335   \context Staff = "down" {
3336        \clef bass
3337        s1*2
3338 } >>
3339 @end lilypond
3340
3341 @noindent
3342 In this example, spacer rests are used to prevent empty staves  from
3343 being terminated too soon.
3344
3345
3346 @seealso
3347
3348 In this manual: @ref{Manual staff switches}.
3349
3350 Program reference: @internalsref{AutoChangeMusic}.
3351
3352
3353
3354 @refbugs
3355
3356 The staff switches may not end up in optimal places. For high
3357 quality output, staff switches should be specified manually.
3358
3359
3360 @code{\autochange} cannot be inside @code{\times}. 
3361
3362 Internally, the @code{\partcombine} interprets both arguments as
3363 @code{Voice}s named @code{one} and @code{two}, and then decides when
3364 the parts can be combined. Consequently, if the arguments switch to
3365 differently named @internalsref{Voice} contexts, the events in those
3366 will be ignored.
3367
3368
3369 @node Manual staff switches
3370 @subsection Manual staff switches
3371
3372 @cindex manual staff switches
3373 @cindex staff switch, manual
3374
3375 Voices can be switched between staves manually, using the command
3376 @example
3377 \change Staff = @var{staffname} @var{music}
3378 @end example
3379
3380 @noindent
3381 The string @var{staffname} is the name of the staff. It switches the
3382 current voice from its current staff to the Staff called
3383 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3384 @code{"down"}. The @context{Staff} referred to must already exist, so
3385 usually the setup for a score will start with a setup of the staves,
3386
3387 @example
3388   <<
3389   \context Staff = up @{
3390     \skip 1 * 10  %@emph{ keep staff alive}
3391     @}
3392   \context Staff = down @{
3393     \skip 1 * 10  %@emph{idem}
3394     @}
3395   >>
3396 @end example 
3397
3398
3399 and the @context{Voice} is inserted afterwards
3400
3401 @example
3402   \context Staff = down
3403     \new Voice @{ @dots{} \change Staff = up @dots{} @}
3404 @end example
3405
3406
3407 @node Pedals
3408 @subsection Pedals
3409 @cindex Pedals
3410
3411 Pianos have pedals that alter the way sound is produced. Generally, a
3412 piano has three pedals, sustain, una corda, and sostenuto.
3413
3414
3415 Piano pedal instruction can be expressed by attaching
3416 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3417 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3418 note or chord
3419
3420 @lilypond[quote,fragment,verbatim]
3421 c'4\sustainDown c'4\sustainUp
3422 @end lilypond
3423
3424 What is printed can be modified by setting @code{pedal@var{X}Strings},
3425 where @var{X} is one of the pedal types: @code{Sustain},
3426 @code{Sostenuto} or @code{UnaCorda}.  Refer to
3427 @internalsref{SustainPedal} in the program reference for more
3428 information.
3429
3430 Pedals can also be indicated by a sequence of brackets, by setting the
3431 @code{pedalSustainStyle} property to bracket objects
3432
3433 @lilypond[quote,fragment,verbatim,relative=2]
3434 \set Staff.pedalSustainStyle = #'bracket
3435 c\sustainDown d e
3436 b\sustainUp\sustainDown
3437 b g \sustainUp a \sustainDown \bar "|."
3438 @end lilypond
3439
3440 A third style of pedal notation is a mixture of text and brackets,
3441 obtained by setting the @code{pedalSustainStyle} style property to
3442 @code{mixed}
3443
3444 @lilypond[quote,fragment,verbatim,relative=2]
3445 \set Staff.pedalSustainStyle = #'mixed
3446 c\sustainDown d e
3447 b\sustainUp\sustainDown
3448 b g \sustainUp a \sustainDown \bar "|."
3449 @end lilypond
3450
3451 The default `*Ped.' style for sustain and damper pedals corresponds to
3452 style @code{#'text}. The sostenuto pedal uses @code{mixed} style by
3453 default.
3454
3455 @lilypond[quote,fragment,verbatim,relative=2]
3456 c\sostenutoDown d e c, f g a\sostenutoUp
3457 @end lilypond
3458
3459 For fine-tuning of the appearance of a pedal bracket, the properties
3460 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3461 @code{PianoPedalBracket} objects (see
3462 @internalsref{PianoPedalBracket} in the Program reference)  can be modified.  For example, the
3463 bracket may be extended to the right edge of the note head
3464
3465 @lilypond[quote,fragment,verbatim,relative=2]
3466 \override Staff.PianoPedalBracket  
3467    #'shorten-pair = #'(0 . -1.0)
3468 c\sostenutoDown d e c, f g a\sostenutoUp
3469 @end lilypond
3470
3471 @node Arpeggio
3472 @subsection Arpeggio
3473 @cindex Arpeggio
3474
3475 @cindex broken arpeggio
3476 @cindex @code{\arpeggio}
3477
3478 You can specify an arpeggio sign on a chord by attaching an
3479 @code{\arpeggio} to a chord
3480
3481
3482 @lilypond[quote,fragment,relative=1,verbatim]
3483 <c e g c>\arpeggio
3484 @end lilypond
3485
3486 When an arpeggio crosses staves, you attach an arpeggio to the chords
3487 in both staves, and set
3488 @internalsref{PianoStaff}.@code{connectArpeggios}
3489
3490 @lilypond[quote,fragment,relative=1,verbatim]
3491 \context PianoStaff <<
3492   \set PianoStaff.connectArpeggios = ##t
3493   \new Staff  { <c' e g c>\arpeggio }
3494   \new Staff { \clef bass  <c,, e g>\arpeggio }
3495 >>
3496 @end lilypond
3497
3498 The direction of the arpeggio is sometimes denoted by adding an
3499 arrowhead to the wiggly line
3500
3501 @lilypond[quote,fragment,relative=1,verbatim]
3502 \context Voice {
3503   \arpeggioUp
3504   <c e g c>\arpeggio
3505   \arpeggioDown
3506   <c e g c>\arpeggio
3507 }
3508 @end lilypond
3509
3510 A square bracket on the left indicates that the player should not
3511 arpeggiate the chord
3512
3513 @c todo: ugh, lousy typography. Look for real example. --hwn
3514
3515 @lilypond[quote,fragment,relative=1,verbatim]
3516 \arpeggioBracket
3517 <c' e g c>\arpeggio
3518 @end lilypond
3519
3520 @refcommands
3521
3522 @cindex @code{\arpeggio}
3523 @code{\arpeggio},
3524 @cindex @code{\arpeggioUp}
3525 @code{\arpeggioUp},
3526 @cindex @code{\arpeggioDown}
3527 @code{\arpeggioDown},
3528 @cindex @code{\arpeggioBoth}
3529 @code{\arpeggioBoth},
3530 @cindex @code{\arpeggioBracket}
3531 @code{\arpeggioBracket}.
3532
3533 @seealso
3534
3535 Program reference: @internalsref{ArpeggioEvent},
3536 @internalsref{Arpeggio}.
3537
3538 @refbugs
3539
3540 It is not possible to mix connected arpeggios and unconnected
3541 arpeggios in one @internalsref{PianoStaff} at the same point in time.
3542
3543 @node Staff switch lines
3544 @subsection Staff switch lines
3545
3546
3547 @cindex follow voice
3548 @cindex staff switching
3549 @cindex cross staff
3550
3551 @cindex @code{followVoice}
3552
3553 Whenever a voice switches to another staff a line connecting the notes
3554 can be printed automatically. This is switched on by setting
3555 @code{PianoStaff.followVoice} to true
3556
3557 @lilypond[quote,fragment,relative=1,verbatim]
3558 \context PianoStaff <<
3559   \set PianoStaff.followVoice = ##t
3560   \context Staff \context Voice {
3561     c1
3562     \change Staff=two
3563     b2 a
3564   }
3565  \context Staff=two { \clef bass \skip 1*2 }
3566 >>  
3567 @end lilypond
3568
3569 @seealso
3570
3571 Program reference: @internalsref{VoiceFollower}.
3572
3573 @refcommands
3574
3575 @cindex @code{\showStaffSwitch}
3576 @code{\showStaffSwitch}, 
3577 @cindex @code{\hideStaffSwitch}
3578 @code{\hideStaffSwitch}.
3579
3580
3581 @node Cross staff stems
3582 @subsection Cross staff stems
3583
3584 The chords which cross staves may be produced by increasing the length
3585 of the stem in the lower stave, so it reaches the stem in the upper
3586 stave, or vice versa.
3587
3588 @lilypond[raggedright,verbatim]
3589 stemExtend = \once \override Stem  #'length = #22
3590 noFlag = \once \override Stem  #'flag-style = #'no-flag
3591 \context PianoStaff <<
3592   \new Staff   {
3593     \stemDown \stemExtend
3594     f'4
3595     \stemExtend \noFlag
3596     f'8
3597   }
3598   \new Staff {
3599     \clef bass
3600     a4 a8
3601   }
3602 >>
3603 @end lilypond
3604
3605
3606 @node Vocal music
3607 @section Vocal music
3608
3609 There are three different issues when printing vocal music
3610
3611 @itemize @bullet
3612 @item
3613   Song texts must be entered as texts, not notes. For example, for 
3614 lyrics, the input @code{a} should be interpreted as
3615 a one letter text, and not the note A.
3616 @item
3617   Song texts must be printed as text, and not as notes. 
3618 @item
3619   Song texts must be aligned with the notes of their melody
3620 @end itemize
3621
3622 The simplest solution to printing music uses the @code{\addlyrics}
3623 function to deal with these three problems in one go.  However, these
3624 three functions can be controlled separately, which is necessary
3625 for complex vocal music. 
3626
3627
3628 @menu
3629 * Setting simple songs::        
3630 * Entering lyrics::             
3631 * Hyphens and extenders::       
3632 * The Lyrics context::          
3633 * Flexibility in alignment::    
3634 * More stanzas::                
3635 * Ambitus::                     
3636 @end menu
3637
3638 @node Setting simple songs
3639 @subsection Setting simple songs
3640
3641 The easiest way to add lyrics to a melody is to append
3642 @cindex \addlyrics
3643 @example
3644   \addlyrics @{ @var{the lyrics} @} 
3645 @end example
3646
3647 @noindent
3648 to a melody. Here is an example,
3649
3650 @lilypond[raggedright,verbatim]
3651 {
3652     \time 3/4 
3653     \relative { c2 e4 g2. }
3654     \addlyrics { play the game }
3655 }
3656 @end lilypond
3657
3658 More stanzas can be added by adding more
3659 @code{\addlyrics} sections 
3660
3661 @lilypond[raggedright,verbatim]
3662 {
3663   \time 3/4
3664   \relative {  c2 e4 g2. }
3665   \addlyrics { play the game } 
3666   \addlyrics { speel het spel } 
3667   \addlyrics { joue le jeu }
3668 }
3669 @end lilypond
3670
3671 @node Entering lyrics
3672 @subsection Entering lyrics
3673
3674
3675 @cindex lyrics
3676 @cindex @code{\lyrics}
3677 @cindex punctuation
3678
3679 Lyrics are entered in a special input mode. This mode is is introduced
3680 by the keyword @code{\lyrics}.  In this mode you can enter lyrics,
3681 with punctuation and accents, and the input @code{a} is not parsed as
3682 a pitch, but rather as a one letter syllable.  Syllables are entered
3683 like notes, but with pitches replaced by text.  For example,
3684 @example
3685   \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3686 @end example
3687
3688
3689 A word lyrics mode begins with an alphabetic character, and ends with
3690 any space or digit.  The following characters can be any character
3691 that is not a digit or white space.  One important consequence of this
3692 is that a word can end with @code{@}}. The following example is
3693 usually a bug. The syllable includes a @code{@}}, so the
3694 opening brace is not balanced
3695 @example
3696   \lyrics @{ twinkle@}
3697 @end example
3698
3699 @cindex @code{\property}, in @code{\lyrics}
3700 @noindent
3701 Similarly, a period following an alphabetic sequence, is included in
3702 the resulting string. As a consequence, spaces must be inserted around
3703 property commands
3704 @example
3705   \override Score . LyricText #'font-shape = #'italic
3706 @end example
3707
3708 @cindex @code{_}
3709 @cindex spaces, in lyrics
3710 @cindex quotes, in lyrics
3711
3712 Any @code{_} character which appears in an unquoted word is converted
3713 to a space.  This provides a mechanism for introducing spaces into words
3714 without using quotes.  Quoted words can also be used in Lyrics mode to
3715 specify words that cannot be written with the above rules. The
3716 following example incorporates double quotes
3717
3718 @example
3719   \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3720 @end example
3721
3722 This example is slightly academic, since it gives better looking
3723 results to use single quotes, @code{``} and @code{''}
3724 @example
3725   \lyrics @{ He said: ``Let my peo ple go'' @}
3726 @end example
3727
3728
3729 The full definition of a word start in Lyrics mode is somewhat more
3730 complex.
3731
3732 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3733 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3734 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3735 any 8-bit character with ASCII code over 127, or a two-character
3736 combination of a backslash followed by one of @code{`}, @code{'},
3737 @code{"}, or @code{^}.
3738
3739
3740
3741 @seealso
3742
3743 Program reference: events @internalsref{LyricEvent}, and
3744 @internalsref{LyricText}.
3745
3746 @refbugs
3747
3748 The definition of lyrics mode is too complex.
3749
3750 @node Hyphens and extenders
3751 @subsection Hyphens and extenders
3752
3753 @cindex hyphens
3754
3755 Centered hyphens are entered as `@code{-}@code{-}' between syllables.
3756 The hyphen will have variable length depending on the space between
3757 the syllables and it will be centered between the syllables.
3758
3759 @cindex melisma
3760 @cindex extender
3761
3762 When a lyric is sung over many notes (this is called a melisma), this is
3763 indicated with a horizontal line centered between a syllable and the
3764 next one. Such a line is called an extender line, and it is entered as
3765 @code{__}.
3766
3767
3768 @seealso
3769
3770 Program reference: @internalsref{HyphenEvent}, 
3771 @internalsref{ExtenderEvent}, @internalsref{LyricHyphen}, and
3772 @internalsref{LyricExtender}
3773
3774 Examples: @inputfileref{input/test,lyric-hyphen-retain.ly}.
3775
3776
3777
3778 @node The Lyrics context
3779 @subsection  The Lyrics context
3780
3781
3782 Lyrics are printed by interpreting them in a @internalsref{Lyrics} context
3783 @example
3784  \context Lyrics \lyrics @dots{}
3785 @end example
3786
3787 @cindex automatic syllable durations
3788 @cindex @code{\lyricsto}
3789 @cindex lyrics and melodies
3790
3791 This will place the lyrics according to the durations that were
3792 entered. The lyrics can also be aligned under a given melody
3793 automatically.  In this case, it is no longer necessary to enter the
3794 correct duration for each syllable.  This is achieved by combining the
3795 melody and the lyrics with the @code{\lyricsto} expression
3796 @example
3797 \lyricsto @var{name} \new Lyrics @dots{} 
3798 @end example
3799
3800 This aligns the lyrics to the
3801 @c
3802 notes of the @internalsref{Voice} context called @var{name}, which has
3803 to exist. Therefore, normally the @code{Voice} is specified first, and
3804 then the lyrics are specified with @code{\lyricsto}. The command
3805 @code{\lyricsto} switches to @code{\lyrics} mode automatically, so the
3806 @code{\lyrics} keyword may be omitted.
3807
3808 For different or more complex orderings, the best way is to setup the
3809 hierarchy of staves and lyrics first, e.g.
3810 @example
3811 \context ChoirStaff  <<
3812   \context Lyrics = sopranoLyrics @{ s1 @}
3813   \context Voice = soprano @{ @emph{music} @}
3814   \context Lyrics = tenorLyrics @{ s1 @}
3815   \context Voice = tenor @{ @emph{music} @}
3816 >>
3817 @end example
3818 and then combine the appropriate melodies and lyric lines
3819 @example
3820   \lyricsto "soprano" \context Lyrics = sopranoLyrics
3821      @emph{the lyrics}
3822 @end example
3823
3824 @noindent
3825 The final input would resemble
3826
3827 @example
3828   << \context ChoirStaff  << @emph{setup the music}  >>
3829      \lyricsto "soprano" @emph{etc}
3830      \lyricsto "alto" @emph{etc}
3831      @emph{etc}
3832   >>
3833 @end example 
3834
3835
3836 The @code{\lyricsto} command detects melismata: it only puts one
3837 syllable under a tied or slurred group of notes. If you want to force
3838 an unslurred group of notes to be a melisma, insert @code{\melisma}
3839 after the first note of the group, and @code{\melismaEnd} after the
3840 last one, e.g.
3841
3842 @lilypond[quote,relative=2,raggedright,fragment,verbatim]
3843 <<
3844   \context Voice = "lala" {
3845     \time 3/4
3846     f4 g8
3847     \melisma 
3848     f e f
3849     \melismaEnd
3850     e2
3851   }
3852   \lyricsto "lala" \new Lyrics {
3853     la di __ daah 
3854   }
3855 >>
3856 @end lilypond
3857
3858 In addition, notes are considered a melisma if they are manually
3859 beamed, and automatic beaming (see @ref{Setting automatic beam
3860 behavior}) is switched off.
3861
3862 @ignore
3863
3864 @c nonformation:
3865
3866 The criteria for deciding melismata can
3867 be tuned with the property @code{melismaBusyProperties}. See
3868 @internalsref{Melisma_translator} in the program reference for more
3869 information.
3870
3871 @end ignore
3872
3873 Lyrics can also be entered without @code{\lyricsto}. In this case the
3874 durations of each syllable must be entered explicitly, for example,
3875
3876 @verbatim
3877   play2 the4 game2.
3878   sink2 or4 swim2.  
3879 @end verbatim
3880
3881 The alignment to a melody can be specified with the
3882 @code{associatedVoice} property,
3883
3884 @verbatim
3885   \set associatedVoice = #"lala"
3886 @end verbatim 
3887
3888 @noindent
3889 The value of the property (here: @code{"lala"}) should be the name of
3890 a @internalsref{Voice} context. Without this setting, extender lines
3891 will not be formatted properly.
3892
3893 Here is an example demonstrating manual lyric durations,
3894
3895 @lilypond[relative=1,verbatim,fragment]
3896 << \context Voice = melody {
3897      \time 3/4
3898      c2 e4 g2.
3899   } 
3900   \new Lyrics \lyrics {
3901     \set associatedVoice = #"melody"
3902     play2 the4 game2.
3903   }  >>
3904 @end lilypond
3905
3906 @cindex SATB
3907 @cindex choral score
3908
3909 A complete example of a SATB score setup is in the file
3910 @inputfileref{input/template,satb.ly}.
3911
3912
3913 @refcommands
3914
3915 @code{\melisma}, @code{\melismaEnd}
3916 @cindex @code{\melismaEnd}
3917 @cindex @code{\melisma}
3918
3919 @seealso
3920
3921 Program reference: @internalsref{LyricCombineMusic},
3922 @internalsref{Lyrics}, @internalsref{Melisma_translator}.
3923
3924 Examples: @inputfileref{input/template,satb.ly},
3925 @inputfileref{input/regression,lyric-combine-new.ly},
3926 @c TODO: make separate section for melismata 
3927 @inputfileref{input/test,lyrics-melisma-variants.ly}.
3928 @inputfileref{input/test,lyrics-melisma-faster.ly}.
3929  
3930 @refbugs
3931
3932 Melismata are not detected automatically, and extender lines must be
3933 inserted by hand.
3934
3935
3936 @c TODO: document \new Staff << Voice \lyricsto >> bug
3937
3938 @node Flexibility in alignment
3939 @subsection Flexibility in alignment
3940
3941
3942 Often, different stanzas of one song are put to one melody in slightly
3943 differing ways.  Such variations can still be captured with
3944 @code{\lyricsto}.
3945
3946 One possibility is that the text has a melisma in one stanza, but
3947 multiple syllables in another one. One solution is to make the faster
3948 voice ignore the melisma. This is done by setting
3949 @code{ignoreMelismata} in the Lyrics context.
3950
3951 There has one tricky aspect. The setting for @code{ignoreMelismata}
3952 must be set one syllable @emph{before} the non-melismatic syllable
3953 in the text, as shown here,
3954
3955 @lilypond[verbatim,raggedright]
3956 <<
3957     \relative \context Voice = "lahlah" {
3958         \set Staff.autoBeaming = ##f 
3959         c4
3960         \slurDotted
3961         f8.[( g16])
3962         a4
3963     }
3964     \new Lyrics \lyricsto "lahlah" {
3965         more slow -- ly
3966     }
3967     \new Lyrics \lyricsto "lahlah" {
3968         \set ignoreMelismata = ##t % applies to "fas"
3969         go fas -- ter
3970         \unset ignoreMelismata
3971         still
3972     }
3973 >>
3974 @end lilypond
3975
3976
3977 The @code{ignoreMelismata} applies to the syllable ``fas'', so it
3978 should bev entered before ``go''.
3979
3980 The reverse is also possible: making a lyric line slower than the
3981 standard. This can be achieved by insert @code{\skip}s into the
3982 lyrics. For every @code{\skip}, the text will be delayed another note.
3983 For example,
3984
3985 @lilypond[verbatim,raggedright]
3986 \relative { c c g' }
3987 \addlyrics {
3988   twin -- \skip 4
3989   kle
3990 }
3991 @end lilypond
3992
3993 More complex variations in text underlay are possible. It is possible
3994 to switch the melody for a line of lyrics during the text. This is
3995 done by setting the @code{associatedVoice} property. In the example 
3996
3997 @lilypond[raggedright]
3998 <<
3999     \relative \context Voice = "lahlah" {
4000         \set Staff.autoBeaming = ##f 
4001         c4
4002         <<
4003             \context Voice = alternative {
4004                 \voiceOne
4005                 \times 2/3 {
4006
4007                     % show associations clearly.
4008                     \override NoteColumn #'force-hshift = #-3
4009                     f8 f g
4010                 }
4011             }
4012             {
4013                 \voiceTwo
4014                 f8.[ g16]
4015                 \oneVoice
4016           } >>
4017         a8( b) c
4018
4019     }
4020     \new Lyrics \lyricsto "lahlah" {
4021         Ju -- ras -- sic Park
4022     }
4023     \new Lyrics \lyricsto "lahlah" {
4024
4025         % Tricky: need to set associatedVoice
4026         % one syllable too soon! 
4027         \set associatedVoice = alternative % applies to "ran"
4028         Ty --
4029         ran  --
4030         no --
4031         \set associatedVoice = lahlah % applies to "rus"
4032         sau -- rus Rex
4033     } >>
4034 @end lilypond
4035
4036 @noindent
4037 the text for the first stanza is set to a melody called ``lahlah'',
4038
4039 @verbatim
4040     \new Lyrics \lyricsto "lahlah" {
4041         Ju -- ras -- sic Park
4042     }
4043 @end verbatim 
4044
4045
4046 The second stanza initially is set to the @code{lahlah} context, but
4047 for the syllable ``ran'', it switches to a different melody.
4048 This is achieved with
4049 @example
4050         \set associatedVoice = alternative
4051 @end example
4052
4053 @noindent
4054 Here, @code{alternative} is the name of the @code{Voice} context
4055 containing the triplet.
4056
4057 Again, the command must be one syllable too early, before ``Ty'' in
4058 this case.
4059
4060 @verbatim
4061     \new Lyrics \lyricsto "lahlah" {
4062         \set associatedVoice = alternative % applies to "ran"
4063         Ty --
4064         ran  --
4065         no --
4066         \set associatedVoice = lahlah % applies to "rus"
4067         sau -- rus Rex
4068     }
4069 @end verbatim 
4070
4071 @noindent
4072 The underlay is switched back to the starting situation by assigning
4073 @code{lahlah} to @code{associatedVoice}.
4074
4075
4076
4077
4078 @node More stanzas
4079 @subsection More stanzas
4080
4081 @cindex phrasing, in lyrics
4082
4083
4084 @cindex stanza number
4085 @cindex singer's names
4086 @cindex name of singer 
4087
4088 Stanza numbers can be added by setting @code{stanza}, e.g.
4089
4090 @lilypond[quote,verbatim,relative=2,fragment]
4091 \new Voice {
4092     \time 3/4 g2 e4 a2 f4 g2.
4093 } \addlyrics {
4094      \set stanza = "1. "
4095      Hi, my name is Bert.
4096 } \addlyrics {
4097      \set stanza = "2. "
4098      Oh, che -- ri, je t'aime
4099 }
4100 @end lilypond
4101
4102 These numbers are put just before the start of first syllable.
4103
4104 Names of singers can also be added. They are printed at the start of
4105 the line, just like instrument names.  They are created by setting
4106 @code{vocalName}. A short version may be entered as @code{vocNam}.
4107
4108
4109 @lilypond[fragment,quote,verbatim,relative=2]
4110 \new Voice {
4111     \time 3/4 g2 e4 a2 f4 g2.
4112 } \addlyrics {
4113      \set vocalName = "Bert "
4114      Hi, my name is Bert.
4115 } \addlyrics {
4116      \set vocalName = "Ernie "
4117      Oh, che -- ri, je t'aime
4118 }
4119 @end lilypond
4120
4121 @seealso
4122
4123 Program reference: Layout objects @internalsref{LyricText} and
4124 @internalsref{VocalName}.  Music expressions
4125 @internalsref{LyricEvent}.
4126
4127
4128
4129 @node Ambitus
4130 @subsection Ambitus
4131 @cindex ambitus
4132
4133 The term @emph{ambitus} denotes a range of pitches for a given voice
4134 in a part of music.  It also may denote the pitch range that a musical
4135 instrument is capable of playing.  Ambits are printed on vocal parts,
4136 so performers can easily determine it meets their capabilities.
4137
4138 It denoted at the beginning of a piece near the initial clef.  The
4139 range is graphically specified by two note heads, that represent the
4140 minimum and maximum pitch.  To print such ambits, add the
4141 @internalsref{Ambitus_engraver} to the @internalsref{Voice} context,
4142 for example,
4143
4144 @example
4145   \paper @{
4146     \context @{
4147       \Voice
4148       \consists Ambitus_engraver
4149     @}
4150   @}
4151 @end example
4152
4153 This results in the following output
4154
4155 @lilypond[quote,raggedright]
4156   \paper {
4157     \context {
4158       \Staff
4159       \consists Ambitus_engraver
4160     }
4161   }
4162
4163   \relative \new Staff {
4164     as'' c e2 cis,2
4165   }
4166 @end lilypond
4167
4168 If you have multiple voices in a single staff, and you want a single
4169 ambitus per staff rather than per each voice, add the
4170 @internalsref{Ambitus_engraver} to the @internalsref{Staff} context
4171 rather than to the @internalsref{Voice} context.  Here is an example,
4172
4173 @lilypond[verbatim,raggedright] 
4174 \new Staff <<
4175     \new Voice \with {
4176         \consists "Ambitus_engraver"
4177     } \relative c'' {
4178         \override Ambitus #'X-offset-callbacks
4179         =  #(list (lambda (grob axis) -1.0))
4180         \voiceOne
4181         c4 a d e f2
4182     }
4183     \new Voice \with {
4184         \consists "Ambitus_engraver"
4185     } \relative c' {
4186         \voiceTwo
4187         es4 f g as b2
4188     }
4189 >>
4190 @end lilypond
4191
4192 @noindent
4193 This example uses one advanced feature,
4194
4195 @example
4196         \override Ambitus #'X-offset-callbacks
4197         =  #(list (lambda (grob axis) -1.0))
4198 @end example
4199
4200 @noindent
4201 This code moves the ambitus to the left. The same effect could have
4202 been achieved with @code{extra-offset}, but then the formatting system
4203 would not reserve space for the moved object. 
4204
4205 @seealso
4206
4207 Program reference: @internalsref{Ambitus},
4208 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
4209 @internalsref{AmbitusAccidental}.
4210
4211 Examples:  @inputfileref{input/regression,ambitus.ly}.
4212
4213 @refbugs
4214
4215 There is no collision handling in the case of multiple per-voice
4216 ambitus.
4217
4218 @node Other instrument specific notation, Tablatures, Vocal music, Notation manual
4219 @section Other instrument specific notation
4220
4221 @menu
4222 * Harmonic notes::              
4223 @end menu
4224
4225 @node Harmonic notes,  , Other instrument specific notation, Other instrument specific notation
4226 @subsection Harmonic notes
4227
4228 @cindex artificial harmonics
4229 @cindex harmonics
4230
4231 Artificial harmonics are notated with a different notehead style. They
4232 are entered by 
4233 marking the harmonic pitch with @code{\harmonic}.
4234
4235 @lilypond[raggedright,verbatim]
4236 {
4237  <c' g'\harmonic>4
4238 }
4239 @end lilypond
4240
4241
4242 @node Tablatures, Popular music, Other instrument specific notation, Notation manual
4243 @section Tablatures
4244
4245 @cindex tablature
4246 @cindex guitar tablature
4247
4248 Tablature notation is used for notating music for plucked string
4249 instruments.  Pitches are not denoted with note heads, but by
4250 indicating on which string and fret a note must be played.  LilyPond
4251 offers limited support for tablature.
4252
4253 @menu
4254 * Tablatures basic::            
4255 * Non-guitar tablatures::       
4256 @end menu
4257
4258 @node Tablatures basic, Non-guitar tablatures, Tablatures, Tablatures
4259 @subsection Tablatures basic
4260 @cindex Tablatures basic
4261
4262 The string number associated to a note is given as a backslash
4263 followed by a number, e.g. @code{c4\3} for a C quarter on the third
4264 string. By default, string 1 is the highest one, and the tuning
4265 defaults to the standard guitar tuning (with 6 strings).  The notes
4266 are printed as tablature, by using @internalsref{TabStaff} and
4267 @internalsref{TabVoice} contexts
4268
4269 @lilypond[quote,fragment,verbatim]
4270  \context TabStaff {
4271   a,4\5 c'\2 a\3 e'\1
4272   e\4 c'\2 a\3 e'\1
4273 }
4274 @end lilypond
4275
4276 @cindex @code{minimumFret}
4277 @cindex fret
4278
4279 When no string is specified, the first string that does not give a
4280 fret number less than @code{minimumFret} is selected. The default
4281 value for @code{minimumFret} is 0
4282
4283
4284 @example
4285 e16 fis gis a b4
4286 \set TabStaff.minimumFret = #8
4287 e16 fis gis a b4
4288 @end example
4289 @lilypond[quote,noindent,raggedright]
4290 frag =  {
4291   \key e \major
4292   e16 fis gis a b4
4293   \set TabStaff.minimumFret = #8
4294   e16 fis gis a b4
4295 }
4296   \context StaffGroup <<
4297     \context Staff { \clef "G_8" \frag }
4298     \context TabStaff { \frag }
4299   >>
4300 @end lilypond
4301
4302 @seealso
4303
4304 Program reference: @internalsref{TabStaff}, @internalsref{TabVoice}, and
4305 @internalsref{StringNumberEvent}.
4306
4307 @refbugs
4308
4309 Chords are not handled in a special way, and hence the automatic
4310 string selector may easily select the same string to two notes in a
4311 chord.
4312
4313
4314 @node Non-guitar tablatures,  , Tablatures basic, Tablatures
4315 @subsection Non-guitar tablatures
4316 @cindex Non-guitar tablatures
4317
4318 You can change the number of strings, by setting the number of lines
4319 in the @internalsref{TabStaff}. 
4320
4321 You can change the tuning of the strings. A string tuning is given as
4322 a Scheme list with one integer number for each string, the number
4323 being the pitch (measured in semitones relative to middle C) of an
4324 open string.  The numbers specified for @code{stringTuning} are the
4325 numbers of semitones to subtract or add, starting the specified pitch
4326 by default middle C, in string order. In the next example,
4327 @code{stringTunings} is set for the pitches e, a, d, and g
4328
4329 @lilypond[quote,fragment,verbatim]
4330   \context TabStaff <<
4331     \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
4332     
4333      {
4334       a,4 c' a e' e c' a e'
4335     }
4336   >> 
4337 @end lilypond
4338
4339 @refbugs
4340
4341 No guitar special effects have been implemented.
4342
4343 @seealso
4344
4345 Program reference: @internalsref{Tab_note_heads_engraver}.
4346
4347
4348 @node Popular music, Orchestral music, Tablatures, Notation manual
4349 @section Popular music 
4350
4351
4352
4353 @menu
4354 * Chord names::                 
4355 * Chords mode::                 
4356 * Printing chord names::        
4357 * Improvisation::               
4358 @end menu
4359
4360 @node Chord names, Chords mode, Popular music, Popular music
4361 @subsection Chord names
4362 @cindex Chords
4363
4364 LilyPond has support for both printing chord names.  Chords may be
4365 entered in musical chord notation, i.e. @code{< .. >}, but they can
4366 also be entered by name. Internally, the chords are represented as a
4367 set of pitches, so they can be transposed
4368
4369
4370 @lilypond[quote,verbatim,raggedright]
4371 twoWays = \transpose c c' {
4372   \chords {
4373     c1 f:sus4 bes/f
4374   }
4375   <c e g>
4376   <f bes c'>
4377   <f bes d'>
4378 }
4379
4380   << \context ChordNames \twoWays
4381      \context Voice \twoWays >> 
4382 @end lilypond
4383
4384 This example also shows that the chord printing routines do not try to
4385 be intelligent. The last chord (@code{f bes d}) is not interpreted as
4386 an inversion.
4387
4388
4389 @menu
4390 * Chords mode::                 
4391 * Printing chord names::        
4392 @end menu
4393
4394
4395 @node Chords mode
4396 @subsection Chords mode
4397 @cindex Chords mode
4398
4399 In chord mode sets of pitches (chords) are entered with common names.
4400 A chord is entered by the root, which is entered like a common pitch
4401
4402 @lilypond[quote,fragment,verbatim,relative=2]
4403 \chords { es4. d8 c2 }
4404 @end lilypond
4405
4406 @noindent
4407 The mode is introduced by the keyword @code{\chords}.
4408
4409 @cindex chord entry
4410 @cindex chord mode
4411
4412 Other chords may be entered by suffixing a colon, and introducing a
4413 modifier, and optionally, a number
4414 @c
4415 @lilypond[quote,fragment,verbatim]
4416 \chords { e1:m e1:7 e1:m7  }
4417 @end lilypond
4418 The first number following the root is taken to be the `type' of the
4419 chord, thirds are added to the root until it reaches the specified
4420 number
4421 @lilypond[quote,fragment,verbatim]
4422 \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
4423 @end lilypond
4424
4425 @cindex root of chord
4426 @cindex additions, in chords
4427 @cindex removals, in  chords
4428
4429 More complex chords may also be constructed  adding separate steps
4430 to a chord. Additions are added after the  number following
4431 the colon, and are separated by dots
4432 @c
4433 @lilypond[quote,verbatim,fragment]
4434 \chords { c:5.6 c:3.7.8 c:3.6.13 }
4435 @end lilypond
4436 Chord steps can be  altered by suffixing a @code{-} or @code{+} sign
4437 to the number
4438 @lilypond[quote,verbatim,fragment]
4439 \chords { c:7+ c:5+.3-  c:3-.5-.7- }
4440 @end lilypond
4441 Removals are specified similarly, and are introduced by a caret.  They
4442 must come after the additions
4443 @lilypond[quote,verbatim,fragment]
4444 \chords { c^3 c:7^5 c:9^3.5 }
4445 @end lilypond
4446
4447 Modifiers can be used to change pitches. The following modifiers are
4448 supported
4449 @table @code
4450 @item m
4451   is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
4452 @item dim
4453   is the   diminished chord. This modifier lowers the 3rd, 5th and (if present)
4454   the 7th step.
4455 @item aug
4456   is the augmented chord. This modifier raises the 5th step.
4457 @item maj
4458   is the major 7th chord. This modifier raises the 7th step if present.  
4459 @item sus
4460   is the suspended 4th or 2nd. This modifier removes the 3rd
4461 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
4462 the chord.
4463 @end table
4464 Modifiers can be mixed with additions
4465 @lilypond[quote,verbatim,fragment]
4466 \chords { c:sus4 c:7sus4 c:dim7 c:m6 } 
4467 @end lilypond
4468
4469 @cindex modifiers, in chords. 
4470 @cindex @code{aug}
4471 @cindex @code{dim}
4472 @cindex @code{maj}
4473 @cindex @code{sus}
4474 @cindex @code{m}
4475
4476 Since an unaltered 11 does not sound good when combined with an
4477 unaltered 3, the 11 is removed in this case (unless it is added
4478 explicitly)
4479 @c
4480 @lilypond[quote,fragment,verbatim]
4481 \chords { c:13 c:13.11 c:m13 }
4482 @end lilypond
4483
4484 @cindex @code{/}
4485
4486 An inversion (putting one pitch of the chord on the bottom), as well
4487 as bass notes, can be specified by appending
4488 @code{/}@var{pitch} to the chord
4489 @lilypond[quote,fragment,verbatim]
4490 \chords { c1 c/g c/f }
4491 @end lilypond
4492 @cindex @code{/+}
4493
4494 A bass note can be added instead of transposed out of the chord,
4495 by using  @code{/+}@var{pitch}.
4496
4497 @lilypond[quote,fragment,verbatim]
4498 \chords { c1 c/+g c/+f }
4499 @end lilypond
4500
4501 Chords is a mode similar to @code{\lyrics} etc.  Most
4502 of the commands continue to work, for example, @code{r} and
4503 @code{\skip} can be used to insert rests and spaces, and property
4504 commands may be used to change various settings.
4505
4506
4507
4508 @refbugs
4509
4510 Each step can only be present in a chord once.  The following
4511 simply produces the augmented chord, since @code{5+} is interpreted
4512 last
4513 @cindex clusters
4514 @lilypond[quote,verbatim,fragment]
4515 \chords { c:5.5-.5+ }
4516 @end lilypond
4517
4518
4519 @node Printing chord names
4520 @subsection Printing chord names
4521
4522 @cindex printing chord names
4523 @cindex chord names
4524 @cindex chords
4525
4526 For displaying printed chord names, use the @internalsref{ChordNames} context.
4527 The chords may be entered either using the notation
4528 described above, or directly using @code{<} and @code{>}
4529
4530 @lilypond[quote,verbatim,raggedright]
4531 scheme =  {
4532   \chords {a1 b c} <d' f' a'>  <e' g' b'>
4533 }
4534
4535  <<
4536     \context ChordNames \scheme
4537     \context Staff \scheme
4538 >>
4539 @end lilypond
4540
4541 You can make the chord changes stand out by setting
4542 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
4543 display chord names when there is a change in the chords scheme and at
4544 the start of a new line
4545
4546 @lilypond[quote,verbatim,linewidth=9\cm]
4547 scheme = \chords {
4548   c1:m c:m \break c:m c:m d
4549 }
4550  <<
4551     \context ChordNames {
4552       \set chordChanges = ##t
4553       \scheme }
4554     \context Staff \transpose c c' \scheme
4555 >>
4556 @end lilypond
4557
4558 The previous examples all show chords over a staff. This is not
4559 necessary. Chords may also be printed separately.  It may be necessary
4560 to add @internalsref{Volta_engraver} and @internalsref{Bar_engraver}
4561 for showing repeats.
4562
4563 @lilypond[raggedright,verbatim]
4564 \new ChordNames \with {
4565         \override BarLine #'bar-size = #4
4566         voltaOnThisStaff = ##t
4567         \consists Bar_engraver
4568         \consists "Volta_engraver"
4569
4570 \repeat volta 2 \chords {
4571         f1:maj f:7 bes:7
4572         c:maj  
4573 } \alternative {
4574   es e
4575 }
4576 @end lilypond
4577
4578
4579 The default chord name layout is a system for Jazz music, proposed by
4580 Klaus Ignatzek (see @ref{Literature list}).  It can be tuned through the
4581 following properties
4582
4583 @table @code
4584 @cindex @code{chordNameExceptions}
4585 @item chordNameExceptions
4586 This is a list that contains the chords that have special formatting.
4587 For an example of tuning this property, see
4588 @inputfileref{input/regression,chord-name-exceptions.ly}.
4589 @cindex exceptions, chord names.
4590
4591
4592 @cindex @code{majorSevenSymbol}
4593 @item majorSevenSymbol
4594 This property contains the markup object used for the 7th step, when
4595 it is major. Predefined options are @code{whiteTriangleMarkup} and
4596 @code{blackTriangleMarkup}.  See
4597 @inputfileref{input/regression,chord-name-major7.ly} for an example.
4598
4599 @cindex @code{chordNameSeparator}
4600 @item chordNameSeparator
4601 Different parts of a chord name are normally separated by a
4602 slash. By setting @code{chordNameSeparator}, you can specify other
4603 separators, e.g.
4604 @lilypond[quote,fragment,verbatim]
4605 \context ChordNames \chords {
4606   c:7sus4
4607   \set chordNameSeparator
4608     = \markup { \typewriter "|" }
4609   c:7sus4
4610 }
4611 @end lilypond
4612
4613 @cindex @code{chordRootNamer}
4614 @item chordRootNamer
4615 The root of a chord is usually printed as a letter with an optional
4616 alteration. The transformation from pitch to letter is done by this
4617 function.  Special note names (for example, the German ``H'' for a
4618 B-chord) can be produced by storing a new function in this property.
4619
4620 @cindex @code{chordNoteNamer}
4621 @item chordNoteNamer
4622 The default is to print single pitch, e.g. the bass note, using the
4623 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
4624 to a specialized function to change this behavior.  For example, the
4625 base can be printed in lower case.
4626
4627 @end table
4628
4629 The predefined variables @code{\germanChords},
4630 @code{\semiGermanChords} set these variables. The effect is
4631 demonstrated here,
4632
4633 @lilypondfile[notexidoc]{chord-names-german.ly}
4634
4635 There are also two other chord name schemes implemented: an alternate
4636 Jazz chord notation, and a systematic scheme called Banter chords. The
4637 alternate jazz notation is also shown on the chart in @ref{Chord name
4638 chart}.  Turning on these styles is described in the input file
4639 @inputfileref{input/test,chord-names-jazz.ly}.
4640
4641 @cindex Banter
4642 @cindex jazz chords
4643 @cindex chords, jazz  
4644
4645
4646 @refcommands
4647
4648 @cindex @code{\germanChords}
4649 @code{\germanChords}, 
4650 @cindex @code{\semiGermanChords}
4651 @code{\semiGermanChords}.
4652
4653
4654
4655
4656 @seealso
4657
4658 Examples: @inputfileref{input/regression,chord-name-major7.ly},
4659 @inputfileref{input/regression,chord-name-exceptions.ly},
4660 @inputfileref{input/test,chord-names-jazz.ly},
4661 @inputfileref{input/test,chords-without-melody.ly}.
4662
4663
4664 Init files: @file{scm/chords-ignatzek.scm}, and @file{scm/chord-entry.scm}.
4665
4666
4667 @refbugs
4668
4669 Chord names are determined solely from the list of pitches. Chord
4670 inversions are not identified, and neither are added bass notes. This
4671 may result in strange chord names when chords are entered with the
4672 @code{< .. >} syntax.
4673
4674
4675 @node Improvisation
4676 @subsection Improvisation
4677
4678 Improvisation is sometimes denoted with slashed note heads.  Such note
4679 heads can be created by adding a @internalsref{Pitch_squash_engraver}
4680 to the @internalsref{Staff} or @internalsref{Voice} context. Then, the
4681 following command
4682
4683 @example
4684     \set squashedPosition = #0
4685     \override NoteHead  #'style = #'slash
4686 @end example
4687
4688 @noindent
4689 switches on the slashes.
4690
4691 There are shortcuts @code{\improvisationOn} (and an accompanying
4692 @code{\improvisationOff}) for this command sequence.  They are used in
4693 the following example
4694
4695 @lilypond[verbatim,raggedright]
4696 \new Staff \with {
4697   \consists Pitch_squash_engraver
4698 } \transpose c c' {
4699   e8 e g a a16(bes)(a8) g \improvisationOn
4700   e8
4701   ~e2~e8 f4 fis8
4702   ~fis2 \improvisationOff a16(bes) a8 g e
4703 }
4704 @end lilypond
4705
4706
4707
4708 @node Orchestral music
4709 @section Orchestral music
4710
4711 @cindex  Writing parts
4712
4713 Orchestral music involves some special notation, both in the full
4714 score and the individual parts. This section explains how to tackle
4715 some common problems in orchestral music.
4716
4717
4718
4719 @menu
4720 * System start delimiters::     
4721 * Aligning to cadenzas::        
4722 * Rehearsal marks::             
4723 * Bar numbers::                 
4724 * Instrument names::            
4725 * Transpose::                   
4726 * Instrument transpositions::   
4727 * Multi measure rests::         
4728 * Automatic part combining::    
4729 * Hiding staves::               
4730 * Different editions from one source::  
4731 * Quoting other voices::        
4732 @end menu
4733
4734 @node System start delimiters
4735 @subsection  System start delimiters
4736
4737 Polyphonic scores consist of many staves. These staves can be
4738 constructed in three different ways
4739 @itemize @bullet
4740 @item The group is started with a brace at the left, and bar lines are
4741 connected. This is done with the @internalsref{GrandStaff} context.
4742
4743 @lilypond[verbatim]
4744 \new GrandStaff
4745 \relative <<
4746   \new Staff { c1 c }
4747   \new Staff { c c }
4748 >>
4749 @end lilypond 
4750
4751
4752 @item The group is started with a bracket, and bar lines are connected. This is done with the
4753 @internalsref{StaffGroup} context
4754
4755 @lilypond[verbatim]
4756 \new GrandStaff
4757 \relative <<
4758   \new Staff { c1 c }
4759   \new Staff { c c }
4760 >>
4761 @end lilypond 
4762
4763
4764 @item The group is  started with a vertical line. Bar lines are not
4765 connected.  This is the default for the score.
4766
4767 @lilypond[verbatim]
4768 \relative <<
4769   \new Staff { c1 c }
4770   \new Staff { c c }
4771 >>
4772 @end lilypond 
4773
4774 @end itemize
4775
4776 @cindex Staff, multiple
4777 @cindex bracket, vertical
4778 @cindex brace, vertical
4779 @cindex grand staff
4780 @cindex staff group
4781
4782
4783 @seealso
4784
4785 The bar lines at the start of each system are
4786 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace}, and
4787 @internalsref{SystemStartBracket}.  Only one of these types is created
4788 in every context, and that type is determined by the property
4789 @code{systemStartDelimiter}.
4790
4791 @node Aligning to cadenzas
4792 @subsection Aligning to cadenzas
4793
4794
4795 In an orchestral context, cadenzas present a special problem:
4796 when constructing a score that includes a cadenza, all other
4797 instruments should skip just as many notes as the length of the
4798 cadenza, otherwise they will start too soon or too late. 
4799
4800 A solution to this problem are the functions @code{mmrest-of-length}
4801 and @code{skip-of-length}. These Scheme functions take a piece music
4802 as argument, and generate a @code{\skip} or multi rest, exactly as
4803 long as the piece. The use of @code{mmrest-of-length} is demonstrated
4804 in the following example. 
4805
4806 @lilypond[verbatim,raggedright] 
4807 cadenza =  \relative c' {
4808     c4 d8 << { e f g } \\ { d4. } >>
4809     g4 f2 g4 g
4810 }
4811     
4812 \new GrandStaff <<
4813   \new Staff { \cadenza c'4 } 
4814   \new Staff {
4815     #(ly:export (mmrest-of-length cadenza))
4816     c'4
4817   }
4818 >>
4819 @end lilypond
4820
4821
4822
4823
4824
4825 @node Rehearsal marks
4826 @subsection Rehearsal marks
4827 @cindex Rehearsal marks
4828 @cindex mark
4829 @cindex @code{\mark}
4830
4831 To print a  rehearsal mark, use the @code{\mark} command
4832
4833 @lilypond[quote,fragment,verbatim,relative=1]
4834 {
4835   c1 \mark \default
4836   c1 \mark \default
4837   c1 \mark #8 
4838   c1 \mark \default
4839   c1 \mark \default
4840 }
4841 @end lilypond
4842
4843 @noindent
4844 (The letter I is skipped in accordance with engraving traditions.)
4845
4846 @c FIXME - should make that tunable.
4847
4848 The mark is incremented automatically if you use @code{\mark
4849 \default}, but you can also use an integer argument to set the mark
4850 manually.  The value to use is stored in the property
4851 @code{rehearsalMark}.
4852
4853 The style is defined by the property @code{markFormatter}. It is a
4854 function taking the current mark (an integer) and the current context
4855 as argument. It should return a markup object. In the following
4856 example, @code{markFormatter} is set to a canned procedure. After a
4857 few measures, it is set to function that produces a boxed number. 
4858
4859 @lilypond[quote,verbatim,fragment,relative=2]
4860 \set Score.markFormatter = #format-mark-numbers 
4861 c1 \mark \default
4862 c1 \mark \default
4863 \set Score.markFormatter
4864    = #(lambda (mark  context)
4865        (make-bold-markup
4866         (make-box-markup (number->string mark))))
4867 c1 \mark \default
4868 c1 \mark \default
4869 @end lilypond
4870
4871 The file @file{scm/translation-functions.scm} contains the definitions
4872 of @code{format-mark-numbers} (the default format) and
4873 @code{format-mark-letters}. These can be used as inspiration for other
4874 formatting functions.
4875
4876
4877 @cindex coda on bar line
4878 @cindex segno on bar line
4879 @cindex fermata on bar line
4880 @cindex bar lines, symbols on
4881
4882 The @code{\mark} command can also be used to put signs like coda,
4883 segno and fermatas on a bar line. Use @code{\markup} to
4884 to access the appropriate symbol
4885
4886 @lilypond[quote,fragment,verbatim,relative=2]
4887 c1 \mark \markup { \musicglyph #"scripts-ufermata" }
4888 c1
4889 @end lilypond
4890
4891 In the case of a line break, marks must also be printed at the end of
4892 the line, and not at the beginning. Use the following to force that
4893 behavior
4894 @example
4895 \override Score.RehearsalMark  
4896   #'break-visibility = #begin-of-line-invisible
4897 @end example
4898
4899 @cindex fermatas
4900 @cindex coda
4901 @cindex segno
4902 @cindex bar lines, putting symbols on 
4903
4904 @seealso
4905
4906 Program reference: @internalsref{MarkEvent}, @internalsref{RehearsalMark}.
4907
4908 Init files: @file{scm/translation-functions.scm} contains the
4909 definition of @code{format-mark-numbers} and
4910 @code{format-mark-letters}. They can be used as inspiration for other
4911 formatting functions.
4912
4913 Examples: @inputfileref{input/regression,rehearsal-mark-letter.ly},
4914
4915 @inputfileref{input/regression,rehearsal-mark-number.ly}.
4916
4917
4918 @node Bar numbers
4919 @subsection Bar numbers
4920
4921
4922 @cindex bar numbers
4923 @cindex measure numbers
4924 @cindex @code{currentBarNumber}
4925
4926 Bar numbers are printed by default at the start of the line.  The
4927 number itself is stored in the @code{currentBarNumber} property, which
4928 is normally updated automatically for every measure.
4929
4930 Bar numbers can be typeset at regular intervals instead of at the
4931 beginning of each line. This is illustrated in the following example,
4932 whose source is available as
4933 @inputfileref{input/test,bar-number-regular-interval.ly}
4934
4935 @lilypondfile[quote]{bar-number-regular-interval.ly}
4936
4937 @seealso
4938
4939 Program reference: @internalsref{BarNumber}.
4940
4941 Examples: @inputfileref{input/test,bar-number-every-five-reset.ly},
4942 and @inputfileref{input/test,bar-number-regular-interval.ly}.
4943
4944 @refbugs
4945
4946 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4947 there is one at the top. To solve this, the
4948 @code{padding} property of @internalsref{BarNumber} can be
4949 used to position the number correctly.
4950
4951 @node Instrument names
4952 @subsection Instrument names
4953
4954 In an orchestral score, instrument names are printed left side of the
4955 staves.
4956
4957 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4958 and @internalsref{Staff}.@code{instr}. This will print a string before
4959 the start of the staff. For the first start, @code{instrument} is
4960 used, for the next ones @code{instr} is used.
4961
4962 @lilypond[quote,verbatim,raggedright,relative=1,fragment]
4963 \set Staff.instrument = "Ploink "
4964 \set Staff.instr = "Plk "
4965 c1
4966 \break
4967 c''
4968 @end lilypond
4969
4970 You can also use markup texts to construct more complicated instrument
4971 names, for example
4972
4973 @lilypond[quote,fragment,verbatim,raggedright]
4974  {
4975   \set Staff.instrument = \markup {
4976     \column < "Clarinetti" { "in B"
4977       \smaller \flat } > }
4978    { c''1 }
4979 }
4980 @end lilypond
4981
4982 For longer instrument names, it may be useful to increase the
4983 @code{indent} setting in the @code{\paper} block.
4984
4985 @seealso
4986
4987 Program reference: @internalsref{InstrumentName}.
4988
4989 @refbugs
4990
4991 When you put a name on a grand staff or piano staff the width of the
4992 brace is not taken into account. You must add extra spaces to the end of
4993 the name to avoid a collision.
4994
4995 @node Transpose
4996 @subsection Transpose
4997 @cindex Transpose
4998 @cindex transposition of pitches
4999 @cindex @code{\transpose}
5000
5001 A music expression can be transposed with @code{\transpose}.  The
5002 syntax is
5003 @example
5004 \transpose @var{from} @var{to} @var{musicexpr}
5005 @end example
5006
5007 This means that @var{musicexpr} is transposed by the interval between
5008 the pitches @var{from} and @var{to}: any note with pitch @code{from}
5009 is changed to @code{to}.
5010
5011
5012 For example, consider  a piece written in the key of  D major.  If
5013 this piece is a  little too low for its performer, it can be
5014 transposed up to E major with
5015 @example
5016 \transpose d e @dots{}
5017 @end example
5018
5019 Consider a part  written for violin (a C instrument). If
5020 this part is to be played on the A clarinet, the following
5021 transposition will produce the appropriate part
5022
5023 @example
5024 \transpose a c @dots{}
5025 @end example   
5026
5027 @code{\transpose} distinguishes between enharmonic pitches: both
5028 @code{\transpose c cis} or @code{\transpose c des} will transpose up
5029 half a tone.  The first version will print sharps and the second
5030 version will print flats
5031
5032 @lilypond[quote,raggedright,verbatim]
5033 mus = { \key d \major cis d fis g }
5034 \context Staff {
5035   \clef "F" \mus
5036   \clef "G"
5037   \transpose c g' \mus
5038   \transpose c f' \mus
5039 }
5040 @end lilypond
5041
5042
5043 @seealso
5044
5045 Program reference: @internalsref{TransposedMusic}, and
5046 @internalsref{UntransposableMusic}.
5047
5048 @refbugs
5049
5050 If you want to use both @code{\transpose} and @code{\relative},
5051 you must put @code{\transpose} outside of @code{\relative}, since
5052 @code{\relative} will have no effect music that appears inside a
5053 @code{\transpose}.
5054
5055 @node Instrument transpositions
5056 @subsection Instrument transpositions
5057
5058 The key of a transposing instrument can also be specified.  This
5059 applies to many wind instruments, for example, clarinets (B-flat, A and
5060 E-flat), horn (F) and trumpet (B-flat, C, D and E-flat).
5061
5062
5063 The transposition is entered after the keyword @code{\transposition}
5064
5065 @example
5066   \transposition bes   %%  B-flat clarinet
5067 @end example
5068
5069 This command sets the property @code{instrumentTransposition}. The value of
5070 this property is used for MIDI output and quotations.  It does not
5071 affect how notes are printed in the current staff.
5072
5073 @cindex transposition, MIDI
5074 @cindex transposition, instrument
5075
5076
5077 @node Multi measure rests
5078 @subsection Multi measure rests
5079 @cindex multi measure rests
5080 @cindex Rests, multi measure
5081
5082 @cindex @code{R}
5083
5084 Multi measure rests are entered using `@code{R}'. It is specifically
5085 meant for full bar rests and for entering parts: the rest can expand
5086 to fill a score with rests, or it can be printed as a single
5087 multimeasure rest. This expansion is controlled by the property
5088 @code{Score.skipBars}. If this is set to true, empty measures will not
5089 be expanded, and the appropriate number is added automatically
5090
5091 @lilypond[quote,fragment,verbatim]
5092  \time 4/4 r1 | R1 | R1*2
5093  \set Score.skipBars = ##t R1*17  R1*4
5094 @end lilypond
5095
5096 The @code{1} in @code{R1} is similar to the duration notation used for
5097 notes. Hence, for time signatures other than 4/4, you must enter other
5098 durations.  This can be done with augmentation dots or fractions
5099
5100 @lilypond[quote,fragment,verbatim]
5101 \set Score.skipBars = ##t
5102 \time 3/4
5103 R2. | R2.*2
5104 \time 13/8
5105 R1*13/8
5106 R1*13/8*12
5107 @end lilypond
5108
5109 An @code{R} spanning a single measure is printed as either a whole rest
5110 or a breve, centered in the measure regardless of the time signature.
5111
5112 @cindex text on multi-measure rest
5113 @cindex script on multi-measure rest
5114 @cindex fermata on multi-measure rest
5115
5116 Texts can be added to multi-measure rests by using the
5117 @var{note}-@code{markup} syntax (see @ref{Text markup}).  In this case, the number is
5118 replaced. If you need both texts and the number, you must add the
5119 number by hand. A variable (@code{\fermataMarkup}) is provided for
5120 adding fermatas
5121
5122
5123 @lilypond[quote,verbatim,fragment]
5124   \time 3/4
5125   R2._\markup { "Ad lib" }
5126   R2.^\fermataMarkup
5127 @end lilypond
5128
5129 If you want to have a text on the left end of a multi-measure rest,
5130 attach the text to a zero-length skip note, i.e.
5131
5132 @example
5133   s1*0^"Allegro"
5134   R1*4 
5135 @end example
5136
5137
5138 @cindex whole rests for a full measure 
5139
5140 @seealso
5141
5142 Program reference: @internalsref{MultiMeasureRestEvent},
5143 @internalsref{MultiMeasureTextEvent},
5144 @internalsref{MultiMeasureRestMusicGroup}, and
5145 @internalsref{MultiMeasureRest}.
5146
5147 The layout object @internalsref{MultiMeasureRestNumber} is for the
5148 default number, and @internalsref{MultiMeasureRestText} for user
5149 specified texts.
5150
5151 @refbugs
5152
5153 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
5154 over multi-measure rests.
5155
5156 @cindex condensing rests
5157
5158 There is no way to automatically condense multiple rests into a single
5159 multimeasure rest. Multi measure rests do not take part in rest
5160 collisions.
5161
5162 Be careful when entering multimeasure rests followed by whole
5163 notes. The following will enter two notes lasting four measures each
5164 @example
5165  R1*4 cis cis 
5166 @end example
5167 When @code{skipBars} is set, the result will look OK, but the bar
5168 numbering will be off.
5169
5170 @node Automatic part combining
5171 @subsection Automatic part combining
5172 @cindex automatic part combining
5173 @cindex part combiner
5174
5175
5176 Automatic part combining is used to merge two parts of music onto a
5177 staff.  It is aimed at typesetting orchestral scores.  When the two
5178 parts are identical for a period of time, only one is shown.  In
5179 places where the two parts differ, they are typeset as separate
5180 voices, and stem directions are set automatically.  Also, solo and
5181 @emph{a due} parts are identified and can be marked.
5182
5183 The syntax for part combining is
5184
5185 @example
5186   \partcombine @var{musicexpr1} @var{musicexpr2}
5187 @end example
5188
5189
5190
5191 The following example demonstrates the basic functionality of the part
5192 combiner: putting parts on one staff, and setting stem directions and
5193 polyphony
5194
5195 @lilypond[quote,verbatim,raggedright,fragment]
5196 \new Staff \partcombine
5197   \relative g' { g g a( b) c c r r }
5198   \relative g' { g g r4 r e e g g }
5199 @end lilypond
5200
5201 The first @code{g} appears only once, although it was
5202 specified twice (once in each part).  Stem, slur and tie directions are
5203 set automatically, depending whether there is a solo or unisono. The
5204 first part (with context called @code{one}) always gets up stems, and
5205 `solo', while the second (called @code{two}) always gets down stems and
5206 `Solo II'.
5207
5208 If you just want the merging parts, and not the textual markings, you
5209 may set the property @code{printPartCombineTexts} to false
5210
5211 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
5212 \new Staff <<
5213   \set Staff.printPartCombineTexts = ##f
5214   \partcombine
5215     \relative g' { g a( b) r }
5216     \relative g' { g r4 r f }
5217 >>
5218 @end lilypond
5219
5220
5221 Both arguments to @code{\partcombine} will be interpreted as
5222 @internalsref{Voice} contexts. If using relative octaves,
5223 @code{\relative} should be specified for both music expressions, i.e.
5224
5225 @example
5226 \partcombine
5227   \relative @dots{} @var{musicexpr1}
5228   \relative @dots{} @var{musicexpr2}
5229 @end example
5230
5231 @noindent
5232 A @code{\relative} section that is outside of @code{\partcombine} has
5233 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
5234
5235 @seealso
5236
5237 Program reference: @internalsref{PartCombineMusic},
5238 @internalsref{SoloOneEvent}, and
5239 @internalsref{SoloTwoEvent}, and
5240 @internalsref{UnisonoEvent}.
5241
5242 @refbugs
5243
5244 When @code{printPartCombineTexts} is set, when the two voices play the
5245 same notes on and off, the part combiner may typeset @code{a2} more
5246 than once in a measure.
5247
5248 @code{\partcombine} cannot be inside @code{\times}. 
5249
5250 @code{\partcombine} cannot be inside @code{\relative}. 
5251
5252 Internally, the @code{\partcombine} interprets both arguments as
5253 @code{Voice}s named @code{one} and @code{two}, and then decides when
5254 the parts can be combined. Consequently, if the arguments switch to
5255 differently named @internalsref{Voice} contexts, the events in those
5256 will be ignored.
5257
5258 @node Hiding staves
5259 @subsection Hiding staves
5260
5261 @cindex Frenched scores
5262 @cindex Hiding staves
5263
5264 In orchestral scores, staff lines that only have rests are usually
5265 removed.  This saves some space. This style is called `French Score'.
5266 For @internalsref{Lyrics}, 
5267 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
5268 switched on by default.  When these line of these contexts turn out
5269 empty after the line-breaking process, they are removed.
5270
5271 For normal staves, a specialized @internalsref{Staff} context is
5272 available, which does the same: staves containing nothing (or only
5273 multi measure rests) are removed. The context definition is stored in
5274 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
5275 in this example disappears in the second line
5276
5277
5278 @lilypond[quote,verbatim]
5279 \paper {
5280   \context { \RemoveEmptyStaffContext }
5281 }
5282
5283 {
5284   \relative c' <<
5285     \new Staff { e4 f g a \break c1 }
5286     \new Staff { c4 d e f \break R1 }
5287   >>
5288 }
5289 @end lilypond
5290
5291 The first system shows all staves in full. If empty staves should be
5292 removed from the first system too, set @code{remove-first} to false in
5293 @internalsref{RemoveEmptyVerticalGroup}.
5294
5295 Another application is making ossia sections, i.e. alternative
5296 melodies on a separate piece of staff, with help of a Frenched
5297 staff. See @inputfileref{input/test,ossia.ly} for an example.
5298
5299
5300 @node Different editions from one source
5301 @subsection Different editions from one source
5302
5303 The @code{\tag} command marks music expressions with a name. These
5304 tagged expressions can be filtered out later.  With this mechanism it
5305 is possible to make different versions of the same music source.
5306
5307 In the following example, we see two versions of a piece of music, one
5308 for the full score, and one with cue notes for the instrumental part
5309
5310 @example
5311   c1
5312   <<
5313     \tag #'part <<
5314       R1 \\
5315       @{
5316         \set fontSize = #-1
5317         c4_"cue" f2 g4 @} 
5318     >>
5319     \tag #'score R1
5320   >>
5321   c1
5322 @end example
5323
5324 The same can be applied to articulations, texts, etc.: they are
5325 made by prepending
5326 @example
5327         -\tag #@var{your-tag} 
5328 @end example
5329 to an articulation, for example, 
5330 @example
5331     c1-\tag #'part ^4
5332 @end example
5333
5334 This defines a note with a conditional fingering indication.
5335
5336 By applying the @code{remove-tag} function, tagged expressions can be
5337 filtered. For example,
5338 @example
5339 <<
5340   @var{the music}
5341   \applymusic #(remove-tag 'score) @var{the music}
5342   \applymusic #(remove-tag 'part) @var{the music}
5343 >>
5344 @end example
5345 would yield
5346
5347 @lilypondfile[quote]{tag-filter.ly}
5348
5349 The argument of the @code{\tag} command should be a symbol, or a list
5350 of symbols, for example,
5351 @example
5352   \tag #'(original-part transposed-part) @dots{}
5353 @end example
5354
5355 @seealso
5356
5357 Examples: @inputfileref{input/regression,tag-filter.ly}.
5358
5359
5360 @node Quoting other voices
5361 @subsection Quoting other voices
5362
5363 With quotations, fragments of other parts can be inserted into a part
5364 directly. Before a part can be quoted, it must be marked especially as
5365 quotable. This is done with code @code{\addquote} command.
5366
5367 @example
5368 \addquote @var{name} @var{music}
5369 @end example
5370
5371
5372 @noindent
5373 Here, @var{name} is an identifying string. The @var{music} is any kind
5374 of music.  This is an example of @code{\addquote}
5375
5376 @verbatim
5377 \addquote clarinet \relative c' {
5378   f4 fis g gis
5379 }
5380 @end verbatim
5381
5382 This command must be entered at toplevel, i.e.  outside any music
5383 blocks.
5384
5385 After calling @code{\addquote}, the quotation may then be done with
5386 @code{\quote},
5387
5388 @example
5389 \quote @var{name} @var{duration}  
5390 @end example
5391
5392 During a part, a piece of music can be quoted with the @code{\quote}
5393 command. 
5394   
5395 @example
5396 \quote clarinet 2.
5397 @end example
5398
5399 This would cite three quarter notes (@code{2.} is a dotted half note)
5400 of the previously added @code{clarinet} voice.
5401
5402 More precisely, it takes the current time-step of the part being
5403 printed, and extracts the notes at the corresponding point of the
5404 @code{\addquote}d voice.  Therefore, the argument to @code{\addquote}
5405 should be the entire part of the voice to be quoted, including any
5406 rests at the beginning. 
5407
5408 Quotations take into account the transposition of both source and target
5409 instruments, if they are specified using the @code{\transposition} command.
5410
5411 @lilypond[quote,raggedright,verbatim]
5412 \addquote clarinet \relative c' {
5413   \transposition bes
5414   f4 fis g gis
5415 }
5416
5417 {
5418   e'8 f'8 \quote clarinet 2
5419 }
5420 @end lilypond
5421
5422 @refbugs
5423
5424 Only the contents of the first @internalsref{Voice} occurring in an
5425 @code{\addquote} command will be considered for quotation, so
5426 @var{music} can not contain @code{\new} and @code{\context Voice}
5427 statements that would switch to a different Voice.
5428
5429
5430 @seealso
5431
5432 In this manual: @ref{Instrument transpositions}.
5433
5434 Examples: @inputfileref{input/regression,quote.ly}
5435 @inputfileref{input/regression,quote-transposition.ly}
5436
5437 Program reference: @internalsref{QuoteMusic}.
5438
5439 @node Formatting cue notes
5440 @section Formatting cue notes
5441
5442
5443 The previous section deals with inserting notes from another
5444 voice. When making a part, these notes need to be specially formatted.
5445 Here is an example of formatted cue notes
5446
5447 @lilypond[verbatim]
5448 smaller = {
5449     \set fontSize = #-1
5450     \override Stem  #'length = #5.5
5451     \override Beam  #'thickness = #0.384
5452     \override Beam  #'space-function =
5453     #(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))
5454 }
5455
5456 {
5457     \set Staff.instrument = #"Horn in F"
5458     \set Score.skipBars = ##t
5459     R1*21
5460     << {
5461             \once \override Staff.MultiMeasureRest  #'staff-position = #-6
5462             R1
5463         }
5464         \new Voice {
5465             s2
5466             \clef tenor
5467             \smaller
5468             r8^"Bsn." c'8  f'8[ f'8]
5469             \clef treble
5470         }
5471     >>
5472     c'8^"Horn" cis'
5473     eis'4 fis'4
5474 }
5475 @end lilypond
5476
5477
5478 There are a couple of points to take care of:
5479
5480 @itemize @bullet
5481 @item
5482 The multi rest of the original part should be moved up or down during
5483 the cue.
5484 @item
5485 Cue notes have smaller font sizes.
5486 @item
5487 When cued notes have a clef change relative to the original part, the
5488 clef should be restored after the cue section. This minimizes
5489 confusion for the reader,
5490 @item
5491 When the original part starts, this should be marked with the name of
5492 the instrument, in this case ``Horn.''   Of course, the cue part is
5493 marked with the instrument playing the cue.
5494 @end itemize
5495  
5496
5497
5498 @node Ancient notation
5499 @section Ancient notation
5500
5501 @cindex Vaticana, Editio
5502 @cindex Medicaea, Editio
5503 @cindex hufnagel
5504 @cindex Petrucci
5505 @cindex mensural
5506
5507 Support for ancient notation includes features for mensural notation
5508 and Gregorian Chant notation.  There is also limited support for
5509 figured bass notation.
5510
5511 Many graphical objects provide a @code{style} property, see
5512 @itemize @bullet
5513 @item
5514 @ref{Ancient note heads},
5515 @item
5516 @ref{Ancient accidentals},
5517 @item
5518 @ref{Ancient
5519 rests},
5520 @item
5521 @ref{Ancient clefs},
5522 @item
5523 @ref{Ancient flags}
5524 @item
5525 @ref{Ancient time signatures}.
5526 @end itemize
5527
5528 By manipulating such a grob property, the typographical appearance of
5529 the affected graphical objects can be accommodated for a specific
5530 notation flavor without need for introducing any new notational
5531 concept.
5532
5533 Other aspects of ancient notation can not that easily be expressed as
5534 in terms of just changing a style property of a graphical object.
5535 Therefore, some notational concepts are introduced specifically for
5536 ancient notation,
5537
5538 @itemize @bullet
5539 @item
5540 @ref{Custodes},
5541 @item
5542 @ref{Divisiones},
5543 @item
5544 @ref{Ligatures}, 
5545 @item
5546 @ref{Figured bass}.
5547 @end itemize
5548
5549 @menu
5550 * Ancient note heads::          
5551 * Ancient accidentals::         
5552 * Ancient rests::               
5553 * Ancient clefs::               
5554 * Ancient flags::               
5555 * Ancient time signatures::     
5556 * Custodes::                    
5557 * Divisiones::                  
5558 * Ligatures::                   
5559 * Vaticana style contexts::     
5560 * Figured bass::                
5561 @end menu
5562
5563 If this all is too much of documentation for you, and you just want to
5564 dive into typesetting without worrying too much about the details on
5565 how to customize a context, you may have a look at the predefined
5566 contexts (see @ref{Vaticana style contexts}).  Use them to set up
5567 predefined style-specific voice and staff contexts, and directly go
5568 ahead with the note entry.
5569
5570 @node Ancient note heads
5571 @subsection Ancient note heads
5572
5573 @cindex note heads
5574
5575
5576 For ancient notation, a note head style other than the @code{default}
5577 style may be chosen.  This is accomplished by setting the @code{style}
5578 property of the NoteHead object to @code{baroque}, @code{neomensural}
5579 or @code{mensural}.  The @code{baroque} style differs from the
5580 @code{default} style only in using a square shape for @code{\breve}
5581 note heads.  The @code{neomensural} style differs from the
5582 @code{baroque} style in that it uses rhomboidal heads for whole notes
5583 and all smaller durations.  Stems are centered on the note heads.
5584 This style is in particular useful when transcribing mensural music,
5585 e.g. for the incipit.  The @code{mensural} style finally produces note
5586 heads that mimic the look of note heads in historic printings of the
5587 16th century.
5588
5589 The following example demonstrates the @code{neomensural} style
5590
5591 @lilypond[quote,fragment,raggedright]
5592 \set Score.skipBars = ##T 
5593 \override NoteHead #'style = #'neomensural
5594 a'\longa a'\breve a'1 a'2 a'4 a'8 a'16
5595 @end lilypond
5596
5597 When typesetting a piece in Gregorian Chant notation, the
5598 @internalsref{Gregorian_ligature_engraver} will automatically select
5599 the proper note heads, such there is no need to explicitly set the
5600 note head style.  Still, the note head style can be set e.g.@: to
5601 @code{vaticana_punctum} to produce punctum neumes.  Similarly, a
5602 @internalsref{Mensural_ligature_engraver} is used to automatically
5603 assemble mensural ligatures.  See @ref{Ligatures} for how ligature
5604 engravers work.
5605
5606 @seealso
5607
5608 Examples: @inputfileref{input/regression,note-head-style.ly} gives an
5609 overview over all available note head styles.
5610
5611
5612 @node Ancient accidentals
5613 @subsection Ancient accidentals
5614
5615 @cindex accidentals
5616
5617
5618 Use the @code{style} property of grob @internalsref{Accidental} to
5619 select ancient accidentals.   Supported styles are
5620 @code{mensural}, @code{vaticana}, @code{hufnagel} and @code{medicaea}.
5621
5622 @lilypond[quote,raggedright,staffsize=26]
5623 \score {
5624     {
5625         \fatText
5626         s
5627         ^\markup {
5628             \column <
5629                 "vaticana" 
5630                 { " " \musicglyph #"accidentals-vaticana-1"
5631                   " " \musicglyph #"accidentals-vaticana0" }
5632             >
5633             \column <
5634                 "medicaea"
5635                 { " " \musicglyph #"accidentals-medicaea-1" }
5636             >
5637             \column <
5638                 "hufnagel"
5639                 { " " \musicglyph #"accidentals-hufnagel-1" }
5640             >
5641             \column <
5642                 "mensural"
5643                 { " " \musicglyph #"accidentals-mensural-1"
5644                   " " \musicglyph #"accidentals-mensural1" }
5645             >
5646         }
5647     }
5648     \paper {
5649         raggedright = ##t 
5650         interscoreline = 1
5651         \context {
5652             \Score
5653             \remove "Bar_number_engraver"
5654         }
5655         \context{
5656             \Staff
5657             \remove "Clef_engraver"
5658             \remove "Key_engraver"
5659             \remove "Time_signature_engraver"
5660             \remove "Staff_symbol_engraver"
5661             minimumVerticalExtent = ##f
5662         }
5663     }
5664 }
5665 @end lilypond
5666
5667 As shown, not all accidentals are supported by each style.  When
5668 trying to access an unsupported accidental, LilyPond will switch to a
5669 different style, as demonstrated in
5670 @inputfileref{input/test,ancient-accidentals.ly}.
5671
5672 Similarly to local accidentals, the style of the key signature can be
5673 controlled by the @code{style} property of the
5674 @internalsref{KeySignature} grob.
5675
5676 @seealso
5677
5678 In this manual: @ref{Pitches}, @ref{Chromatic alterations} and
5679 @ref{Accidentals} give a general introduction into the use of
5680 accidentals.  @ref{Key signature} gives a general introduction into
5681 the use of key signatures.
5682
5683 Program reference: @internalsref{KeySignature}.
5684
5685 Examples: @inputfileref{input/test,ancient-accidentals.ly}.
5686
5687 @node Ancient rests
5688 @subsection Ancient rests
5689
5690 @cindex rests
5691
5692
5693 Use the @code{style} property of grob @internalsref{Rest} to select
5694 ancient accidentals.   Supported styles are @code{classical},
5695 @code{neomensural} and @code{mensural}.  @code{classical} differs
5696 from the @code{default} style only in that the quarter rest looks like
5697 a horizontally mirrored 8th rest.  The @code{neomensural} style suits
5698 well for e.g. the incipit of a transcribed mensural piece of music.
5699 The @code{mensural} style finally mimics the appearance of rests as
5700 in historic prints of the 16th century.
5701
5702 The following example demonstrates the @code{neomensural} style
5703
5704 @lilypond[quote,fragment,raggedright]
5705 \override Rest #'style = #'neomensural
5706 \set Score.skipBars = ##t 
5707 r\longa r\breve r1 r2 r4 r8 r16
5708 @end lilypond
5709
5710 There are no 32th and 64th rests specifically for the mensural or
5711 neo-mensural style.  Instead, the rests from the default style will be
5712 taken.  See @inputfileref{input/test,rests.ly} for a chart of all
5713 rests.
5714
5715 There are no rests in Gregorian Chant notation; instead, it uses
5716 @ref{Divisiones}.
5717
5718 @seealso
5719
5720 In this manual: @ref{Rests} gives a general introduction into the use of rests.
5721
5722
5723 @node Ancient clefs
5724 @subsection Ancient clefs
5725
5726 @cindex clefs
5727
5728
5729 LilyPond supports a variety of clefs, many of them ancient.
5730
5731 The following table shows all ancient clefs that are supported via the
5732 @code{\clef} command.  Some of the clefs use the same glyph, but
5733 differ only with respect to the line they are printed on.  In such
5734 cases, a trailing number in the name is used to enumerate these clefs.
5735 Still, you can manually force a clef glyph to be typeset on an
5736 arbitrary line, as described in @ref{Clef}.  The note printed to the
5737 right side of each clef in the example column denotes the @code{c'}
5738 with respect to that clef.
5739
5740 @multitable @columnfractions   .4 .4 .2
5741
5742 @item
5743 @b{Description} @tab
5744 @b{Supported Clefs} @tab
5745 @b{Example}
5746
5747 @item
5748 modern style mensural C clef @tab
5749 @code{neomensural_c1}, @code{neomensural_c2},
5750 @code{neomensural_c3}, @code{neomensural_c4} @tab
5751 @lilypond[fragment,quote,relative=1,notime]
5752
5753 \clef "neomensural_c2" c
5754 @end lilypond
5755
5756 @item
5757 petrucci style mensural C clefs, for use  on different  staff lines
5758 (the examples shows the 2nd staff line C clef).
5759
5760 @tab
5761 @code{petrucci_c1}
5762 @code{petrucci_c2}
5763 @code{petrucci_c3}
5764 @code{petrucci_c4}
5765 @code{petrucci_c5}
5766
5767 @tab
5768 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5769
5770 \clef "petrucci_c2" c
5771 @end lilypond
5772
5773 @item
5774 petrucci style mensural F clef @tab
5775 @code{petrucci_f} @tab
5776 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5777
5778 \clef "petrucci_f" c
5779 @end lilypond
5780
5781 @item
5782 petrucci style mensural G clef @tab
5783 @code{petrucci_g} @tab
5784 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5785
5786 \clef "petrucci_g" c
5787 @end lilypond
5788
5789 @item
5790 historic style mensural C clef @tab
5791 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
5792 @code{mensural_c4} @tab
5793 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5794
5795 \clef "mensural_c2" c
5796 @end lilypond
5797
5798 @item
5799 historic style mensural F clef @tab
5800 @code{mensural_f} @tab
5801 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5802
5803 \clef "mensural_f" c
5804 @end lilypond
5805
5806 @item
5807 historic style mensural G clef @tab
5808 @code{mensural_g} @tab
5809 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5810
5811 \clef "mensural_g" c
5812 @end lilypond
5813
5814 @item
5815 Editio Vaticana style do clef @tab
5816 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
5817 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5818     \override Staff.StaffSymbol   #'line-count = #4
5819
5820 \clef "vaticana_do2" c
5821 @end lilypond
5822
5823 @item
5824 Editio Vaticana style fa clef @tab
5825 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
5826 @lilypond[quote,relative=1,notime,indent=0.0\mm,fragment]
5827     \override Staff.StaffSymbol   #'line-count = #4
5828
5829 \clef "vaticana_fa2" c
5830 @end lilypond
5831
5832 @item
5833 Editio Medicaea style do clef @tab
5834 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
5835 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5836     \override Staff.StaffSymbol   #'line-count = #4
5837
5838 \clef "medicaea_do2" c
5839 @end lilypond
5840
5841 @item
5842 Editio Medicaea style fa clef @tab
5843 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
5844 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5845     \override Staff.StaffSymbol   #'line-count = #4
5846
5847 \clef "medicaea_fa2" c
5848 @end lilypond
5849
5850 @item
5851 historic style hufnagel do clef @tab
5852 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
5853 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5854     \override Staff.StaffSymbol   #'line-count = #4
5855
5856 \clef "hufnagel_do2" c
5857 @end lilypond
5858
5859 @item
5860 historic style hufnagel fa clef @tab
5861 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
5862 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5863     \override Staff.StaffSymbol   #'line-count = #4
5864
5865 \clef "hufnagel_fa2" c
5866 @end lilypond
5867
5868 @item
5869 historic style hufnagel combined do/fa clef @tab
5870 @code{hufnagel_do_fa} @tab
5871 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5872 \clef "hufnagel_do_fa" c
5873 @end lilypond
5874
5875 @end multitable
5876
5877
5878
5879 @emph{Modern style} means ``as is typeset in contemporary editions of
5880 transcribed mensural music''.
5881
5882 @emph{Petrucci style} means ``inspired by printings published by the
5883 famous engraver Petrucci (1466-1539)''.
5884
5885 @emph{Historic style} means ``as was typeset or written in historic
5886 editions (other than those of Petrucci)''.
5887
5888 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
5889
5890 Petrucci used C clefs with differently balanced left-side vertical
5891 beams, depending on which staff line it is printed.
5892
5893 @seealso
5894
5895 In this manual: see @ref{Clef}.
5896
5897 @refbugs
5898
5899 The mensural g clef is mapped to the Petrucci g clef.
5900
5901
5902
5903 @node Ancient flags
5904 @subsection Ancient flags
5905
5906 @cindex flags
5907
5908
5909 Use the @code{flag-style} property of grob @internalsref{Stem} to
5910 select ancient flags.  Besides the @code{default} flag style,
5911  only @code{mensural} style is supported
5912
5913 @lilypond[quote,fragment,raggedright,verbatim]
5914 \override Stem #'flag-style = #'mensural
5915 \override Stem #'thickness = #1.0
5916 \override NoteHead #'style = #'mensural
5917 \autoBeamOff
5918 c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8
5919 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5920 @end lilypond
5921
5922 Note that the innermost flare of each mensural flag always is
5923 vertically aligned with a staff line.  If you do not like this
5924 behavior, you can set the @code{adjust-if-on-staffline} property of
5925 grob @internalsref{Stem} to @code{##f}.  Then, the vertical position
5926 of the end of each flare is different between notes on staff lines and
5927 notes between staff lines
5928
5929 @lilypond[quote,fragment,raggedright]
5930 \override Stem #'flag-style = #'mensural
5931 \override Stem #'thickness = #1.0
5932 \override Stem #'adjust-if-on-staffline = ##f
5933 \override NoteHead #'style = #'mensural
5934 \autoBeamOff
5935 c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8
5936 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5937 @end lilypond
5938
5939 There is no particular flag style for neo-mensural notation.  Hence,
5940 when typesetting  the incipit of a transcribed piece of mensural
5941 music, the default flag style should be used.  There are no flags in
5942 Gregorian Chant notation.
5943
5944
5945 @node Ancient time signatures
5946 @subsection Ancient time signatures
5947
5948 @cindex time signatures
5949
5950
5951 There is limited support for mensural time signatures.   The
5952 glyphs are hard-wired to particular time fractions.  In other words,
5953 to get a particular mensural signature glyph with the @code{\time n/m}
5954 command, @code{n} and @code{m} have to be chosen according to the
5955 following table
5956
5957 @lilypond[quote]
5958 \paper {
5959     indent = 0.0
5960     raggedright = ##t
5961     \context {
5962         \Staff
5963         \remove Staff_symbol_engraver
5964         \remove Clef_engraver
5965         \remove Time_signature_engraver
5966     }
5967 } {
5968     \set Score.timing = ##f
5969     \set Score.barAlways = ##t
5970     s_\markup { "$\\backslash$time 4/4" }
5971      ^\markup { "       " \musicglyph #"timesig-neomensural4/4" }
5972     s
5973     s_\markup { "$\\backslash$time 2/2" }
5974      ^\markup { "       " \musicglyph #"timesig-neomensural2/2" }
5975     s
5976     s_\markup { "$\\backslash$time 6/4" }
5977      ^\markup { "       " \musicglyph #"timesig-neomensural6/4" }
5978     s
5979     s_\markup { "$\\backslash$time 6/8" }
5980      ^\markup { "       " \musicglyph #"timesig-neomensural6/8" }
5981     \break
5982     s_\markup { "$\\backslash$time 3/2" }
5983      ^\markup { "       " \musicglyph #"timesig-neomensural3/2" }
5984     s
5985     s_\markup { "$\\backslash$time 3/4" }
5986      ^\markup { "       " \musicglyph #"timesig-neomensural3/4" }
5987     s
5988     s_\markup { "$\\backslash$time 9/4" }
5989      ^\markup { "       " \musicglyph #"timesig-neomensural9/4" }
5990     s
5991     s_\markup { "$\\backslash$time 9/8" }
5992      ^\markup { "       " \musicglyph #"timesig-neomensural9/8" }
5993     \break
5994     s_\markup { "$\\backslash$time 4/8" }
5995      ^\markup { "       " \musicglyph #"timesig-neomensural4/8" }
5996     s
5997     s_\markup { "$\\backslash$time 2/4" }
5998      ^\markup { "       " \musicglyph #"timesig-neomensural2/4" }
5999     \break
6000 }
6001 @end lilypond
6002
6003 Use the @code{style} property of grob @internalsref{TimeSignature} to
6004 select ancient time signatures.  Supported styles are
6005 @code{neomensural} and @code{mensural}.  The above table uses the
6006 @code{neomensural} style.  This style is appropriate  for the
6007 incipit of transcriptions of mensural pieces.  The @code{mensural}
6008 style mimics the look of historical printings of the 16th century.
6009
6010 The following examples shows the differences in style,
6011 @lilypond[raggedright]
6012 {
6013   \time 2/2
6014   c1^\markup { \hspace #-2.0 \typewriter default }
6015
6016   \override Staff.TimeSignature #'style = #'numbered  
6017   \time 2/2
6018   c1^\markup { \hspace #-2.0 \typewriter numbered }
6019
6020   \override Staff.TimeSignature #'style = #'mensural
6021   \time 2/2
6022   c1^\markup { \hspace #-2.0 \typewriter mensural }
6023   
6024   \override Staff.TimeSignature #'style = #'neomensural
6025   \time 2/2
6026   c1^\markup { \hspace #-2.0 \typewriter neomensural }
6027   \override Staff.TimeSignature #'style = #'single-digit
6028   \time 2/2
6029   c1^\markup { \hspace #-2.0 \typewriter single-digit }
6030 }
6031 @end lilypond
6032
6033 @seealso
6034
6035 This manual: @ref{Time signature} gives a general introduction into
6036 the use of time signatures.
6037
6038 @refbugs
6039
6040 Ratios of note durations do not change with the time signature. For
6041 example, the ratio of 1 brevis = 3 semibrevis (tempus perfectum) must
6042 be made by hand, by setting
6043
6044 @example
6045   breveTP = #(ly:make-duration -1 0 3 2)
6046   @dots{}
6047   @{ c\breveTP f1 @}
6048 @end example
6049
6050 @noindent
6051 This sets @code{breveTP} to 3/2 times 2 = 3 times a whole note. 
6052
6053 The @code{old6/8alt} symbol (an alternate   symbol for 6/8) is not
6054 addressable with @code{\time}. Use a @code{\markup} instead
6055
6056 @node Custodes
6057 @subsection Custodes
6058
6059 @cindex custos
6060 @cindex custodes
6061
6062 A @emph{custos} (plural: @emph{custodes}; Latin word for `guard') is a
6063 symbol that appears at the end of a staff.  It anticipates the pitch
6064 of the first note(s) of the following line thus helping the performer
6065 to manage line breaks during performance.
6066
6067 Custodes were frequently used in music notation until the 17th
6068 century.  Nowadays, they have survived only in a few particular forms
6069 of musical notation such as contemporary editions of Gregorian chant
6070 like the @emph{editio vaticana}.  There are different custos glyphs
6071 used in different flavors of notational style.
6072
6073 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
6074 @internalsref{Staff} context when declaring the @code{\paper} block,
6075 as shown in the following example
6076
6077 @example
6078 \paper @{
6079   \context @{
6080      \Staff
6081      \consists Custos_engraver
6082      Custos \override #'style = #'mensural
6083   @}
6084 @}
6085 @end example
6086
6087 The result looks like this
6088
6089 @lilypond[quote,raggedright]
6090 \score {
6091      {
6092         a'1
6093         \override Staff.Custos #'style = #'mensural
6094         \break
6095         g'
6096     }
6097     \paper {
6098         \context {
6099             \Staff
6100             \consists Custos_engraver
6101         }
6102     }
6103 }
6104 @end lilypond
6105
6106 The custos glyph is selected by the @code{style} property. The styles
6107 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
6108 @code{mensural}.  They are demonstrated in the following fragment
6109
6110 @lilypond[quote]
6111 \score {
6112        \new Lyrics    \lyrics {
6113         \markup {
6114             \column <
6115                 \typewriter                "vaticana" 
6116                 { " " \musicglyph #"custodes-vaticana-u0" }
6117             > }
6118         \markup {    \column <
6119                 \typewriter                "medicaea"
6120                 { " " \musicglyph #"custodes-medicaea-u0" }
6121             >}
6122             \markup {
6123             \column <
6124                 \typewriter                "hufnagel"
6125                 { " " \musicglyph #"custodes-hufnagel-u0" }
6126             >}
6127             \markup {
6128             \column <
6129                 \typewriter                "mensural"
6130                 { " " \musicglyph #"custodes-mensural-u0" }
6131             >}
6132         }
6133     
6134     \paper {
6135         raggedright = ##t 
6136         }      
6137 }
6138 @end lilypond
6139
6140 @seealso
6141
6142 Program reference: @internalsref{Custos}.
6143
6144 Examples: @inputfileref{input/regression,custos.ly}.
6145
6146
6147 @node Divisiones
6148 @subsection Divisiones
6149
6150 @cindex divisio
6151 @cindex divisiones
6152 @cindex finalis
6153
6154 A @emph{divisio} (plural: @emph{divisiones}; Latin word for
6155 `division') is a staff context symbol that is used to structure
6156 Gregorian music into phrases and sections.  The musical meaning of
6157 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
6158 can be characterized as short, medium and long pause, somewhat like
6159 the breathmarks from @ref{Breath marks}.  The @emph{finalis} sign not
6160 only marks the end of a chant, but is also frequently used within a
6161 single antiphonal/responsorial chant to mark the end of each section.
6162
6163
6164 To use divisiones, include the file @code{gregorian-init.ly}.  It
6165 contains definitions that you can apply by just inserting
6166 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
6167 and @code{\finalis} at proper places in the input.  Some editions use
6168 @emph{virgula} or @emph{caesura} instead of divisio minima.
6169 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
6170 @code{\caesura}
6171
6172 @lilypondfile[quote,raggedright]{divisiones.ly}
6173
6174 @refcommands
6175
6176 @cindex @code{\virgula}
6177 @code{\virgula},
6178 @cindex @code{\caesura}
6179 @code{\caesura},
6180 @cindex @code{\divisioMinima}
6181 @code{\divisioMinima},
6182 @cindex @code{\divisioMaior}
6183 @code{\divisioMaior},
6184 @cindex @code{\divisioMaxima}
6185 @code{\divisioMaxima},
6186 @cindex @code{\finalis}
6187 @code{\finalis}.
6188
6189 @seealso
6190
6191 In this manual: @ref{Breath marks}.
6192
6193 Program reference: @internalsref{BreathingSign}, @internalsref{BreathingSignEvent}.
6194
6195 Examples: @inputfileref{input/test,divisiones.ly}.
6196
6197 @node Ligatures
6198 @subsection Ligatures
6199
6200 @cindex Ligatures
6201
6202 @c TODO: Should double check if I recalled things correctly when I wrote
6203 @c down the following paragraph by heart.
6204
6205 A ligature is a graphical symbol that represents at least two distinct
6206 notes.  Ligatures originally appeared in the manuscripts of Gregorian
6207 chant notation to denote ascending or descending sequences of notes.
6208
6209 Ligatures are entered by enclosing them in @code{\[} and @code{\]}.
6210 Some ligature styles may need additional input syntax specific for
6211 this particular type of ligature.  By default, the
6212 @internalsref{LigatureBracket} engraver just puts a square bracket
6213 above the ligature
6214
6215 @lilypond[quote,raggedright,verbatim]
6216 \transpose c c' {
6217     \[ g c a f d' \]
6218     a g f
6219     \[ e f a g \]
6220 }
6221 @end lilypond
6222
6223 To select a specific style of ligatures, a proper ligature engraver
6224 has to be added to the @internalsref{Voice} context, as explained in
6225 the following subsections.   Only white mensural ligatures
6226 are supported with certain limitations.
6227
6228
6229
6230 @refbugs
6231
6232 Ligatures need special spacing that has not yet been implemented.  As
6233 a result, there is too much space between ligatures most of the time,
6234 and line breaking often is unsatisfactory.  Also, lyrics do not
6235 correctly align with ligatures.
6236
6237 Accidentals must not be printed within a ligature, but instead need to
6238 be collected and printed in front of it.
6239
6240 Augmentum dots within ligatures are  not handled correctly.
6241
6242
6243 @menu
6244 * White mensural ligatures::    
6245 * Gregorian square neumes ligatures::  
6246 @end menu
6247
6248 @node White mensural ligatures
6249 @subsubsection White mensural ligatures
6250
6251 @cindex Mensural ligatures
6252 @cindex White mensural ligatures
6253
6254 There is limited support for white mensural ligatures.  
6255
6256 To engrave white mensural ligatures, in the paper block the
6257 @internalsref{Mensural_ligature_engraver} has to be put into the
6258 @internalsref{Voice} context, and remove the
6259 @internalsref{Ligature_bracket_engraver}
6260
6261 @example
6262     \paper @{
6263         \context @{
6264             \Voice
6265             \remove Ligature_bracket_engraver
6266             \consists Mensural_ligature_engraver
6267         @}
6268     @}
6269 @end example
6270
6271 There is no additional input language to describe the shape of a
6272 white mensural ligature.  The shape is rather determined solely from
6273 the pitch and duration of the enclosed notes.  While this approach may
6274 take a new user a while to get accustomed, it has the great advantage
6275 that the full musical information of the ligature is known internally.
6276 This is not only required for correct MIDI output, but also allows for
6277 automatic transcription of the ligatures.
6278
6279 For example,
6280
6281 @example
6282         \set Score.timing = ##f
6283         \set Score.defaultBarType = "empty"
6284         \override NoteHead #'style = #'neomensural
6285         \override Staff.TimeSignature   #'style = #'neomensural
6286         \clef "petrucci_g"
6287         \[ g\longa c\breve a\breve f\breve d'\longa \]
6288         s4
6289         \[ e1 f1 a\breve g\longa \]
6290 @end example
6291 @lilypond[quote,raggedright]
6292 \score {
6293     \transpose c c' {
6294         \set Score.timing = ##f
6295         \set Score.defaultBarType = "empty"
6296         \override NoteHead #'style = #'neomensural
6297         \override Staff.TimeSignature   #'style = #'neomensural
6298         \clef "petrucci_g"
6299         \[ g\longa c\breve a\breve f\breve d'\longa \]
6300         s4
6301         \[ e1 f1 a\breve g\longa \]
6302     }
6303     \paper {
6304         \context {
6305             \Voice
6306             \remove Ligature_bracket_engraver
6307             \consists Mensural_ligature_engraver
6308         }
6309     }
6310 }
6311 @end lilypond
6312
6313 Without replacing @internalsref{Ligature_bracket_engraver} with
6314 @internalsref{Mensural_ligature_engraver}, the same music transcribes
6315 to the following
6316
6317 @lilypond[quote,raggedright]
6318 \transpose c c' {
6319         \set Score.timing = ##f
6320         \set Score.defaultBarType = "empty"
6321         \override NoteHead #'style = #'neomensural
6322         \override Staff.TimeSignature   #'style = #'neomensural
6323         \clef "petrucci_g"
6324         \[ g\longa c\breve a\breve f\breve d'\longa \]
6325         s4
6326         \[ e1 f1 a\breve g\longa \]
6327 }
6328 @end lilypond
6329
6330 @refbugs
6331
6332 The implementation is experimental. It may output strange warnings,
6333 incorrect results, and might even crash on more complex ligatures.
6334
6335 @node Gregorian square neumes ligatures
6336 @subsubsection Gregorian square neumes ligatures
6337
6338 @cindex Square neumes ligatures
6339 @cindex Gregorian square neumes ligatures
6340
6341 There is limited support for Gregorian square neumes notation
6342 (following the style of the Editio Vaticana).  Core ligatures can
6343 already be typeset, but essential issues for serious typesetting are
6344 still lacking, such as (among others) horizontal alignment of multiple
6345 ligatures, lyrics alignment and proper accidentals handling.
6346
6347
6348 The following table contains the extended neumes table of the 2nd
6349 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
6350 1983 by the monks of Solesmes.
6351
6352 @multitable @columnfractions .4 .2 .2 .2
6353
6354 @item
6355 @b{Neuma aut@*Neumarum Elementa} @tab
6356 @b{Figurae@*Rectae} @tab
6357 @b{Figurae@*Liquescentes Auctae} @tab
6358 @b{Figurae@*Liquescentes Deminutae}
6359
6360 @c TODO: \paper block is identical in all of the below examples.
6361 @c Therefore, it should somehow be included rather than duplicated all
6362 @c the time. --jr
6363
6364 @c why not make identifiers in ly/engraver-init.ly? --hwn
6365
6366 @c Because it's just used to typeset plain notes without
6367 @c a staff for demonstration purposes rather than something
6368 @c special of Gregorian chant notation. --jr
6369
6370 @item
6371 @code{1. Punctum}
6372 @tab
6373 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.5\cm]
6374 \include "gregorian-init.ly"
6375 \score {
6376     \transpose c c' {
6377         % Punctum
6378         \[ b \]
6379         \noBreak s^\markup {"a"} \noBreak
6380
6381         % Punctum Inclinatum
6382         \[ \inclinatum b \]
6383         \noBreak s^\markup {"b"}
6384     }
6385 \paper { \neumeDemoPaper }}
6386 @end lilypond
6387 @tab
6388 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.5\cm]
6389 \include "gregorian-init.ly"
6390 \score {
6391      \transpose c c' {
6392         % Punctum Auctum Ascendens
6393         \[ \auctum \ascendens b \]
6394         \noBreak s^\markup {"c"} \noBreak
6395
6396         % Punctum Auctum Descendens
6397         \[ \auctum \descendens b \]
6398         \noBreak s^\markup {"d"} \noBreak
6399
6400         % Punctum Inclinatum Auctum
6401         \[ \inclinatum \auctum b \]
6402         \noBreak s^\markup {"e"}
6403     }
6404 \paper { \neumeDemoPaper }}
6405 @end lilypond
6406 @tab
6407 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6408 \include "gregorian-init.ly"
6409 \score {
6410      \transpose c c' {
6411         % Punctum Inclinatum Parvum
6412         \[ \inclinatum \deminutum b \]
6413         \noBreak s^\markup {"f"}
6414     }
6415 \paper { \neumeDemoPaper }}
6416 @end lilypond
6417
6418 @item
6419 @code{2. Virga}
6420 @tab
6421 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6422 \include "gregorian-init.ly"
6423 \score {
6424      \transpose c c' {
6425         % Virga
6426         \[ \virga b \]
6427         \noBreak s^\markup {"g"}
6428     }
6429 \paper { \neumeDemoPaper }}
6430 @end lilypond
6431 @tab
6432 @tab
6433
6434 @item
6435 @code{3. Apostropha vel Stropha}
6436 @tab
6437 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6438 \include "gregorian-init.ly"
6439 \score {
6440      \transpose c c' {
6441         % Stropha
6442         \[ \stropha b \]
6443         \noBreak s^\markup {"h"}
6444     }
6445 \paper { \neumeDemoPaper }}
6446 @end lilypond
6447 @tab
6448 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6449 \include "gregorian-init.ly"
6450 \score {
6451      \transpose c c' {
6452         % Stropha Aucta
6453         \[ \stropha \auctum b \]
6454         \noBreak s^\markup {"i"}
6455     }
6456 \paper { \neumeDemoPaper }}
6457 @end lilypond
6458 @tab
6459
6460 @item
6461 @code{4. Oriscus}
6462 @tab
6463 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6464 \include "gregorian-init.ly"
6465 \score {
6466      \transpose c c' {
6467         % Oriscus
6468         \[ \oriscus b \]
6469         \noBreak s^\markup {"j"}
6470     }
6471 \paper { \neumeDemoPaper }}
6472 @end lilypond
6473 @tab
6474 @tab
6475
6476 @item
6477 @code{5. Clivis vel Flexa}
6478 @tab
6479 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6480 \include "gregorian-init.ly"
6481 \score {
6482      \transpose c c' {
6483         % Clivis vel Flexa
6484         \[ b \flexa g \]
6485         s^\markup {"k"}
6486     }
6487 \paper { \neumeDemoPaper }}
6488 @end lilypond
6489 @tab
6490 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
6491 \include "gregorian-init.ly"
6492 \score {
6493      \transpose c c' {
6494         % Clivis Aucta Descendens
6495         \[ b \flexa \auctum \descendens g \]
6496         \noBreak s^\markup {"l"} \noBreak
6497
6498         % Clivis Aucta Ascendens
6499         \[ b \flexa \auctum \ascendens g \]
6500         \noBreak s^\markup {"m"}
6501     }
6502 \paper { \neumeDemoPaper }}
6503 @end lilypond
6504 @tab
6505 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6506 \include "gregorian-init.ly"
6507 \score {
6508      \transpose c c' {
6509         % Cephalicus
6510         \[ b \flexa \deminutum g \]
6511         s^\markup {"n"}
6512     }
6513 \paper { \neumeDemoPaper }}
6514 @end lilypond
6515
6516 @item
6517 @code{6. Podatus vel Pes}
6518 @tab
6519 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6520 \include "gregorian-init.ly"
6521 \score {
6522      \transpose c c' {
6523         % Podatus vel Pes
6524         \[ g \pes b \]
6525         s^\markup {"o"}
6526     }
6527 \paper { \neumeDemoPaper }}
6528 @end lilypond
6529 @tab
6530 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
6531 \include "gregorian-init.ly"
6532 \score {
6533      \transpose c c' {
6534         % Pes Auctus Descendens
6535         \[ g \pes \auctum \descendens b \]
6536         \noBreak s^\markup {"p"} \noBreak
6537
6538         % Pes Auctus Ascendens
6539         \[ g \pes \auctum \ascendens b \]
6540         \noBreak s^\markup {"q"}
6541     }
6542 \paper { \neumeDemoPaper }}
6543 @end lilypond
6544 @tab
6545 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6546 \include "gregorian-init.ly"
6547 \score {
6548      \transpose c c' {
6549         % Epiphonus
6550         \[ g \pes \deminutum b \]
6551         s^\markup {"r"}
6552     }
6553 \paper { \neumeDemoPaper }}
6554 @end lilypond
6555
6556 @item
6557 @code{7. Pes Quassus}
6558 @tab
6559 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6560 \include "gregorian-init.ly"
6561 \score {
6562      \transpose c c' {
6563         % Pes Quassus
6564         \[ \oriscus g \pes \virga b \]
6565         s^\markup {"s"}
6566     }
6567 \paper { \neumeDemoPaper }}
6568 @end lilypond
6569 @tab
6570 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6571 \include "gregorian-init.ly"
6572 \score {
6573      \transpose c c' {
6574         % Pes Quassus Auctus Descendens
6575         \[ \oriscus g \pes \auctum \descendens b \]
6576         s^\markup {"t"}
6577     }
6578 \paper { \neumeDemoPaper }}
6579 @end lilypond
6580 @tab
6581
6582 @item
6583 @code{8. Quilisma Pes}
6584 @tab
6585 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6586 \include "gregorian-init.ly"
6587 \score {
6588      \transpose c c' {
6589         % Quilisma Pes
6590         \[ \quilisma g \pes b \]
6591         s^\markup {"u"}
6592     }
6593 \paper { \neumeDemoPaper }}
6594 @end lilypond
6595 @tab
6596 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6597 \include "gregorian-init.ly"
6598 \score {
6599      \transpose c c' {
6600         % Quilisma Pes Auctus Descendens
6601         \[ \quilisma g \pes \auctum \descendens b \]
6602         s^\markup {"v"}
6603     }
6604 \paper { \neumeDemoPaper }}
6605 @end lilypond
6606 @tab
6607
6608 @item
6609 @code{9. Podatus Initio Debilis}
6610 @tab
6611 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6612 \include "gregorian-init.ly"
6613 \score {
6614      \transpose c c' {
6615         % Pes Initio Debilis
6616         \[ \deminutum g \pes b \]
6617         s^\markup {"w"}
6618     }
6619 \paper { \neumeDemoPaper }}
6620 @end lilypond
6621 @tab
6622 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6623 \include "gregorian-init.ly"
6624 \score {
6625      \transpose c c' {
6626         % Pes Auctus Descendens Initio Debilis
6627         \[ \deminutum g \pes \auctum \descendens b \]
6628         s^\markup {"x"}
6629     }
6630 \paper { \neumeDemoPaper }}
6631 @end lilypond
6632 @tab
6633
6634 @item
6635 @code{10. Torculus}
6636 @tab
6637 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6638 \include "gregorian-init.ly"
6639 \score {
6640      \transpose c c' {
6641         % Torculus
6642         \[ a \pes b \flexa g \]
6643         s^\markup {"y"}
6644     }
6645 \paper { \neumeDemoPaper }}
6646 @end lilypond
6647 @tab
6648 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6649 \include "gregorian-init.ly"
6650 \score {
6651      \transpose c c' {
6652         % Torculus Auctus Descendens
6653         \[ a \pes b \flexa \auctum \descendens g \]
6654         s^\markup {"z"}
6655     }
6656 \paper { \neumeDemoPaper }}
6657 @end lilypond
6658 @tab
6659 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6660 \include "gregorian-init.ly"
6661 \score {
6662      \transpose c c' {
6663         % Torculus Deminutus
6664         \[ a \pes b \flexa \deminutum g \]
6665         s^\markup {"A"}
6666     }
6667 \paper { \neumeDemoPaper }}
6668 @end lilypond
6669
6670 @item
6671 @code{11. Torculus Initio Debilis}
6672 @tab
6673 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6674 \include "gregorian-init.ly"
6675 \score {
6676      \transpose c c' {
6677         % Torculus Initio Debilis
6678         \[ \deminutum a \pes b \flexa g \]
6679         s^\markup {"B"}
6680     }
6681 \paper { \neumeDemoPaper }}
6682 @end lilypond
6683 @tab
6684 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6685 \include "gregorian-init.ly"
6686 \score {
6687      \transpose c c' {
6688         % Torculus Auctus Descendens Initio Debilis
6689         \[ \deminutum a \pes b \flexa \auctum \descendens g \]
6690         s^\markup {"C"}
6691     }
6692 \paper { \neumeDemoPaper }}
6693 @end lilypond
6694 @tab
6695 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6696 \include "gregorian-init.ly"
6697 \score {
6698      \transpose c c' {
6699         % Torculus Deminutus Initio Debilis
6700         \[ \deminutum a \pes b \flexa \deminutum g \]
6701         s^\markup {"D"}
6702     }
6703 \paper { \neumeDemoPaper }}
6704 @end lilypond
6705
6706 @item
6707 @code{12. Porrectus}
6708 @tab
6709 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6710 \include "gregorian-init.ly"
6711 \score {
6712      \transpose c c' {
6713         % Porrectus
6714         \[ a \flexa g \pes b \]
6715         s^\markup {"E"}
6716     }
6717 \paper { \neumeDemoPaper }}
6718 @end lilypond
6719 @tab
6720 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6721 \include "gregorian-init.ly"
6722 \score {
6723      \transpose c c' {
6724         % Porrectus Auctus Descendens
6725         \[ a \flexa g \pes \auctum \descendens b \]
6726         s^\markup {"F"}
6727     }
6728 \paper { \neumeDemoPaper }}
6729 @end lilypond
6730 @tab
6731 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6732 \include "gregorian-init.ly"
6733 \score {
6734      \transpose c c' {
6735         % Porrectus Deminutus
6736         \[ a \flexa g \pes \deminutum b \]
6737         s^\markup {"G"}
6738     }
6739 \paper { \neumeDemoPaper }}
6740 @end lilypond
6741
6742 @item
6743 @code{13. Climacus}
6744 @tab
6745 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6746 \include "gregorian-init.ly"
6747 \score {
6748      \transpose c c' {
6749         % Climacus
6750         \[ \virga b \inclinatum a \inclinatum g \]
6751         s^\markup {"H"}
6752     }
6753     \paper { \neumeDemoPaper }
6754 }
6755 @end lilypond
6756 @tab
6757 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6758 \include "gregorian-init.ly"
6759 \score {
6760      \transpose c c' {
6761         % Climacus Auctus
6762         \[ \virga b \inclinatum a \inclinatum \auctum g \]
6763         s^\markup {"I"}
6764     }
6765 \paper { \neumeDemoPaper }}
6766 @end lilypond
6767 @tab
6768 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6769 \include "gregorian-init.ly"
6770 \score {
6771      \transpose c c' {
6772         % Climacus Deminutus
6773         \[ \virga b \inclinatum a \inclinatum \deminutum g \]
6774         s^\markup {"J"}
6775     }
6776 \paper { \neumeDemoPaper }}
6777 @end lilypond
6778
6779 @item
6780 @code{14. Scandicus}
6781 @tab
6782 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6783 \include "gregorian-init.ly"
6784 \score {
6785      \transpose c c' {
6786         % Scandicus
6787         \[ g \pes a \virga b \]
6788         s^\markup {"K"}
6789     }
6790 \paper { \neumeDemoPaper }}
6791 @end lilypond
6792 @tab
6793 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6794 \include "gregorian-init.ly"
6795 \score {
6796      \transpose c c' {
6797         % Scandicus Auctus Descendens
6798         \[ g \pes a \pes \auctum \descendens b \]
6799         s^\markup {"L"}
6800     }
6801 \paper { \neumeDemoPaper }}
6802 @end lilypond
6803 @tab
6804 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6805 \include "gregorian-init.ly"
6806 \score {
6807      \transpose c c' {
6808         % Scandicus Deminutus
6809         \[ g \pes a \pes \deminutum b \]
6810         s^\markup {"M"}
6811     }
6812 \paper { \neumeDemoPaper }}
6813 @end lilypond
6814
6815 @item
6816 @code{15. Salicus}
6817 @tab
6818 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6819 \include "gregorian-init.ly"
6820 \score {
6821      \transpose c c' {
6822         % Salicus
6823         \[ g \oriscus a \pes \virga b \]
6824         s^\markup {"N"}
6825     }
6826 \paper { \neumeDemoPaper }}
6827 @end lilypond
6828 @tab
6829 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6830 \include "gregorian-init.ly"
6831 \score {
6832      \transpose c c' {
6833         % Salicus Auctus Descendens
6834         \[ g \oriscus a \pes \auctum \descendens b \]
6835         s^\markup {"O"}
6836     }
6837 \paper { \neumeDemoPaper }}
6838 @end lilypond
6839 @tab
6840
6841 @item
6842 @code{16. Trigonus}
6843 @tab
6844 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6845 \include "gregorian-init.ly"
6846 \score {
6847    \transpose c c' {
6848     % Trigonus
6849     \[ \stropha b \stropha b \stropha a \]
6850     s^\markup {"P"}
6851   }
6852   \paper { \neumeDemoPaper }
6853 }
6854 @end lilypond
6855 @tab
6856 @tab
6857
6858 @end multitable
6859
6860
6861 Unlike most other neumes notation systems, the input language for
6862 neumes does not reflect the typographical appearance, but is designed
6863 to focus on musical meaning.  For example, @code{\[ a \pes b
6864 \flexa g \]} produces a Torculus consisting of three Punctum heads,
6865 while @code{\[ a \flexa g \pes b \]} produces a Porrectus with a
6866 curved flexa shape and only a single Punctum head.  There is no
6867 command to explicitly typeset the curved flexa shape; the decision of
6868 when to typeset a curved flexa shape is based on the musical
6869 input.  The idea of this approach is to separate the musical aspects
6870 of the input from the notation style of the output.  This way, the
6871 same input can be reused to typeset the same music in a different
6872 style of Gregorian chant notation.
6873
6874 The following table shows the code fragments that produce the
6875 ligatures in the above neumes table.  The letter in the first column
6876 in each line of the below table indicates to which ligature in the
6877 above table it refers.  The second column gives the name of the
6878 ligature.  The third column shows the code fragment that produces this
6879 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
6880
6881 @multitable @columnfractions .1 .4 .5
6882
6883 @item
6884 @b{#} @tab
6885 @b{Name} @tab
6886 @b{Input Language}
6887
6888 @item
6889 a @tab
6890 Punctum @tab
6891 @code{\[ b \]}
6892
6893 @item
6894 b @tab
6895 Punctum Inclinatum @tab
6896 @code{\[ \inclinatum b \]}
6897
6898 @item
6899 c @tab
6900 Punctum Auctum Ascendens @tab
6901 @code{\[ \auctum \ascendens b \]}
6902
6903 @item
6904 d @tab
6905 Punctum Auctum Descendens @tab
6906 @code{\[ \auctum \descendens b \]}
6907
6908 @item
6909 e @tab
6910 Punctum Inclinatum Auctum @tab
6911 @code{\[ \inclinatum \auctum b \]}
6912
6913 @item
6914 f @tab
6915 Punctum Inclinatum Parvum @tab
6916 @code{\[ \inclinatum \deminutum b \]}
6917
6918 @item
6919 g @tab
6920 Virga @tab
6921 @code{\[ \virga b \]}
6922
6923 @item
6924 h @tab
6925 Stropha @tab
6926 @code{\[ \stropha b \]}
6927
6928 @item
6929 i @tab
6930 Stropha Aucta @tab
6931 @code{\[ \stropha \auctum b \]}
6932
6933 @item
6934 j @tab
6935 Oriscus @tab
6936 @code{\[ \oriscus b \]}
6937
6938 @item
6939 k @tab
6940 Clivis vel Flexa @tab
6941 @code{\[ b \flexa g \]}
6942
6943 @item
6944 l @tab
6945 Clivis Aucta Descendens @tab
6946 @code{\[ b \flexa \auctum \descendens g \]}
6947
6948 @item
6949 m @tab
6950 Clivis Aucta Ascendens @tab
6951 @code{\[ b \flexa \auctum \ascendens g \]}
6952
6953 @item
6954 n @tab
6955 Cephalicus @tab
6956 @code{\[ b \flexa \deminutum g \]}
6957
6958 @item
6959 o @tab
6960 Podatus vel Pes @tab
6961 @code{\[ g \pes b \]}
6962
6963 @item
6964 p @tab
6965 Pes Auctus Descendens @tab
6966 @code{\[ g \pes \auctum \descendens b \]}
6967
6968 @item
6969 q @tab
6970 Pes Auctus Ascendens @tab
6971 @code{\[ g \pes \auctum \ascendens b \]}
6972
6973 @item
6974 r @tab
6975 Epiphonus @tab
6976 @code{\[ g \pes \deminutum b \]}
6977
6978 @item
6979 s @tab
6980 Pes Quassus @tab
6981 @code{\[ \oriscus g \pes \virga b \]}
6982
6983 @item
6984 t @tab
6985 Pes Quassus Auctus Descendens @tab
6986 @code{\[ \oriscus g \pes \auctum \descendens b \]}
6987
6988 @item
6989 u @tab
6990 Quilisma Pes @tab
6991 @code{\[ \quilisma g \pes b \]}
6992
6993 @item
6994 v @tab
6995 Quilisma Pes Auctus Descendens @tab
6996 @code{\[ \quilisma g \pes \auctum \descendens b \]}
6997
6998 @item
6999 w @tab
7000 Pes Initio Debilis @tab
7001 @code{\[ \deminutum g \pes b \]}
7002
7003 @item
7004 x @tab
7005 Pes Auctus Descendens Initio Debilis @tab
7006 @code{\[ \deminutum g \pes \auctum \descendens b \]}
7007
7008 @item
7009 y @tab
7010 Torculus @tab
7011 @code{\[ a \pes b \flexa g \]}
7012
7013 @item
7014 z @tab
7015 Torculus Auctus Descendens @tab
7016 @code{\[ a \pes b \flexa \auctum \descendens g \]}
7017
7018 @item
7019 A @tab
7020 Torculus Deminutus @tab
7021 @code{\[ a \pes b \flexa \deminutum g \]}
7022
7023 @item
7024 B @tab
7025 Torculus Initio Debilis @tab
7026 @code{\[ \deminutum a \pes b \flexa g \]}
7027
7028 @item
7029 C @tab
7030 Torculus Auctus Descendens Initio Debilis @tab
7031 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
7032
7033 @item
7034 D @tab
7035 Torculus Deminutus Initio Debilis @tab
7036 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
7037
7038 @item
7039 E @tab
7040 Porrectus @tab
7041 @code{\[ a \flexa g \pes b \]}
7042
7043 @item
7044 F @tab
7045 Porrectus Auctus Descendens @tab
7046 @code{\[ a \flexa g \pes \auctum \descendens b \]}
7047
7048 @item
7049 G @tab
7050 Porrectus Deminutus @tab
7051 @code{\[ a \flexa g \pes \deminutum b \]}
7052
7053 @item
7054 H @tab
7055 Climacus @tab
7056 @code{\[ \virga b \inclinatum a \inclinatum g \]}
7057
7058 @item
7059 I @tab
7060 Climacus Auctus @tab
7061 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
7062
7063 @item
7064 J @tab
7065 Climacus Deminutus @tab
7066 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
7067
7068 @item
7069 K @tab
7070 Scandicus @tab
7071 @code{\[ g \pes a \virga b \]}
7072
7073 @item
7074 L @tab
7075 Scandicus Auctus Descendens @tab
7076 @code{\[ g \pes a \pes \auctum \descendens b \]}
7077
7078 @item
7079 M @tab
7080 Scandicus Deminutus @tab
7081 @code{\[ g \pes a \pes \deminutum b \]}
7082
7083 @item
7084 N @tab
7085 Salicus @tab
7086 @code{\[ g \oriscus a \pes \virga b \]}
7087
7088 @item
7089 O @tab
7090 Salicus Auctus Descendens @tab
7091 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
7092
7093 @item
7094 P @tab
7095 Trigonus @tab
7096 @code{\[ \stropha b \stropha b \stropha a \]}
7097
7098 @end multitable
7099
7100 @refcommands
7101
7102 The following head prefixes are supported
7103
7104 @cindex @code{\virga}
7105 @code{\virga},
7106 @cindex @code{\stropha}
7107 @code{\stropha},
7108 @cindex @code{\inclinatum}
7109 @code{\inclinatum},
7110 @cindex @code{\auctum}
7111 @code{\auctum},
7112 @cindex @code{\descendens}
7113 @code{\descendens},
7114 @cindex @code{\ascendens}
7115 @code{\ascendens},
7116 @cindex @code{\oriscus}
7117 @code{\oriscus},
7118 @cindex @code{\quilisma}
7119 @code{\quilisma},
7120 @cindex @code{\deminutum}
7121 @code{\deminutum}.
7122
7123 Head prefixes can be accumulated, though restrictions apply.  For
7124 example, either @code{\descendens} or @code{\ascendens} can be applied
7125 to a head, but not both to the same head.
7126
7127 @cindex @code{\pes}
7128 @cindex @code{\flexa}
7129 Two adjacent heads can be tied together with the @code{\pes} and
7130 @code{\flexa} infix commands for a rising and falling line of melody,
7131 respectively.
7132
7133
7134
7135 @node Vaticana style contexts
7136 @subsection Vaticana style contexts
7137
7138 @cindex VaticanaVoiceContext
7139 @cindex VaticanaStaffContext
7140
7141 The predefined @code{VaticanaVoiceContext} and
7142 @code{VaticanaStaffContext} can be used to engrave a piece of
7143 Gregorian Chant in the style of the Editio Vaticana.  These contexts
7144 initialize all relevant context properties and grob properties to
7145 proper values, so you can immediately go ahead entering the chant, as
7146 the following excerpt demonstrates
7147
7148 @lilypond[quote,raggedright,verbatim,noindent]
7149 \include "gregorian-init.ly"
7150 \score {
7151   <<
7152     \context VaticanaVoice = "cantus" {
7153       \override Score.BarNumber #'transparent = ##t
7154        {
7155         \[ c'\melisma c' \flexa a \]
7156         \[ a \flexa \deminutum g\melismaEnd \]
7157         f \divisioMinima
7158         \[ f\melisma \pes a c' c' \pes d'\melismaEnd \]
7159         c' \divisioMinima \break
7160         \[ c'\melisma c' \flexa a \]
7161         \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
7162       }
7163     }
7164     \lyricsto "cantus" \new Lyrics {
7165       San- ctus, San- ctus, San- ctus
7166     }
7167   >>
7168 }
7169 @end lilypond
7170
7171 @node Figured bass
7172 @subsection Figured bass
7173
7174 @cindex Basso continuo
7175
7176 @c TODO: musicological blurb about FB
7177
7178
7179 LilyPond has limited support for figured bass
7180
7181 @lilypond[quote,verbatim,fragment]
7182 <<
7183   \context Voice  { \clef bass dis4  c d ais }
7184   \context FiguredBass \figures {
7185     < 6 >4 < 7 >8 < 6+ [_!] >
7186     < 6 >4 <6 5 [3+] >
7187   }
7188 >>
7189 @end lilypond
7190
7191 The support for figured bass consists of two parts: there is an input
7192 mode, introduced by @code{\figures}, where you can enter bass figures
7193 as numbers, and there is a context called @internalsref{FiguredBass} that
7194 takes care of making @internalsref{BassFigure} objects.
7195
7196 In figures input mode, a group of bass figures is delimited by
7197 @code{<} and @code{>}. The duration is entered after the @code{>>}
7198 @example
7199 <4 6>
7200 @end example
7201 @lilypond[quote,fragment]
7202 \context FiguredBass
7203 \figures { <4 6> }
7204 @end lilypond
7205
7206 Accidentals are added when you append @code{-}, @code{!}  and @code{+}
7207 to the numbers
7208
7209 @example
7210 <4- 6+ 7!>
7211 @end example
7212 @lilypond[quote,fragment]
7213 \context FiguredBass
7214 \figures { <4- 6+ 7!> }
7215 @end lilypond
7216
7217 Spaces or dashes may be inserted by using @code{_}. Brackets are
7218 introduced with @code{[} and @code{]}
7219
7220 @example
7221 < [4 6] 8 [_! 12]>
7222 @end example
7223 @lilypond[quote,fragment]
7224 \context FiguredBass
7225 \figures { < [4 6] 8 [_! 12]> }
7226 @end lilypond
7227
7228 Although the support for figured bass may superficially resemble chord
7229 support, it works much simpler.  The @code{\figures} mode simply
7230 stores the numbers , and @internalsref{FiguredBass} context prints
7231 them as entered. There is no conversion to pitches, and no
7232 realizations of the bass are played in the MIDI file.
7233
7234 Internally, the code produces markup texts. You can use any of the
7235 markup text properties to override formatting. For example, the
7236 vertical spacing of the figures may be set with @code{baseline-skip}.
7237
7238 @seealso
7239
7240 Program reference: @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object, 
7241 and @internalsref{FiguredBass} context.
7242
7243 @refbugs
7244
7245 Slash notation for alterations is not supported.
7246
7247 @node Contemporary notation
7248 @section Contemporary notation
7249
7250 In the 20th century, composers have greatly expanded the musical
7251 vocabulary. With this expansion, many innovations in musical notation
7252 have been tried. The book by Stone (1980) gives a comprehensive
7253 overview (see @ref{Literature list}). In general, the use of new,
7254 innovative notation makes a piece harder to understand and perform and
7255 its use should therefore be avoided if possible.  For this reason,
7256 support for contemporary notation in LilyPond is limited.
7257
7258
7259 @menu
7260 * Polymetric notation::         
7261 * Clusters::                    
7262 * Special fermatas::            
7263 * Feathered beams::             
7264 @end menu
7265
7266 @node Polymetric notation
7267 @subsection Polymetric notation
7268
7269 Double time signatures are not supported explicitly, but they can be
7270 faked. In the next example, the markup for the time signature is
7271 created with a markup text. This markup text is inserted in the
7272 @internalsref{TimeSignature} grob.
7273
7274 @lilypond[verbatim,raggedright]
7275
7276 % create 2/4 + 5/8
7277 tsMarkup =\markup  {
7278     \number { 
7279       \column < "2" "4" >
7280       \musicglyph #"scripts-stopped" 
7281       \bracket \column < "5" "8" >
7282     }
7283 }
7284
7285 {
7286   \override Staff.TimeSignature  #'print-function = #Text_item::print
7287   \override Staff.TimeSignature  #'text = #tsMarkup
7288   \time 3/2
7289   c'2  \bar ":" c'4 c'4.
7290 }
7291 @end lilypond
7292
7293 Each staff can also have its own time signature.  This is done by
7294 moving the @internalsref{Timing_engraver} to @internalsref{Staff}
7295 context.
7296
7297 @verbatim
7298 \paper{
7299     \context{
7300         \Score
7301         \remove "Timing_engraver"
7302     }
7303     \context{
7304         \Staff
7305         \consists "Timing_engraver"
7306     }
7307 }       
7308 @end verbatim
7309
7310
7311 Now, each staff has its own time signature.
7312 @verbatim
7313 <<
7314     \new Staff {
7315         \time 3/4
7316         c4 c c | c c c |
7317     }
7318
7319     \new Staff {
7320         \time 2/4
7321         c4 c | c c | c c
7322     }
7323     \new Staff {
7324         \time 3/8
7325         c4. c8 c c   c4. c8 c c
7326     }
7327 >>
7328 @end verbatim
7329
7330 @lilypond[raggedright]
7331 \paper{
7332     \context{
7333         \Score
7334         \remove "Timing_engraver"
7335     }
7336     \context{
7337         \Staff
7338         \consists "Timing_engraver"
7339     }
7340 }       
7341
7342 \relative c'  <<
7343     \new Staff {
7344         \time 3/4
7345         c4 c c | c c c |
7346     }
7347
7348     \new Staff {
7349         \time 2/4
7350         c4 c | c c | c c
7351     }
7352     \new Staff {
7353         \time 3/8
7354         c4. c8 c c   c4. c8 c c
7355     }
7356 >>
7357 @end lilypond
7358
7359
7360 A different form of polymetric notation is where note lengths have
7361 different values across staves.
7362
7363 This notation can be created by setting a common time signature for
7364 each staff but replacing it manually using
7365 @code{timeSignatureFraction} to the desired fraction. Then the printed
7366 durations in each staff are scaled to the common time signature.
7367 The latter is done with @code{\compressmusic}, which is similar to
7368 @code{\times}, but does not create a tuplet bracket.
7369
7370
7371 In this example, music with the time signatures of 3/4, 9/8 and 10/8 are
7372 used in parallel. In the second staff, shown durations are multiplied by 
7373 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are 
7374 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
7375
7376 @lilypond[raggedright,verbatim]
7377 \relative c'  <<
7378     \new Staff {
7379         \time 3/4
7380         c4 c c | c c c |
7381     }
7382     \new Staff {
7383         \time 3/4
7384         \set Staff.timeSignatureFraction = #'(9 . 8)
7385         \compressmusic #'(2 . 3)
7386           \repeat unfold 6 { c8[ c c] }
7387     }
7388     \new Staff {
7389         \time 3/4
7390         \set Staff.timeSignatureFraction = #'(10 . 8)
7391         \compressmusic #'(3 . 5)
7392           { \repeat unfold 2 { c8[ c c] }
7393             \repeat unfold 2 { c8[  c] }
7394             |  c4. c4. \times 2/3 { c8 c c } c4  }
7395     }
7396 >>
7397 @end lilypond
7398
7399
7400
7401
7402 @refbugs
7403
7404 When using different time signatures in parallel, the spacing is
7405 aligned vertically, but bar lines distort the regular spacing.
7406
7407
7408
7409 @node Clusters
7410 @subsection Clusters
7411
7412 @cindex cluster
7413
7414 A cluster indicates a continuous range of pitches to be played.  They
7415 can be denoted as the envelope of a set of notes.  They are entered by
7416 applying the function @code{makeClusters} to a sequence of
7417 chords, e.g.
7418 @c
7419 @lilypond[quote,relative=2,verbatim]
7420 \makeClusters {  <c e > <b f'>  }
7421 @end lilypond
7422
7423 The following example (from
7424 @inputfileref{input/regression,cluster.ly}) shows what the result
7425 looks like
7426
7427 @lilypondfile[quote]{cluster.ly}
7428
7429 Ordinary notes and clusters can be put together in the same staff,
7430 even simultaneously.  In such a case no attempt is made to
7431 automatically avoid collisions between ordinary notes and clusters.
7432
7433 @seealso
7434
7435 Program reference: @internalsref{ClusterSpanner},
7436 @internalsref{ClusterSpannerBeacon},
7437 @internalsref{Cluster_spanner_engraver}, and
7438 @internalsref{ClusterNoteEvent}.
7439
7440 Examples: @inputfileref{input/regression,cluster.ly}.
7441
7442 @refbugs
7443
7444 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
7445 accurately.  Use @code{<g a>8 <e a>8} instead.
7446
7447
7448
7449 @node Special fermatas
7450 @subsection Special Fermatas
7451
7452 @cindex fermatas, special
7453
7454 In contemporary music notation, special fermata symbols denote breaks
7455 of differing lengths.  The following fermatas are supported
7456
7457 @lilypond[quote,raggedright]
7458 <<
7459     \oldaddlyrics  {
7460       b'
7461       ^\shortfermata
7462       _\shortfermata
7463       r
7464       b'
7465       ^\fermata
7466       _\fermata
7467
7468       r
7469       b'
7470       ^\longfermata
7471       _\longfermata
7472
7473       r
7474       b'
7475       ^\verylongfermata
7476       _\verylongfermata
7477     r
7478     }
7479     \context Lyrics \lyrics {
7480       \override LyricText #'font-family = #'typewriter
7481       "shortfermata" "fermata"  "longfermata" "verylongfermata"
7482     }
7483 >>
7484 @end lilypond
7485
7486 See @ref{Articulations} for general instructions how to apply scripts
7487 such as fermatas to notes.
7488
7489 @node Feathered beams
7490 @subsection Feathered beams
7491
7492 Feathered beams are not supported natively, but they can be faked by
7493 forcing two beams to overlap. Here is an example,
7494
7495 @lilypond[raggedright]
7496 \relative \new Staff <<
7497     \new Voice
7498     {
7499         \stemUp
7500         \once \override Voice.Beam #'positions = #'(0 . 0.5)
7501         c8[ c c c c ]
7502     }
7503     \new Voice {
7504         \stemUp
7505         \once \override Voice.Beam #'positions = #'(0 . -0.5) 
7506         c[ c c c c]
7507     }
7508 >>
7509 @end lilypond
7510
7511
7512
7513 @node Educational use
7514 @section Educational use
7515
7516 @menu
7517 * Balloon help::                
7518 * Blank music paper::           
7519 * Notation for excercises::     
7520 * Easy Notation note heads::    
7521 @end menu
7522
7523 @node Balloon help
7524 @subsection Balloon help
7525
7526 Elements of notation can be marked and named with the help of a square
7527 balloon.  The primary purpose of this feature is to explain notation.
7528
7529 The following example demonstrates its use.
7530
7531 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
7532 \context Voice
7533 \applyoutput
7534    #(add-balloon-text 'NoteHead "heads, or tails?"
7535     '(1 . -3))
7536 c8
7537 @end lilypond
7538
7539 @noindent
7540 The function @code{add-balloon-text} takes the name of a grob, the
7541 label to print, and the position where to put the label relative to 
7542 the object. In the above example, the text ``heads or tails?'' ends 
7543 3 spaces below and 1 space to the right of the marked head.
7544
7545 @cindex balloon
7546 @cindex notation, explaining
7547
7548 @seealso
7549
7550 Program reference: @internalsref{text-balloon-interface}.
7551
7552 Examples: @inputfileref{input/regression,balloon.ly}.
7553
7554
7555
7556
7557 @node Blank music paper
7558 @subsection Blank music paper
7559
7560 A blank music paper can be produced also by using invisible notes, and
7561 removing @code{Bar_number_engraver}.
7562
7563
7564 @lilypond
7565 emptymusic =  {
7566   \repeat unfold 2 % Change this for more lines. 
7567   { s1\break }
7568   \bar "|."
7569 }
7570 \new Score \with {
7571     \override TimeSignature #'transparent = ##t
7572     defaultBarType = #""
7573     \remove Bar_number_engraver
7574 } <<
7575         \context Staff \emptymusic
7576         \context TabStaff \emptymusic
7577 >>
7578 @end lilypond
7579
7580
7581 @node Notation for excercises
7582 @subsection Notation for excercises
7583
7584 @cindex Blank Notes
7585
7586 Invisible (or transparent) notes can be useful, when weird tricks are
7587 needed; especially, a slur cannot be attach to a rest or spacer rest.
7588
7589
7590 @lilypond
7591 blanknotes = { \override NoteHead  #'transparent = ##t
7592                \override Stem  #'transparent = ##t }
7593 unblanknotes = { \revert NoteHead #'transparent
7594                  \revert Stem #'transparent }
7595
7596
7597 \relative c'' {
7598     c4 d4 
7599     \blanknotes e4 f4   \unblanknotes
7600     g4 a 
7601 }
7602 @end lilypond
7603
7604
7605 @node Easy Notation note heads
7606 @subsection Easy Notation note heads
7607
7608 @cindex easy notation
7609 @cindex Hal Leonard
7610
7611 The `easy play' note head includes a note name inside the head.  It is
7612 used in music for beginners
7613
7614 @lilypond[quote,raggedright,verbatim,fragment,staffsize=26]
7615 \setEasyHeads
7616 c'2 e'4 f' | g'1
7617 @end lilypond
7618
7619 The command @code{\setEasyHeads} overrides settings for the
7620 @internalsref{NoteHead} object.  To make the letters readable, it has
7621 to be printed in a large font size.  To print with a larger font, see
7622 @ref{Setting global staff size}.
7623
7624 @refcommands
7625
7626 @cindex @code{\setEasyHeads}
7627 @code{\setEasyHeads}
7628