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