]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/notation.itely
c9c60ed41a2e6b453857b779089950339082b139
[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, Easier music entry, Notation manual, Notation manual
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, Pitches, Note entry, Note entry
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, Chromatic alterations, Notes, Note entry
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, Micro tones, Pitches, Note entry
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, Chords, Chromatic alterations, Note entry
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, Rests, Micro tones, Note entry
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, Skips, Chords, Note entry
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, Durations, Rests, Note entry
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, Augmentation dots, Skips, Note entry
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, Scaling durations, Durations, Note entry
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, Stems, Augmentation dots, Note entry
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, Ties, Scaling durations, Note entry
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, Tuplets, Stems, Note entry
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,  , Ties, Note entry
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, Staff notation, Note entry, Notation manual
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, Octave check, Easier music entry, Easier music entry
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, Bar check, Relative octaves, Easier music entry
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, Skipping corrected music, Octave check, Easier music entry
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, Automatic note splitting, Bar check, Easier music entry
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,  , Skipping corrected music, Easier music entry
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, Polyphony, Easier music entry, Notation manual
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, Key signature, Staff notation, Staff notation
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, Clef, Staff symbol, Staff notation
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, Ottava brackets, Key signature, Staff notation
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, Time signature, Clef, Staff notation
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, Partial measures, Ottava brackets, Staff notation
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, Unmetered music, Time signature, Staff notation
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, Bar lines, Partial measures, Staff notation
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, Time administration, Unmetered music, Staff notation
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, Controlling formatting of  prefatory matter, Bar lines, Staff notation
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,  , Time administration, Staff notation
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, Beaming, Staff notation, Notation manual
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, Accidentals, Polyphony, Notation manual
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, Setting automatic beam behavior, Beaming, Beaming
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, Beam formatting, Manual beams, Beaming
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,  , Setting automatic beam behavior, Beaming
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, Expressive marks, Beaming, Notation manual
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, Repeats, Accidentals, Notation manual
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, Phrasing slurs, Expressive marks, Expressive marks
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, Breath marks, Slurs, Expressive marks
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, Metronome marks, Phrasing slurs, Expressive 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, Text spanners, Breath marks, Expressive 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   \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, Analysis brackets, Metronome marks, Expressive marks
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, Articulations, Text spanners, Expressive marks
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, Running trills, Analysis brackets, Expressive marks
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 @lilypondfile[quote,raggedright]{script-chart.ly}
2214
2215
2216 The vertical ordering of scripts is controlled with the
2217 @code{script-priority} property. The lower this number, the closer it
2218 will be put to the note.  In this example, the
2219 @internalsref{TextScript} (the sharp symbol) first has the lowest
2220 priority, so it is put lowest in the first example. In the second, the
2221 prall trill (the @internalsref{Script}) has the lowest, so it on the
2222 inside. When two objects have the same priority, the order in which
2223 they are entered decides which one comes first.
2224
2225
2226 @lilypond[verbatim,raggedright]
2227 \relative g''{
2228     \once \override TextScript #'script-priority = #-100
2229     a4^\prall^\markup { \sharp }
2230     
2231     \once \override Script  #'script-priority = #-100
2232     a4^\prall^\markup { \sharp }
2233 }
2234 @end lilypond
2235
2236
2237
2238 @refcommands
2239
2240 @cindex @code{\scriptUp}
2241 @code{\scriptUp}, 
2242 @cindex @code{\scriptDown}
2243 @code{\scriptDown}, 
2244 @cindex @code{\scriptBoth}
2245 @code{\scriptBoth}.
2246
2247 @seealso
2248
2249 Program reference: @internalsref{ScriptEvent}, and @internalsref{Script}.
2250
2251 @refbugs
2252
2253 These note ornaments appear in the printed output but have no
2254 effect on the MIDI rendering of the music.
2255
2256
2257
2258 @node  Running trills, Fingering instructions, Articulations, Expressive marks
2259 @subsection Running trills
2260
2261 Long running trills are made with @code{\startTrillSpan} and
2262 @code{\stopTrillSpan},
2263
2264
2265 @lilypond[verbatim,raggedright]
2266 \relative \new Voice {
2267     << { c1 \startTrillSpan }
2268        { s2. \grace { d16[\stopTrillSpan e] } } >>
2269     c4 }
2270 @end lilypond
2271
2272 @refcommands
2273
2274 @code{\startTrillSpan},
2275 @cindex @code{\startTrillSpan}
2276 @code{\stopTrillSpan}.
2277 @cindex @code{\stopTrillSpan}
2278
2279 @seealso
2280
2281 Program reference: @internalsref{TrillSpanner},
2282 @internalsref{TrillSpanEvent}.
2283
2284 @node Fingering instructions, Text scripts, Running trills, Expressive marks
2285 @subsection Fingering instructions
2286
2287 @cindex fingering
2288
2289 Fingering instructions can be entered using
2290 @example
2291   @var{note}-@var{digit}
2292 @end example
2293 For finger changes, use markup texts
2294 @c
2295 @lilypond[quote,verbatim,raggedright,fragment]
2296 c'4-1 c'4-2 c'4-3 c'4-4
2297 c'^\markup { \finger "2-3" }
2298 @end lilypond
2299
2300 @cindex finger change
2301 @cindex scripts
2302 @cindex superscript
2303 @cindex subscript
2304
2305 You can use the thumb-script to indicate that a note should be
2306 played with the thumb (e.g. in cello music)
2307
2308 @lilypond[quote,verbatim,raggedright,fragment]
2309 <a' a''-3>8_\thumb <b' b''-3>_\thumb
2310 @end lilypond
2311
2312 Fingerings for chords can also be added to individual notes
2313 of the chord by adding them after the pitches
2314 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
2315 < c-1 e-2 g-3 b-5 >4
2316 @end lilypond
2317
2318 @noindent
2319 iIn this case, setting @code{fingeringOrientations} will put  fingerings next
2320 to note heads
2321
2322 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2323 \set fingeringOrientations = #'(left down)
2324 <c-1 es-2 g-4 bes-5 > 4
2325 \set fingeringOrientations = #'(up right down)
2326 <c-1 es-2 g-4 bes-5 > 4
2327 \set fingeringOrientations = #'(right)
2328 <es-2>4
2329 @end lilypond
2330
2331 The last note demonstrates how fingering instructions can be put close
2332 to note heads in monophonic music, using this feature.
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, Grace notes, Fingering instructions, Expressive marks
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 It is possible to use @TeX{} commands in the strings, but this should
2360 be avoided because the exact dimensions of the string can then no
2361 longer be computed.
2362
2363 @refcommands
2364
2365 @cindex @code{\fatText}
2366 @code{\fatText}, 
2367 @cindex @code{\emptyText}
2368 @code{\emptyText}.
2369
2370 @seealso
2371
2372 In this manual: @ref{Text markup}.
2373
2374 Program reference: @internalsref{TextScriptEvent}, @internalsref{TextScript}.
2375
2376
2377
2378
2379 @node Grace notes, Glissando, Text scripts, Expressive marks
2380 @subsection Grace notes
2381
2382
2383 @c should have blurb about accaciatura / appogiatura
2384
2385 @cindex @code{\grace}
2386 @cindex ornaments
2387 @cindex grace notes
2388
2389 Grace notes are ornaments that are written out.  The most common ones
2390 are acciaccatura, which should be played as very short.  It is denoted
2391 by a slurred small note with a slashed stem.  The appoggiatura is a
2392 grace note that takes a fixed fraction of the main note, is and
2393 denoted as a slurred note in small print without a slash.
2394 They are entered with the commands @code{\acciaccatura} and
2395 @code{\appoggiatura}, as demonstrated in the following example
2396
2397
2398 @cindex appoggiatura
2399 @cindex acciaccatura
2400
2401 @lilypond[quote,relative=2,verbatim,fragment]
2402 b4 \acciaccatura d8 c4 \appoggiatura e8 d4
2403 \acciaccatura { g16[ f] } e4
2404 @end lilypond
2405
2406 Both are special forms of the @code{\grace} command. By prefixing this
2407 keyword to a music expression, a new one is formed, which will be
2408 printed in a smaller font and takes up no logical time in a measure.
2409
2410 @lilypond[quote,relative=2,verbatim,fragment]
2411 c4 \grace c16 c4
2412 \grace { c16[ d16] } c2 c4
2413 @end lilypond
2414
2415 @noindent
2416 Unlike @code{\acciaccatura} and @code{\appoggiatura}, the
2417 @code{\grace} command does not start a slur.
2418
2419 Internally, timing for grace notes is done using a second, `grace'
2420 time. Every point in time consists of two rational numbers: one
2421 denotes the logical time, one denotes the grace timing. The above
2422 example is shown here with timing tuples
2423
2424 @lilypond[quote,raggedright]
2425 <<
2426   \relative c''{ 
2427     c4 \grace c16  c4  \grace {
2428     c16[  d16] } c2 c4
2429   }
2430   \new Lyrics \lyrics {
2431     \markup { (0,0) } 4
2432     \grace { \markup {
2433       ( \fraction 1 4 ,  \fraction -1 16 ) } 16 }
2434     \markup { (\fraction 1 4 , 0 ) } 4
2435     \grace {
2436       \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
2437       \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
2438     } 
2439     \markup { ( \fraction 2 4 , 0 ) }
2440   }
2441 >>
2442 @end lilypond
2443
2444
2445 The placement of grace notes is synchronized between different staves.
2446 In the following example, there are two sixteenth graces notes for
2447 every eighth grace note
2448
2449 @lilypond[quote,relative=2,verbatim,fragment] 
2450 << \new Staff { e4 \grace { c16[ d e f] } e4 }
2451    \new Staff { c4 \grace { g8[ b] } c4 } >>
2452 @end lilypond
2453
2454
2455
2456 If you want to end a note with a grace, the standard trick is to put
2457 the grace notes after a ``space note''
2458
2459 @lilypond[quote,fragment,verbatim,relative=2]
2460 \context Voice {
2461   << { d1^\trill ( }
2462      { s2 \grace { c16[ d] } } >>
2463   c4)
2464 }
2465 @end lilypond
2466
2467 @noindent
2468 By adjusting the duration of the skip note (here it is a half-note),
2469 the space between the main-note and the grace is adjusted.
2470
2471
2472 A @code{\grace} section will introduce special typesetting settings,
2473 for example, to produce smaller type, and set directions. Hence, when
2474 introducing layout tweaks, they should be inside the grace section,
2475 for example,
2476 @lilypond[quote,fragment,verbatim,relative=2]
2477 \new Voice {
2478   \acciaccatura {
2479     \override Stem #'direction = #-1
2480     f16->
2481     \revert Stem #'direction
2482   }
2483   g4
2484 }
2485 @end lilypond
2486
2487 @noindent
2488 The overrides should also be reverted inside the grace section.
2489
2490 If the layout of grace sections must be changed throughout the music,
2491 then this can be accomplished through the function
2492 @code{add-grace-property}. The following example undefines the Stem
2493 direction for this grace, so stems do not always point up.
2494
2495 @example
2496 \new Staff @{
2497    #(add-grace-property 'Voice 'Stem 'direction '())
2498    @dots{}
2499 @}
2500 @end example
2501
2502 @noindent
2503 Another option is to change the variables @code{startGraceMusic},
2504 @code{stopGraceMusic}, @code{startAcciaccaturaMusic},
2505 @code{stopAcciaccaturaMusic}, @code{startAppoggiaturaMusic},
2506 @code{stopAppoggiaturaMusic}.  More information is in the file
2507 @file{ly/grace-init.ly}.
2508
2509
2510 @seealso
2511
2512 Program reference: @internalsref{GraceMusic}.
2513
2514 @refbugs
2515
2516 A score that starts with an @code{\grace} section needs an explicit
2517 @code{\context Voice} declaration, otherwise the main note and grace
2518 note end up on different staves.
2519
2520 Grace note synchronization can also lead to surprises. Staff notation,
2521 such as key signatures, bar lines, etc. are also synchronized. Take
2522 care when you mix staves with grace notes and staves without, for example,
2523
2524 @lilypond[quote,relative=2,verbatim,fragment]
2525 << \new Staff { e4 \bar "|:" \grace c16 d4 }
2526    \new Staff { c4  \bar "|:"  d4 } >>
2527 @end lilypond
2528
2529 @noindent
2530 This can be remedied by inserting grace skips, for the above example
2531
2532 @example
2533 \new Staff @{ c4  \bar "|:"  \grace s16 d4 @} >>
2534 @end example
2535
2536 Grace sections should only be used within sequential music
2537 expressions.  Nesting or juxtaposing grace sections is not supported,
2538 and might produce crashes or other errors.
2539
2540
2541 @node Glissando, Dynamics, Grace notes, Expressive marks
2542 @subsection Glissando
2543 @cindex Glissando 
2544
2545 @cindex @code{\glissando}
2546
2547 A glissando is a smooth change in pitch. It is denoted by a line or a
2548 wavy line between two notes.
2549
2550
2551 A glissando line can be requested by attaching a @code{\glissando} to
2552 a note
2553
2554 @lilypond[quote,fragment,relative=1,verbatim]
2555 c'\glissando c'
2556 @end lilypond
2557
2558 @seealso
2559
2560 Program reference: @internalsref{Glissando}, and @internalsref{GlissandoEvent}.
2561
2562 Example files: @file{input/regression,glissando.ly}
2563
2564  
2565
2566 @refbugs
2567
2568 Printing text over the line (such as @emph{gliss.}) is not supported.
2569
2570
2571 @node Dynamics,  , Glissando, Expressive marks
2572 @subsection Dynamics
2573 @cindex Dynamics
2574
2575
2576
2577 @cindex @code{\ppp}
2578 @cindex @code{\pp}
2579 @cindex @code{\p}
2580 @cindex @code{\mp}
2581 @cindex @code{\mf}
2582 @cindex @code{\f}
2583 @cindex @code{\ff}
2584 @cindex @code{\fff}
2585 @cindex @code{\ffff}
2586 @cindex @code{\fp}
2587 @cindex @code{\sf}
2588 @cindex @code{\sff}
2589 @cindex @code{\sp}
2590 @cindex @code{\spp}
2591 @cindex @code{\sfz}
2592 @cindex @code{\rfz}
2593
2594
2595 Absolute dynamic marks are specified using a command after a note
2596 @code{c4\ff}.  The available dynamic marks are @code{\ppp},
2597 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2598 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2599 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}
2600
2601 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2602 c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
2603 c2\sf c\rfz
2604 @end lilypond
2605
2606 @cindex @code{\<}
2607 @cindex @code{\>}
2608 @cindex @code{\"!}
2609
2610
2611
2612 A crescendo mark is started with @code{\<} and terminated with
2613 @code{\!}. A decrescendo is started with @code{\>} and also terminated
2614 with @code{\!}.  Because these marks are bound to notes, if you must
2615 use spacer notes if multiple marks during one note are needed
2616
2617 @lilypond[quote,fragment,verbatim]
2618 c''\< c''\! d''\> e''\! 
2619 << f''1 { s4 s4\< s4\! \> s4\! } >>
2620 @end lilypond
2621 This may give rise to very short hairpins. Use @code{minimum-length}
2622 in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
2623 example
2624
2625 @example
2626  \override Staff.Hairpin #'minimum-length = #5
2627 @end example
2628
2629 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2630 is an example how to do it
2631
2632 @lilypond[quote,fragment,relative=2,verbatim]
2633 \setTextCresc
2634 c \< d e f\!
2635 \setHairpinCresc
2636 e\> d c b\!
2637 @end lilypond
2638
2639 @cindex crescendo
2640 @cindex decrescendo
2641
2642 You can also supply your own texts
2643 @lilypond[quote,fragment,relative=1,verbatim]
2644 \context Voice {
2645   \set crescendoText = \markup { \italic "cresc. poco" }
2646   \set crescendoSpanner = #'dashed-line
2647   a'2\< a a a\!\mf
2648 }
2649 @end lilypond
2650
2651 @cindex diminuendo
2652
2653
2654 @refcommands
2655
2656 @cindex @code{\dynamicUp}
2657 @code{\dynamicUp}, 
2658 @cindex @code{\dynamicDown}
2659 @code{\dynamicDown}, 
2660 @cindex @code{\dynamicBoth}
2661 @code{\dynamicBoth}.
2662
2663 @cindex direction, of dynamics
2664
2665 @seealso
2666
2667 Program reference: @internalsref{CrescendoEvent},
2668 @internalsref{DecrescendoEvent}, and
2669 @internalsref{AbsoluteDynamicEvent}.
2670
2671 Dynamics @internalsref{DynamicText} and @internalsref{Hairpin}
2672 objects. Vertical positioning of these symbols is handled by the
2673 @internalsref{DynamicLineSpanner} object.
2674
2675
2676 @node Repeats, Rhythmic music, Expressive marks, Notation manual
2677 @section Repeats
2678
2679
2680 @cindex repeats
2681 @cindex @code{\repeat}
2682
2683
2684 Repetition is a central concept in music, and multiple notations exist
2685 for repetitions. In LilyPond, most of these notations can be captured
2686 in a uniform syntax. One of the advantages is that they can be
2687 rendered in MIDI accurately.
2688
2689 The following types of repetition are supported
2690
2691 @table @code
2692 @item unfold
2693 Repeated music is fully written (played) out.  Useful for MIDI
2694 output, and entering repetitive music.
2695
2696 @item volta
2697 This is the normal notation: Repeats are not written out, but
2698 alternative endings (volte) are printed, left to right.
2699
2700 @ignore
2701 @item fold
2702 Alternative endings are written stacked. This has limited use but may be
2703 used to typeset two lines of lyrics in songs with repeats, see
2704 @inputfileref{input,star-spangled-banner.ly}.
2705 @end ignore
2706
2707 @c tremolo, beamed
2708 @item tremolo
2709 Make tremolo beams.
2710
2711 @item percent
2712 Make beat or measure repeats. These look like percent signs.
2713
2714 @end table  
2715
2716 @menu
2717 * Repeat syntax::               
2718 * Repeats and MIDI::            
2719 * Manual repeat commands::      
2720 * Tremolo repeats::             
2721 * Tremolo subdivisions::        
2722 * Measure repeats::             
2723 @end menu
2724
2725 @node Repeat syntax, Repeats and MIDI, Repeats, Repeats
2726 @subsection Repeat syntax
2727
2728
2729 LilyPond has one syntactic construct for specifying different types of
2730 repeats.  The syntax is
2731
2732 @example
2733   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2734 @end example
2735
2736 If you have alternative endings, you may add
2737 @cindex @code{\alternative}
2738 @example
2739  \alternative @code{@{} @var{alternative1}
2740             @var{alternative2}
2741             @var{alternative3} @dots{} @code{@}}
2742 @end example
2743 where each @var{alternative} is a music expression.  If you do not
2744 give enough alternatives for all of the repeats, the first alternative
2745 is assumed to be played more than once.
2746
2747 Normal notation repeats are used like this
2748 @lilypond[quote,fragment,verbatim,relative=2]
2749 c1
2750 \repeat volta 2 { c4 d e f }
2751 \repeat volta 2 { f e d c }
2752 @end lilypond
2753
2754 With alternative endings
2755 @lilypond[quote,fragment,verbatim,relative=2]
2756 c1
2757 \repeat volta 2 {c4 d e f} 
2758 \alternative { {d2 d} {f f,} }
2759 @end lilypond
2760
2761
2762 @lilypond[quote,fragment,verbatim,relative=2]
2763 \context Staff {
2764   \partial 4
2765   \repeat volta 4 { e | c2 d2 | e2 f2 | }
2766   \alternative { { g4 g g } { a | a a a a | b2. } }
2767 }
2768 @end lilypond
2769
2770 @seealso
2771
2772 Brackets for the repeat are normally only printed over the topmost
2773 staff. This can be adjusted by setting the @code{voltaOnThisStaff}
2774 property @inputfileref{input/regression,volta-multi-staff.ly},
2775 @inputfileref{input/regression,volta-chord-names.ly}
2776
2777 It is possible to shorten volta brackets
2778 by setting @code{voltaSpannerDuration}. In the next example, the
2779 bracket only lasts one measure, which is a duration of 3/4. 
2780
2781
2782
2783 @lilypond[verbatim,raggedright]
2784 \relative c''{
2785     \time 3/4
2786     c c c 
2787     \set Staff.voltaSpannerDuration = #(ly:make-moment 3 4)
2788     \repeat "volta" 5 { d d d  }
2789     \alternative { { e e e f f f }
2790     { g g g } }
2791 }
2792 @end lilypond
2793         
2794 @refbugs
2795
2796 A nested repeat like
2797
2798 @example 
2799 \repeat @dots{}
2800 \repeat @dots{}
2801 \alternative 
2802 @end example 
2803
2804 @noindent
2805 is ambiguous, since it is is not clear to which @code{\repeat} the
2806 @code{\alternative} belongs. This ambiguity is resolved by always
2807 having the @code{\alternative} belong to the inner @code{\repeat}.
2808 For clarity, it is advisable to use braces in such situations.
2809 @cindex ambiguity
2810
2811
2812
2813 Timing information is not remembered at the start of an alternative,
2814 so after a repeat timing information must be reset by hand, for
2815 example by setting @code{Score.measurePosition} or entering
2816 @code{\partial}.  Similarly, slurs or ties are also not repeated.
2817
2818
2819
2820
2821 @node Repeats and MIDI, Manual repeat commands, Repeat syntax, Repeats
2822 @subsection Repeats and MIDI
2823
2824 @cindex expanding repeats
2825
2826 An advantage of the unified syntax for repeats, is that all repeats
2827 may be played out for the MIDI output. This is achieved by
2828 applying the @code{\unfoldrepeats} music function.
2829
2830 @lilypond[verbatim,raggedright]
2831 \new Staff
2832   \unfoldrepeats {
2833     \repeat tremolo 8 {c'32 e' }
2834     \repeat percent 2 { c''8 d'' }
2835     \repeat volta 2 {c'4 d' e' f'} 
2836     \alternative {
2837       { g' a' a' g' }
2838       {f' e' d' c' }
2839     }
2840     \bar "|."
2841   }
2842 @end lilypond
2843
2844 When creating a score file using @code{\unfoldrepeats} for midi, then
2845 it is necessary to make two @code{\score} blocks. One for MIDI, with
2846 unfolded repeats, and one for notation, eg.
2847
2848 @example
2849   \score @{
2850       @var{..music..}
2851       \paper @{ .. @}
2852   @} 
2853   \score @{
2854       \unfoldrepeats @var{..music..}
2855       \midi @{ .. @}
2856   @} 
2857 @end example
2858
2859 @node Manual repeat commands, Tremolo repeats, Repeats and MIDI, Repeats
2860 @subsection Manual repeat commands
2861
2862 @cindex @code{repeatCommands}
2863
2864 The property @code{repeatCommands} can be used to control the layout of
2865 repeats. Its value is a Scheme list of repeat commands, where each repeat
2866 command can be
2867
2868 @table @asis
2869 @item the symbol @code{start-repeat},
2870   which prints a @code{|:} bar line,
2871 @item the symbol @code{end-repeat},
2872   which prints a @code{:|} bar line,
2873 @item the list @code{(volta @var{text})},
2874   which prints a volta bracket saying @var{text}: The text can be specified as
2875 a text string or as a markup text, see @ref{Text markup}. Do not
2876 forget to change the font, as the default number font does not contain
2877 alphabetic characters. Or,
2878 @item the list @code{(volta #f)}, which 
2879   stops a running volta bracket
2880 @end table
2881
2882 @lilypond[quote,verbatim,fragment,relative=2]
2883 c4
2884   \set Score.repeatCommands = #'((volta "93") end-repeat)
2885 c4 c4
2886   \set Score.repeatCommands = #'((volta #f))
2887 c4 c4
2888 @end lilypond
2889
2890
2891
2892 @seealso
2893
2894 Program reference: @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2895 @internalsref{VoltaRepeatedMusic},
2896 @internalsref{UnfoldedRepeatedMusic}, and
2897 @internalsref{FoldedRepeatedMusic}.
2898
2899 @node Tremolo repeats, Tremolo subdivisions, Manual repeat commands, Repeats
2900 @subsection Tremolo repeats
2901 @cindex tremolo beams
2902
2903 To place tremolo marks between notes, use @code{\repeat} with tremolo
2904 style
2905 @lilypond[quote,verbatim,raggedright]
2906   \context Voice \relative c' {
2907     \repeat "tremolo" 8 { c16 d16 }
2908     \repeat "tremolo" 4 { c16 d16 }    
2909     \repeat "tremolo" 2 { c16 d16 }
2910   }
2911 @end lilypond
2912
2913 Tremolo marks can also be put on a single note.  In this case, the
2914 note should not be surrounded by braces.
2915 @lilypond[quote,verbatim,raggedright]
2916 \repeat "tremolo" 4 c'16
2917 @end lilypond
2918
2919 A similar mechanism  is the tremolo subdivision, described in
2920 @ref{Tremolo subdivisions}.
2921
2922 @seealso
2923
2924 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
2925
2926 Program reference: tremolo beams are @internalsref{Beam} objects. Single stem
2927 tremolos are @internalsref{StemTremolo} objects.  The music expression is
2928 @internalsref{TremoloEvent}.
2929
2930 Example files: @inputfileref{input/regression,chord-tremolo.ly},
2931 @inputfileref{input/regression,stem-tremolo.ly}.
2932
2933 @node Tremolo subdivisions, Measure repeats, Tremolo repeats, Repeats
2934 @subsection Tremolo subdivisions
2935 @cindex tremolo marks
2936 @cindex @code{tremoloFlags}
2937
2938 Tremolo marks can be printed on a single note by adding
2939 `@code{:}[@var{length}]' after the note.  The length must be at least
2940 8.  A @var{length} value of 8 gives one line across the note stem.  If
2941 the length is omitted, the last value (stored in @code{tremoloFlags})
2942 is used
2943
2944 @lilypond[quote,verbatim,fragment]
2945 c'2:8 c':32 | c': c': |
2946 @end lilypond
2947
2948 @c [TODO : stok is te kort bij 32en]
2949
2950 @refbugs
2951
2952 Tremolos entered in this way do not carry over into the MIDI output.
2953
2954 @seealso
2955
2956 In this manual: @ref{Tremolo repeats}.
2957
2958 Elsewhere: @internalsref{StemTremolo}, @internalsref{TremoloEvent}.
2959
2960 @node Measure repeats,  , Tremolo subdivisions, Repeats
2961 @subsection Measure repeats
2962
2963 @cindex percent repeats
2964 @cindex measure repeats
2965
2966 In the @code{percent} style, a note pattern can be repeated. It is
2967 printed once, and then the pattern is replaced with a special sign.
2968 Patterns of a one and two measures are replaced by percent-like signs,
2969 patterns that divide the measure length are replaced by slashes
2970
2971 @lilypond[quote,verbatim,raggedright]
2972 \new Voice {
2973   \repeat  "percent" 4  { c'4 }
2974   \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2975 }
2976 @end lilypond
2977
2978 @seealso
2979
2980 Program reference: @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2981 @internalsref{PercentRepeatedMusic}, and
2982 @internalsref{DoublePercentRepeat}.
2983
2984
2985
2986 @node Rhythmic music, Piano music, Repeats, Notation manual
2987 @section Rhythmic music
2988
2989
2990 @menu
2991 * Showing melody rhythms::      
2992 * Entering percussion::         
2993 * Percussion staves::           
2994 @end menu
2995
2996
2997 @node Showing melody rhythms, Entering percussion, Rhythmic music, Rhythmic music
2998 @subsection Showing melody rhythms
2999
3000 Sometimes you might want to show only the rhythm of a melody.  This
3001 can be done with the rhythmic staff. All pitches of notes on such a
3002 staff are squashed, and the staff itself has a single line
3003
3004 @lilypond[quote,fragment,relative=1,verbatim]
3005 \context RhythmicStaff {
3006   \time 4/4
3007   c4 e8 f  g2 | r4 g r2 | g1:32 | r1 |
3008 }
3009 @end lilypond
3010
3011 @seealso
3012
3013 Program reference: @internalsref{RhythmicStaff}.
3014
3015 Examples: @inputfileref{input/regression,rhythmic-staff.ly}.
3016
3017
3018 @node Entering percussion, Percussion staves, Showing melody rhythms, Rhythmic music
3019 @subsection Entering percussion
3020
3021 @cindex percussion
3022 @cindex drums
3023
3024
3025 Percussion notes may be entered in @code{\drums} mode, which is
3026 similar to @code{notes}.  Each piece of percussion has a full name and
3027 an abbreviated name, and both be used in input files
3028
3029 @example
3030   hihat hh bassdrum bd
3031 @end example
3032 @lilypond[quote,raggedright]
3033 \new DrumStaff \drums { hihat hh bassdrum bd }
3034 @end lilypond
3035
3036 The complete list of drum names is in the init file
3037 @file{ly/drumpitch-init.ly}.
3038 @c TODO: properly document this.
3039
3040 @seealso
3041
3042 Program reference: @internalsref{DrumNoteEvent}.
3043
3044 @node Percussion staves,  , Entering percussion, Rhythmic music
3045 @subsection Percussion staves
3046 @cindex percussion
3047 @cindex drums
3048
3049 A percussion part for more than one instrument typically uses a
3050 multiline staff where each position in the staff refers to one piece
3051 of percussion.
3052
3053
3054 To typeset the music, the notes must be interpreted in a
3055 @internalsref{DrumStaff} and @internalsref{DrumVoice} contexts
3056
3057 @c
3058 @lilypond[quote,raggedright,verbatim]
3059 up = \drums { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
3060 down = \drums { bassdrum4 snare8 bd r bd sn4 }
3061   \new DrumStaff <<
3062     \new DrumVoice { \voiceOne \up } 
3063     \new DrumVoice { \voiceTwo \down } 
3064   >>
3065 @end lilypond
3066
3067 The above example shows verbose polyphonic notation. The short
3068 polyphonic notation, described in @ref{Polyphony}, can also be used if
3069 the @internalsref{DrumVoices} are instantiated by hand first. For example, 
3070
3071 @lilypond[quote,fragment,verbatim] 
3072 \new DrumStaff <<
3073   \context DrumVoice = "1" {  s1 *2 }
3074   \context DrumVoice = "2" {  s1 *2 }
3075   \drums {
3076     bd4 sn4 bd4 sn4
3077     <<
3078       { \repeat unfold 16 hh16 }
3079       \\
3080       { bd4 sn4 bd4 sn4 }
3081     >>
3082   }   
3083 >>
3084 @end lilypond
3085
3086
3087 There are also other layout possibilities. To use these, set the
3088 property @code{drumStyleTable} in context @internalsref{DrumVoice}.
3089 The following variables have been predefined
3090
3091 @table @code
3092 @item drums-style
3093 is the default. It typesets a typical drum kit on a five-line staff
3094
3095 @lilypond[quote,noindent]
3096 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
3097     bd sn ss tomh tommh tomml toml tomfh tomfl }
3098 mus = \drums  { cymc cyms cymr hh | hhc hho hhho hhp | \break cb hc
3099     bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
3100 \score {
3101     << \new DrumStaff\with {
3102             \remove Bar_engraver
3103             \remove Time_signature_engraver
3104             \override Stem #'transparent = ##t
3105             \override Stem #'Y-extent-callback = ##f
3106             minimumVerticalExtent = #'(-4.0 . 5.0)
3107     } \mus
3108         \context Lyrics \nam 
3109     >>
3110     \paper {
3111     %% need to do this, because of indented @itemize
3112     linewidth= 9 \cm 
3113     \context { \Score
3114     \override LyricText #'font-family = #'typewriter
3115     \override BarNumber #'transparent =##T
3116 }}}
3117 @end lilypond
3118
3119 The drum scheme supports six different toms.  When there fewer toms, simply
3120 select the toms that produce the desired result, i.e. to get toms on
3121 the three middle lines you use @code{tommh}, @code{tomml} and
3122 @code{tomfh}.
3123
3124 @item timbales-style
3125 to typeset timbales on a two line staff
3126
3127 @lilypond[quote,raggedright]
3128 nam = \lyrics { timh ssh timl ssl cb }
3129 mus = \drums  { timh ssh timl ssl cb s16 }
3130
3131 <<
3132         \context DrumStaff \with {
3133             \remove Bar_engraver
3134             \remove Time_signature_engraver
3135             \override Stem #'transparent = ##t
3136             \override Stem #'Y-extent-callback = ##f
3137             \override StaffSymbol #'line-count = #2
3138             \override StaffSymbol #'staff-space = #2
3139             minimumVerticalExtent = #'(-3.0 . 4.0)
3140             drumStyleTable = #timbales-style
3141         } \mus
3142         \context Lyrics {
3143             \override LyricText #'font-family = #'typewriter
3144
3145         \nam  }
3146 >>
3147 @end lilypond
3148 @item congas-style
3149 to typeset congas on a two line staff
3150
3151 @lilypond[quote,raggedright]
3152 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
3153 mus = \drums  { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
3154 <<
3155         \context DrumStaff\with {
3156             \remove Bar_engraver
3157             \remove Time_signature_engraver
3158             drumStyleTable = #congas-style
3159             \override StaffSymbol #'line-count = #2
3160             
3161             %% this sucks; it will lengthen stems.
3162             \override StaffSymbol #'staff-space = #2
3163             \override Stem #'transparent = ##t
3164             \override Stem #'Y-extent-callback = ##f
3165         } \mus
3166         \context Lyrics {
3167                     \override LyricText #'font-family = #'typewriter
3168 \nam  }
3169 >>
3170 @end lilypond
3171 @item bongos-style
3172 to typeset bongos on a two line staff
3173
3174 @lilypond[quote,raggedright]
3175 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
3176 mus = \drums  { boh boho bohm ssh bol bolo bolm ssl s16 }
3177 <<
3178         \context DrumStaff\with {
3179             \remove Bar_engraver
3180             \remove Time_signature_engraver
3181             \override StaffSymbol #'line-count = #2
3182             drumStyleTable = #bongos-style
3183            
3184             %% this sucks; it will lengthen stems.
3185             \override StaffSymbol #'staff-space = #2
3186             \override Stem #'transparent = ##t
3187             \override Stem #'Y-extent-callback = ##f
3188         } \mus
3189         \context Lyrics {
3190                     \override LyricText #'font-family = #'typewriter
3191 \nam  }
3192 >>
3193 @end lilypond
3194
3195 @item percussion-style
3196 to typeset all kinds of simple percussion on one line staves
3197 @lilypond[quote,raggedright]
3198 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
3199 mus = \drums  { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
3200 <<
3201         \context DrumStaff\with{
3202             \remove Bar_engraver
3203             drumStyleTable = #percussion-style
3204             \override StaffSymbol #'line-count = #1
3205             \remove Time_signature_engraver
3206             \override Stem #'transparent = ##t
3207             \override Stem #'Y-extent-callback = ##f
3208         } \mus
3209         \context Lyrics {
3210           \nam
3211           \override LyricText #'font-family = #'typewriter
3212         }
3213 >>
3214 @end lilypond
3215 @end table
3216
3217 If you do not like any of the predefined lists you can define your own
3218 list at the top of your file
3219
3220 @lilypond[quote,raggedright,verbatim]
3221 #(define mydrums '(
3222         (bassdrum     default   #f        -1)
3223         (snare        default   #f        0)
3224         (hihat        cross     #f        1)
3225         (pedalhihat   xcircle   "stopped" 2)
3226         (lowtom       diamond   #f       3)))
3227 up = \drums { hh8 hh hh hh hhp4 hhp }
3228 down = \drums { bd4 sn bd toml8 toml }
3229
3230 \new DrumStaff <<
3231     \set DrumStaff.drumStyleTable
3232        = #(alist->hash-table mydrums)
3233     \new DrumVoice { \voiceOne \up }
3234     \new DrumVoice { \voiceTwo \down }
3235 >>
3236 @end lilypond
3237
3238
3239 @seealso
3240
3241 Init files: @file{ly/drumpitch-init.ly}.
3242
3243 Program reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
3244
3245 @refbugs
3246
3247 Because general MIDI does not contain rim shots, the sidestick is used
3248 for this purpose instead.
3249
3250 @node Piano music, Vocal music, Rhythmic music, Notation manual
3251 @section Piano music
3252
3253 Piano staves are two normal staves coupled with a brace.  The staves
3254 are largely independent, but sometimes voices can cross between the
3255 two staves.  The same notation is also used for harps and other key
3256 instruments.  The @internalsref{PianoStaff} is especially built to
3257 handle this cross-staffing behavior.  In this section we discuss the
3258 @internalsref{PianoStaff} and some other pianistic peculiarities.
3259
3260
3261 @menu
3262 * Automatic staff changes::     
3263 * Manual staff switches::       
3264 * Pedals::                      
3265 * Arpeggio::                    
3266 * Staff switch lines::          
3267 * Cross staff stems::           
3268 @end menu 
3269
3270 @refbugs
3271
3272 Dynamics are not centered, but kludges do exist. See
3273 @inputfileref{input/template,piano-dynamics.ly}.
3274
3275 @cindex cross staff stem
3276 @cindex stem, cross staff
3277 @cindex distance between staves in piano music
3278
3279 The distance between the two staves is normally fixed across the
3280 entire score. It is possible to tune this per system, but it does
3281 require arcane command incantations. See
3282 @inputfileref{input/test,piano-staff-distance.ly}.
3283
3284
3285 @node Automatic staff changes, Manual staff switches, Piano music, Piano music
3286 @subsection Automatic staff changes
3287 @cindex Automatic staff changes
3288
3289 Voices can switch automatically between the top and the bottom
3290 staff. The syntax for this is
3291
3292 @quotation
3293 @example
3294 \autochange \context Voice @{ @dots{}@var{music}@dots{} @}
3295 @end example
3296 @end quotation
3297
3298 @noindent
3299 The two staves of the piano staff must be named @code{up} and
3300 @code{down}.
3301
3302 A @code{\relative} section that is outside of @code{\autochange} has
3303 no effect on the pitches of @var{music}, so, if necessary, put
3304 @code{\relative} inside @code{\autochange} like
3305
3306 @quotation
3307 @example
3308 \autochange \relative @dots{} \new Voice @dots{}
3309 @end example
3310 @end quotation
3311
3312
3313 The autochanger switches on basis of pitch (middle C is the turning
3314 point), and it looks ahead skipping over rests to switch in
3315 advance. Here is a practical example
3316         
3317 @lilypond[quote,verbatim,raggedright]
3318 \context PianoStaff <<
3319   \context Staff = "up" {
3320     \autochange \new Voice \relative c' {
3321        g4 a  b c d r4 a g } }
3322   \context Staff = "down" {
3323        \clef bass
3324        s1*2
3325 } >>
3326 @end lilypond
3327
3328 @noindent
3329 In this example, spacer rests are used to prevent the bottom staff from
3330 terminating too soon.
3331
3332
3333 @seealso
3334
3335 In this manual: @ref{Manual staff switches}.
3336
3337 Program reference: @internalsref{AutoChangeMusic}.
3338
3339
3340
3341 @refbugs
3342
3343 The staff switches often do not end up in optimal places. For high
3344 quality output, staff switches should be specified manually.
3345
3346
3347 @code{\autochange} cannot be inside @code{\times}. 
3348
3349 Internally, the @code{\partcombine} interprets both arguments as
3350 @code{Voice}s named @code{one} and @code{two}, and then decides when
3351 the parts can be combined. Consequently, if the arguments switch to
3352 differently named @internalsref{Voice} contexts, the events in those
3353 will be ignored.
3354
3355
3356 @node Manual staff switches, Pedals, Automatic staff changes, Piano music
3357 @subsection Manual staff switches
3358
3359 @cindex manual staff switches
3360 @cindex staff switch, manual
3361
3362 Voices can be switched between staves manually, using the following command
3363 @example
3364 \change Staff = @var{staffname} @var{music}
3365 @end example
3366
3367 @noindent
3368 The string @var{staffname} is the name of the staff. It switches the
3369 current voice from its current staff to the Staff called
3370 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3371 @code{"down"}. The @context{Staff} referred to must already exist, so
3372 usually the setup for a score will start with a setup of the staves,
3373
3374 @example
3375   <<
3376   \context Staff = up @{
3377     \skip 1 * 10  %@emph{ keep staff alive}
3378     @}
3379   \context Staff = down @{
3380     \skip 1 * 10  %@emph{idem}
3381     @}
3382   >>
3383 @end example 
3384
3385
3386 and the @context{Voice} is inserted afterwards
3387
3388 @example
3389   \context Staff = down
3390     \new Voice @{ @dots{} \change Staff = up @dots{} @}
3391 @end example
3392
3393
3394 @node Pedals, Arpeggio, Manual staff switches, Piano music
3395 @subsection Pedals
3396 @cindex Pedals
3397
3398 Pianos have pedals that alter the way sound are produced. Generally, a
3399 piano has three pedals, sustain, una corda, and sostenuto.
3400
3401
3402 Piano pedal instruction can be expressed by attaching
3403 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3404 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3405 note or chord
3406
3407 @lilypond[quote,fragment,verbatim]
3408 c'4\sustainDown c'4\sustainUp
3409 @end lilypond
3410
3411 What is printed can be modified by setting @code{pedal@var{X}Strings},
3412 where @var{X} is one of the pedal types: @code{Sustain},
3413 @code{Sostenuto} or @code{UnaCorda}.  Refer to
3414 @internalsref{SustainPedal} in the program reference for more
3415 information.
3416
3417 Pedals can also be indicated by a sequence of brackets, by setting the 
3418 @code{pedalSustainStyle} property to @code{bracket} objects
3419
3420 @lilypond[quote,fragment,verbatim,relative=2]
3421 \set Staff.pedalSustainStyle = #'bracket
3422 c\sustainDown d e
3423 b\sustainUp\sustainDown
3424 b g \sustainUp a \sustainDown \bar "|."
3425 @end lilypond
3426
3427 A third style of pedal notation is a mixture of text and brackets,
3428 obtained by setting the @code{pedalSustainStyle} style property to
3429 @code{mixed}
3430
3431 @lilypond[quote,fragment,verbatim,relative=2]
3432 \set Staff.pedalSustainStyle = #'mixed
3433 c\sustainDown d e
3434 b\sustainUp\sustainDown
3435 b g \sustainUp a \sustainDown \bar "|."
3436 @end lilypond
3437
3438 The default `*Ped.' style for sustain and damper pedals corresponds to
3439 style @code{#'text}. The sostenuto pedal uses @code{mixed} style by
3440 default.
3441
3442 @lilypond[quote,fragment,verbatim,relative=2]
3443 c\sostenutoDown d e c, f g a\sostenutoUp
3444 @end lilypond
3445
3446 For fine-tuning of the appearance of a pedal bracket, the properties
3447 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3448 @code{PianoPedalBracket} objects (see
3449 @internalsref{PianoPedalBracket} in the Program reference)  can be modified.  For example, the
3450 bracket may be extended to the end of the note head
3451
3452 @lilypond[quote,fragment,verbatim,relative=2]
3453 \override Staff.PianoPedalBracket  
3454    #'shorten-pair = #'(0 . -1.0)
3455 c\sostenutoDown d e c, f g a\sostenutoUp
3456 @end lilypond
3457
3458 @node Arpeggio, Staff switch lines, Pedals, Piano music
3459 @subsection Arpeggio
3460 @cindex Arpeggio
3461
3462 @cindex broken arpeggio
3463 @cindex @code{\arpeggio}
3464
3465 You can specify an arpeggio sign on a chord by attaching an
3466 @code{\arpeggio} to a chord
3467
3468
3469 @lilypond[quote,fragment,relative=1,verbatim]
3470 <c e g c>\arpeggio
3471 @end lilypond
3472
3473 When an arpeggio crosses staves, you attach an arpeggio to the chords
3474 in both staves, and set
3475 @internalsref{PianoStaff}.@code{connectArpeggios}
3476
3477 @lilypond[quote,fragment,relative=1,verbatim]
3478 \context PianoStaff <<
3479   \set PianoStaff.connectArpeggios = ##t
3480   \new Staff  { <c' e g c>\arpeggio }
3481   \new Staff { \clef bass  <c,, e g>\arpeggio }
3482 >>
3483 @end lilypond
3484
3485 The direction of the arpeggio is sometimes denoted by adding an
3486 arrowhead to the wiggly line
3487
3488 @lilypond[quote,fragment,relative=1,verbatim]
3489 \context Voice {
3490   \arpeggioUp
3491   <c e g c>\arpeggio
3492   \arpeggioDown
3493   <c e g c>\arpeggio
3494 }
3495 @end lilypond
3496
3497 A square bracket on the left indicates that the player should not
3498 arpeggiate the chord
3499
3500 @lilypond[quote,fragment,relative=1,verbatim]
3501 \arpeggioBracket
3502 <c' e g c>\arpeggio
3503 @end lilypond
3504
3505 @refcommands
3506
3507 @cindex @code{\arpeggio}
3508 @code{\arpeggio},
3509 @cindex @code{\arpeggioUp}
3510 @code{\arpeggioUp},
3511 @cindex @code{\arpeggioDown}
3512 @code{\arpeggioDown},
3513 @cindex @code{\arpeggioBoth}
3514 @code{\arpeggioBoth},
3515 @cindex @code{\arpeggioBracket}
3516 @code{\arpeggioBracket}.
3517
3518 @seealso
3519
3520 Program reference: @internalsref{ArpeggioEvent} music expressions lead to
3521 @internalsref{Arpeggio} objects.  Cross staff arpeggios are
3522 @internalsref{PianoStaff}.@internalsref{Arpeggio}.
3523
3524 @refbugs
3525
3526 It is not possible to mix connected arpeggios and unconnected
3527 arpeggios in one @internalsref{PianoStaff} at the same time.
3528
3529 @node Staff switch lines, Cross staff stems, Arpeggio, Piano music
3530 @subsection Staff switch lines
3531
3532
3533 @cindex follow voice
3534 @cindex staff switching
3535 @cindex cross staff
3536
3537 @cindex @code{followVoice}
3538
3539 Whenever a voice switches to another staff a line connecting the notes
3540 can be printed automatically. This is enabled if the property
3541 @code{PianoStaff.followVoice} is set to true
3542
3543 @lilypond[quote,fragment,relative=1,verbatim]
3544 \context PianoStaff <<
3545   \set PianoStaff.followVoice = ##t
3546   \context Staff \context Voice {
3547     c1
3548     \change Staff=two
3549     b2 a
3550   }
3551  \context Staff=two { \clef bass \skip 1*2 }
3552 >>  
3553 @end lilypond
3554
3555 @seealso
3556
3557 The associated object is @internalsref{VoiceFollower}.
3558
3559 @refcommands
3560
3561 @cindex @code{\showStaffSwitch}
3562 @code{\showStaffSwitch}, 
3563 @cindex @code{\hideStaffSwitch}
3564 @code{\hideStaffSwitch}.
3565
3566
3567 @node Cross staff stems,  , Staff switch lines, Piano music
3568 @subsection Cross staff stems
3569
3570 The chords which cross staves may be produced by increasing the length
3571 of the stem in the lower stave, so it reaches the stem in the upper
3572 stave, or vice versa.
3573
3574 @lilypond[raggedright,verbatim]
3575 stemExtend = \once \override Stem  #'length = #22
3576 noFlag = \once \override Stem  #'flag-style = #'no-flag
3577 \context PianoStaff <<
3578   \new Staff   {
3579     \stemDown \stemExtend
3580     f'4
3581     \stemExtend \noFlag
3582     f'8
3583   }
3584   \new Staff {
3585     \clef bass
3586     a4 a8
3587   }
3588 >>
3589 @end lilypond
3590
3591
3592 @node Vocal music, Other instrument specific notation, Piano music, Notation manual
3593 @section Vocal music
3594
3595
3596 The easiest way to add lyrics to a melody, is by appending
3597
3598
3599 @cindex \addlyrics
3600 @example
3601   \addlyrics @{ @var{the lyrics} @} 
3602 @end example
3603
3604 to a melody. Here is an example,
3605
3606 @lilypond[raggedright,verbatim]
3607   \relative { \time 3/4 c2 e4 g2. }
3608   \addlyrics { play the game } 
3609 @end lilypond
3610
3611 More stanzas can be added by adding more
3612 @code{\addlyrics} sections 
3613
3614 @lilypond[raggedright,verbatim]
3615   \relative { \time 3/4 c2 e4 g2. }
3616   \addlyrics { play the game } 
3617   \addlyrics { speel het spel } 
3618   \addlyrics { joue le jeu } 
3619 @end lilypond
3620
3621 The @code{\addlyrics} keyword has three functions: it interprets the
3622 following words as texts instead of notes, it sets up a context for
3623 printing texts (the @code{Lyrics} context), and it couples the melody
3624 with the lyrics, so the durations of both are aligned.
3625
3626 These three functions can be controlled separately, and that is what
3627 the following sections are about.
3628
3629 @menu
3630 * Entering lyrics::             
3631 * The Lyrics context::          
3632 * Flexibility in alignment::    
3633 * More stanzas::                
3634 * Ambitus::                     
3635 @end menu
3636
3637 @node Entering lyrics, The Lyrics context, Vocal music, Vocal music
3638 @subsection Entering lyrics
3639
3640
3641 @cindex lyrics
3642 @cindex @code{\lyrics}
3643 @cindex punctuation
3644
3645 Lyrics are entered in a special input mode. This mode is is introduced
3646 by the keyword @code{\lyrics}.  In this mode you can enter lyrics,
3647 with punctuation and accents without any hassle.  Syllables are
3648 entered like notes, but with pitches replaced by text.  For example,
3649 @example
3650   \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3651 @end example
3652
3653 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3654 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3655 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3656 any 8-bit character with ASCII code over 127, or a two-character
3657 combination of a backslash followed by one of @code{`}, @code{'},
3658 @code{"}, or @code{^}.
3659
3660 Subsequent characters of a word can be any character that is not a digit
3661 and not white space.  One important consequence of this is that a word
3662 can end with @code{@}}. The following example is usually a bug. The
3663 syllable includes a @code{@}}, and hence the opening brace is not balanced
3664 @example
3665   \lyrics @{ twinkle@}
3666 @end example
3667
3668 @cindex @code{\property}, in @code{\lyrics}
3669 Similarly, a period following a alphabetic sequence, is included in
3670 the resulting string. As a consequence, spaces must be inserted around
3671 property commands
3672 @example
3673   \override Score . LyricText #'font-shape = #'italic
3674 @end example
3675
3676 @cindex @code{_}
3677 @cindex spaces, in lyrics
3678 @cindex quotes, in lyrics
3679
3680 Any @code{_} character which appears in an unquoted word is converted
3681 to a space.  This provides a mechanism for introducing spaces into words
3682 without using quotes.  Quoted words can also be used in Lyrics mode to
3683 specify words that cannot be written with the above rules. The
3684 following example incorporates double quotes
3685
3686 @example
3687   \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3688 @end example
3689
3690 This example is slightly academic, since it gives better looking
3691 results to use matched single quotes, @code{``} and @code{''}
3692 @example
3693   \lyrics @{ He said: ``Let my peo ple go'' @}
3694 @end example
3695
3696 @cindex hyphens
3697
3698 Centered hyphens are entered as `@code{-}@code{-}' between syllables.
3699 The hyphen will have variable length depending on the space between
3700 the syllables and it will be centered between the syllables.
3701
3702 @cindex melisma
3703 @cindex extender
3704
3705 When a lyric is sung over many notes (this is called a melisma), this is
3706 indicated with a horizontal line centered between a syllable and the
3707 next one. Such a line is called an extender line, and it is entered as
3708 @code{__}.
3709
3710 @seealso
3711
3712 Program reference: events @internalsref{LyricEvent},
3713 @internalsref{HyphenEvent}, and @internalsref{ExtenderEvent}. Objects
3714 @internalsref{LyricHyphen}, @internalsref{LyricExtender} and
3715 @internalsref{LyricText}.
3716
3717 Examples: @inputfileref{input/test,lyric-hyphen-retain.ly}.
3718
3719 @refbugs
3720
3721 The definition of lyrics mode is too complex.
3722
3723
3724
3725 @node The Lyrics context, Flexibility in alignment, Entering lyrics, Vocal music
3726 @subsection  The Lyrics context
3727
3728
3729 Lyrics are printed by interpreting them in a @internalsref{Lyrics} context
3730 @example
3731  \context Lyrics \lyrics @dots{}
3732 @end example
3733
3734 @cindex automatic syllable durations
3735 @cindex @code{\lyricsto}
3736 @cindex lyrics and melodies
3737
3738 This will place the lyrics according to the durations that were
3739 entered. The lyrics can also be aligned under a given melody
3740 automatically.  In this case, it is no longer necessary to enter the
3741 correct duration for each syllable.  This is achieved by combining the
3742 melody and the lyrics with the @code{\lyricsto} expression
3743 @example
3744 \lyricsto @var{name} \new Lyrics @dots{} 
3745 @end example
3746
3747 This aligns the lyrics to the
3748 @c
3749 notes of the @internalsref{Voice} context called @var{name}, which has
3750 to exist. Therefore, normally the @code{Voice} is specified first, and
3751 then the lyrics are specified with @code{\lyricsto}. The command
3752 @code{\lyricsto} switches to @code{\lyrics} mode automatically, so the
3753 @code{\lyrics} keyword may be omitted.
3754
3755 For different or more complex orderings, the best way is to setup the
3756 hierarchy of staves and lyrics first, e.g.
3757 @example
3758 \context ChoirStaff  <<
3759   \context Lyrics = sopranoLyrics @{ s1 @}
3760   \context Voice = soprano @{ @emph{music} @}
3761   \context Lyrics = tenorLyrics @{ s1 @}
3762   \context Voice = tenor @{ @emph{music} @}
3763 >>
3764 @end example
3765 and then combine the appropriate melodies and lyric lines
3766 @example
3767   \lyricsto "soprano" \context Lyrics = sopranoLyrics
3768      @emph{the lyrics}
3769 @end example
3770
3771 @noindent
3772 The final input would resemble
3773
3774 @example
3775   << \context ChoirStaff  << @emph{setup the music}  >>
3776      \lyricsto "soprano" @emph{etc}
3777      \lyricsto "alto" @emph{etc}
3778      @emph{etc}
3779   >>
3780 @end example 
3781
3782
3783 The @code{\lyricsto} command detects melismata: it only puts one
3784 syllable under a tied or slurred group of notes. If you want to force
3785 an unslurred group of notes to be a melisma, insert @code{\melisma}
3786 after the first note of the group, and @code{\melismaEnd} after the
3787 last one, e.g.
3788
3789 @lilypond[quote,relative=2,raggedright,fragment,verbatim]
3790 <<
3791   \context Voice = "lala" {
3792     \time 3/4
3793     f4 g8
3794     \melisma 
3795     f e f
3796     \melismaEnd
3797     e2
3798   }
3799   \lyricsto "lala" \new Lyrics {
3800     la di __ daah 
3801   }
3802 >>
3803 @end lilypond
3804
3805 In addition, notes are considered a melisma if they are manually
3806 beamed, and automatic beaming (see @ref{Setting automatic beam
3807 behavior}) is switched off.  The criteria for deciding melismata can
3808 be tuned with the property @code{melismaBusyProperties}. See
3809 @internalsref{Melisma_translator} in the program reference for more
3810 information.
3811
3812 Lyrics can also be entered without @code{\lyricsto}. In this case the
3813 durations of each syllable must be entered explicitly, for example,
3814
3815 @verbatim
3816   play2 the4 game2.
3817   sink2 or4 swim2.  
3818 @end verbatim
3819
3820 Alignment to a melody can be specified with the @code{associatedVoice}
3821 property,
3822
3823 @verbatim
3824   \set associatedVoice = #"melody"
3825 @end verbatim 
3826
3827 Here is an example demonstrating manual lyric durations,
3828
3829 @lilypond[relative=1,verbatim,fragment]
3830 << \context Voice = melody {
3831      \time 3/4
3832      c2 e4 g2.
3833   } 
3834   \new Lyrics \lyrics {
3835     \set associatedVoice = #"melody"
3836     play2 the4 game2.
3837   }  >>
3838 @end lilypond
3839
3840 @cindex SATB
3841 @cindex choral score
3842
3843 A complete example of a SATB score setup is in the file
3844 @inputfileref{input/template,satb.ly}.
3845
3846
3847 @refcommands
3848
3849 @code{\melisma}, @code{\melismaEnd}
3850 @cindex @code{\melismaEnd}
3851 @cindex @code{\melisma}
3852
3853 @seealso
3854
3855 Program reference: Music expressions: @internalsref{LyricCombineMusic},
3856 Contexts: @internalsref{Lyrics}, @internalsref{Melisma_translator}.
3857
3858 Examples: @inputfileref{input/template,satb.ly},
3859 @inputfileref{input/regression,lyric-combine-new.ly},
3860 @c TODO: make separate section for melismata 
3861 @inputfileref{input/test,lyrics-melisma-variants.ly}.
3862 @inputfileref{input/test,lyrics-melisma-faster.ly}.
3863  
3864 @refbugs
3865
3866 Melismata are not detected automatically, and extender lines must be
3867 inserted by hand.
3868
3869
3870 For proper processing of extender lines, the
3871  @internalsref{Lyrics} and @internalsref{Voice} should be
3872 linked. This can be achieved either by using @code{\lyricsto} or by
3873 setting corresponding names for both contexts. The latter is explained
3874 in @ref{More stanzas}.
3875
3876 @c TODO: document \new Staff << Voice \lyricsto >> bug
3877
3878 @node Flexibility in alignment, More stanzas, The Lyrics context, Vocal music
3879 @subsection Flexibility in alignment
3880
3881
3882 Often, different stanzas of one song are put to one melody in slightly
3883 differing ways.  Such variations can still be captured with
3884 @code{\lyricsto}.
3885
3886 One possibility is that the text has a melisma in one stanza, but
3887 multiple syllables in another one. One solution is to make the faster
3888 voice ignore the melisma. This is done by setting
3889 @code{ignoreMelismata} in the Lyrics context.
3890
3891 There has one tricky aspect. The setting for @code{ignoreMelismata}
3892 must be set one syllable @emph{before} the non-melismatic syllable
3893 in the text, as shown here,
3894
3895 @lilypond[verbatim,raggedright]
3896 <<
3897     \relative \context Voice = "lahlah" {
3898         \set Staff.autoBeaming = ##f 
3899         c4
3900         \slurDotted
3901         f8.[( g16])
3902         a4
3903     }
3904     \new Lyrics \lyricsto "lahlah" {
3905         more slow -- ly
3906     }
3907     \new Lyrics \lyricsto "lahlah" {
3908         \set ignoreMelismata = ##t % applies to "fas"
3909         go fas -- ter
3910         \unset ignoreMelismata
3911         still
3912     }
3913 >>
3914 @end lilypond
3915
3916
3917 The @code{ignoreMelismata} applies to the syllable ``fas'', so it
3918 should bev entered before ``go''.
3919
3920 The reverse is also possible: making a lyric line slower than the
3921 standard. This can be achieved by insert @code{\skip}s into the
3922 lyrics. For every @code{\skip}, the text will be delayed another note.
3923 For example,
3924
3925 @lilypond[verbatim,raggedright]
3926 \relative { c c g' }
3927 \addlyrics {
3928   twin -- \skip 4
3929   kle
3930 }
3931 @end lilypond
3932
3933 More complex variations in text underlay are possible. It is possible
3934 to switch the melody for a line of lyrics during the text. This is
3935 done by setting the @code{associatedVoice} property. In the example 
3936
3937 @lilypond[raggedright]
3938 <<
3939     \relative \context Voice = "lahlah" {
3940         \set Staff.autoBeaming = ##f 
3941         c4
3942         <<
3943             \context Voice = alternative {
3944                 \voiceOne
3945                 \times 2/3 {
3946
3947                     % show associations clearly.
3948                     \override NoteColumn #'force-hshift = #-3
3949                     f8 f g
3950                 }
3951             }
3952             {
3953                 \voiceTwo
3954                 f8.[ g16]
3955                 \oneVoice
3956           } >>
3957         a8( b) c
3958
3959     }
3960     \new Lyrics \lyricsto "lahlah" {
3961         Ju -- ras -- sic Park
3962     }
3963     \new Lyrics \lyricsto "lahlah" {
3964
3965         % Tricky: need to set associatedVoice
3966         % one syllable too soon! 
3967         \set associatedVoice = alternative % applies to "ran"
3968         Ty --
3969         ran  --
3970         no --
3971         \set associatedVoice = lahlah % applies to "rus"
3972         sau -- rus Rex
3973     } >>
3974 @end lilypond
3975
3976 @noindent
3977 the text for the first stanza is set to a melody called ``lahlah'',
3978
3979 @verbatim
3980     \new Lyrics \lyricsto "lahlah" {
3981         Ju -- ras -- sic Park
3982     }
3983 @end verbatim 
3984
3985
3986 The second stanza initially is set to the @code{lahlah} context, but
3987 for the syllable ``ran'', it switches to a different melody.
3988 This is achieved with
3989 @example
3990         \set associatedVoice = alternative
3991 @end example
3992
3993 @noindent
3994 Here, @code{alternative} is the name of the @code{Voice} context
3995 containing the triplet.
3996
3997 Again, the command must be one syllable too early, before ``Ty'' in
3998 this case.
3999
4000 @verbatim
4001     \new Lyrics \lyricsto "lahlah" {
4002         \set associatedVoice = alternative % applies to "ran"
4003         Ty --
4004         ran  --
4005         no --
4006         \set associatedVoice = lahlah % applies to "rus"
4007         sau -- rus Rex
4008     }
4009 @end verbatim 
4010
4011 @noindent
4012 The underlay is switched back to the starting situation by assigning
4013 @code{lahlah} to @code{associatedVoice}.
4014
4015
4016
4017
4018 @node More stanzas, Ambitus, Flexibility in alignment, Vocal music
4019 @subsection More stanzas
4020
4021 @cindex phrasing, in lyrics
4022
4023
4024 @cindex stanza number
4025 @cindex singer's names
4026 @cindex name of singer 
4027
4028 Stanza numbers can be added by setting @code{stanza}, e.g.
4029
4030 @lilypond[quote,verbatim,relative=2,fragment]
4031 \new Voice {
4032     \time 3/4 g2 e4 a2 f4 g2.
4033 } \addlyrics {
4034      \set stanza = "1. "
4035      Hi, my name is Bert.
4036 } \addlyrics {
4037      \set stanza = "2. "
4038      Oh, che -- ri, je t'aime
4039 }
4040 @end lilypond
4041
4042 These numbers are put just before the start of first syllable.
4043
4044 Names of singers can also be added. They are printed at the start of
4045 the line, just like instrument names.  They are created by setting
4046 @code{vocalName}. A short version may be entered as @code{vocNam}.
4047
4048
4049 @lilypond[fragment,quote,verbatim,relative=2]
4050 \new Voice {
4051     \time 3/4 g2 e4 a2 f4 g2.
4052 } \addlyrics {
4053      \set vocalName = "Bert "
4054      Hi, my name is Bert.
4055 } \addlyrics {
4056      \set vocalName = "Ernie "
4057      Oh, che -- ri, je t'aime
4058 }
4059 @end lilypond
4060
4061 @seealso
4062
4063 Program reference: Layout objects @internalsref{LyricText} and
4064 @internalsref{VocalName}.  Music expressions
4065 @internalsref{LyricEvent}.
4066
4067
4068
4069 @node Ambitus,  , More stanzas, Vocal music
4070 @subsection Ambitus
4071 @cindex ambitus
4072
4073 The term @emph{ambitus} denotes a range of pitches for a given voice
4074 in a part of music.  It also may denote the pitch range that a musical
4075 instrument is capable of playing.  Ambits are printed on vocal
4076 parts, so singers can easily determine if it meets his or her
4077 capabilities.
4078
4079 It denoted at the beginning of a piece near the initial clef.  The
4080 range is graphically specified by two note heads, that represent the
4081 minimum and maximum pitch.  To print such ambits, add the
4082 @internalsref{Ambitus_engraver} to the @internalsref{Voice} context,
4083 for example,
4084
4085 @example
4086   \paper @{
4087     \context @{
4088       \Voice
4089       \consists Ambitus_engraver
4090     @}
4091   @}
4092 @end example
4093
4094 This results in the following output
4095
4096 @lilypond[quote,raggedright]
4097   \paper {
4098     \context {
4099       \Staff
4100       \consists Ambitus_engraver
4101     }
4102   }
4103
4104   \context ChoirStaff 
4105   \relative c' <<
4106     \new Staff {
4107       as'' c e2 cis,2
4108     }
4109     \new Staff  {
4110       es4 b c f as g
4111     }
4112   >>
4113 @end lilypond
4114
4115 If you have multiple voices in a single staff, and you want a single
4116 ambitus per staff rather than per each voice, add the
4117 @internalsref{Ambitus_engraver} to the @internalsref{Staff} context
4118 rather than to the @internalsref{Voice} context.  Here is an example,
4119
4120 @lilypond[verbatim,raggedright] 
4121 \new Staff <<
4122     \new Voice \with {
4123         \consists "Ambitus_engraver"
4124     } \relative c'' {
4125         \override Ambitus #'X-offset-callbacks
4126         =  #(list (lambda (grob axis) -1.0))
4127         \voiceOne
4128         c4 a d e f2
4129     }
4130     \new Voice \with {
4131         \consists "Ambitus_engraver"
4132     } \relative c' {
4133         \voiceTwo
4134         es4 f g as b2
4135     }
4136 >>
4137 @end lilypond
4138
4139 @noindent
4140 This example uses one advanced feature,
4141
4142 @example
4143         \override Ambitus #'X-offset-callbacks
4144         =  #(list (lambda (grob axis) -1.0))
4145 @end example
4146
4147 @noindent
4148 This code moves the ambitus to the left. The same effect could have
4149 been achieved with @code{extra-offset}, but then the formatting system
4150 would not reserve space for the moved object. 
4151
4152 @seealso
4153
4154 Program reference: @internalsref{Ambitus},
4155 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
4156 @internalsref{AmbitusAccidental}.
4157
4158 Examples:  @inputfileref{input/regression,ambitus.ly}.
4159
4160 @refbugs
4161
4162 There is no collision handling in the case of multiple per-voice
4163 ambitus.
4164
4165 @node Other instrument specific notation, Tablatures, Vocal music, Notation manual
4166 @section Other instrument specific notation
4167
4168 @menu
4169 * Harmonic notes::              
4170 @end menu
4171
4172 @node Harmonic notes,  , Other instrument specific notation, Other instrument specific notation
4173 @subsection Harmonic notes
4174
4175 @cindex artificial harmonics
4176 @cindex harmonics
4177
4178 Artificial harmonics are notated with a different notehead style. They
4179 are entered by 
4180 marking the harmonic pitch with @code{\harmonic}.
4181
4182 @lilypond[raggedright,verbatim]
4183 {
4184  <c' g'\harmonic>4
4185 }
4186 @end lilypond
4187
4188
4189 @node Tablatures, Popular music, Other instrument specific notation, Notation manual
4190 @section Tablatures
4191
4192 @cindex tablature
4193 @cindex guitar tablature
4194
4195 Tablature notation is used for notating music for plucked string
4196 instruments.  It notates pitches not by using note heads, but by
4197 indicating on which string and fret a note must be played.  LilyPond
4198 offers limited support for tablature.
4199
4200 @menu
4201 * Tablatures basic::            
4202 * Non-guitar tablatures::       
4203 @end menu
4204
4205 @node Tablatures basic, Non-guitar tablatures, Tablatures, Tablatures
4206 @subsection Tablatures basic
4207 @cindex Tablatures basic
4208
4209 The string number associated to a note is given as a backslash
4210 followed by a number, e.g. @code{c4\3} for a C quarter on the third
4211 string. By default, string 1 is the highest one, and the tuning
4212 defaults to the standard guitar tuning (with 6 strings).  The notes
4213 are printed as tablature, by using @internalsref{TabStaff} and
4214 @internalsref{TabVoice} contexts
4215
4216 @lilypond[quote,fragment,verbatim]
4217  \context TabStaff {
4218   a,4\5 c'\2 a\3 e'\1
4219   e\4 c'\2 a\3 e'\1
4220 }
4221 @end lilypond
4222
4223 @cindex @code{minimumFret}
4224 @cindex fret
4225
4226 When no string is specified, the first string that does not give a
4227 fret number less than @code{minimumFret} is selected. The default
4228 value for @code{minimumFret} is 0
4229
4230
4231 @example
4232 e16 fis gis a b4
4233 \set TabStaff.minimumFret = #8
4234 e16 fis gis a b4
4235 @end example
4236 @lilypond[quote,noindent,raggedright]
4237 frag =  {
4238   \key e \major
4239   e16 fis gis a b4
4240   \set TabStaff.minimumFret = #8
4241   e16 fis gis a b4
4242 }
4243   \context StaffGroup <<
4244     \context Staff { \clef "G_8" \frag }
4245     \context TabStaff { \frag }
4246   >>
4247 @end lilypond
4248
4249 @seealso
4250
4251 Program reference: @internalsref{TabStaff}, @internalsref{TabVoice}, and
4252 @internalsref{StringNumberEvent}.
4253
4254 @refbugs
4255
4256 Chords are not handled in a special way, and hence the automatic
4257 string selector may easily select the same string to two notes in a
4258 chord.
4259
4260
4261 @node Non-guitar tablatures,  , Tablatures basic, Tablatures
4262 @subsection Non-guitar tablatures
4263 @cindex Non-guitar tablatures
4264
4265 You can change the number of strings, by setting the number of lines
4266 in the @internalsref{TabStaff}. 
4267
4268 You can change the tuning of the strings. A string tuning is given as
4269 a Scheme list with one integer number for each string, the number
4270 being the pitch (measured in semitones relative to middle C) of an
4271 open string.  The numbers specified for @code{stringTuning} are the
4272 numbers of semitones to subtract or add, starting the specified pitch
4273 by default middle C, in string order. Thus, the notes are e, a, d, and
4274 g
4275
4276 @lilypond[quote,fragment,verbatim]
4277   \context TabStaff <<
4278     \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
4279     
4280      {
4281       a,4 c' a e' e c' a e'
4282     }
4283   >> 
4284 @end lilypond
4285
4286 @refbugs
4287
4288 No guitar special effects have been implemented.
4289
4290 @seealso
4291
4292 Program reference: @internalsref{Tab_note_heads_engraver}.
4293
4294
4295 @node Popular music, Orchestral music, Tablatures, Notation manual
4296 @section Popular music 
4297
4298
4299
4300 @menu
4301 * Chord names::                 
4302 * Chords mode::                 
4303 * Printing chord names::        
4304 * Improvisation::               
4305 @end menu
4306
4307 @node Chord names, Chords mode, Popular music, Popular music
4308 @subsection Chord names
4309 @cindex Chords
4310
4311 LilyPond has support for both printing chord names.  Chords may be
4312 entered in musical chord notation, i.e. @code{< .. >}, but they can
4313 also be entered by name. Internally, the chords are represented as a
4314 set of pitches, so they can be transposed
4315
4316
4317 @lilypond[quote,verbatim,raggedright]
4318 twoWays =  \transpose c c' {
4319   \chords {
4320     c1 f:sus4 bes/f
4321   }
4322   <c e g>
4323   <f bes c'>
4324   <f bes d'>
4325 }
4326
4327   << \context ChordNames \twoWays
4328      \context Voice \twoWays >> 
4329 @end lilypond
4330
4331 This example also shows that the chord printing routines do not try to
4332 be intelligent. The last chord (@code{f bes d}) is not interpreted as
4333 an inversion.
4334
4335
4336 @menu
4337 * Chords mode::                 
4338 * Printing chord names::        
4339 @end menu
4340
4341
4342 @node Chords mode
4343 @subsection Chords mode
4344 @cindex Chords mode
4345
4346 Chord mode is a mode where you can input sets of pitches using common
4347 names.  It is introduced by the keyword @code{\chords}.
4348 In chords mode,  a  chord is entered by the root, which is entered
4349 like a common pitch
4350 @lilypond[quote,fragment,verbatim,relative=2]
4351 \chords { es4. d8 c2 }
4352 @end lilypond
4353 @cindex chord entry
4354 @cindex chord mode
4355
4356 Other chords may be entered by suffixing a colon, and introducing a
4357 modifier, and optionally, a number
4358 @c
4359 @lilypond[quote,fragment,verbatim]
4360 \chords { e1:m e1:7 e1:m7  }
4361 @end lilypond
4362 The first number following the root is taken to be the `type' of the
4363 chord, thirds are added to the root until it reaches the specified
4364 number
4365 @lilypond[quote,fragment,verbatim]
4366 \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
4367 @end lilypond
4368
4369 @cindex root of chord
4370 @cindex additions, in chords
4371 @cindex removals, in  chords
4372
4373 More complex chords may also be constructed  adding separate steps
4374 to a chord. Additions are added after the  number following
4375 the colon, and are separated by dots
4376 @c
4377 @lilypond[quote,verbatim,fragment]
4378 \chords { c:5.6 c:3.7.8 c:3.6.13 }
4379 @end lilypond
4380 Chord steps can be  altered by suffixing a @code{-} or @code{+} sign
4381 to the number
4382 @lilypond[quote,verbatim,fragment]
4383 \chords { c:7+ c:5+.3-  c:3-.5-.7- }
4384 @end lilypond
4385 Removals are specified similarly, and are introduced by a caret.  They
4386 must come after the additions
4387 @lilypond[quote,verbatim,fragment]
4388 \chords { c^3 c:7^5 c:9^3.5 }
4389 @end lilypond
4390
4391 Modifiers can be used to change pitches. The following modifiers are
4392 supported
4393 @table @code
4394 @item m
4395   is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
4396 @item dim
4397   is the   diminished chord. This modifier lowers the 3rd, 5th and (if present)
4398   the 7th step.
4399 @item aug
4400   is the augmented chord. This modifier raises the 5th step.
4401 @item maj
4402   is the major 7th chord. This modifier raises the 7th step if present.  
4403 @item sus
4404   is the suspended 4th or 2nd. This modifier removes the 3rd
4405 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
4406 the chord.
4407 @end table
4408 Modifiers can be mixed with additions
4409 @lilypond[quote,verbatim,fragment]
4410 \chords { c:sus4 c:7sus4 c:dim7 c:m6 } 
4411 @end lilypond
4412
4413 @cindex modifiers, in chords. 
4414 @cindex @code{aug}
4415 @cindex @code{dim}
4416 @cindex @code{maj}
4417 @cindex @code{sus}
4418 @cindex @code{m}
4419
4420 Since an unaltered 11 does not sound good when combined with an
4421 unaltered 3, the 11 is removed in this case (unless it is added
4422 explicitly)
4423 @c
4424 @lilypond[quote,fragment,verbatim]
4425 \chords { c:13 c:13.11 c:m13 }
4426 @end lilypond
4427
4428 @cindex @code{/}
4429
4430 An inversion (putting one pitch of the chord on the bottom), as well
4431 as bass notes, can be specified by appending
4432 @code{/}@var{pitch} to the chord
4433 @lilypond[quote,fragment,verbatim]
4434 \chords { c1 c/g c/f }
4435 @end lilypond
4436 @cindex @code{/+}
4437
4438 A bass note can be added instead of transposed out of the chord,
4439 by using  @code{/+}@var{pitch}.
4440
4441 @lilypond[quote,fragment,verbatim]
4442 \chords { c1 c/+g c/+f }
4443 @end lilypond
4444
4445 Chords is a mode similar to @code{\lyrics} etc.  Most
4446 of the commands continue to work, for example, @code{r} and
4447 @code{\skip} can be used to insert rests and spaces, and property
4448 commands may be used to change various settings.
4449
4450
4451
4452 @refbugs
4453
4454 Each step can only be present in a chord once.  The following
4455 simply produces the augmented chord, since @code{5+} is interpreted
4456 last
4457 @cindex clusters
4458 @lilypond[quote,verbatim,fragment]
4459 \chords { c:5.5-.5+ }
4460 @end lilypond
4461
4462
4463 @node Printing chord names
4464 @subsection Printing chord names
4465
4466 @cindex printing chord names
4467 @cindex chord names
4468 @cindex chords
4469
4470 For displaying printed chord names, use the @internalsref{ChordNames} context.
4471 The chords may be entered either using the notation
4472 described above, or directly using @code{<} and @code{>}
4473
4474 @lilypond[quote,verbatim,raggedright]
4475 scheme =  {
4476   \chords {a1 b c} <d' f' a'>  <e' g' b'>
4477 }
4478
4479  <<
4480     \context ChordNames \scheme
4481     \context Staff \scheme
4482 >>
4483 @end lilypond
4484
4485 You can make the chord changes stand out by setting
4486 @internalsref{ChordNames}.@code{chordChanges} to true.  This will only
4487 display chord names when there is a change in the chords scheme and at
4488 the start of a new line
4489
4490 @lilypond[quote,verbatim,linewidth=9\cm]
4491 scheme = \chords {
4492   c1:m c:m \break c:m c:m d
4493 }
4494  <<
4495     \context ChordNames {
4496       \set chordChanges = ##t
4497       \scheme }
4498     \context Staff \transpose c c' \scheme
4499 >>
4500 @end lilypond
4501
4502 The previous examples all show chords over a staff. This is not
4503 necessary. Chords may also be printed separately.  It may be necessary
4504 to add @internalsref{Volta_engraver} and @internalsref{Bar_engraver}
4505 for showing repeats.
4506
4507 @lilypond[raggedright,verbatim]
4508 \new ChordNames \with {
4509         \override BarLine #'bar-size = #4
4510         voltaOnThisStaff = ##t
4511         \consists Bar_engraver
4512         \consists "Volta_engraver"
4513
4514 \repeat volta 2 \chords {
4515         f1:maj f:7 bes:7
4516         c:maj  
4517 } \alternative {
4518   es e
4519 }
4520 @end lilypond
4521
4522
4523 The default chord name layout is a system for Jazz music, proposed by
4524 Klaus Ignatzek (see @ref{Literature list}).  It can be tuned through the
4525 following properties
4526
4527 @table @code
4528 @cindex @code{chordNameExceptions}
4529 @item chordNameExceptions
4530 This is a list that contains the chords that have special formatting.
4531 For an example, see
4532 @inputfileref{input/regression,chord-name-exceptions.ly}.
4533 @cindex exceptions, chord names.
4534
4535
4536 @cindex @code{majorSevenSymbol}
4537 @item majorSevenSymbol
4538 This property contains the markup object used for the 7th step, when
4539 it is major. Predefined options are @code{whiteTriangleMarkup} and
4540 @code{blackTriangleMarkup}.  See
4541 @inputfileref{input/regression,chord-name-major7.ly} for an example.
4542
4543 @cindex @code{chordNameSeparator}
4544 @item chordNameSeparator
4545 Different parts of a chord name are normally separated by a
4546 slash. By setting @code{chordNameSeparator}, you can specify other
4547 separators, e.g.
4548 @lilypond[quote,fragment,verbatim]
4549 \context ChordNames \chords {
4550   c:7sus4
4551   \set chordNameSeparator
4552     = \markup { \typewriter "|" }
4553   c:7sus4
4554 }
4555 @end lilypond
4556
4557 @cindex @code{chordRootNamer}
4558 @item chordRootNamer
4559 The root of a chord is usually printed as a letter with an optional
4560 alteration. The transformation from pitch to letter is done by this
4561 function.  Special note names (for example, the German ``H'' for a
4562 B-chord) can be produced by storing a new function in this property.
4563
4564 @cindex @code{chordNoteNamer}
4565 @item chordNoteNamer
4566 The default is to print single pitch, e.g. the bass note, using the
4567 @code{chordRootNamer}.  The @code{chordNoteNamer} property can be set
4568 to a specialized function to change this behavior.  For example, the
4569 base can be printed in lower case.
4570
4571 @end table
4572
4573 The predefined variables @code{\germanChords},
4574 @code{\semiGermanChords} set these variables. The effect is
4575 demonstrated here,
4576
4577 @lilypondfile[notexidoc]{chord-names-german.ly}
4578
4579 There are also two other chord name schemes implemented: an alternate
4580 Jazz chord notation, and a systematic scheme called Banter chords. The
4581 alternate jazz notation is also shown on the chart in @ref{Chord name
4582 chart}.  Turning on these styles is described in the input file
4583 @inputfileref{input/test,chord-names-jazz.ly}.
4584
4585 @cindex Banter
4586 @cindex jazz chords
4587 @cindex chords, jazz  
4588
4589
4590 @refcommands
4591
4592 @cindex @code{\germanChords}
4593 @code{\germanChords}, 
4594 @cindex @code{\semiGermanChords}
4595 @code{\semiGermanChords}.
4596
4597
4598
4599
4600 @seealso
4601
4602 Examples: @inputfileref{input/regression,chord-name-major7.ly},
4603 @inputfileref{input/regression,chord-name-exceptions.ly},
4604 @inputfileref{input/test,chord-names-jazz.ly},
4605 @inputfileref{input/test,chords-without-melody.ly}.
4606
4607
4608 Init files: @file{scm/chords-ignatzek.scm}, and @file{scm/chord-entry.scm}.
4609
4610
4611 @refbugs
4612
4613 Chord names are determined solely from the list of pitches. Chord
4614 inversions are not identified, and neither are added bass notes. This
4615 may result in strange chord names when chords are entered with the
4616 @code{< .. >} syntax.
4617
4618
4619 @node Improvisation
4620 @subsection Improvisation
4621
4622 Improvisation is sometimes denoted with slashed note heads.  Such note
4623 heads can be created by adding a @internalsref{Pitch_squash_engraver}
4624 to the @internalsref{Staff} or @internalsref{Voice} context. Then, the
4625 following command
4626
4627 @example
4628     \set squashedPosition = #0
4629     \override NoteHead  #'style = #'slash
4630 @end example
4631
4632 @noindent
4633 switches on the slashes.
4634
4635 There are shortcuts @code{\improvisationOn} (and an accompanying
4636 @code{\improvisationOff}) for this command sequence.  They are used in
4637 the following example
4638
4639 @lilypond[verbatim,raggedright]
4640 \new Staff \with {
4641   \consists Pitch_squash_engraver
4642 } \transpose c c' {
4643   e8 e g a a16(bes)(a8) g \improvisationOn
4644   e8
4645   ~e2~e8 f4 fis8
4646   ~fis2 \improvisationOff a16(bes) a8 g e
4647 }
4648 @end lilypond
4649
4650
4651
4652 @node Orchestral music
4653 @section Orchestral music
4654
4655 @cindex  Writing parts
4656
4657 Orchestral music involves some special notation, both in the full
4658 score and the individual parts. This section explains how to tackle
4659 some common problems in orchestral music.
4660
4661
4662
4663 @menu
4664 * System start delimiters::     
4665 * Aligning to cadenzas::        
4666 * Rehearsal marks::             
4667 * Bar numbers::                 
4668 * Instrument names::            
4669 * Transpose::                   
4670 * Instrument transpositions::   
4671 * Multi measure rests::         
4672 * Automatic part combining::    
4673 * Hiding staves::               
4674 * Different editions from one source::  
4675 * Quoting other voices::        
4676 @end menu
4677
4678 @node System start delimiters
4679 @subsection  System start delimiters
4680
4681 Polyphonic scores consist of many staves. These staves can be
4682 constructed in three different ways
4683 @itemize @bullet
4684 @item The group is started with a brace at the left, and bar lines are
4685 connected. This is done with the @internalsref{GrandStaff} context.
4686
4687 @item The group is started with a bracket, and bar lines are connected. This is done with the
4688 @internalsref{StaffGroup} context
4689
4690
4691 @item The group is  started with a vertical line. Bar lines are not
4692 connected.  This is the default for the score.
4693
4694 @end itemize
4695
4696 @cindex Staff, multiple
4697 @cindex bracket, vertical
4698 @cindex brace, vertical
4699 @cindex grand staff
4700 @cindex staff group
4701
4702
4703 @seealso
4704
4705 The bar lines at the start of each system are
4706 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace}, and
4707 @internalsref{SystemStartBracket}.  Only one of these types is created
4708 in every context, and that type is determined by the property
4709 @code{systemStartDelimiter}.
4710
4711 @node Aligning to cadenzas
4712 @subsection Aligning to cadenzas
4713
4714
4715 In an orchestral context, cadenzas present a special problem:
4716 when constructing a score that includes a cadenza, all other
4717 instruments should skip just as many notes as the length of the
4718 cadenza, otherwise they will start too soon or too late. 
4719
4720 A solution to this problem are the functions @code{mmrest-of-length}
4721 and @code{skip-of-length}. These Scheme functions take a piece music
4722 as argument, and generate a @code{\skip} or multi rest, exactly as
4723 long as the piece. The use of @code{mmrest-of-length} is demonstrated
4724 in the following example. 
4725
4726 @lilypond[verbatim,raggedright] 
4727 cadenza =  \relative c' {
4728     c4 d8 << { e f g } \\ { d4. } >>
4729     g4 f2 g4 g
4730 }
4731     
4732 \new GrandStaff <<
4733   \new Staff { \cadenza c'4 } 
4734   \new Staff {
4735     #(ly:export (mmrest-of-length cadenza))
4736     c'4
4737   }
4738 >>
4739 @end lilypond
4740
4741
4742
4743
4744
4745 @node Rehearsal marks
4746 @subsection Rehearsal marks
4747 @cindex Rehearsal marks
4748 @cindex mark
4749 @cindex @code{\mark}
4750
4751 To print a  rehearsal mark, use the @code{\mark} command
4752 @lilypond[quote,fragment,verbatim]
4753 \relative c'' {
4754   c1 \mark \default
4755   c1 \mark \default
4756   c1 \mark #8 
4757   c1 \mark \default
4758   c1 \mark \default
4759 }
4760 @end lilypond
4761
4762 @noindent
4763 (The letter I is skipped in accordance with engraving traditions.)
4764
4765 The mark is incremented automatically if you use @code{\mark
4766 \default}, but you can also use an integer argument to set the mark
4767 manually.  The value to use is stored in the property
4768 @code{rehearsalMark}.
4769
4770 The style is defined by the property @code{markFormatter}. It is a
4771 function taking the current mark (an integer) and the current context
4772 as argument. It should return a markup object. In the following
4773 example, @code{markFormatter} is set to a canned procedure. After a
4774 few measures, it is set to function that produces a boxed number. 
4775
4776 @lilypond[quote,verbatim,fragment,relative=2]
4777 \set Score.markFormatter = #format-mark-numbers 
4778 c1 \mark \default
4779 c1 \mark \default
4780 \set Score.markFormatter
4781    = #(lambda (mark  context)
4782        (make-bold-markup (make-box-markup (number->string mark))))
4783 c1 \mark \default
4784 c1 \mark \default
4785 @end lilypond
4786
4787 The file @file{scm/translation-functions.scm} contains the definitions
4788 of @code{format-mark-numbers} (the default format) and
4789 @code{format-mark-letters}. They can be used as inspiration for other
4790 formatting functions.
4791
4792
4793 @cindex coda on bar line
4794 @cindex segno on bar line
4795 @cindex fermata on bar line
4796 @cindex bar lines, symbols on
4797
4798 The @code{\mark} command can also be used to put signs like coda,
4799 segno and fermatas on a bar line. Use @code{\markup} to
4800 to access the appropriate symbol
4801
4802 @lilypond[quote,fragment,verbatim,relative=2]
4803 c1 \mark \markup { \musicglyph #"scripts-ufermata" }
4804 c1
4805 @end lilypond
4806
4807 In the case of a line break, marks must also be printed at the end of
4808 the line, and not at the beginning. Use the following to force that
4809 behavior
4810 @example
4811 \override Score.RehearsalMark  
4812   #'break-visibility = #begin-of-line-invisible
4813 @end example
4814
4815 @cindex fermatas
4816 @cindex coda
4817 @cindex segno
4818 @cindex bar lines, putting symbols on 
4819
4820 @seealso
4821
4822 Program reference: @internalsref{MarkEvent}, @internalsref{RehearsalMark}.
4823
4824 Init files: @file{scm/translation-functions.scm} contains the
4825 definition of @code{format-mark-numbers} and
4826 @code{format-mark-letters}. They can be used as inspiration for other
4827 formatting functions.
4828
4829 Examples: @inputfileref{input/regression,rehearsal-mark-letter.ly},
4830 @inputfileref{input/regression,rehearsal-mark-number.ly}.
4831
4832
4833 @node Bar numbers
4834 @subsection Bar numbers
4835
4836
4837 @cindex bar numbers
4838 @cindex measure numbers
4839 @cindex @code{currentBarNumber}
4840
4841 Bar numbers are printed by default at the start of the line.  The
4842 number itself is stored in the @code{currentBarNumber} property, which
4843 is normally updated automatically for every measure.
4844
4845 Bar numbers can be typeset at regular intervals instead of at the
4846 beginning of each line. This is illustrated in the following example,
4847 whose source is available as
4848 @inputfileref{input/test,bar-number-regular-interval.ly}
4849
4850 @lilypondfile[quote]{bar-number-regular-interval.ly}
4851
4852 @seealso
4853
4854 Program reference: @internalsref{BarNumber}.
4855
4856 Examples: @inputfileref{input/test,bar-number-every-five-reset.ly},
4857 and @inputfileref{input/test,bar-number-regular-interval.ly}.
4858
4859 @refbugs
4860
4861 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4862 there is one at the top. To solve this, the
4863 @code{padding} property of @internalsref{BarNumber} can be
4864 used to position the number correctly.
4865
4866 @node Instrument names
4867 @subsection Instrument names
4868
4869 In an orchestral score, instrument names are printed left side of the
4870 staves.
4871
4872 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4873 and @internalsref{Staff}.@code{instr}. This will print a string before
4874 the start of the staff. For the first start, @code{instrument} is
4875 used, for the next ones @code{instr} is used.
4876
4877 @lilypond[quote,verbatim,raggedright,relative=1,fragment]
4878 \set Staff.instrument = "Ploink "
4879 \set Staff.instr = "Plk "
4880 c1
4881 \break
4882 c''
4883 @end lilypond
4884
4885 You can also use markup texts to construct more complicated instrument
4886 names, for example
4887
4888 @lilypond[quote,fragment,verbatim,raggedright]
4889  {
4890   \set Staff.instrument = \markup {
4891     \column < "Clarinetti" { "in B"
4892       \smaller \flat } > }
4893    { c''1 }
4894 }
4895 @end lilypond
4896
4897 For longer instrument names, it may be useful to increase the
4898 @code{indent} setting in the @code{\paper} block.
4899
4900 @seealso
4901
4902 Program reference: @internalsref{InstrumentName}.
4903
4904 @refbugs
4905
4906 When you put a name on a grand staff or piano staff the width of the
4907 brace is not taken into account. You must add extra spaces to the end of
4908 the name to avoid a collision.
4909
4910 @node Transpose
4911 @subsection Transpose
4912 @cindex Transpose
4913 @cindex transposition of pitches
4914 @cindex @code{\transpose}
4915
4916 A music expression can be transposed with @code{\transpose}.  The
4917 syntax is
4918 @example
4919 \transpose @var{from} @var{to} @var{musicexpr}
4920 @end example
4921
4922 This means that @var{musicexpr} is transposed by the interval between
4923 the pitches @var{from} and @var{to}: any note with pitch @code{from}
4924 is changed to @code{to}.
4925
4926
4927 For example, consider  a piece written in the key of  D major.  If
4928 this piece is a  little too low for its performer, it can be
4929 transposed up to E major with
4930 @example
4931 \transpose d e @dots{}
4932 @end example
4933
4934 Consider a part  written for violin (a C instrument). If
4935 this part is to be played on the A clarinet, the following
4936 transposition will produce the appropriate part
4937
4938 @example
4939 \transpose a c @dots{}
4940 @end example   
4941
4942 @code{\transpose} distinguishes between enharmonic pitches: both
4943 @code{\transpose c cis} or @code{\transpose c des} will transpose up
4944 half a tone.  The first version will print sharps and the second
4945 version will print flats
4946
4947 @lilypond[quote,raggedright,verbatim]
4948 mus = { \key d \major cis d fis g }
4949 \context Staff {
4950   \clef "F" \mus
4951   \clef "G"
4952   \transpose c g' \mus
4953   \transpose c f' \mus
4954 }
4955 @end lilypond
4956
4957
4958 @seealso
4959
4960 Program reference: @internalsref{TransposedMusic}, and
4961 @internalsref{UntransposableMusic}.
4962
4963 @refbugs
4964
4965 If you want to use both @code{\transpose} and @code{\relative},
4966 you must put @code{\transpose} outside of @code{\relative}, since
4967 @code{\relative} will have no effect music that appears inside a
4968 @code{\transpose}.
4969
4970 @node Instrument transpositions
4971 @subsection Instrument transpositions
4972
4973 The key of a transposing instrument can also be specified.  This
4974 applies to many wind instruments, for example, clarinets (B-flat, A and
4975 E-flat), horn (F) and trumpet (B-flat, C, D and E-flat).
4976
4977
4978 The transposition is entered after the keyword @code{\transposition}
4979
4980 @example
4981   \transposition bes   %%  B-flat clarinet
4982 @end example
4983
4984 This command sets the property @code{instrumentTransposition}. The value of
4985 this property is used for MIDI output and quotations.  It does not
4986 affect how notes are printed in the current staff.
4987
4988 @cindex transposition, MIDI
4989 @cindex transposition, instrument
4990
4991
4992 @node Multi measure rests
4993 @subsection Multi measure rests
4994 @cindex multi measure rests
4995 @cindex Rests, multi measure
4996
4997 @cindex @code{R}
4998
4999 Multi measure rests are entered using `@code{R}'. It is specifically
5000 meant for full bar rests and for entering parts: the rest can expand
5001 to fill a score with rests, or it can be printed as a single
5002 multimeasure rest. This expansion is controlled by the property
5003 @code{Score.skipBars}. If this is set to true, empty measures will not
5004 be expanded, and the appropriate number is added automatically
5005
5006 @lilypond[quote,fragment,verbatim]
5007  \time 4/4 r1 | R1 | R1*2
5008  \set Score.skipBars = ##t R1*17  R1*4
5009 @end lilypond
5010
5011 The @code{1} in @code{R1} is similar to the duration notation used for
5012 notes. Hence, for time signatures other than 4/4, you must enter other
5013 durations.  This can be done with augmentation dots or fractions
5014
5015 @lilypond[quote,fragment,verbatim]
5016 \set Score.skipBars = ##t
5017 \time 3/4
5018 R2. | R2.*2
5019 \time 13/8
5020 R1*13/8
5021 R1*13/8*12
5022 @end lilypond
5023
5024 An @code{R} spanning a single measure is printed as either a whole rest
5025 or a breve, centered in the measure regardless of the time signature.
5026
5027 @cindex text on multi-measure rest
5028 @cindex script on multi-measure rest
5029 @cindex fermata on multi-measure rest
5030
5031 Texts can be added to multi-measure rests by using the
5032 @var{note}-@code{markup} syntax (see @ref{Text markup}).  In this case, the number is
5033 replaced. If you need both texts and the number, you must add the
5034 number by hand. A variable (@code{\fermataMarkup}) is provided for
5035 adding fermatas
5036
5037
5038 @lilypond[quote,verbatim,fragment]
5039   \time 3/4
5040   R2._\markup { "Ad lib" }
5041   R2.^\fermataMarkup
5042 @end lilypond
5043
5044 If you want to have a text on the left end of a multi-measure rest,
5045 attach the text to a zero-length skip note, i.e.
5046
5047 @example
5048   s1*0^"Allegro"
5049   R1*4 
5050 @end example
5051
5052
5053 @cindex whole rests for a full measure 
5054
5055 @seealso
5056
5057 Program reference: @internalsref{MultiMeasureRestEvent},
5058 @internalsref{MultiMeasureTextEvent},
5059 @internalsref{MultiMeasureRestMusicGroup}, and
5060 @internalsref{MultiMeasureRest}.
5061
5062 The layout object @internalsref{MultiMeasureRestNumber} is for the
5063 default number, and @internalsref{MultiMeasureRestText} for user
5064 specified texts.
5065
5066 @refbugs
5067
5068 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
5069 over multi-measure rests.
5070
5071 @cindex condensing rests
5072
5073 There is no way to automatically condense multiple rests into a single
5074 multimeasure rest. Multi measure rests do not take part in rest
5075 collisions.
5076
5077 Be careful when entering multimeasure rests followed by whole
5078 notes. The following will enter two notes lasting four measures each
5079 @example
5080  R1*4 cis cis 
5081 @end example
5082 When @code{skipBars} is set, the result will look OK, but the bar
5083 numbering will be off.
5084
5085 @node Automatic part combining
5086 @subsection Automatic part combining
5087 @cindex automatic part combining
5088 @cindex part combiner
5089
5090
5091 Automatic part combining is used to merge two parts of music onto a
5092 staff.  It is aimed at typesetting orchestral scores.  When the two
5093 parts are identical for a period of time, only one is shown.  In
5094 places where the two parts differ, they are typeset as separate
5095 voices, and stem directions are set automatically.  Also, solo and
5096 @emph{a due} parts are identified and can be marked.
5097
5098 The syntax for part combining is
5099
5100 @example
5101   \partcombine @var{musicexpr1} @var{musicexpr2}
5102 @end example
5103
5104 The music expressions will be interpreted as @internalsref{Voice}
5105 contexts. If using relative octaves, @code{\relative} should be
5106 specified for both music expressions, i.e.
5107
5108 @example
5109 \partcombine \relative @dots{}  @var{musicexpr1}
5110   \relative @dots{} @var{musicexpr2}
5111 @end example
5112
5113 @noindent
5114 A @code{\relative} section that is outside of @code{\partcombine} has
5115 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
5116
5117
5118 The following example demonstrates the basic functionality of the part
5119 combiner: putting parts on one staff, and setting stem directions and
5120 polyphony
5121
5122 @lilypond[quote,verbatim,raggedright,fragment]
5123 \new Staff \partcombine
5124   \relative g' { g g a( b) c c r r }
5125   \relative g' { g g r4 r e e g g }
5126 @end lilypond
5127
5128 The first @code{g} appears only once, although it was
5129 specified twice (once in each part).  Stem, slur and tie directions are
5130 set automatically, depending whether there is a solo or unisono. The
5131 first part (with context called @code{one}) always gets up stems, and
5132 `solo', while the second (called @code{two}) always gets down stems and
5133 `Solo II'.
5134
5135 If you just want the merging parts, and not the textual markings, you
5136 may set the property @code{soloADue} to false
5137
5138 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
5139 \new Staff <<
5140   \set Staff.soloADue = ##f
5141   \partcombine
5142     \relative g' { g a( b) r }
5143     \relative g' { g r4 r f }
5144 >>
5145 @end lilypond
5146
5147 @seealso
5148
5149 Program reference: @internalsref{PartCombineMusic},
5150 @internalsref{SoloOneEvent}, and
5151 @internalsref{SoloTwoEvent}, and
5152 @internalsref{UnisonoEvent}.
5153
5154 @refbugs
5155
5156 In @code{soloADue} mode, when the two voices play the same notes on and
5157 off, the part combiner may typeset @code{a2} more than once in a
5158 measure.
5159
5160 @code{\partcombine} cannot be inside @code{\times}. 
5161
5162 @code{\partcombine} cannot be inside @code{\relative}. 
5163
5164 Internally, the @code{\partcombine} interprets both arguments as
5165 @code{Voice}s named @code{one} and @code{two}, and then decides when
5166 the parts can be combined. Consequently, if the arguments switch to
5167 differently named @internalsref{Voice} contexts, the events in those
5168 will be ignored.
5169
5170 @node Hiding staves
5171 @subsection Hiding staves
5172
5173 @cindex Frenched scores
5174 @cindex Hiding staves
5175
5176 In orchestral scores, staff lines that only have rests are usually
5177 removed.  This saves some space. This style is called `French Score'.
5178 For @internalsref{Lyrics}, 
5179 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
5180 switched on by default.  When these line of these contexts turn out
5181 empty after the line-breaking process, they are removed.
5182
5183 For normal staves, a specialized @internalsref{Staff} context is
5184 available, which does the same: staves containing nothing (or only
5185 multi measure rests) are removed. The context definition is stored in
5186 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
5187 in this example disappears in the second line
5188
5189
5190 @lilypond[quote,verbatim]
5191   \paper {
5192     linewidth = 6.\cm 
5193     \context { \RemoveEmptyStaffContext }
5194   }
5195
5196 {
5197   \relative c' <<
5198     \new Staff { e4 f g a \break c1 }
5199     \new Staff { c4 d e f \break R1 }
5200   >>
5201 }
5202 @end lilypond
5203
5204 The first page shows all staves in full. If empty staves should be
5205 removed from the first page too, set @code{remove-first} to false in
5206 @internalsref{RemoveEmptyVerticalGroup}.
5207
5208 Another application is making ossia sections, i.e. alternative
5209 melodies on a separate piece of staff, with help of a Frenched
5210 staff. See @inputfileref{input/test,ossia.ly} for an example.
5211
5212
5213 @node Different editions from one source
5214 @subsection Different editions from one source
5215
5216 The @code{\tag} command marks music expressions with a name. These
5217 tagged expressions can be filtered out later.  With this mechanism it
5218 is possible to make different versions of the same music source.
5219
5220 In the following example, we see two versions of a piece of music, one
5221 for the full score, and one with cue notes for the instrumental part
5222
5223 @example
5224   c1
5225   \relative c' <<
5226     \tag #'part <<
5227       R1 \\
5228       @{
5229         \set fontSize = #-1
5230         c4_"cue" f2 g4 @} 
5231     >>
5232     \tag #'score R1
5233   >>
5234   c1
5235 @end example
5236
5237 The same can be applied to articulations, texts, etc.: they are
5238 made by prepending
5239 @example
5240         -\tag #@var{your-tag} 
5241 @end example
5242 to an articulation, for example, 
5243 @example
5244     c1-\tag #'part ^4
5245 @end example
5246
5247 This defines a note with a conditional fingering indication.
5248
5249 By applying the @code{remove-tag} function, tagged expressions can be
5250 filtered. For example,
5251 @example
5252 \simultaneous @{
5253   @var{the music}
5254   \applymusic #(remove-tag 'score) @var{the music}
5255   \applymusic #(remove-tag 'part) @var{the music}
5256 @}
5257 @end example
5258 would yield
5259
5260 @lilypondfile[quote]{tag-filter.ly}
5261
5262 The argument of the @code{\tag} command should be a symbol, or a list
5263 of symbols, for example,
5264 @example
5265   \tag #'(original-part transposed-part) @dots{}
5266 @end example
5267
5268 @seealso
5269
5270 Examples: @inputfileref{input/regression,tag-filter.ly}.
5271
5272
5273 @node Quoting other voices
5274 @subsection Quoting other voices
5275
5276 With quotations, fragments of other parts can be inserted into a part
5277 directly. Before a part can be quoted, it must be marked especially as
5278 quotable. This is done with code @code{\addquote} command. The
5279 quotation may then be done with @code{\quote}
5280
5281 @example
5282 \addquote @var{name} @var{music}
5283 \quote @var{name} @var{duration}  
5284 @end example
5285
5286 @noindent
5287
5288 Here, @var{name} is an identifying string. The @var{music} is any kind
5289 of music.  This is an example of @code{\addquote}
5290
5291 @verbatim
5292 \addquote clarinet \relative c' {
5293   f4 fis g gis
5294 }
5295 @end verbatim
5296
5297 During a part, a piece of music can be quoted with the @code{\quote}
5298 command. 
5299   
5300 @example
5301 \quote clarinet 2.
5302 @end example
5303
5304 This would cite 3 quarter notes (a dotted half note) of the previously
5305 added clarinet voice.
5306
5307 Quotations take into account the transposition both source and target
5308 instruments, if they are specified using the @code{\transposition} command.
5309
5310 @lilypond[quote,raggedright,verbatim]
5311 \addquote clarinet \relative c' {
5312   \transposition bes
5313   f4 fis g gis
5314 }
5315
5316 {
5317   e'8 f'8 \quote clarinet 2
5318 }
5319 @end lilypond
5320
5321 @refbugs
5322
5323 Only the contents of the first @internalsref{Voice} occurring in an
5324 @code{\addquote} command will be considered for quotation, so
5325 @var{music} can not contain @code{\new} and @code{\context Voice}
5326 statements that would switch to a different Voice.
5327
5328
5329 @seealso
5330
5331 In this manual: @ref{Instrument transpositions}.
5332
5333 Examples: @inputfileref{input/regression,quote.ly}
5334 @inputfileref{input/regression,quote-transposition.ly}
5335
5336 Program reference: @internalsref{QuoteMusic}.
5337
5338 @node Formatting cue notes
5339 @section Formatting cue notes
5340
5341
5342 The previous section deals with inserting notes from another
5343 voice. When making a part, these notes need to be specially formatted.
5344 Here is an example of formatted cue notes
5345
5346 @lilypond[verbatim]
5347 smaller = {
5348     \set fontSize = #-1
5349     \override Stem  #'length = #5.5
5350     \override Beam  #'thickness = #0.384
5351     \override Beam  #'space-function =
5352     #(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))
5353 }
5354
5355 {
5356     \set Staff.instrument = #"Horn in F"
5357     \set Score.skipBars = ##t
5358     R1*21
5359     << {
5360             \once \override Staff.MultiMeasureRest  #'staff-position = #-6
5361             R1
5362         }
5363         \new Voice {
5364             s2
5365             \clef tenor
5366             \smaller
5367             r8^"Bsn." c'8  f'8[ f'8]
5368             \clef treble
5369         }
5370     >>
5371     c'8^"Horn" cis'
5372     eis'4 fis'4
5373 }
5374 @end lilypond
5375
5376
5377 There are a couple of points to take care of:
5378
5379 @itemize @bullet
5380 @item
5381 The multi rest of the original part should be moved up or down during
5382 the cue.
5383 @item
5384 Cue notes have smaller font sizes.
5385 @item
5386 When cued notes have a clef change relative to the original part, the
5387 clef should be restored after the cue section. This minimizes
5388 confusion for the reader,
5389 @item
5390 When the original part starts, this should be marked with the name of
5391 the instrument, in this case ``Horn.''   Of course, the cue part is
5392 marked with the instrument playing the cue.
5393 @end itemize
5394  
5395
5396
5397 @node Ancient notation
5398 @section Ancient notation
5399
5400 @cindex Vaticana, Editio
5401 @cindex Medicaea, Editio
5402 @cindex hufnagel
5403 @cindex Petrucci
5404 @cindex mensural
5405
5406 Support for ancient notation includes features for mensural notation
5407 and Gregorian Chant notation.  There is also limited support for
5408 figured bass notation.
5409
5410 Many graphical objects provide a @code{style} property, see
5411 @ref{Ancient note heads}, @ref{Ancient accidentals}, @ref{Ancient
5412 rests}, @ref{Ancient clefs}, @ref{Ancient flags} and @ref{Ancient time
5413 signatures}.  By manipulating such a grob property, the typographical
5414 appearance of the affected graphical objects can be accommodated for a
5415 specific notation flavor without need for introducing any new
5416 notational concept.
5417
5418 Other aspects of ancient notation can not that easily be expressed as
5419 in terms of just changing a style property of a graphical object.
5420 Therefore, some notational concepts are introduced specifically for
5421 ancient notation, see @ref{Custodes}, @ref{Divisiones},
5422 @ref{Ligatures}, and @ref{Figured bass}.
5423
5424
5425 @menu
5426 * Ancient note heads::          
5427 * Ancient accidentals::         
5428 * Ancient rests::               
5429 * Ancient clefs::               
5430 * Ancient flags::               
5431 * Ancient time signatures::     
5432 * Custodes::                    
5433 * Divisiones::                  
5434 * Ligatures::                   
5435 * Vaticana style contexts::     
5436 * Figured bass::                
5437 @end menu
5438
5439 If this all is way too much of documentation for you, and you just
5440 want to dive into typesetting without worrying too much about the
5441 details on how to customize a context, you may have a look at the
5442 predefined contexts (see @ref{Vaticana style contexts}).  Use them to
5443 set up predefined style-specific voice and staff contexts, and
5444 directly go ahead with the note entry.
5445
5446 @refbugs
5447
5448 Ligatures need special spacing that has not yet been implemented.  As
5449 a result, there is too much space between ligatures most of the time,
5450 and line breaking often is unsatisfactory.  Also, lyrics do not
5451 correctly align with ligatures.
5452
5453 Accidentals must not be printed within a ligature, but instead need to
5454 be collected and printed in front of it.
5455
5456 Augmentum dots within ligatures are  not handled correctly.
5457
5458
5459 @node Ancient note heads
5460 @subsection Ancient note heads
5461
5462 @cindex note heads
5463
5464
5465 For ancient notation, a note head style other than the @code{default}
5466 style may be chosen.  This is accomplished by setting the @code{style}
5467 property of the NoteHead object to the desired value (@code{baroque},
5468 @code{neomensural} or @code{mensural}).  The @code{baroque} style
5469 differs from the @code{default} style only in using a square shape for
5470 @code{\breve} note heads.  The @code{neomensural} style differs from
5471 the @code{baroque} style in that it uses rhomboidal heads for whole
5472 notes and all smaller durations.  Stems are centered on the note
5473 heads.  This style is in particular useful when transcribing mensural
5474 music, e.g. for the incipit.  The @code{mensural} style finally
5475 produces note heads that mimic the look of note heads in historic
5476 printings of the 16th century.
5477
5478 The following example demonstrates the @code{neomensural} style
5479
5480 @lilypond[quote,fragment,raggedright,verbatim]
5481 \override NoteHead #'style = #'neomensural
5482 a'\longa a'\breve a'1 a'2 a'4 a'8 a'16
5483 @end lilypond
5484
5485 When typesetting a piece in Gregorian Chant notation, a Gregorian
5486 ligature engraver will automatically select the proper note heads,
5487 such there is no need to explicitly set the note head style.  Still,
5488 the note head style can be set e.g. to @code{vaticana_punctum} to
5489 produce punctum neumes.  Similarly, a mensural ligature engraver is
5490 used to automatically assemble mensural ligatures.  See
5491 @ref{Ligatures} for how ligature engravers work.
5492
5493 @seealso
5494
5495 In this manual
5496 @ref{Percussion staves} use note head styles of their own that are
5497 frequently used in contemporary music notation.
5498
5499 Examples: @inputfileref{input/regression,note-head-style.ly} gives an
5500 overview over all available note head styles.
5501
5502
5503 @node Ancient accidentals
5504 @subsection Ancient accidentals
5505
5506 @cindex accidentals
5507
5508
5509 Use the @code{style} property of grob @internalsref{Accidental} to
5510 select ancient accidentals.   Supported styles are
5511 @code{mensural}, @code{vaticana}, @code{hufnagel} and @code{medicaea}.
5512
5513 @lilypond[quote,raggedright,staffsize=26]
5514 \score {
5515     {
5516         \fatText
5517         s
5518         ^\markup {
5519             \column <
5520                 "vaticana" 
5521                 { " " \musicglyph #"accidentals-vaticana-1"
5522                   " " \musicglyph #"accidentals-vaticana0" }
5523             >
5524             \column <
5525                 "medicaea"
5526                 { " " \musicglyph #"accidentals-medicaea-1" }
5527             >
5528             \column <
5529                 "hufnagel"
5530                 { " " \musicglyph #"accidentals-hufnagel-1" }
5531             >
5532             \column <
5533                 "mensural"
5534                 { " " \musicglyph #"accidentals-mensural-1"
5535                   " " \musicglyph #"accidentals-mensural1" }
5536             >
5537         }
5538     }
5539     \paper {
5540         raggedright = ##t 
5541         interscoreline = 1
5542         \context {
5543             \Score
5544             \remove "Bar_number_engraver"
5545         }
5546         \context{
5547             \Staff
5548             \remove "Clef_engraver"
5549             \remove "Key_engraver"
5550             \remove "Time_signature_engraver"
5551             \remove "Staff_symbol_engraver"
5552             minimumVerticalExtent = ##f
5553         }
5554     }
5555 }
5556 @end lilypond
5557
5558 As shown, not all accidentals are supported by each style.  When
5559 trying to access an unsupported accidental, LilyPond will switch to a
5560 different style, as demonstrated in
5561 @inputfileref{input/test,ancient-accidentals.ly}.
5562
5563 Similarly to local accidentals, the style of the key signature can be
5564 controlled by the @code{style} property of the
5565 @internalsref{KeySignature} grob.
5566
5567 @seealso
5568
5569 In this manual: @ref{Pitches}, @ref{Chromatic alterations} and
5570 @ref{Accidentals} give a general introduction into the use of
5571 accidentals.  @ref{Key signature} gives a general introduction into
5572 the use of key signatures.
5573
5574 Program reference: @internalsref{KeySignature}.
5575
5576 Examples: @inputfileref{input/test,ancient-accidentals.ly}.
5577
5578 @node Ancient rests
5579 @subsection Ancient rests
5580
5581 @cindex rests
5582
5583
5584 Use the @code{style} property of grob @internalsref{Rest} to select
5585 ancient accidentals.   Supported styles are @code{classical},
5586 @code{neomensural} and @code{mensural}.  @code{classical} differs
5587 from the @code{default} style only in that the quarter rest looks like
5588 a horizontally mirrored 8th rest.  The @code{neomensural} style suits
5589 well for e.g. the incipit of a transcribed mensural piece of music.
5590 The @code{mensural} style finally mimics the appearance of rests as
5591 in historic prints of the 16th century.
5592
5593 The following example demonstrates the @code{neomensural} style
5594
5595 @lilypond[quote,fragment,raggedright,verbatim]
5596 \override Rest #'style = #'neomensural
5597 r\longa r\breve r1 r2 r4 r8 r16
5598 @end lilypond
5599
5600 There are no 32th and 64th rests specifically for the mensural or
5601 neo-mensural style.  Instead, the rests from the default style will be
5602 taken.  See @inputfileref{input/test,rests.ly} for a chart of all
5603 rests.
5604
5605 There are no rests in Gregorian Chant notation; instead, it uses
5606 @ref{Divisiones}.
5607
5608 @seealso
5609
5610 In this manual: @ref{Rests} gives a general introduction into the use of rests.
5611
5612
5613 @node Ancient clefs
5614 @subsection Ancient clefs
5615
5616 @cindex clefs
5617
5618
5619 LilyPond supports a variety of clefs, many of them ancient.
5620
5621 The following table shows all ancient clefs that are supported via the
5622 @code{\clef} command.  Some of the clefs use the same glyph, but
5623 differ only with respect to the line they are printed on.  In such
5624 cases, a trailing number in the name is used to enumerate these clefs.
5625 Still, you can manually force a clef glyph to be typeset on an
5626 arbitrary line, as described in @ref{Clef}.  The note printed to the
5627 right side of each clef in the example column denotes the @code{c'}
5628 with respect to that clef.
5629
5630 @multitable @columnfractions   .4 .4 .2
5631
5632 @item
5633 @b{Description} @tab
5634 @b{Supported Clefs} @tab
5635 @b{Example}
5636
5637 @item
5638 modern style mensural C clef @tab
5639 @code{neomensural_c1}, @code{neomensural_c2},
5640 @code{neomensural_c3}, @code{neomensural_c4} @tab
5641 @lilypond[fragment,quote,relative=1,notime]
5642
5643 \clef "neomensural_c2" c
5644 @end lilypond
5645
5646 @item
5647 petrucci style mensural C clefs, for use  on different  staff lines
5648 (the examples shows the 2nd staff line C clef).
5649
5650 @tab
5651 @code{petrucci_c1}
5652 @code{petrucci_c2}
5653 @code{petrucci_c3}
5654 @code{petrucci_c4}
5655 @code{petrucci_c5}
5656
5657 @tab
5658 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5659
5660 \clef "petrucci_c2" c
5661 @end lilypond
5662
5663 @item
5664 petrucci style mensural F clef @tab
5665 @code{petrucci_f} @tab
5666 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5667
5668 \clef "petrucci_f" c
5669 @end lilypond
5670
5671 @item
5672 petrucci style mensural G clef @tab
5673 @code{petrucci_g} @tab
5674 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5675
5676 \clef "petrucci_g" c
5677 @end lilypond
5678
5679 @item
5680 historic style mensural C clef @tab
5681 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
5682 @code{mensural_c4} @tab
5683 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5684
5685 \clef "mensural_c2" c
5686 @end lilypond
5687
5688 @item
5689 historic style mensural F clef @tab
5690 @code{mensural_f} @tab
5691 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5692
5693 \clef "mensural_f" c
5694 @end lilypond
5695
5696 @item
5697 historic style mensural G clef @tab
5698 @code{mensural_g} @tab
5699 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5700
5701 \clef "mensural_g" c
5702 @end lilypond
5703
5704 @item
5705 Editio Vaticana style do clef @tab
5706 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
5707 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5708     \override Staff.StaffSymbol   #'line-count = #4
5709
5710 \clef "vaticana_do2" c
5711 @end lilypond
5712
5713 @item
5714 Editio Vaticana style fa clef @tab
5715 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
5716 @lilypond[quote,relative=1,notime,indent=0.0\mm,fragment]
5717     \override Staff.StaffSymbol   #'line-count = #4
5718
5719 \clef "vaticana_fa2" c
5720 @end lilypond
5721
5722 @item
5723 Editio Medicaea style do clef @tab
5724 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
5725 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5726     \override Staff.StaffSymbol   #'line-count = #4
5727
5728 \clef "medicaea_do2" c
5729 @end lilypond
5730
5731 @item
5732 Editio Medicaea style fa clef @tab
5733 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
5734 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5735     \override Staff.StaffSymbol   #'line-count = #4
5736
5737 \clef "medicaea_fa2" c
5738 @end lilypond
5739
5740 @item
5741 historic style hufnagel do clef @tab
5742 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
5743 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5744     \override Staff.StaffSymbol   #'line-count = #4
5745
5746 \clef "hufnagel_do2" c
5747 @end lilypond
5748
5749 @item
5750 historic style hufnagel fa clef @tab
5751 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
5752 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5753     \override Staff.StaffSymbol   #'line-count = #4
5754
5755 \clef "hufnagel_fa2" c
5756 @end lilypond
5757
5758 @item
5759 historic style hufnagel combined do/fa clef @tab
5760 @code{hufnagel_do_fa} @tab
5761 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5762 \clef "hufnagel_do_fa" c
5763 @end lilypond
5764
5765 @end multitable
5766
5767
5768
5769 @emph{Modern style} means ``as is typeset in contemporary editions of
5770 transcribed mensural music''.
5771
5772 @emph{Petrucci style} means ``inspired by printings published by the
5773 famous engraver Petrucci (1466-1539)''.
5774
5775 @emph{Historic style} means ``as was typeset or written in historic
5776 editions (other than those of Petrucci)''.
5777
5778 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
5779
5780 Petrucci used C clefs with differently balanced left-side vertical
5781 beams, depending on which staff line it is printed.
5782
5783 @seealso
5784
5785 In this manual: see @ref{Clef}.
5786
5787 @refbugs
5788
5789 The mensural g clef is mapped to the Petrucci g clef, until a new
5790 mensural g clef is implemented.
5791
5792
5793
5794 @node Ancient flags
5795 @subsection Ancient flags
5796
5797 @cindex flags
5798
5799
5800 Use the @code{flag-style} property of grob @internalsref{Stem} to
5801 select ancient flags.  Besides the @code{default} flag style,
5802  only @code{mensural} style is supported
5803
5804 @lilypond[quote,fragment,raggedright,verbatim]
5805 \override Stem #'flag-style = #'mensural
5806 \override Stem #'thickness = #1.0
5807 \override NoteHead #'style = #'mensural
5808 \autoBeamOff
5809 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
5810 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5811 @end lilypond
5812
5813 Note that the innermost flare of each mensural flag always is
5814 vertically aligned with a staff line.  If you do not like this
5815 behavior, you can set the @code{adjust-if-on-staffline} property of
5816 grob @internalsref{Stem} to @code{##f}.  Then, the vertical position
5817 of the end of each flare is different between notes on staff lines and
5818 notes between staff lines
5819
5820 @lilypond[quote,fragment,raggedright]
5821 \override Stem #'flag-style = #'mensural
5822 \override Stem #'thickness = #1.0
5823 \override Stem #'adjust-if-on-staffline = ##f
5824 \override NoteHead #'style = #'mensural
5825 \autoBeamOff
5826 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
5827 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5828 @end lilypond
5829
5830 There is no particular flag style for neo-mensural notation.  Hence,
5831 when typesetting e.g. the incipit of a transcribed piece of mensural
5832 music, the default flag style should be used.  There are no flags in
5833 Gregorian Chant notation.
5834
5835
5836 @node Ancient time signatures
5837 @subsection Ancient time signatures
5838
5839 @cindex time signatures
5840
5841
5842 There is limited support for mensural time signatures.   The
5843 glyphs are hard-wired to particular time fractions.  In other words,
5844 to get a particular mensural signature glyph with the @code{\time n/m}
5845 command, @code{n} and @code{m} have to be chosen according to the
5846 following table
5847
5848 @lilypond[quote]
5849 \paper {
5850     indent = 0.0
5851     raggedright = ##t
5852     \context {
5853         \Staff
5854         \remove Staff_symbol_engraver
5855         \remove Clef_engraver
5856         \remove Time_signature_engraver
5857     }
5858 } {
5859     \set Score.timing = ##f
5860     \set Score.barAlways = ##t
5861     s_\markup { "$\\backslash$time 4/4" }
5862      ^\markup { "       " \musicglyph #"timesig-neomensural4/4" }
5863     s
5864     s_\markup { "$\\backslash$time 2/2" }
5865      ^\markup { "       " \musicglyph #"timesig-neomensural2/2" }
5866     s
5867     s_\markup { "$\\backslash$time 6/4" }
5868      ^\markup { "       " \musicglyph #"timesig-neomensural6/4" }
5869     s
5870     s_\markup { "$\\backslash$time 6/8" }
5871      ^\markup { "       " \musicglyph #"timesig-neomensural6/8" }
5872     \break
5873     s_\markup { "$\\backslash$time 3/2" }
5874      ^\markup { "       " \musicglyph #"timesig-neomensural3/2" }
5875     s
5876     s_\markup { "$\\backslash$time 3/4" }
5877      ^\markup { "       " \musicglyph #"timesig-neomensural3/4" }
5878     s
5879     s_\markup { "$\\backslash$time 9/4" }
5880      ^\markup { "       " \musicglyph #"timesig-neomensural9/4" }
5881     s
5882     s_\markup { "$\\backslash$time 9/8" }
5883      ^\markup { "       " \musicglyph #"timesig-neomensural9/8" }
5884     \break
5885     s_\markup { "$\\backslash$time 4/8" }
5886      ^\markup { "       " \musicglyph #"timesig-neomensural4/8" }
5887     s
5888     s_\markup { "$\\backslash$time 2/4" }
5889      ^\markup { "       " \musicglyph #"timesig-neomensural2/4" }
5890     \break
5891 }
5892 @end lilypond
5893
5894 Use the @code{style} property of grob @internalsref{TimeSignature} to
5895 select ancient time signatures.  Supported styles are
5896 @code{neomensural} and @code{mensural}.  The above table uses the
5897 @code{neomensural} style.  This style is appropriate e.g. for the
5898 incipit of transcriptions of mensural pieces.  The @code{mensural}
5899 style mimics the look of historical printings of the 16th century.
5900
5901 The following examples shows the differences in style,
5902 @lilypond[raggedright]
5903 {
5904   \time 2/2
5905   c1^\markup { \hspace #-2.0 \typewriter default }
5906
5907   \override Staff.TimeSignature #'style = #'numbered  
5908   \time 2/2
5909   c1^\markup { \hspace #-2.0 \typewriter numbered }
5910
5911   \override Staff.TimeSignature #'style = #'mensural
5912   \time 2/2
5913   c1^\markup { \hspace #-2.0 \typewriter mensural }
5914   
5915   \override Staff.TimeSignature #'style = #'neomensural
5916   \time 2/2
5917   c1^\markup { \hspace #-2.0 \typewriter neomensural }
5918   \override Staff.TimeSignature #'style = #'single-digit
5919   \time 2/2
5920   c1^\markup { \hspace #-2.0 \typewriter single-digit }
5921 }
5922 @end lilypond
5923
5924 @seealso
5925
5926 This manual: @ref{Time signature} gives a general introduction into
5927 the use of time signatures.
5928
5929 @refbugs
5930
5931 Ratios of note durations do not change with the time signature. For
5932 example, the ratio of 1 brevis = 3 semibrevis (tempus perfectum) must
5933 be made by hand, by setting
5934
5935 @example
5936   breveTP = #(ly:make-duration -1 0 3 2)
5937 @end example
5938
5939 @noindent
5940 This sets breveTP to 3/2 times 2 = 3 times a whole note. 
5941
5942 The @code{old6/8alt} symbol (an alternate   symbol for 6/8) is not
5943 addressable with @code{\time}. Use a @code{\markup} instead
5944
5945 @node Custodes
5946 @subsection Custodes
5947
5948 @cindex custos
5949 @cindex custodes
5950
5951 A @emph{custos} (plural: @emph{custodes}; Latin word for `guard') is a
5952 symbol that appears at the end of a staff.  It anticipates the pitch
5953 of the first note(s) of the following line and thus helps the player
5954 or singer to manage line breaks during performance, thus enhancing
5955 readability of a score.
5956
5957 Custodes were frequently used in music notation until the 17th
5958 century.  Nowadays, they have survived only in a few particular forms
5959 of musical notation such as contemporary editions of Gregorian chant
5960 like the @emph{editio vaticana}.  There are different custos glyphs
5961 used in different flavors of notational style.
5962
5963 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
5964 @internalsref{Staff} context when declaring the @code{\paper} block,
5965 as shown in the following example
5966
5967 @example
5968 \paper @{
5969   \context @{
5970      \Staff
5971      \consists Custos_engraver
5972      Custos \override #'style = #'mensural
5973   @}
5974 @}
5975 @end example
5976
5977 The result looks like this
5978
5979 @lilypond[quote,raggedright]
5980 \score {
5981      {
5982         a'1
5983         \override Staff.Custos #'style = #'mensural
5984         \break
5985         g'
5986     }
5987     \paper {
5988         \context {
5989             \Staff
5990             \consists Custos_engraver
5991         }
5992     }
5993 }
5994 @end lilypond
5995
5996 The custos glyph is selected by the @code{style} property. The styles
5997 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
5998 @code{mensural}.  They are demonstrated in the following fragment
5999
6000 @lilypond[quote]
6001 \score {
6002        \new Lyrics    \lyrics {
6003         \markup {
6004             \column <
6005                 "vaticana" 
6006                 { " " \musicglyph #"custodes-vaticana-u0" }
6007             > }
6008         \markup {    \column <
6009                 "medicaea"
6010                 { " " \musicglyph #"custodes-medicaea-u0" }
6011             >}
6012             \markup {
6013             \column <
6014                 "hufnagel"
6015                 { " " \musicglyph #"custodes-hufnagel-u0" }
6016             >}
6017             \markup {
6018             \column <
6019                 "mensural"
6020                 { " " \musicglyph #"custodes-mensural-u0" }
6021             >}
6022         }
6023     
6024     \paper {
6025         raggedright = ##t 
6026         }      
6027 }
6028 @end lilypond
6029
6030 @seealso
6031
6032 Program reference: @internalsref{Custos}.
6033
6034 Examples: @inputfileref{input/regression,custos.ly}.
6035
6036
6037 @node Divisiones
6038 @subsection Divisiones
6039
6040 @cindex divisio
6041 @cindex divisiones
6042 @cindex finalis
6043
6044 A @emph{divisio} (plural: @emph{divisiones}; Latin word for
6045 `division') is a staff context symbol that is used to structure
6046 Gregorian music into phrases and sections.  The musical meaning of
6047 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
6048 can be characterized as short, medium and long pause, somewhat like
6049 @ref{Breath marks}.  The @emph{finalis} sign not only marks the end of
6050 a chant, but is also frequently used within a single
6051 antiphonal/responsorial chant to mark the end of each section.
6052
6053
6054 To use divisiones, include the file @code{gregorian-init.ly}.  It
6055 contains definitions that you can apply by just inserting
6056 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
6057 and @code{\finalis} at proper places in the input.  Some editions use
6058 @emph{virgula} or @emph{caesura} instead of divisio minima.
6059 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
6060 @code{\caesura}
6061
6062 @lilypondfile[quote,raggedright]{divisiones.ly}
6063
6064 @refcommands
6065
6066 @cindex @code{\virgula}
6067 @code{\virgula},
6068 @cindex @code{\caesura}
6069 @code{\caesura},
6070 @cindex @code{\divisioMinima}
6071 @code{\divisioMinima},
6072 @cindex @code{\divisioMaior}
6073 @code{\divisioMaior},
6074 @cindex @code{\divisioMaxima}
6075 @code{\divisioMaxima},
6076 @cindex @code{\finalis}
6077 @code{\finalis}.
6078
6079 @seealso
6080
6081 In this manual: @ref{Breath marks}.
6082
6083 Program reference: @internalsref{BreathingSign}, @internalsref{BreathingSignEvent}.
6084
6085 Examples: @inputfileref{input/test,divisiones.ly}.
6086
6087 @node Ligatures
6088 @subsection Ligatures
6089
6090 @cindex Ligatures
6091
6092 @c TODO: Should double check if I recalled things correctly when I wrote
6093 @c down the following paragraph by heart.
6094
6095 A ligature is a coherent graphical symbol that represents at least two
6096 distinct notes.  Ligatures originally appeared in the manuscripts of
6097 Gregorian chant notation roughly since the 9th century to denote
6098 ascending or descending sequences of notes.  
6099
6100 Ligatures are entered by enclosing them in @code{\[} and @code{\]}.
6101 Some ligature styles may need additional input syntax specific for
6102 this particular type of ligature.  By default, the
6103 @internalsref{LigatureBracket} engraver just puts a square bracket
6104 above the ligature
6105
6106 @lilypond[quote,raggedright,verbatim]
6107 \transpose c c' {
6108     \[ g c a f d' \]
6109     a g f
6110     \[ e f a g \]
6111 }
6112 @end lilypond
6113
6114 To select a specific style of ligatures, a proper ligature engraver
6115 has to be added to the @internalsref{Voice} context, as explained in
6116 the following subsections.   Only white mensural ligatures
6117 are supported with certain limitations.
6118
6119 @menu
6120 * White mensural ligatures::    
6121 * Gregorian square neumes ligatures::  
6122 @end menu
6123
6124 @node White mensural ligatures
6125 @subsubsection White mensural ligatures
6126
6127 @cindex Mensural ligatures
6128 @cindex White mensural ligatures
6129
6130 There is limited support for white mensural ligatures.  
6131
6132 To engrave white mensural ligatures, in the paper block the
6133 @internalsref{Mensural_ligature_engraver} has to be put into the
6134 @internalsref{Voice} context, and remove the
6135 @internalsref{Ligature_bracket_engraver}
6136
6137 @example
6138     \paper @{
6139         \context @{
6140             \Voice
6141             \remove Ligature_bracket_engraver
6142             \consists Mensural_ligature_engraver
6143         @}
6144     @}
6145 @end example
6146
6147 There is no additional input language to describe the shape of a
6148 white mensural ligature.  The shape is rather determined solely from
6149 the pitch and duration of the enclosed notes.  While this approach may
6150 take a new user a while to get accustomed, it has the great advantage
6151 that the full musical information of the ligature is known internally.
6152 This is not only required for correct MIDI output, but also allows for
6153 automatic transcription of the ligatures.
6154
6155 For example,
6156
6157 @example
6158         \set Score.timing = ##f
6159         \set Score.defaultBarType = "empty"
6160         \override NoteHead #'style = #'neomensural
6161         \override Staff.TimeSignature   #'style = #'neomensural
6162         \clef "petrucci_g"
6163         \[ g\longa c\breve a\breve f\breve d'\longa \]
6164         s4
6165         \[ e1 f1 a\breve g\longa \]
6166 @end example
6167 @lilypond[quote,raggedright]
6168 \score {
6169     \transpose c c' {
6170         \set Score.timing = ##f
6171         \set Score.defaultBarType = "empty"
6172         \override NoteHead #'style = #'neomensural
6173         \override Staff.TimeSignature   #'style = #'neomensural
6174         \clef "petrucci_g"
6175         \[ g\longa c\breve a\breve f\breve d'\longa \]
6176         s4
6177         \[ e1 f1 a\breve g\longa \]
6178     }
6179     \paper {
6180         \context {
6181             \Voice
6182             \remove Ligature_bracket_engraver
6183             \consists Mensural_ligature_engraver
6184         }
6185     }
6186 }
6187 @end lilypond
6188
6189 Without replacing @internalsref{Ligature_bracket_engraver} with
6190 @internalsref{Mensural_ligature_engraver}, the same music transcribes
6191 to the following
6192
6193 @lilypond[quote,raggedright]
6194 \transpose c c' {
6195         \set Score.timing = ##f
6196         \set Score.defaultBarType = "empty"
6197         \override NoteHead #'style = #'neomensural
6198         \override Staff.TimeSignature   #'style = #'neomensural
6199         \clef "petrucci_g"
6200         \[ g\longa c\breve a\breve f\breve d'\longa \]
6201         s4
6202         \[ e1 f1 a\breve g\longa \]
6203 }
6204 @end lilypond
6205
6206 @refbugs
6207
6208 The implementation is experimental; it may output strange warnings or
6209 even crash in some cases or produce weird results on more complex
6210 ligatures.
6211
6212 @node Gregorian square neumes ligatures
6213 @subsubsection Gregorian square neumes ligatures
6214
6215 @cindex Square neumes ligatures
6216 @cindex Gregorian square neumes ligatures
6217
6218 Gregorian square neumes notation (following the style of the Editio
6219 Vaticana) is under heavy development, but not yet really usable for
6220 production purposes.  Core ligatures can already be typeset, but
6221 essential issues for serious typesetting are still under development,
6222 such as (among others) horizontal alignment of multiple ligatures,
6223 lyrics alignment and proper accidentals handling.  Still, this section
6224 gives a sneak preview of what Gregorian chant may look like once it
6225 will work.
6226
6227 The following table contains the extended neumes table of the 2nd
6228 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
6229 1983 by the monks of Solesmes.
6230
6231 @multitable @columnfractions .4 .2 .2 .2
6232
6233 @item
6234 @b{Neuma aut@*Neumarum Elementa} @tab
6235 @b{Figurae@*Rectae} @tab
6236 @b{Figurae@*Liquescentes Auctae} @tab
6237 @b{Figurae@*Liquescentes Deminutae}
6238
6239 @c TODO: \paper block is identical in all of the below examples.
6240 @c Therefore, it should somehow be included rather than duplicated all
6241 @c the time. --jr
6242
6243 @c why not make identifiers in ly/engraver-init.ly? --hwn
6244
6245 @c Because it's just used to typeset plain notes without
6246 @c a staff for demonstration purposes rather than something
6247 @c special of Gregorian chant notation. --jr
6248
6249 @item
6250 @code{1. Punctum}
6251 @tab
6252 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.5\cm]
6253 \include "gregorian-init.ly"
6254 \score {
6255     \transpose c c' {
6256         % Punctum
6257         \[ b \]
6258         \noBreak s^\markup {"a"} \noBreak
6259
6260         % Punctum Inclinatum
6261         \[ \inclinatum b \]
6262         \noBreak s^\markup {"b"}
6263     }
6264 \paper { \neumeDemoPaper }}
6265 @end lilypond
6266 @tab
6267 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.5\cm]
6268 \include "gregorian-init.ly"
6269 \score {
6270      \transpose c c' {
6271         % Punctum Auctum Ascendens
6272         \[ \auctum \ascendens b \]
6273         \noBreak s^\markup {"c"} \noBreak
6274
6275         % Punctum Auctum Descendens
6276         \[ \auctum \descendens b \]
6277         \noBreak s^\markup {"d"} \noBreak
6278
6279         % Punctum Inclinatum Auctum
6280         \[ \inclinatum \auctum b \]
6281         \noBreak s^\markup {"e"}
6282     }
6283 \paper { \neumeDemoPaper }}
6284 @end lilypond
6285 @tab
6286 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6287 \include "gregorian-init.ly"
6288 \score {
6289      \transpose c c' {
6290         % Punctum Inclinatum Parvum
6291         \[ \inclinatum \deminutum b \]
6292         \noBreak s^\markup {"f"}
6293     }
6294 \paper { \neumeDemoPaper }}
6295 @end lilypond
6296
6297 @item
6298 @code{2. Virga}
6299 @tab
6300 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6301 \include "gregorian-init.ly"
6302 \score {
6303      \transpose c c' {
6304         % Virga
6305         \[ \virga b \]
6306         \noBreak s^\markup {"g"}
6307     }
6308 \paper { \neumeDemoPaper }}
6309 @end lilypond
6310 @tab
6311 @tab
6312
6313 @item
6314 @code{3. Apostropha vel Stropha}
6315 @tab
6316 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6317 \include "gregorian-init.ly"
6318 \score {
6319      \transpose c c' {
6320         % Stropha
6321         \[ \stropha b \]
6322         \noBreak s^\markup {"h"}
6323     }
6324 \paper { \neumeDemoPaper }}
6325 @end lilypond
6326 @tab
6327 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6328 \include "gregorian-init.ly"
6329 \score {
6330      \transpose c c' {
6331         % Stropha Aucta
6332         \[ \stropha \auctum b \]
6333         \noBreak s^\markup {"i"}
6334     }
6335 \paper { \neumeDemoPaper }}
6336 @end lilypond
6337 @tab
6338
6339 @item
6340 @code{4. Oriscus}
6341 @tab
6342 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6343 \include "gregorian-init.ly"
6344 \score {
6345      \transpose c c' {
6346         % Oriscus
6347         \[ \oriscus b \]
6348         \noBreak s^\markup {"j"}
6349     }
6350 \paper { \neumeDemoPaper }}
6351 @end lilypond
6352 @tab
6353 @tab
6354
6355 @item
6356 @code{5. Clivis vel Flexa}
6357 @tab
6358 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6359 \include "gregorian-init.ly"
6360 \score {
6361      \transpose c c' {
6362         % Clivis vel Flexa
6363         \[ b \flexa g \]
6364         s^\markup {"k"}
6365     }
6366 \paper { \neumeDemoPaper }}
6367 @end lilypond
6368 @tab
6369 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
6370 \include "gregorian-init.ly"
6371 \score {
6372      \transpose c c' {
6373         % Clivis Aucta Descendens
6374         \[ b \flexa \auctum \descendens g \]
6375         \noBreak s^\markup {"l"} \noBreak
6376
6377         % Clivis Aucta Ascendens
6378         \[ b \flexa \auctum \ascendens g \]
6379         \noBreak s^\markup {"m"}
6380     }
6381 \paper { \neumeDemoPaper }}
6382 @end lilypond
6383 @tab
6384 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6385 \include "gregorian-init.ly"
6386 \score {
6387      \transpose c c' {
6388         % Cephalicus
6389         \[ b \flexa \deminutum g \]
6390         s^\markup {"n"}
6391     }
6392 \paper { \neumeDemoPaper }}
6393 @end lilypond
6394
6395 @item
6396 @code{6. Podatus vel Pes}
6397 @tab
6398 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6399 \include "gregorian-init.ly"
6400 \score {
6401      \transpose c c' {
6402         % Podatus vel Pes
6403         \[ g \pes b \]
6404         s^\markup {"o"}
6405     }
6406 \paper { \neumeDemoPaper }}
6407 @end lilypond
6408 @tab
6409 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
6410 \include "gregorian-init.ly"
6411 \score {
6412      \transpose c c' {
6413         % Pes Auctus Descendens
6414         \[ g \pes \auctum \descendens b \]
6415         \noBreak s^\markup {"p"} \noBreak
6416
6417         % Pes Auctus Ascendens
6418         \[ g \pes \auctum \ascendens b \]
6419         \noBreak s^\markup {"q"}
6420     }
6421 \paper { \neumeDemoPaper }}
6422 @end lilypond
6423 @tab
6424 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6425 \include "gregorian-init.ly"
6426 \score {
6427      \transpose c c' {
6428         % Epiphonus
6429         \[ g \pes \deminutum b \]
6430         s^\markup {"r"}
6431     }
6432 \paper { \neumeDemoPaper }}
6433 @end lilypond
6434
6435 @item
6436 @code{7. Pes Quassus}
6437 @tab
6438 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6439 \include "gregorian-init.ly"
6440 \score {
6441      \transpose c c' {
6442         % Pes Quassus
6443         \[ \oriscus g \pes \virga b \]
6444         s^\markup {"s"}
6445     }
6446 \paper { \neumeDemoPaper }}
6447 @end lilypond
6448 @tab
6449 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6450 \include "gregorian-init.ly"
6451 \score {
6452      \transpose c c' {
6453         % Pes Quassus Auctus Descendens
6454         \[ \oriscus g \pes \auctum \descendens b \]
6455         s^\markup {"t"}
6456     }
6457 \paper { \neumeDemoPaper }}
6458 @end lilypond
6459 @tab
6460
6461 @item
6462 @code{8. Quilisma Pes}
6463 @tab
6464 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6465 \include "gregorian-init.ly"
6466 \score {
6467      \transpose c c' {
6468         % Quilisma Pes
6469         \[ \quilisma g \pes b \]
6470         s^\markup {"u"}
6471     }
6472 \paper { \neumeDemoPaper }}
6473 @end lilypond
6474 @tab
6475 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6476 \include "gregorian-init.ly"
6477 \score {
6478      \transpose c c' {
6479         % Quilisma Pes Auctus Descendens
6480         \[ \quilisma g \pes \auctum \descendens b \]
6481         s^\markup {"v"}
6482     }
6483 \paper { \neumeDemoPaper }}
6484 @end lilypond
6485 @tab
6486
6487 @item
6488 @code{9. Podatus Initio Debilis}
6489 @tab
6490 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6491 \include "gregorian-init.ly"
6492 \score {
6493      \transpose c c' {
6494         % Pes Initio Debilis
6495         \[ \deminutum g \pes b \]
6496         s^\markup {"w"}
6497     }
6498 \paper { \neumeDemoPaper }}
6499 @end lilypond
6500 @tab
6501 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6502 \include "gregorian-init.ly"
6503 \score {
6504      \transpose c c' {
6505         % Pes Auctus Descendens Initio Debilis
6506         \[ \deminutum g \pes \auctum \descendens b \]
6507         s^\markup {"x"}
6508     }
6509 \paper { \neumeDemoPaper }}
6510 @end lilypond
6511 @tab
6512
6513 @item
6514 @code{10. Torculus}
6515 @tab
6516 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6517 \include "gregorian-init.ly"
6518 \score {
6519      \transpose c c' {
6520         % Torculus
6521         \[ a \pes b \flexa g \]
6522         s^\markup {"y"}
6523     }
6524 \paper { \neumeDemoPaper }}
6525 @end lilypond
6526 @tab
6527 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6528 \include "gregorian-init.ly"
6529 \score {
6530      \transpose c c' {
6531         % Torculus Auctus Descendens
6532         \[ a \pes b \flexa \auctum \descendens g \]
6533         s^\markup {"z"}
6534     }
6535 \paper { \neumeDemoPaper }}
6536 @end lilypond
6537 @tab
6538 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6539 \include "gregorian-init.ly"
6540 \score {
6541      \transpose c c' {
6542         % Torculus Deminutus
6543         \[ a \pes b \flexa \deminutum g \]
6544         s^\markup {"A"}
6545     }
6546 \paper { \neumeDemoPaper }}
6547 @end lilypond
6548
6549 @item
6550 @code{11. Torculus Initio Debilis}
6551 @tab
6552 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6553 \include "gregorian-init.ly"
6554 \score {
6555      \transpose c c' {
6556         % Torculus Initio Debilis
6557         \[ \deminutum a \pes b \flexa g \]
6558         s^\markup {"B"}
6559     }
6560 \paper { \neumeDemoPaper }}
6561 @end lilypond
6562 @tab
6563 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6564 \include "gregorian-init.ly"
6565 \score {
6566      \transpose c c' {
6567         % Torculus Auctus Descendens Initio Debilis
6568         \[ \deminutum a \pes b \flexa \auctum \descendens g \]
6569         s^\markup {"C"}
6570     }
6571 \paper { \neumeDemoPaper }}
6572 @end lilypond
6573 @tab
6574 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6575 \include "gregorian-init.ly"
6576 \score {
6577      \transpose c c' {
6578         % Torculus Deminutus Initio Debilis
6579         \[ \deminutum a \pes b \flexa \deminutum g \]
6580         s^\markup {"D"}
6581     }
6582 \paper { \neumeDemoPaper }}
6583 @end lilypond
6584
6585 @item
6586 @code{12. Porrectus}
6587 @tab
6588 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6589 \include "gregorian-init.ly"
6590 \score {
6591      \transpose c c' {
6592         % Porrectus
6593         \[ a \flexa g \pes b \]
6594         s^\markup {"E"}
6595     }
6596 \paper { \neumeDemoPaper }}
6597 @end lilypond
6598 @tab
6599 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6600 \include "gregorian-init.ly"
6601 \score {
6602      \transpose c c' {
6603         % Porrectus Auctus Descendens
6604         \[ a \flexa g \pes \auctum \descendens b \]
6605         s^\markup {"F"}
6606     }
6607 \paper { \neumeDemoPaper }}
6608 @end lilypond
6609 @tab
6610 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6611 \include "gregorian-init.ly"
6612 \score {
6613      \transpose c c' {
6614         % Porrectus Deminutus
6615         \[ a \flexa g \pes \deminutum b \]
6616         s^\markup {"G"}
6617     }
6618 \paper { \neumeDemoPaper }}
6619 @end lilypond
6620
6621 @item
6622 @code{13. Climacus}
6623 @tab
6624 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6625 \include "gregorian-init.ly"
6626 \score {
6627      \transpose c c' {
6628         % Climacus
6629         \[ \virga b \inclinatum a \inclinatum g \]
6630         s^\markup {"H"}
6631     }
6632     \paper { \neumeDemoPaper }
6633 }
6634 @end lilypond
6635 @tab
6636 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6637 \include "gregorian-init.ly"
6638 \score {
6639      \transpose c c' {
6640         % Climacus Auctus
6641         \[ \virga b \inclinatum a \inclinatum \auctum g \]
6642         s^\markup {"I"}
6643     }
6644 \paper { \neumeDemoPaper }}
6645 @end lilypond
6646 @tab
6647 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6648 \include "gregorian-init.ly"
6649 \score {
6650      \transpose c c' {
6651         % Climacus Deminutus
6652         \[ \virga b \inclinatum a \inclinatum \deminutum g \]
6653         s^\markup {"J"}
6654     }
6655 \paper { \neumeDemoPaper }}
6656 @end lilypond
6657
6658 @item
6659 @code{14. Scandicus}
6660 @tab
6661 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6662 \include "gregorian-init.ly"
6663 \score {
6664      \transpose c c' {
6665         % Scandicus
6666         \[ g \pes a \virga b \]
6667         s^\markup {"K"}
6668     }
6669 \paper { \neumeDemoPaper }}
6670 @end lilypond
6671 @tab
6672 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6673 \include "gregorian-init.ly"
6674 \score {
6675      \transpose c c' {
6676         % Scandicus Auctus Descendens
6677         \[ g \pes a \pes \auctum \descendens b \]
6678         s^\markup {"L"}
6679     }
6680 \paper { \neumeDemoPaper }}
6681 @end lilypond
6682 @tab
6683 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6684 \include "gregorian-init.ly"
6685 \score {
6686      \transpose c c' {
6687         % Scandicus Deminutus
6688         \[ g \pes a \pes \deminutum b \]
6689         s^\markup {"M"}
6690     }
6691 \paper { \neumeDemoPaper }}
6692 @end lilypond
6693
6694 @item
6695 @code{15. Salicus}
6696 @tab
6697 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6698 \include "gregorian-init.ly"
6699 \score {
6700      \transpose c c' {
6701         % Salicus
6702         \[ g \oriscus a \pes \virga b \]
6703         s^\markup {"N"}
6704     }
6705 \paper { \neumeDemoPaper }}
6706 @end lilypond
6707 @tab
6708 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6709 \include "gregorian-init.ly"
6710 \score {
6711      \transpose c c' {
6712         % Salicus Auctus Descendens
6713         \[ g \oriscus a \pes \auctum \descendens b \]
6714         s^\markup {"O"}
6715     }
6716 \paper { \neumeDemoPaper }}
6717 @end lilypond
6718 @tab
6719
6720 @item
6721 @code{16. Trigonus}
6722 @tab
6723 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6724 \include "gregorian-init.ly"
6725 \score {
6726    \transpose c c' {
6727     % Trigonus
6728     \[ \stropha b \stropha b \stropha a \]
6729     s^\markup {"P"}
6730   }
6731   \paper { \neumeDemoPaper }
6732 }
6733 @end lilypond
6734 @tab
6735 @tab
6736
6737 @end multitable
6738
6739
6740 Unlike most other neumes notation systems, the input language for
6741 neumes does not necessarily reflect directly the typographical
6742 appearance, but is designed to solely focuse on musical meaning.  For
6743 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
6744 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
6745 a Porrectus with a curved flexa shape and only a single Punctum head.
6746 There is no command to explicitly typeset the curved flexa shape; the
6747 decision of when to typeset a curved flexa shape is purely taken from
6748 the musical input.  The idea of this approach is to separate the
6749 musical aspects of the input from the notation style of the output.
6750 This way, the same input can be reused to typeset the same music in a
6751 different style of Gregorian chant notation.
6752
6753 The following table shows the code fragments that produce the
6754 ligatures in the above neumes table.  The letter in the first column
6755 in each line of the below table indicates to which ligature in the
6756 above table it refers.  The second column gives the name of the
6757 ligature.  The third column shows the code fragment that produces this
6758 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
6759
6760 @multitable @columnfractions .1 .4 .5
6761
6762 @item
6763 @b{#} @tab
6764 @b{Name} @tab
6765 @b{Input Language}
6766
6767 @item
6768 a @tab
6769 Punctum @tab
6770 @code{\[ b \]}
6771
6772 @item
6773 b @tab
6774 Punctum Inclinatum @tab
6775 @code{\[ \inclinatum b \]}
6776
6777 @item
6778 c @tab
6779 Punctum Auctum Ascendens @tab
6780 @code{\[ \auctum \ascendens b \]}
6781
6782 @item
6783 d @tab
6784 Punctum Auctum Descendens @tab
6785 @code{\[ \auctum \descendens b \]}
6786
6787 @item
6788 e @tab
6789 Punctum Inclinatum Auctum @tab
6790 @code{\[ \inclinatum \auctum b \]}
6791
6792 @item
6793 f @tab
6794 Punctum Inclinatum Parvum @tab
6795 @code{\[ \inclinatum \deminutum b \]}
6796
6797 @item
6798 g @tab
6799 Virga @tab
6800 @code{\[ \virga b \]}
6801
6802 @item
6803 h @tab
6804 Stropha @tab
6805 @code{\[ \stropha b \]}
6806
6807 @item
6808 i @tab
6809 Stropha Aucta @tab
6810 @code{\[ \stropha \auctum b \]}
6811
6812 @item
6813 j @tab
6814 Oriscus @tab
6815 @code{\[ \oriscus b \]}
6816
6817 @item
6818 k @tab
6819 Clivis vel Flexa @tab
6820 @code{\[ b \flexa g \]}
6821
6822 @item
6823 l @tab
6824 Clivis Aucta Descendens @tab
6825 @code{\[ b \flexa \auctum \descendens g \]}
6826
6827 @item
6828 m @tab
6829 Clivis Aucta Ascendens @tab
6830 @code{\[ b \flexa \auctum \ascendens g \]}
6831
6832 @item
6833 n @tab
6834 Cephalicus @tab
6835 @code{\[ b \flexa \deminutum g \]}
6836
6837 @item
6838 o @tab
6839 Podatus vel Pes @tab
6840 @code{\[ g \pes b \]}
6841
6842 @item
6843 p @tab
6844 Pes Auctus Descendens @tab
6845 @code{\[ g \pes \auctum \descendens b \]}
6846
6847 @item
6848 q @tab
6849 Pes Auctus Ascendens @tab
6850 @code{\[ g \pes \auctum \ascendens b \]}
6851
6852 @item
6853 r @tab
6854 Epiphonus @tab
6855 @code{\[ g \pes \deminutum b \]}
6856
6857 @item
6858 s @tab
6859 Pes Quassus @tab
6860 @code{\[ \oriscus g \pes \virga b \]}
6861
6862 @item
6863 t @tab
6864 Pes Quassus Auctus Descendens @tab
6865 @code{\[ \oriscus g \pes \auctum \descendens b \]}
6866
6867 @item
6868 u @tab
6869 Quilisma Pes @tab
6870 @code{\[ \quilisma g \pes b \]}
6871
6872 @item
6873 v @tab
6874 Quilisma Pes Auctus Descendens @tab
6875 @code{\[ \quilisma g \pes \auctum \descendens b \]}
6876
6877 @item
6878 w @tab
6879 Pes Initio Debilis @tab
6880 @code{\[ \deminutum g \pes b \]}
6881
6882 @item
6883 x @tab
6884 Pes Auctus Descendens Initio Debilis @tab
6885 @code{\[ \deminutum g \pes \auctum \descendens b \]}
6886
6887 @item
6888 y @tab
6889 Torculus @tab
6890 @code{\[ a \pes b \flexa g \]}
6891
6892 @item
6893 z @tab
6894 Torculus Auctus Descendens @tab
6895 @code{\[ a \pes b \flexa \auctum \descendens g \]}
6896
6897 @item
6898 A @tab
6899 Torculus Deminutus @tab
6900 @code{\[ a \pes b \flexa \deminutum g \]}
6901
6902 @item
6903 B @tab
6904 Torculus Initio Debilis @tab
6905 @code{\[ \deminutum a \pes b \flexa g \]}
6906
6907 @item
6908 C @tab
6909 Torculus Auctus Descendens Initio Debilis @tab
6910 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
6911
6912 @item
6913 D @tab
6914 Torculus Deminutus Initio Debilis @tab
6915 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
6916
6917 @item
6918 E @tab
6919 Porrectus @tab
6920 @code{\[ a \flexa g \pes b \]}
6921
6922 @item
6923 F @tab
6924 Porrectus Auctus Descendens @tab
6925 @code{\[ a \flexa g \pes \auctum \descendens b \]}
6926
6927 @item
6928 G @tab
6929 Porrectus Deminutus @tab
6930 @code{\[ a \flexa g \pes \deminutum b \]}
6931
6932 @item
6933 H @tab
6934 Climacus @tab
6935 @code{\[ \virga b \inclinatum a \inclinatum g \]}
6936
6937 @item
6938 I @tab
6939 Climacus Auctus @tab
6940 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
6941
6942 @item
6943 J @tab
6944 Climacus Deminutus @tab
6945 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
6946
6947 @item
6948 K @tab
6949 Scandicus @tab
6950 @code{\[ g \pes a \virga b \]}
6951
6952 @item
6953 L @tab
6954 Scandicus Auctus Descendens @tab
6955 @code{\[ g \pes a \pes \auctum \descendens b \]}
6956
6957 @item
6958 M @tab
6959 Scandicus Deminutus @tab
6960 @code{\[ g \pes a \pes \deminutum b \]}
6961
6962 @item
6963 N @tab
6964 Salicus @tab
6965 @code{\[ g \oriscus a \pes \virga b \]}
6966
6967 @item
6968 O @tab
6969 Salicus Auctus Descendens @tab
6970 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
6971
6972 @item
6973 P @tab
6974 Trigonus @tab
6975 @code{\[ \stropha b \stropha b \stropha a \]}
6976
6977 @end multitable
6978
6979 @refcommands
6980
6981 The following head prefixes are supported
6982
6983 @cindex @code{\virga}
6984 @code{\virga},
6985 @cindex @code{\stropha}
6986 @code{\stropha},
6987 @cindex @code{\inclinatum}
6988 @code{\inclinatum},
6989 @cindex @code{\auctum}
6990 @code{\auctum},
6991 @cindex @code{\descendens}
6992 @code{\descendens},
6993 @cindex @code{\ascendens}
6994 @code{\ascendens},
6995 @cindex @code{\oriscus}
6996 @code{\oriscus},
6997 @cindex @code{\quilisma}
6998 @code{\quilisma},
6999 @cindex @code{\deminutum}
7000 @code{\deminutum}.
7001
7002 Head prefixes can be accumulated, though restrictions apply.  For
7003 example, either @code{\descendens} or @code{\ascendens} can be applied
7004 to a head, but not both to the same head.
7005
7006 @cindex @code{\pes}
7007 @cindex @code{\flexa}
7008 Two adjacent heads can be tied together with the @code{\pes} and
7009 @code{\flexa} infix commands for a rising and falling line of melody,
7010 respectively.
7011
7012
7013
7014 @node Vaticana style contexts
7015 @subsection Vaticana style contexts
7016
7017 @cindex VaticanaVoiceContext
7018 @cindex VaticanaStaffContext
7019
7020 The predefined @code{VaticanaVoiceContext} and
7021 @code{VaticanaStaffContext} can be used to easily engrave a piece of
7022 Gregorian Chant in the style of the Editio Vaticana.  These contexts
7023 initialize all relevant context properties and grob properties to
7024 proper values.  With these contexts, you can immediately go ahead
7025 entering the chant, as the following short excerpt demonstrates
7026
7027 @lilypond[quote,raggedright,verbatim,noindent]
7028 \include "gregorian-init.ly"
7029 \score {
7030   <<
7031     \context VaticanaVoice = "cantus" {
7032       \override Score.BarNumber #'transparent = ##t
7033        {
7034         \[ c'\melisma c' \flexa a \]
7035         \[ a \flexa \deminutum g\melismaEnd \]
7036         f \divisioMinima
7037         \[ f\melisma \pes a c' c' \pes d'\melismaEnd \]
7038         c' \divisioMinima \break
7039         \[ c'\melisma c' \flexa a \]
7040         \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
7041       }
7042     }
7043     \lyricsto "cantus" \new Lyrics {
7044       San- ctus, San- ctus, San- ctus
7045     }
7046   >>
7047 }
7048 @end lilypond
7049
7050 @node Figured bass
7051 @subsection Figured bass
7052
7053 @cindex Basso continuo
7054
7055 @c TODO: musicological blurb about FB
7056
7057
7058 LilyPond has limited support for figured bass
7059
7060 @lilypond[quote,verbatim,fragment]
7061 <<
7062   \context Voice  { \clef bass dis4  c d ais }
7063   \context FiguredBass \figures {
7064     < 6 >4 < 7 >8 < 6+ [_!] >
7065     < 6 >4 <6 5 [3+] >
7066   }
7067 >>
7068 @end lilypond
7069
7070 The support for figured bass consists of two parts: there is an input
7071 mode, introduced by @code{\figures}, where you can enter bass figures
7072 as numbers, and there is a context called @internalsref{FiguredBass} that
7073 takes care of making @internalsref{BassFigure} objects.
7074
7075 In figures input mode, a group of bass figures is delimited by
7076 @code{<} and @code{>}. The duration is entered after the @code{>>}
7077 @example
7078 <4 6>
7079 @end example
7080 @lilypond[quote,fragment]
7081 \context FiguredBass
7082 \figures { <4 6> }
7083 @end lilypond
7084
7085 Accidentals are added when you append @code{-}, @code{!}  and @code{+}
7086 to the numbers
7087
7088 @example
7089 <4- 6+ 7!>
7090 @end example
7091 @lilypond[quote,fragment]
7092 \context FiguredBass
7093 \figures { <4- 6+ 7!> }
7094 @end lilypond
7095
7096 Spaces or dashes may be inserted by using @code{_}. Brackets are
7097 introduced with @code{[} and @code{]}
7098
7099 @example
7100 < [4 6] 8 [_! 12]>
7101 @end example
7102 @lilypond[quote,fragment]
7103 \context FiguredBass
7104 \figures { < [4 6] 8 [_! 12]> }
7105 @end lilypond
7106
7107 Although the support for figured bass may superficially resemble chord
7108 support, it works much simpler.  The @code{\figures} mode simply
7109 stores the numbers , and @internalsref{FiguredBass} context prints
7110 them as entered. There is no conversion to pitches, and no
7111 realizations of the bass are played in the MIDI file.
7112
7113 Internally, the code produces markup texts. You can use any of the
7114 markup text properties to override formatting. For example, the
7115 vertical spacing of the figures may be set with @code{baseline-skip}.
7116
7117 @seealso
7118
7119 Program reference: @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object, 
7120 and @internalsref{FiguredBass} context.
7121
7122 @refbugs
7123
7124 Slash notation for alterations is not supported.
7125
7126 @node Contemporary notation
7127 @section Contemporary notation
7128
7129 In the 20th century, composers have greatly expanded the musical
7130 vocabulary. With this expansion, many innovations in musical notation
7131 have been tried. The book by Stone (1980) gives a comprehensive
7132 overview (see @ref{Literature list}). In general, the use of new,
7133 innovative notation makes a piece harder to understand and perform and
7134 its use should therefore be avoided if possible.  For this reason,
7135 support for contemporary notation in LilyPond is limited.
7136
7137
7138 @menu
7139 * Polymetric notation::         
7140 * Clusters::                    
7141 * Fermatas::                    
7142 * Feathered beams::             
7143 @end menu
7144
7145 @node Polymetric notation
7146 @subsection Polymetric notation
7147
7148 Double time signatures are not supported explicitly, but they can be
7149 faked. In the next example, the markup for the time signature is
7150 created with a markup text. This markup text is inserted in the
7151 @internalsref{TimeSignature} grob.
7152
7153 @lilypond[verbatim,raggedright]
7154
7155 % create 2/4 + 5/8
7156 tsMarkup =\markup  {
7157     \number { 
7158       \column < "2" "4" >
7159       \musicglyph #"scripts-stopped" 
7160       \bracket \column < "5" "8" >
7161     }
7162 }
7163
7164 {
7165   \override Staff.TimeSignature  #'print-function = #Text_item::print
7166   \override Staff.TimeSignature  #'text = #tsMarkup
7167   \time 3/2
7168   c'2  \bar ":" c'4 c'4.
7169 }
7170 @end lilypond
7171
7172 Each staff can also have its own time signature.  This is done by
7173 moving the @internalsref{Timing_engraver} to @internalsref{Staff}
7174 context.
7175
7176 @verbatim
7177 \paper{
7178     \context{
7179         \Score
7180         \remove "Timing_engraver"
7181     }
7182     \context{
7183         \Staff
7184         \consists "Timing_engraver"
7185     }
7186 }       
7187 @end verbatim
7188
7189
7190 Now, each staff has its own time signature.
7191 @verbatim
7192 <<
7193     \new Staff {
7194         \time 3/4
7195         c4 c c | c c c |
7196     }
7197
7198     \new Staff {
7199         \time 2/4
7200         c4 c | c c | c c
7201     }
7202     \new Staff {
7203         \time 3/8
7204         c4. c8 c c   c4. c8 c c
7205     }
7206 >>
7207 @end verbatim
7208
7209 @lilypond[raggedright]
7210 \paper{
7211     \context{
7212         \Score
7213         \remove "Timing_engraver"
7214     }
7215     \context{
7216         \Staff
7217         \consists "Timing_engraver"
7218     }
7219 }       
7220
7221 \relative c'  <<
7222     \new Staff {
7223         \time 3/4
7224         c4 c c | c c c |
7225     }
7226
7227     \new Staff {
7228         \time 2/4
7229         c4 c | c c | c c
7230     }
7231     \new Staff {
7232         \time 3/8
7233         c4. c8 c c   c4. c8 c c
7234     }
7235 >>
7236 @end lilypond
7237
7238
7239 A different form of polymetric notation is where note lengths have
7240 different values across staves.
7241
7242 This notation can be created by setting a common time signature for
7243 each staff but replacing it manually using
7244 @code{timeSignatureFraction} to the desired fraction. Then the printed
7245 durations in each staff are scaled to the common time signature.
7246 The latter is done with @code{\compressmusic}, which is similar to
7247 @code{\times}, but does not create a tuplet bracket.
7248
7249
7250 In this example, music with the time signatures of 3/4, 9/8 and 10/8 are
7251 used in parallel. In the second staff, shown durations are multiplied by 
7252 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are 
7253 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
7254
7255 @lilypond[raggedright,verbatim]
7256 \relative c'  <<
7257     \new Staff {
7258         \time 3/4
7259         c4 c c | c c c |
7260     }
7261     \new Staff {
7262         \time 3/4
7263         \set Staff.timeSignatureFraction = #'(9 . 8)
7264         \compressmusic #'(2 . 3)
7265           \repeat unfold 6 { c8[ c c] }
7266     }
7267     \new Staff {
7268         \time 3/4
7269         \set Staff.timeSignatureFraction = #'(10 . 8)
7270         \compressmusic #'(3 . 5)
7271           { \repeat unfold 2 { c8[ c c] }
7272             \repeat unfold 2 { c8[  c] }
7273             |  c4. c4. \times 2/3 { c8 c c } c4  }
7274     }
7275 >>
7276 @end lilypond
7277
7278
7279
7280
7281 @refbugs
7282
7283 When using different time signatures in parallel, the spacing is
7284 aligned vertically, but bar lines distort the regular spacing.
7285
7286
7287
7288 @node Clusters
7289 @subsection Clusters
7290
7291 @cindex cluster
7292
7293 A cluster indicates a continuous range of pitches to be played.  They
7294 can be denoted as the envelope of a set of notes.  They are entered by
7295 applying the function @code{notes-to-clusters} to a sequence of
7296 chords, e.g.
7297 @c
7298 @lilypond[quote,relative=2,verbatim]
7299 \applymusic #notes-to-clusters {  <c e > <b f'>  }
7300 @end lilypond
7301
7302 The following example (from
7303 @inputfileref{input/regression,cluster.ly}) shows what the result
7304 looks like
7305
7306 @lilypondfile[quote]{cluster.ly}
7307
7308 Ordinary notes and clusters can be put together in the same staff,
7309 even simultaneously.  In such a case no attempt is made to
7310 automatically avoid collisions between ordinary notes and clusters.
7311
7312 @seealso
7313
7314 Program reference: @internalsref{ClusterSpanner},
7315 @internalsref{ClusterSpannerBeacon},
7316 @internalsref{Cluster_spanner_engraver}, and
7317 @internalsref{ClusterNoteEvent}.
7318
7319 Examples: @inputfileref{input/regression,cluster.ly}.
7320
7321 @refbugs
7322
7323 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
7324 accurately.  Use @code{<g a>8 <e a>8} instead.
7325
7326
7327
7328 @node Fermatas
7329 @subsection Fermatas
7330
7331 @cindex fermatas
7332
7333
7334
7335 Contemporary music notation frequently uses special fermata symbols to
7336 indicate fermatas of differing lengths.  The following fermatas are
7337 supported
7338
7339 @lilypond[quote,raggedright]
7340 <<
7341     \oldaddlyrics  {
7342       b'
7343       ^\shortfermata
7344       _\shortfermata
7345       r
7346       b'
7347       ^\fermata
7348       _\fermata
7349
7350       r
7351       b'
7352       ^\longfermata
7353       _\longfermata
7354
7355       r
7356       b'
7357       ^\verylongfermata
7358       _\verylongfermata
7359     r
7360     }
7361     \context Lyrics \lyrics {
7362       \override LyricText #'font-family = #'typewriter
7363       "shortfermata" "fermata"  "longfermata" "verylongfermata"
7364     }
7365 >>
7366 @end lilypond
7367
7368 See @ref{Articulations} for general instructions how to apply scripts
7369 such as fermatas to notes.
7370
7371 @node Feathered beams
7372 @subsection Feathered beams
7373
7374 Feathered beams are not supported natively, but they can be faked by
7375 forcing two beams to overlap. Here is an example,
7376
7377 @lilypond[raggedright]
7378 \relative \new Staff <<
7379     \new Voice
7380     {
7381         \stemUp
7382         \once \override Voice.Beam #'positions = #'(0 . 0.5)
7383         c8[ c c c c ]
7384     }
7385     \new Voice {
7386         \stemUp
7387         \once \override Voice.Beam #'positions = #'(0 . -0.5) 
7388         c[ c c c c]
7389     }
7390 >>
7391 @end lilypond
7392
7393
7394
7395 @node Educational use
7396 @section Educational use
7397
7398 @menu
7399 * Balloon help::                
7400 * Blank music paper::           
7401 * Notation for excercises::     
7402 * Easy Notation note heads::    
7403 @end menu
7404
7405 @node Balloon help
7406 @subsection Balloon help
7407
7408 Elements of notation can be marked and named with the help of a square
7409 balloon.  The primary purpose of this feature is to explain notation.
7410
7411 The following example demonstrates its use.
7412
7413 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
7414 \context Voice
7415 \applyoutput
7416    #(add-balloon-text 'NoteHead "heads, or tails?"
7417     '(1 . -3))
7418 c8
7419 @end lilypond
7420
7421 @noindent
7422 The function @code{add-balloon-text} takes the name of a grob, the
7423 label to print, and the position where to put the label relative to 
7424 the object. In the above example, the text ``heads or tails?'' ends 
7425 3 spaces below the `balloon.' 
7426
7427 @cindex balloon
7428 @cindex notation, explaining
7429
7430 @seealso
7431
7432 Program reference: @internalsref{text-balloon-interface}.
7433
7434 Examples: @inputfileref{input/regression,balloon.ly}.
7435
7436
7437
7438
7439 @node Blank music paper
7440 @subsection Blank music paper
7441
7442 A blank music paper can be produced also by using invisible notes, and
7443 removing @code{Bar_number_engraver}.
7444
7445
7446 @lilypond
7447 emptymusic =  {
7448   \repeat unfold 2 % Change this for more lines. 
7449   { s1\break }
7450   \bar "|."
7451 }
7452 \new Score \with {
7453     \override TimeSignature #'transparent = ##t
7454     defaultBarType = #""
7455     \remove Bar_number_engraver
7456 } <<
7457         \context Staff \emptymusic
7458         \context TabStaff \emptymusic
7459 >>
7460 @end lilypond
7461
7462
7463 @node Notation for excercises
7464 @subsection Notation for excercises
7465
7466 @cindex Blank Notes
7467
7468 Invisible (or transparent) notes can be useful, when weird tricks are
7469 needed; especially, a slur cannot be attach to a rest or spacer rest.
7470
7471
7472 @lilypond
7473 blanknotes = { \override NoteHead  #'transparent = ##t
7474                \override Stem  #'transparent = ##t }
7475 unblanknotes = { \revert NoteHead #'transparent
7476                  \revert Stem #'transparent }
7477
7478
7479 \relative c'' {
7480     c4 d4 
7481     \blanknotes e4 f4   \unblanknotes
7482     g4 a 
7483 }
7484 @end lilypond
7485
7486
7487 @node Easy Notation note heads
7488 @subsection Easy Notation note heads
7489
7490 @cindex easy notation
7491 @cindex Hal Leonard
7492
7493 The `easy play' note head includes a note name inside the head.  It is
7494 used in music for beginners
7495
7496 @lilypond[quote,raggedright,verbatim,fragment,staffsize=26]
7497 \setEasyHeads
7498 c'2 e'4 f' | g'1
7499 @end lilypond
7500
7501 The command @code{\setEasyHeads} overrides settings for the
7502 @internalsref{NoteHead} object.  To make the letters readable, it has
7503 to be printed in a large font size.  To print with a larger font, see
7504 @ref{Setting global staff size}.
7505
7506 @cindex Xdvi
7507 @cindex ghostscript
7508
7509 If you view the result with Xdvi, staff lines may show through the
7510 letters.  Printing the PostScript file obtained does produce the
7511 correct result.
7512
7513 @refcommands
7514
7515 @cindex @code{\setEasyHeads}
7516 @code{\setEasyHeads}
7517