]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/refman.itely
patch::: 1.3.143.jcn1
[lilypond.git] / Documentation / user / refman.itely
1
2 @c Note:
3 @c
4 @c A menu is needed before every deeper *section nesting of @nodes
5 @c Run M-x texinfo-all-menus-update
6 @c to automagically fill in these menus
7 @c before saving changes
8
9
10 @macro refbugs
11 @unnumberedsubsec Bugs
12
13 @end macro
14
15
16 @c .{Reference Manual}
17
18 @node Reference Manual
19 @chapter Reference Manual
20
21 This document describes GNU LilyPond and its input format. The last
22 revision of this document was for LilyPond 1.3.141.
23
24
25 @menu
26 * Overview::                    
27 * Note entry::                  
28 * Staff notation::              
29 * Polyphony::                   
30 * Beaming::                     
31 * Expressive marks::            
32 * Ornaments::                   
33 * Repeats::                     
34 * Rhythmic music::              
35 * Piano music::                 
36 * Lyrics::                      
37 * Chords::                      
38 * Writing parts::               
39 * Custodes::                    
40 * Tuning output::               
41 * Page layout::                 
42 * Sound::                       
43 * Music entry::                 
44 * Skipping corrected music::    
45 * Interpretation context::      
46 * Syntactic details::           
47 * Lexical details::             
48 @end menu
49
50 @c . {Overview}
51 @node Overview
52 @section Overview
53
54
55 The purpose of LilyPond is explained informally by the term `music
56 typesetter'.  This is not a fully correct name: not only does the
57 program print musical symbols, it also makes esthetic decisions.
58 Symbols and their placements are @emph{generated} from a high-level
59 musical description.  In other words, LilyPond would be best described
60 by `music compiler' or `music to notation compiler'.
61
62 LilyPond is linked to GUILE, GNU's Scheme library for extension. The
63 Scheme library provides the glue that holds together the low-level
64 routines and separate modules general, which are C++.
65
66 When lilypond is run to typeset sheet music, the following happens:
67 @itemize @bullet
68 @item GUILE Initialization: various scheme files are read
69 @item parsing: first standard @code{ly} initialization  files are read, and
70 then the user @file{ly} file is read.
71 @item interpretation: the music in the file is processed ``in playing
72 order'', i.e. the order that  you  use to read sheet music, or the
73 order in which notes are played.
74
75 @item typesetting:
76 in this step, the results of the interpretation, a typesetting
77 specification, is solved.
78
79 @item the visible results ("virtual ink") is written to the output file.
80 @end itemize
81
82 During these stages different types of data play the the main role:
83 during parsing, @strong{Music} objects are created.  During the
84 interpretation, @strong{context} is constructed, and with this context
85 af network of @strong{graphical objects} (``grobs'') is created. The
86 grobs contain unknown variables, and the network forms a set of
87 equations. After solving the equations and filling in these variables,
88 the printed output (in the form of @strong{molecules}) is written to an
89 output file.
90
91 These threemanship of tasks (parsing, translating, typesetting) and
92 data-structures (music, context, graphical objects) permeates the entire
93 design of the program.  This manual is ordered in terms of user
94 tasks. With each concept will be explained to which of the three parts
95 it belongs.
96
97
98 @c . {Note entry}
99 @node Note entry
100 @section Note entry
101 @cindex Note entry
102
103 The most basic forms of music are notes. We discuss how you enter them
104 here.  Notes on their own don't form valid input, but for the sake of
105 brevity we omit obligotary lint such as @code{\score} blocks and
106 @code{\paper} declarations.
107
108
109 @menu
110 * Pitches::                     
111 * Defining pitch names::        
112 * Durations::                   
113 * Notes::                       
114 * Easy Notation note heads ::   
115 * Tie::                         
116 * Tuplets::                     
117 * Rests::                       
118 * Skip::                        
119 * Note mode::                   
120 @end menu
121
122 @c .  {Pitches}
123 @node Pitches
124 @subsection Pitches
125
126 @cindex Pitch names
127 @cindex Note specification
128 @cindex pitches
129 @cindex entering notes
130
131 The verbose syntax for pitch specification is
132
133 @cindex @code{\pitch}
134 @example
135   \pitch @var{scmpitch}
136 @end example
137
138 @var{scmpitch} is a pitch scheme object, see @ref{Pitch data type}.
139
140 In Note and Chord mode, pitches may be designated by names.  The default
141 names are the Dutch note names.  The notes are specified by the letters
142 @code{a} through @code{g} (where the octave is formed by notes ranging
143 from @code{c}, to @code{b}).  The pitch @code{c} is an octave below
144 middle C and the letters span the octave above that C.
145
146 @cindex note names, Dutch
147
148 In Dutch, a sharp is formed by adding @code{-is} to the end of a pitch
149 name.  A flat is formed by adding @code{-es}. Double sharps and double
150 flats are obtained by adding @code{-isis} or @code{-eses}.  @code{aes}
151 and @code{ees} are contracted to @code{as} and @code{es} in Dutch, but
152 both forms are accepted.
153
154 LilyPond has predefined sets of notenames for various other languages.
155 To use them, simply include the language specific init file.  For
156 example: @code{\include "english.ly"}.  The available language files and
157 the names they define are:
158
159 @example 
160                         Note Names               sharp       flat
161 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
162 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
163 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
164 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
165 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
166 italiano.ly    do  re  mi  fa  sol la  sib si  -d          -b
167 catalan.ly     do  re  mi  fa  sol la  sib si  -d/-s       -b 
168 @end example 
169
170 @cindex @code{'}
171 @cindex @code{,}
172
173
174
175 The optional octave specification takes the form of a series of
176 single quote (`@code{'}') characters or a series of comma
177 (`@code{,}') characters.  Each @code{'} raises the pitch by one
178 octave; each @code{,} lowers the pitch by an octave.
179
180 @lilypond[fragment,verbatim,center]
181   c' c'' es' g' as' gisis' ais'  
182 @end lilypond
183
184 @c .  {Defining pitch names}
185 @node Defining pitch names
186 @subsection Defining pitch names
187
188 @cindex defining pitch names
189 @cindex pitch names, defining 
190
191 Note names and chord modifiers can be customised for nationalities.  The
192 syntax is as follows.
193
194 @cindex @code{\pitchnames}
195 @cindex @code{\chordmodifiers}
196 @example
197    \pitchnames @var{scheme-alist}
198    \chordmodifiers @var{scheme-alist}
199 @end example
200
201 See @file{ly/nederlands.ly} and @file{ly/chord-modifiers.ly} for
202 specific examples how to do this.
203
204
205
206 @c .  {Durations}
207 @node Durations
208 @subsection Durations
209
210
211 @cindex duration
212 @cindex @code{\duration}
213
214 The syntax for a verbose duration specification is
215 @example
216  \duration @var{scmduration}
217 @end example
218 Here, @var{scmduration} is a Scheme object of type Duration. See
219 @ref{Duration} for more information.
220
221
222 In Note, Chord, and Lyrics mode, durations may be designated by numbers
223 and dots: durations are entered as their reciprocal values.  For notes
224 longer than a whole note, use identifiers.
225
226 @quotation
227
228 @example 
229 c'\longa c'\breve  
230 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64 
231 r\longa r\breve  
232 r1 r2 r4 r8 r16 r32 r64 r64 
233 @end example 
234
235
236 @lilypond[]
237 \score {
238   \notes \relative c'' {
239     a\longa a\breve  \autoBeamOff
240     a1 a2 a4 a8 a16 a32 a64 a64 
241     r\longa r\breve  
242     r1 r2 r4 r8 r16 r32 r64 r64 
243   }
244   \paper {
245     \translator {
246       \StaffContext
247         \remove "Clef_engraver";
248         \remove "Staff_symbol_engraver";
249         \remove "Time_signature_engraver";
250         \consists "Pitch_squash_engraver";
251     }
252   }
253 }
254 @end lilypond
255 @end quotation
256
257 As you can see, the longa is not printed. To get a longa note head, you
258 have to use a mensural note heads. This is done accomplished by setting
259 the @code{style} property of the NoteHead grob to @code{mensural}.
260
261 If the duration is omitted then it is set to the previous duration
262 entered.  At the start of parsing a quarter note is assumed.  The
263 duration can be followed by a dot (`@code{.}')  to obtain dotted note
264 lengths.
265 @cindex @code{.}
266
267 @lilypond[fragment,verbatim,center]
268   a'4. b'4.. c'8.
269 @end lilypond
270 @cindex @code{r}
271 @cindex @code{s}
272
273 You can alter the length of duration by appending
274 `@code{*}@var{fraction}'.  This will not affect the appearance of the
275 notes or rests produced.
276
277 @c . {Notes}
278 @node Notes
279 @subsection Notes
280
281 A note specification has the form
282
283 @example
284   @var{pitch}[@var{octavespec}][!][?][@var{duration}]
285 @end example
286
287 LilyPond will determine what accidentals to typeset depending on the key
288 and context. The alteration refers to what note is heard, not to whether
289 an accidental is printed.  A reminder accidental
290 @cindex reminder accidental
291 @cindex @code{?}
292 can be forced by adding an exclamation mark @code{!} after the pitch.  A
293 cautionary accidental,
294 @cindex cautionary accidental
295 i.e., an accidental within parentheses can be obtained by adding the
296 question mark `@code{?}' after the pitch.
297
298 @lilypond[fragment,verbatim,center]
299   cis' d' e' cis'  c'? d' e' c'!
300 @end lilypond
301
302
303 @node Easy Notation note heads 
304 @subsection Easy Notation note heads
305
306 @cindex easy notation
307 @cindex Hal Leonard
308
309 A entirely different type of note head is the "easyplay" note head: a
310 note head that includes a note name.  It is used in some publications by
311 Hal-Leonard Inc.  music publishers.
312
313 @lilypond[singleline,verbatim]
314 \include "paper26.ly"
315 \score {
316         \notes { c'2 e'4 f' | g'1 }
317         \paper { \translator { \EasyNotation } } 
318 }
319 @end lilypond
320
321 Note that @code{EasyNotation} overrides a @code{Score} context.  You
322 probably will want to print it with magnification to make it better
323 readable.
324
325 @cindex Xdvi
326 @cindex ghostscript
327
328 If you view the result with Xdvi, then staff lines will show through the
329 letters.  Printing the postscript file obtained either by using dvips or
330 the @code{-f ps} option of lilypond will produce the desired result.
331
332
333 @node Tie
334 @subsection Tie
335
336 @cindex Tie
337 @cindex ties
338 @cindex @code{~}
339
340 A tie connects two adjacent note heads of the same pitch.  When used
341 with chords, it connects all of the note heads whose pitches match.
342 Ties are indicated using the tilde symbol `@code{~}'.
343 If you try to tie together chords which have no common pitches, a
344 warning message will appear and no ties will be created.
345
346 @lilypond[fragment,verbatim,center]
347   e' ~ e' <c' e' g'> ~ <c' e' g'>
348 @end lilypond
349
350 If you dislike the amount of ties created for a chord, you set
351 @code{Voice.sparseTies} to true, resulting in  a smaller number of
352 ties:
353 @lilypond[fragment,verbatim,center]
354   \property Voice.sparseTies = ##t
355   <c' e' g'> ~ <c' e' g'>
356 @end lilypond
357
358 In its meaning a tie is just a way of extending a note duration, similar
359 to the augmentation dot: the following example are three ways of notating
360 exactly the same concept.
361 @lilypond[fragment, singleline]
362 c'2 c'4 ~ c'4
363 @end lilypond
364
365 @refbugs
366
367 At present, the tie is implemented as a separate thing, temporally
368 located in between the notes. There is also no way to convert
369 between tied notes, dotted notes and plain notes.
370
371 Tieing only a subset of the note heads of a chord is not supported in a
372 simple way.  It can be achieved by moving the tie-engraver into Thread
373 context and turning off ties per Thread.
374
375
376 @node Tuplets
377 @subsection Tuplets
378
379 @cindex tuplets
380 @cindex triplets
381 @cindex @code{\times}
382
383 Tuplets are made out of a music expression by multiplying their duration
384 with a fraction.
385
386 @cindex @code{\times}
387 @example
388   \times @var{fraction} @var{musicexpr}
389 @end example
390
391 The duration of @var{musicexpr} will be multiplied by the fraction. 
392 In print, the fraction's denominator will be printed over the notes,
393 optionally with a bracket.  The most common tuplet is the triplet in
394 which 3 notes have the length of 2, so the notes are 2/3 of
395 their written length:
396
397 @lilypond[fragment,verbatim,center]
398   g'4 \times 2/3 {c'4 c' c'} d'4 d'4
399 @end lilypond
400
401 The property @code{tupletSpannerDuration} specifies how long brackets
402 should last.  With this, you can make lots of tuplets while typing
403 @code{\times} only once. This saves typing work when you must make lots
404 of tuplets.
405
406 @lilypond[fragment,  relative, singleline, verbatim]
407 \property Voice.tupletSpannerDuration = #(make-moment 1 4)
408 \times 2/3 { c''8 c c c c c }
409 @end lilypond
410
411 @c .  {Rests}
412 @node  Rests
413 @subsection Rests
414 @cindex Rests
415
416 Rests are entered like notes, with note name `@code{r}'.
417
418
419 @c .  {Skip}
420 @node Skip
421 @subsection Skip
422 @cindex Skip
423
424
425 @example
426   \skip @var{duration} @code{;}
427   s@var{duration}
428 @end example
429 @cindex @code{\skip}
430
431 Skips the amount of time specified by @var{duration}.  If no other music
432 is played, a gap will be left for the skipped time with no notes
433 printed.  The shorthand is only available in Note and Chord mode.
434
435
436
437 @node Note mode
438 @subsection Note mode
439
440
441
442 @cindex note mode
443 @cindex @code{\notes}
444
445 Note mode is the lexical mode generally used for inputting notes. The
446 syntax is
447 @example
448 \notes @var{expr}
449 @end example
450
451 This instructs the tokenizer to interpret @var{expr} in note mode.  If a
452 a sequence of alfabetical characters, like @code{foobar}, LilyPond first
453 checks if @code{foobar} is a pitch name.  If it is not a pitch name,
454 then it is treated as a string.
455
456 Numbers and dots indicate durations, so you can enter floating point
457 numbers in this mode.
458
459
460 @node Staff notation
461 @section Staff notation
462
463 @cindex Staff notation
464
465 @menu
466 * Key signature::               
467 * Clef::                        
468 * Time signature::              
469 * Unmetered music::             
470 * Bar lines::                   
471 @end menu
472
473 @c .  {Key}
474 @node Key signature
475 @subsection Key signature
476 @cindex Key
477
478 @cindex @code{\key}
479
480 Changing the key signature is done with the @code{\key} command.
481 @example
482   @code{\key} @var{pitch} @var{type} @code{;}
483 @end example
484
485 @cindex @code{\minor}
486 @cindex @code{\major}
487 @cindex @code{\minor}
488 @cindex @code{\ionian}
489 @cindex @code{\locrian}
490 @cindex @code{\aeolian}
491 @cindex @code{\mixolydian}
492 @cindex @code{\lydian}
493 @cindex @code{\phrygian}
494 @cindex @code{\dorian}
495
496 Here, @var{type} should be @code{\major} or @code{\minor} to get
497 @var{pitch}-major or @var{pitch}-minor, respectively.  The second
498 argument is optional; the default is major keys.  The @var{\context}
499 argument can also be given as an integer, which tells the number of
500 semitones that should be added to the pitch given in the subsequent
501 @code{\key} commands to get the corresponding major key, e.g.,
502 @code{\minor} is defined as 3.  The standard mode names @code{\ionian},
503 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
504 @code{\phrygian}, and @code{\dorian} are also defined.
505
506 This command sets context property @code{Staff.keySignature}.
507
508 @cindex @code{keySignature}
509
510 @c .  {Clef}
511 @node Clef
512 @subsection Clef
513 @cindex @code{\clef}
514 @example
515   \clef @var{clefname} @code{;}
516 @end example
517
518 Shortcut for
519
520 @example
521   \property Staff.clefGlyph = @var{glyph associated with clefname} 
522   \property Staff.clefPosition = @var{clef Y-position for clefname}
523   \property Staff.clefOctavation = @var{extra pitch of clefname}
524 @end example
525
526 Supported clef-names include 
527
528 @itemize @bullet
529 @item treble, violin, G, G2: G clef on 2nd line
530 @item french: G clef on 1st line
531 @item soprano: C clef on 1st line
532 @item mezzosoprano: C clef on 2nd line
533 @item alto: C clef on 3rd line
534 @item tenor: C clef on 4th line
535 @item baritone: C clef on 5th line
536 @item varbaritone: F clef on 3rd line
537 @item bass, F: F clef on 4th line
538 @item subbass: F clef on 5th line
539 @item percussion: percussion clef
540 @end itemize
541
542 Supported associated glyphs (for @code{Staff.clefGlyph}) are:
543
544 @itemize @bullet
545 @item clefs-C: modern style C clef
546 @item clefs-F: modern style F clef
547 @item clefs-G: modern style G clef
548 @item clefs-vaticana_do: Editio Vaticana style do clef
549 @item clefs-vaticana_fa: Editio Vaticana style fa clef
550 @item clefs-medicaea_do: Editio Medicaea style do clef
551 @item clefs-medicaea_fa: Editio Medicaea style fa clef
552 @item clefs-mensural1_c: modern style mensural C clef
553 @item clefs-mensural2_c: historic style small mensural C clef
554 @item clefs-mensural3_c: historic style big mensural C clef
555 @item clefs-mensural1_f: historic style traditional mensural F clef
556 @item clefs-mensural2_f: historic style new mensural F clef
557 @item clefs-mensural_g: historic style mensural G clef
558 @item clefs-hufnagel_do: historic style hufnagel do clef
559 @item clefs-hufnagel_fa: historic style hufnagel fa clef
560 @item clefs-hufnagel_do_fa: historic style hufnagel combined do/fa clef
561 @item clefs-percussion: modern style percussion clef
562 @end itemize
563
564 @emph{Modern style} means ``as is typeset in current editions.''
565 @emph{Historic style} means ``as was typeset or written in contemporary
566 historic editions''.  @emph{Editio XXX style} means ``as is/was printed in
567 Editio XXX.''
568
569 @cindex Vaticana, Editio
570 @cindex Medicaea, Editio
571 @cindex hufnagel clefs
572
573
574 @c .  {Time signature}
575 @node Time signature
576 @subsection Time signature
577 @cindex Time signature
578 @cindex meter
579 @cindex @code{\time}
580
581 The time signature is changed by the @code{\time} command. Syntax:
582 @example
583   \time @var{numerator}@code{/}@var{denominator} @code{;}
584 @end example
585 Internally, this is a shortcut for doing
586 @example
587      \property Score.timeSignatureFraction = #'(@var{numerator} . @var{denominator})
588 @end example
589
590 [TODO: discuss options for layout]
591
592 @c .   {Partial}
593 @subsection Partial
594 @cindex Partial
595 @cindex anacrusis
596 @cindex upstep
597 @cindex partial measure
598 @cindex measure, partial
599 @cindex shorten measures
600 @cindex @code{\partial}
601
602 Partial measures are entered using the @code{\partial} command:
603 @example
604   \partial @var{duration} @code{;}
605 @end example
606
607 Internally,  this is a shortcut for 
608
609 @example
610   \property Score.measurePosition = -@var{length of duration}
611 @end example
612 @cindex @code{|}
613
614
615 @node Unmetered music
616 @subsection Unmetered music
617
618 Bar lines and bar numbers are calculated automatically. For unmetered
619 music (e.g. cadenzas), this is not desirable. The property
620 @code{Score.timing} can be used to switch off this automatic timing
621
622 @lilypond[fragment,relative,singleline,verbatim]
623 c'2.
624 \property Score.timing = ##f
625 c4 c4 c4  
626 \property Score.timing = ##t
627 c4 c4 c4 
628 @end lilypond
629
630 The identifiers @code{\cadenzaOn} and @code{\cadenzaOff} can be used to
631 achieve the same effect.
632
633
634
635 @c .   {Bar lines}
636 @node Bar lines
637 @subsection Bar lines
638 @cindex Bar lines
639
640 @cindex @code{\bar}
641 @cindex measure lines
642 @cindex repeat bars
643
644 @example
645   \bar @var{bartype};
646 @end example
647
648 This is a shortcut for doing
649 @example
650   \property Score.whichBar = @var{bartype} 
651 @end example
652
653 You are encouraged to use @code{\repeat} for repetitions.  See
654 @ref{Repeats}, and the documentation of @code{whichBar} in the generated
655 documentation.
656
657
658 @cindex Bar_line_engraver
659 @cindex whichBar
660 @cindex repeatCommands
661 @cindex defaultBarType
662
663 Bar lines are created by the @code{Bar_line_engraver}. That engraver examines
664 @code{whichBar} at every moment. Whenever it is set to a string, it will
665 create a bar with that type.  @code{whichBar} is usually set
666 automatically: at the start of a measure it is set to
667 @code{defaultBarType}. The contents of @code{repeatCommands} is used to
668 override default measure bars. 
669
670 @code{whichBar} can also be set directly, using @code{\property} or
671 @code{\bar ; }.  These settings take precedence over automatic @code{whichBar}
672 settings. 
673
674
675 @c .   {Polyphony}
676 @node Polyphony
677 @section Polyphony
678 @cindex polyphony
679
680 Polyphonic parts, i.e. parts with more than one voice on a staff can be
681 typeset with LilyPond.   To use this, instantiate a separate Voice
682 context for each part, and assign a stem direction to each part. 
683 @lilypond[fragment,verbatim]
684 \context Staff
685 < \context Voice = VA { \stemUp b'4 a' g' f' e' }
686   \context Voice = VB { \stemDown g'4 g' g' g' g' } >
687 @end lilypond
688
689 When there are more than two voices on a staff, you must also indicate
690 which voice should moved horizontally in case of a collision. This can
691 be done with the identifiers @code{\shiftOff}, @code{\shiftOn},
692 @code{\shiftOnn}, etc. (which sets grob property @code{horizontal-shift}
693 in @code{NoteColumn}).
694
695 @lilypond[fragment, verbatim]
696   \context Staff \notes\relative c''<
697        \context Voice=one {
698        \shiftOff \stemUp e4
699        }
700        \context Voice=two {
701           \shiftOn \stemUp cis
702        }
703        \context Voice=three {
704          \shiftOnn \stemUp ais
705        }
706        \context Voice=four {
707           \shiftOnnn \stemUp fis-2
708        }
709   >
710 @end lilypond
711
712 The most convenient way is to use the identifiers @code{\voiceOne}
713 through @code{\voiceFour}, which also set slur and tie directions in the
714 correct manner.
715
716 @lilypond[singleline, verbatim]
717 \relative c''
718 \context Staff < \context Voice = VA { \voiceOne cis2 b  }
719   \context Voice = VB { \voiceThree b4 ais ~ ais4 gis4 } 
720   \context Voice = VC { \voiceTwo fis4~  fis4 f ~ f  } >
721 @end lilypond
722
723
724 LilyPond also vertically shifts rests that are opposite of a stem. 
725
726 @lilypond[singleline,verbatim]
727 \context Staff <
728 \context Voice {  \stemUp c''4  }
729 \context Voice =VB { r4 }
730 >
731 @end lilypond
732
733 Note head collisions (horizontal shifting of note heads) are handled by
734 the @code{NoteCollision} grob. @code{RestCollision} handles vertical
735 shifting of rests.
736
737 @cindex @code{NoteCollision}
738 @cindex @code{RestCollision}
739
740
741 @refbugs
742
743 Resolving collisions is a very intricate subject, and LilyPond only
744 handles a few situations. When it can not cope, you are advised to use
745 @code{force-hshift} of the NoteColumn grob and @code{staff-position} of
746 the Rest grob to override typesetting decisions.
747
748 [TODO: doc merge-differently-dotted]
749
750 @node Beaming
751 @section Beaming
752
753 Beams are used to group short notes into chunks that are aligned with
754 the metrum.  LilyPond guesses where beams should be inserted, but if
755 you're not satisfied with the automatic beaming, you can either instruct
756 lilypond which patterns to beam automatically. In specific cases, you
757 can also specify explicitly what to beam and what not.
758
759
760 @c .    {Automatic beams}
761 @subsection Automatic beams
762
763 @cindex @code{Voice.autoBeamSettings}
764 @cindex @code{(end * * * *)}
765 @cindex @code{(begin * * * *)}
766
767 A large number of Voice properties are used to decide how to generate
768 beams.  Their default values appear in @file{scm/auto-beam.scm}.
769
770 By default, automatic beams can start on any note@footnote{In exotic
771 time signatures such as 1/8 and 1/16 this is not true} but can only end
772 in a few positions within the measure: they can end on a beat, or at
773 durations specified by the properties in
774 @code{Voice.autoBeamSettings}. The defaults for @code{autoBeamSettings}
775 are defined in @file{scm/auto-beam.scm}.
776
777 The syntax for  changing the value @code{autoBeamSettings} is set using
778 @code{\override} and unset using @code{\revert}:
779 @example
780 \property Voice.autoBeamSettings \override #'(@var{BE} @var{N} @var{M} @var{P} @var{Q}) = @var{dur}
781 \property Voice.autoBeamSettings \revert #'(@var{BE} @var{N} @var{M} @var{P} @var{Q})
782 @end example
783 Here, @var{BE} is the symbol @code{begin} or @code{end}. It determines
784 whether the rule applies to begin or end-points.  The quantity
785 @var{N}/@var{M} refers to a time signature (@code{* *} may be entered to
786 designate all time signatures), @var{P}/@var{Q} refers to the length of
787 the beamed notes (@code{* *} designate notes of any length).
788
789 If you want automatic beams to end on every  quarter note, you can
790 use the following:
791 @example
792 \property Voice.autoBeamSettings \override
793     #'(end * * * *) = #(make-moment 1 4)
794 @end example
795 The duration a quarter note is 1/4 of a whole note. It is entered as
796 @code{(make-moment 1 4)}. 
797
798 The same syntax can be used to specify beam starting points. In this
799 example, you automatic beams can only end on a dotted quarter note. 
800 @example
801 \property Voice.autoBeamSettings \override
802     #'(begin * * * *) = #(make-moment 3 8)
803 @end example
804 In 4/4 time signature, this means that automatic beams could end only on
805 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
806 3/8 has passed within the measure).
807
808 You can also restrict rules to specific time signatures. A rule that
809 should only be applied in @var{N}/@var{M} time signature is formed by
810 replacing the first asterisks by @var{N} and @var{M}. For example, a
811 rule for 6/8 time exclusively looks like
812 @example
813 \property Voice.autoBeamSettings \override
814     #'(begin 6 8 * *) =  ... 
815 @end example
816
817 If you want a rule to apply to certain types of beams, you can use the
818 second pair of asterisks. Beams are classified according to the shortest
819 note they contain. For a beam ending rule that only applies to beams
820 with 32nd notes (and no shorter notes), you would use @code{(end * * 1
821 32)}.
822
823 @c not true
824 @c Automatic beams can not be put on the last note in a score.
825
826 If a score ends while an automatic beam has not been ended and is still
827 accepting notes, this last beam will not be typeset at all.
828
829 @cindex automatic beam generation
830 @cindex autobeam
831 @cindex @code{Voice.noAutoBeaming}
832
833 Automatic beaming is on by default, but it can switched off by setting
834 @code{Voice.noAutoBeaming} to true.  You you may find this necessary for
835 a melody that goes with lyrics.
836
837 @refbugs
838
839 It is not possible to specify beaming parameters for beams with mixed
840 durations, that differ from the beaming parameters of all separate
841 durations, ie, you'll have to specify manual beams to get:
842 @lilypond[fragment,singleline,relative]
843   \property Voice.autoBeamSettings
844   \override #'(end * * * *) = #(make-moment 3 8)
845   \time 12/8; c'8 c c c16 c c c c c [c c c c] c8 c c4
846 @end lilypond
847
848 It is not possible to specify beaming parameters that act differently in
849 different parts of a measure, eg, in irregular meters such as @code{5/8}
850 that breaks down to @code{2/8 +3/8} or @code{3/8 + 2/8}, automatic beams
851 won't act according to the broken down parts @code{2/8} and @code{3/8}.
852
853 @c .    {Manual beams}
854 @cindex Automatic beams
855 @subsection Manual beams
856 @cindex beams, manual
857 @cindex @code{]}
858 @cindex @code{[}
859
860 In some cases it may be necessary to override LilyPond's automatic
861 beaming algorithm.  For example, the auto beamer will not beam over
862 rests or bar lines, so if you want that, specify the begin and end point
863 manually using @code{[} and @code{]}:
864
865 @lilypond[fragment,relative,verbatim]
866   \context Staff {
867     r4 [r8 g'' a r8] r8 [g | a] r8
868   }
869 @end lilypond
870 Whenever an manual beam is busy, the auto beam will not produce
871 anything.
872
873 @cindex @code{stemLeftBeamCount}
874
875 If you have specific wishes for the number of beams, you can fully
876 control the number of beams through the properties
877 @code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount}.
878
879 @lilypond[fragment,relative,verbatim]
880   \context Staff {
881     [f'8 r16 f g a]
882     [f8 r16 \property Voice.stemLeftBeamCount = #1 f g a]
883   }
884 @end lilypond
885 @cindex @code{stemRightBeamCount}
886
887 The beam symbol can be tweaked through @code{Voice.Beam}'s
888 grob-properties @code{height} and @code{staff-position},
889 in staff-spaces.
890
891 Set @code{height} to zero, to get horizontal beams:
892
893 @lilypond[fragment,relative,verbatim]
894   \property Voice.Beam \set #'direction = #1
895   \property Voice.Beam \set #'height = #0
896   [a''8 e' d c]
897 @end lilypond
898
899 Here's how you'd specify a weird looking beam that instead of being
900 horizontal, falls two staff spaces:
901
902 @lilypond[fragment,relative,verbatim]
903   \property Voice.Beam \set #'staff-position = #2
904   \property Voice.Beam \set #'height = #-2
905   [c'8 c] 
906 @end lilypond
907 @cindex @code{default-neutral-direction}
908
909 @node Expressive marks
910 @section Expressive marks
911
912 @c .   {Slur}
913 @menu
914 * Slur ::                       
915 * Phrasing slur::               
916 * Breath marks::                
917 * Tempo::                       
918 * Text spanner::                
919 @end menu
920
921 @node Slur 
922 @subsection Slur
923 @cindex slur
924
925 A slur indicates that notes are to be played bound or @emph{legato}.  In
926 lilypond, they are entered using parentheses:
927 @lilypond[fragment,verbatim,center]
928   f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
929 @end lilypond
930
931
932 Slurs avoid crossing stems, and are attached to note heads whenever
933 possible.  In some instances involving beams slurs may be attached to a
934 stem end.  If you want to override this layout you can do this through
935 @code{Voice.Slur}'s grob-property @code{attachment}:
936
937 Maybe reinclude other slur features and move back to tricks?  Esp. the
938 second example, how to fix, can be very helpful.
939
940 @lilypond[fragment,relative,verbatim]
941   \property Voice.Slur \set #'direction = #1
942   \property Voice.Stem \set #'length = #5.5
943   g''8(g)g4
944   \property Voice.Slur \set #'attachment = #'(stem . stem)
945   g8(g)g4
946 @end lilypond
947
948 If a slur would strike through a stem or beam, the slur will be moved
949 away upward or downward. If this happens, attaching the slur to the
950 stems might look better:
951
952 @lilypond[fragment,relative,verbatim]
953   \property Voice.Stem \set #'direction = #1
954   \property Voice.Slur \set #'direction = #1
955   d'32( d'4 )d8..
956   \property Voice.Slur \set #'attachment = #'(stem . stem)
957   d,32( d'4 )d8..
958 @end lilypond
959
960
961 Similarly, the curvature of a slur is adjusted to stay clear of note
962 heads and stems.  When that would increase the curvature too much, the
963 slur is reverted to its default shape.  The threshold for this decision
964 is in @code{Voice.Slur}'s grob-property @code{beautiful}.  It is loosely
965 related to the enclosed area between the slur and the notes.  Usually,
966 the default setting works well, but in some cases you may prefer a
967 curved slur when LilyPond decides for a vertically moved one.  You can
968 express this by increasing the @code{beautiful} value:
969
970 @lilypond[verbatim,singleline,relative]
971   \property Voice.Beam \override #'direction = #-1
972   \property Voice.Slur \override #'direction = #1
973   c'16( a' f' a a f a, )c,
974   c( a' f' a a f d, )c
975   \property Voice.Slur \override #'beautiful = #5.0
976   c( a' f' a a f d, )c
977 @end lilypond
978
979 @refbugs
980
981 The definition for @code{beautiful} is vague, the default setting is
982 experimental computer science.
983
984 @cindex Adusting slurs
985
986 @node Phrasing slur
987 @subsection Phrasing slur
988
989 @cindex phrasing slur
990 @cindex phrasing mark
991
992 A phrasing slur (or phrasing mark) connects chords and is used to
993 indicate a musical sentence. It is entered using @code{\(} and
994 @code{\)}.
995
996 @lilypond[fragment,verbatim,center,relative]
997   \time 6/4; c''\((d)e f(e)\)d
998 @end lilypond
999
1000 Typographically, the phrasing slur behaves almost exactly like a normal
1001 slur. The grob associated with it is @code{Voice.PhrasingSlur}.
1002
1003 @node Breath marks
1004 @subsection Breath marks
1005
1006 Breath marks are entered using @code{\breathe}:
1007
1008 @lilypond[fragment,relative]
1009 c'4 \breathe d4
1010 @end lilypond
1011
1012 Currently, only tick marks are supported, comma style breath marks are
1013 not. The grob for this object is called @code{Voice.BreathingSign}.
1014
1015
1016 @refbugs
1017
1018   Currently, only tick marks are supported, comma style breath marks are
1019 not.
1020
1021
1022 @c .  {Tempo}
1023 @node Tempo
1024 @subsection Tempo
1025 @cindex Tempo
1026 @cindex beats per minute
1027 @cindex metronome marking
1028
1029 @cindex @code{\tempo}
1030 @example
1031   \tempo @var{duration} = @var{perminute} @code{;}
1032 @end example
1033
1034 Used to specify the tempo.  For example, @code{\tempo 4 = 76;} requests
1035 output with 76 quarter notes per minute.
1036   
1037 @refbugs
1038   
1039 The tempo setting is not printed, but is currently only used in the MIDI
1040 output.
1041   
1042
1043
1044 @node Text spanner
1045 @subsection Text spanner
1046 @cindex Text spanner
1047
1048 Some textual indications, e.g. rallentando, accelerando, often extend
1049 over a many measures. This is indicated by following the text with a
1050 dotted line.   You can create such texts in LilyPond using 
1051 text spanners. The syntax is as follows: 
1052 @example
1053 \spanrequest \start "text"
1054 \spanrequest \stop "text"
1055 @end example
1056 LilyPond will respond by creating a @code{Voice.TextSpanner} grob.  The
1057 string to be printed, as well as the style is set through grob
1058 properties.
1059
1060 An application---or rather, a hack---is to fake octavation indications.
1061 @lilypond[fragment,relative,verbatim]
1062  \relative c' {  a'''' b c a
1063   \property Voice.TextSpanner \set #'type = #'dotted-line
1064   \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5)
1065   \property Voice.TextSpanner \set #'edge-text = #'("8va " . "")
1066   \property Staff.centralCPosition = #-13
1067   a\spanrequest \start "text" b c a \spanrequest \stop "text" }
1068 @end lilypond
1069
1070
1071 @c .  {Ornaments}
1072 @node Ornaments
1073 @section Ornaments
1074 @cindex Ornaments
1075 @menu
1076 * Articulation::                
1077 * Text scripts::                
1078 * Grace notes::                 
1079 * Glissando ::                  
1080 * Dynamics::                    
1081 @end menu
1082
1083 @c .   {Articulation}
1084 @node Articulation
1085 @subsection Articulation
1086 @cindex Articulation
1087
1088 @cindex articulations
1089 @cindex scripts
1090 @cindex ornaments
1091
1092 A variety of symbols can appear above and below notes to indicate
1093 different characteristics of the performance.  These symbols can be
1094 added to a note with `@var{note}@code{-\}@var{name}'.  Numerous symbols
1095 are defined in @file{script.ly} and @file{script.scm}.  Symbols can be
1096 forced to appear above or below the note by writing
1097 `@var{note}@code{^\}@var{name}' and `@var{note}@code{_\}@var{name}'
1098 respectively.  Here is a chart showing symbols above notes, with the
1099 name of the corresponding symbol appearing underneath.
1100
1101 @lilypond[]
1102   \score {
1103     < \notes {
1104         \property Score.LyricSyllable \override #'font-family =
1105 #'typewriter
1106         \property Score.LyricSyllable \override #'font-shape = #'upright
1107         c''-\accent      c''-\marcato      c''-\staccatissimo c''-\fermata 
1108         c''-\stopped     c''-\staccato     c''-\tenuto        c''-\upbow
1109         c''-\downbow     c''^\lheel        c''-\rheel         c''^\ltoe
1110         c''-\rtoe        c''-\turn         c''-\open          c''-\flageolet
1111         c''-\reverseturn c''-\trill        c''-\prall         c''-\mordent
1112         c''-\prallprall  c''-\prallmordent c''-\upprall       c''-\downprall
1113         c''-\thumb       c''-\segno        c''-\coda
1114       }
1115       \context Lyrics \lyrics {
1116         accent__      marcato__      staccatissimo__ fermata
1117         stopped__     staccato__     tenuto__        upbow
1118         downbow__     lheel__        rheel__         ltoe
1119         rtoe__        turn__         open__          flageolet
1120         reverseturn__ trill__        prall__         mordent
1121         prallprall__  prallmordent__ uprall__        downprall
1122         thumb__       segno__        coda
1123       }
1124     >
1125     \paper {
1126       linewidth = 5.875\in;          
1127       indent    = 0.0;
1128     }
1129   }
1130 @end lilypond
1131
1132 To save typing work, some shorthands are available:
1133 @lilypond[singleline]
1134   \score {
1135     \notes \context Voice {
1136       \property Voice.TextScript \set #'font-family = #'typewriter
1137       \property Voice.TextScript \set #'font-shape = #'upright
1138       c''4-._"c-."      s4
1139       c''4--_"c-{}-"    s4
1140       c''4-+_"c-+"      s4
1141       c''4-|_"c-|"      s4
1142       c''4->_"c->"      s4
1143       c''4-^_"c-\\^{ }" s4
1144     }
1145   }
1146 @end lilypond
1147
1148 @cindex fingering
1149
1150 Fingering instructions can also be entered in  this shorthand.
1151 @lilypond[verbatim, singleline, fragment]
1152       c'4-1 c'4-2 c'4-3 c'4-4
1153 @end lilypond
1154
1155
1156 @cindex @code{\script}
1157 @cindex scripts
1158 @cindex superscript
1159 @cindex subscript
1160
1161 @example
1162   \script @var{alias}
1163 @end example
1164
1165 Defines a script printing request.  The argument is a string which
1166 points into the script-alias table defined in @file{scm/script.scm}.
1167 Usually the @code{\script} keyword is not used directly.  Various
1168 helpful identifier definitions appear in @file{script.ly}.
1169
1170 For information on how to add scripts, consult @file{scm/script.scm}.
1171
1172
1173 @refbugs
1174
1175 All of these note ornaments appear in the printed output but have no
1176 effect on the MIDI rendering of the music.
1177
1178 Unfortunately, there is no support adding fingering instructions or
1179 ornaments to individual note heads. Some hacks exist, though. See
1180 @file{input/test/script-horizontal.ly}.
1181
1182
1183 @c .  {Text scripts}
1184 @node Text scripts
1185 @subsection Text scripts
1186 @cindex Text scripts
1187
1188 In addition, it is possible to place arbitrary strings of text or markup
1189 text (see @ref{Text markup}) above or below notes by using a string:
1190 @code{c^"text"}.  The text is typeset in italic by default.
1191
1192 The amount of space taken by these indications by default does not
1193 influence, spacing, but setting @code{Voice.textNonEmpty} to true will
1194 take the widths into account.  The identifier @code{\fattext} is defined
1195 in the standard  includes.
1196 @lilypond[fragment,singleline,verbatim]
1197 \relative c' { c4^"longtext" \fatText c4_"longlongtext" c4 }
1198 @end lilypond
1199
1200 Text scripts are created in form of @code{Voice.TextScript} grobs.
1201
1202 For purposes of defining identifiers, a more verbose form also exists:
1203
1204 @example
1205   \textscript @var{text} 
1206 @end example
1207
1208 Defines a text to be printed over or under a note.  @var{text} is a
1209 string or  a markup text.
1210 @quotation
1211
1212 @example 
1213 foo = \textscript #'(finger "6")
1214   [..]
1215 c4-\foo
1216 @end example 
1217
1218 @end quotation
1219
1220 This is equivalent to @code{c4-6 c4-"foo"}.  
1221
1222
1223 @c .   {Grace notes}
1224 @node Grace notes
1225 @subsection Grace notes
1226
1227
1228
1229
1230
1231
1232
1233 @cindex Grace music
1234 @cindex @code{\grace}
1235 @cindex ornaments
1236 @cindex grace notes
1237 @cindex @code{graceAlignPosition}
1238
1239 Grace notes are ornaments that are written out, but do not take up  any
1240 logical time in a measure. LilyPond has limited support for grace notes.
1241 The syntax is as follows. 
1242 @example
1243   \grace @var{musicexpr}
1244 @end example
1245
1246 When grace music is interpreted, a score-within-a-score is set up:
1247 @var{musicexpr} has its own time bookkeeping, and you could (for
1248 example) have a separate time signature within grace notes.  While in
1249 this score-within-a-score, you can create notes, beams, slurs, etc.
1250 Unbeamed eighth notes and shorter by default have a slash through the
1251 stem.  This behavior can be controlled with the
1252 @code{Stem}.@code{flag-style} property.
1253
1254 @lilypond[fragment,verbatim]
1255 \relative c'' {
1256   \grace c8 c4 \grace { [c16 c16] } c4
1257   \grace { \property Grace.Stem \override #'flag-style = #'() c16 } c4
1258 }
1259 @end lilypond
1260
1261
1262 At present, nesting @code{\grace} notes is not supported. The following
1263 may cause run-time errors:
1264 @example
1265   @code{\grace @{ \grace c32 c16 @} c4}
1266 @end example
1267 Since the meaning of such a construct is unclear, we don't consider this
1268 a loss.  Similarly, juxtaposing two @code{\grace} sections is
1269 syntactically valid, but makes no sense and may cause runtime errors.
1270 Ending a staff or score with grace notes may also generate a run-time
1271 error, since there will be no main note to attach the grace notes to.
1272
1273
1274 A grace note expression has duration 0; the next real note is assumed to
1275 be the main note. If you want the note to appear after the main note,
1276 set @code{Voice.graceAlignPosition} to @code{1}.
1277
1278 @refbugs
1279
1280 The present implementation of grace notes is not robust and generally
1281 kludgy. We expect it to change after LilyPond 1.4. Syntax changes might
1282 also be implemented.
1283
1284
1285
1286 @menu
1287 * Glissando ::                  
1288 * Dynamics::                    
1289 @end menu
1290
1291
1292
1293 @c .   {Glissando}
1294 @node Glissando 
1295 @subsection Glissando
1296 @cindex Glissando 
1297
1298 @cindex @code{\glissando}
1299
1300 A glissando line can be requested by attaching a @code{\glissando} to a
1301 note:
1302
1303 @lilypond[fragment,relative,verbatim]
1304   c'' \glissando c'
1305 @end lilypond
1306
1307 @refbugs
1308
1309 Printing of an additional text (such as @emph{gliss.}) must be done
1310 manually.
1311
1312
1313
1314 @c .   {Dynamics}
1315 @node Dynamics
1316 @subsection Dynamics
1317 @cindex Dynamics
1318
1319
1320
1321 @cindex @code{\ppp}
1322 @cindex @code{\pp}
1323 @cindex @code{\p}
1324 @cindex @code{\mp}
1325 @cindex @code{\mf}
1326 @cindex @code{\f}
1327 @cindex @code{\ff}
1328 @cindex @code{\fff}
1329 @cindex @code{\ffff}
1330 @cindex @code{\fp}
1331 @cindex @code{\sf}
1332 @cindex @code{\sff}
1333 @cindex @code{\sp}
1334 @cindex @code{\spp}
1335 @cindex @code{\sfz}
1336 @cindex @code{\rfz}
1337
1338
1339 Absolute dynamic marks are specified by using an identifier after a
1340 note: @code{c4-\ff}.  The available dynamic marks are: @code{\ppp},
1341 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
1342 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
1343 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
1344
1345 @lilypond[verbatim,singleline,fragment,relative]
1346   c''\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
1347   c2\sf c\rfz
1348 @end lilypond
1349
1350 @cindex Crescendo and Decrescendo
1351 @cindex crescendo
1352 @cindex @code{\cr}
1353 @cindex @code{\rc}
1354 @cindex @code{\decr}
1355 @cindex @code{\rced}
1356 @cindex @code{\<}
1357 @cindex @code{\>}
1358 @cindex @code{\"!}
1359
1360
1361 A crescendo mark is started with @code{\cr} and terminated with
1362 @code{\rc} (the textual reverse of @code{cr}).  A decrescendo mark is
1363 started with @code{\decr} and terminated with @code{\rced}.  There are
1364 also shorthands for these marks.  A crescendo can be started with
1365 @code{\<} and a decrescendo can be started with @code{\>}.  Either one
1366 can be terminated with @code{\!}.  Note that @code{\!}  must go before
1367 the last note of the dynamic mark whereas @code{\rc} and @code{\rced} go
1368 after the last note.  Because these marks are bound to notes, if you
1369 want to get several marks during one note, you must use spacer notes.
1370
1371 @lilypond[fragment,verbatim,center]
1372   c'' \< \! c''   d'' \decr e'' \rced 
1373   < f''1 { s4 s4 \< \! s4 \> \! s4 } >
1374 @end lilypond
1375
1376 You can also use a text saying @emph{cresc.} instead of hairpins. Here
1377 is an example how to do it:
1378
1379 @lilypond[fragment,relative,verbatim]
1380   \context Voice {
1381     \property Voice.crescendoText = "cresc."
1382     \property Voice.crescendoSpanner = #'dashed-line
1383     a''2\mf\< a a \!a 
1384   }
1385 @end lilypond
1386
1387
1388 @refbugs
1389
1390 When using spacer notes to subdivide note dynamics and @code{linewidth =
1391 -1}, starting a hairpin on the first spacer note (the one coinciding
1392 with the real note) exposes an embarassing bug.
1393
1394
1395
1396 @c .  {Repeats}
1397 @node Repeats
1398 @section Repeats
1399
1400
1401 @cindex repeats
1402 @cindex @code{\repeat}
1403
1404 To specify repeats, use the @code{\repeat} keyword.  Since repeats
1405 should work differently when played or printed, there are a few
1406 different variants of repeats.
1407
1408 @table @asis
1409 @item unfolded  
1410 Repeated music is fully written (played) out.  Useful for MIDI
1411 output.
1412
1413 @item volta  
1414 This is the normal notation: Repeats are not written out, but
1415 alternative endings (voltas) are printed, left to right.
1416
1417 @item folded  
1418 Alternative endings are written stacked.  Which is unfortunately not
1419 practical for anything right now.
1420
1421 @item tremolo
1422 Make tremolo beams.
1423
1424 @item percent
1425 Make  measure repeats. These look like percent signs.
1426
1427 @end table  
1428
1429 @menu
1430 * Repeat syntax::               
1431 * Manual repeat commands::      
1432 * Tremolo repeats::             
1433 * Tremolo subdivision::         
1434 * Measure repeats::             
1435 @end menu
1436
1437 @node Repeat syntax
1438 @subsection Repeat syntax
1439
1440 The syntax for repeats is
1441
1442 @example
1443   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
1444 @end example
1445
1446 If you have alternative endings, you may add
1447 @cindex @code{\alternative}
1448 @example
1449  \alternative @code{@{} @var{alternative1}
1450             @var{alternative2}
1451             @var{alternative3} @dots{} @code{@}}
1452 @end example
1453 where each @var{alternative} is a music expression.
1454
1455 Normal notation repeats are used like this:
1456 @lilypond[fragment,verbatim]
1457   c'1
1458   \repeat volta 2 { c'4 d' e' f' }
1459   \repeat volta 2 { f' e' d' c' }
1460 @end lilypond
1461
1462 With alternative endings:
1463 @lilypond[fragment,verbatim]
1464   c'1
1465   \repeat volta 2 {c'4 d' e' f'} 
1466   \alternative { {d'2 d'} {f' f} }
1467 @end lilypond
1468
1469 Folded repeats look like this:@footnote{Folded repeats offer little
1470 more over simultaneous music.  However, it is to be expected that
1471 more functionality -- especially for the MIDI backend -- will be
1472 implemented at some point in the future.}
1473
1474 @lilypond[fragment,verbatim]
1475   c'1
1476   \repeat fold 2 {c'4 d' e' f'} 
1477   \alternative { {d'2 d'} {f' f} }
1478
1479 @end lilypond
1480
1481 If you don't give enough alternatives for all of the repeats, then
1482 the first alternative is assumed to be repeated often enough to equal
1483 the specified number of repeats.
1484
1485 @lilypond[fragment,verbatim]
1486 \context Staff {
1487   \relative c' {
1488     \partial 4;
1489     \repeat volta 3 { e | c2 d2 | e2 f2 | }
1490     \alternative { { g4 g g } { a | a a a a | b2. } }
1491   }
1492 }
1493 @end lilypond
1494
1495 @refbugs
1496
1497 As you can see, LilyPond doesn't remember the timing information, nor
1498 are slurs or ties repeated, so you have to reset timing information
1499 after a repeat, e.g. using a bar-check (See @ref{Bar check}),
1500 @code{Score.measurePosition} or @code{\partial}. We hope to fix this
1501 after 1.4.
1502
1503 It is possible to nest @code{\repeat}, although it probably is only
1504 meaningful for unfolded repeats.
1505
1506 @node Manual repeat commands
1507 @subsection Manual repeat commands
1508
1509 @cindex @code{repeatCommands}
1510
1511 The property @code{repeatCommands} can be used to control the layout of
1512 repeats. Its value is a Scheme list of repeat commands, where each repeat
1513 command can be
1514
1515 @table @code
1516 @item 'start-repeat
1517  Print a |: bar line
1518 @item 'stop-repeat
1519  Print a :| bar line
1520 @item (volta . @var{text})
1521   Print a volta bracket saying @var{text}.
1522 @item (volta . #f)
1523   Stop a running volta bracket
1524 @end table
1525
1526 @lilypond[verbatim, fragment]
1527  c''4
1528     \property Score.repeatCommands = #'((volta "93") end-repeat)
1529  c4 c4
1530     \property Score.repeatCommands = #'((volta #f))
1531  c4 c4
1532 @end lilypond
1533
1534
1535 @node Tremolo repeats
1536 @subsection Tremolo repeats
1537 @cindex tremolo beams
1538
1539 To place tremolo marks between notes, use @code{\repeat} with tremolo
1540 style.  
1541 @lilypond[verbatim,center,singleline]
1542 \score { 
1543   \context Voice \notes\relative c' {
1544     \repeat "tremolo" 8 { c16 d16 }
1545     \repeat "tremolo" 4 { c16 d16 }    
1546     \repeat "tremolo" 2 { c16 d16 }
1547     \repeat "tremolo" 4 c16
1548   }
1549 }
1550 @end lilypond
1551
1552 @refbugs
1553
1554
1555 At present, the spacing between tremolo beams is not regular, since the
1556 spacing engine does not notice that not all notes are printed.
1557
1558 @node Tremolo subdivision
1559 @subsection Tremolo subdivision
1560 @cindex tremolo marks
1561 @cindex @code{tremoloFlags}
1562
1563 Tremolo marks can be printed on a single note by adding
1564 `@code{:}[@var{length}]' after the note.  The length must be at least 8.
1565 A @var{length} value of 8 gives one line across the note stem.  If the
1566 length is omitted, then then the last value (stored in
1567 @code{Voice.tremoloFlags}) is used.
1568
1569 @lilypond[verbatim,fragment,center]
1570   c'2:8 c':32
1571 @end lilypond
1572 Using this mechanism pays off when you entering many tremolos, since the
1573 default argument saves a lot of typing.
1574
1575 @refbugs
1576
1577
1578 Tremolos in this style do not carry over into the MIDI output.
1579
1580
1581 @node Measure repeats
1582 @subsection Measure repeats
1583
1584 @cindex percent repeats
1585 @cindex measure repeats
1586
1587 In the @code{percent} style, a note pattern can be repeated. It is
1588 printed once, and then the pattern is replaced with a special sign.
1589
1590 @lilypond[verbatim,singleline]
1591  \context Voice { \repeat  "percent" 4  { c'4 }
1592     \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
1593 }
1594 @end lilypond
1595
1596 @refbugs
1597
1598 You can not nest percent repeats, filling in the first measure with
1599 slashes, and repeating that measure with percents.
1600
1601 @node Rhythmic music
1602 @section Rhythmic music
1603
1604
1605 @menu
1606 * Rhythmic staffs::             
1607 @end menu
1608
1609 @node Rhythmic staffs
1610 @subsection Rhythmic staffs
1611
1612 Some times you might want to show only the rhythm of a melody.  This can
1613 be done  with the rhythmic staff. All pitches of notes on such a staff
1614 are squashed, and the  staff itself  looks has  a single staff line:
1615
1616 @lilypond[fragment,relative ]
1617   \context RhythmicStaff {
1618       \time 4/4; 
1619       c4 e8 f  g2 | r4 g r2 | g1:32 | r1 |
1620   }
1621 @end lilypond
1622
1623
1624 @c . {Piano music}
1625 @node Piano music
1626 @section Piano music
1627
1628 Piano music is an odd type of notation: two staffs are largely
1629 independent, but sometimes voices can cross between the two staffs.  The
1630 @code{PianoStaff} is especially built to handle this cross-staffing
1631 behavior.  In this section we discuss the @code{PianoStaff} and some
1632 other pianistic peculiarities.
1633
1634 @menu
1635 * Automatic staff changes::     
1636 * Manual staff switches::       
1637 * Pedals::                      
1638 * Arpeggio::                    
1639 * VoiceFollower::               
1640 @end menu 
1641
1642
1643 @c .   {Automatic staff changes}
1644 @node Automatic staff changes
1645 @subsection Automatic staff changes
1646 @cindex Automatic staff changes
1647
1648 Voices can be switched from top to bottom staff automatically. The
1649 syntax for this is
1650 @example
1651         \autochange @var{contexttype} @var{musicexp}
1652 @end example
1653 This will switch notation context of @var{musicexp} between a
1654 @var{contexttype} named @code{up} and @code{down}. Typically, you use
1655 @code{Staff} for @var{contexttype}.  The autochanger switches on basis
1656 of pitch (central C is the turning point), and it looks ahead skipping
1657 over rests to switch rests in advance.
1658         
1659 @lilypond[verbatim,singleline]
1660 \score { \notes \context PianoStaff <
1661   \context Staff = "up" {
1662     \autochange Staff \context Voice = VA < \relative c' {
1663        g4 a  b c d r4 a g } > }
1664   \context Staff = "down" {
1665        \clef bass; 
1666        s1*2
1667 } > }
1668 @end lilypond
1669
1670 Note how spacer rests are used to prevent the bottom staff from
1671 terminating too soon.
1672
1673
1674 @node Manual staff switches
1675 @subsection Manual staff switches
1676
1677 @cindex manual staff switches
1678 @cindex staff switch, manual
1679
1680 Voices can be switched between staffs manually, using the following command:
1681 @example
1682   \translator Staff = @var{which} @var{music}
1683 @end example
1684 The string @var{which} is the name of the staff. Typically it is
1685 @code{"up"} or @code{"down"}. 
1686
1687 Formally, this construct is a music expression indicating that the
1688 context which is a direct child of the a context of type
1689 @var{contexttype} should be shifted to a context of type
1690 @var{contexttype} and the specified name.
1691
1692 @cindex @code{\translator}
1693 @example
1694   \translator @var{contexttype} = @var{name}
1695 @end example
1696
1697
1698 @c .   {Pedals}
1699 @node Pedals
1700 @subsection Pedals
1701 @cindex Pedals
1702
1703 Piano pedal instruction can be expressed using 
1704 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
1705 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp}.
1706
1707 These identifiers are shorthands for spanner commands of the types
1708 @code{Sustain}, @code{UnaCorda} and @code{Sostenuto}:
1709
1710 @lilypond[fragment,verbatim]
1711 c''4 \spanrequest \start "Sustain" c''4 c''4 \spanrequest \stop "Sustain"
1712 @end lilypond
1713
1714 The symbols that are printed can be modified by setting
1715 @code{pedal@var{X}Strings}, where @var{X} is one of the pedal
1716 types. Refer to the generated documentation for more information.
1717
1718 @refbugs
1719
1720
1721 Currently, brackets are not supported, only text markings (ie. *Ped
1722 style).
1723
1724
1725 @c .   {Arpeggio}
1726 @node Arpeggio
1727 @subsection Arpeggio
1728 @cindex Arpeggio
1729
1730 @cindex broken arpeggio
1731 @cindex @code{\arpeggio}
1732
1733 You can specify an arpeggio sign on a chord by attaching an
1734 @code{\arpeggio} to a note of the chord.
1735
1736
1737 @lilypond[fragment,relative,verbatim]
1738   \context Voice <c'\arpeggio e g c>
1739 @end lilypond
1740
1741 When an arpeggio crosses staffs in piano music, you attach an arpeggio
1742 to the chords in both staffs, and set
1743 @code{PianoStaff.connectArpeggios}.
1744
1745 @lilypond[fragment,relative,verbatim]
1746   \context PianoStaff <
1747     \property PianoStaff.connectArpeggios = ##t
1748     \context Voice = one  { <c''\arpeggio e g c> }
1749     \context Voice = other { \clef bass;  <c,,\arpeggio e g>}
1750   >  
1751 @end lilypond
1752
1753 This command creates @code{Arpeggio} grobs. 
1754
1755 @refbugs
1756
1757  It is not possible to mix
1758 connected arpeggios and unconnected arpeggios at the same time.
1759
1760
1761 @c .    {VoiceFollower}
1762 @node  VoiceFollower
1763 @subsection VoiceFollower
1764
1765 @cindex follow voice
1766 @cindex staff switching
1767 @cindex cross staff
1768
1769 @cindex @code{followVoice}
1770
1771 Whenever a voice switches to another staff a line connecting the notes
1772 can be printed automatically. This is enabled if the property
1773 @code{PianoStaff.followVoice} is set to true:
1774
1775 @lilypond[fragment,relative,verbatim]
1776   \context PianoStaff <
1777     \property PianoStaff.followVoice = ##t
1778     \context Staff \context Voice {
1779       c'1
1780       \translator Staff=two
1781       b2 a
1782     }
1783     \context Staff=two {\clef bass; \skip 1*2;}
1784   >  
1785 @end lilypond
1786
1787
1788 @c . {Lyrics}
1789 @node Lyrics
1790 @section Lyrics
1791
1792
1793 @menu
1794 * Lyrics mode::                 
1795 * Printing lyrics::             
1796 * Automatic syllable durations::  
1797 * More stanzas::                
1798 @end menu
1799
1800 @c .  {Lyrics mode}
1801 @node Lyrics mode
1802 @subsection Lyrics mode
1803 @cindex Lyrics mode
1804
1805 To print lyrics in LilyPond, you must first make a music expression from
1806 the lyric text. When they're in a music expression, that music
1807 expression can be printed by selecting an appropriate context.  We shall
1808 discuss lyric printing in this order.
1809
1810
1811 @cindex lyric mode
1812 @cindex @code{\lyrics}
1813
1814 You can enter lyrics in a special input mode of LilyPond. This mode is
1815 called Lyrics mode, and it is introduced by the keyword @code{\lyrics}.
1816 The purpose of this mode is that you can enter lyrics as plain text,
1817 punctuation and accents without any hassle.
1818
1819 The precise definition of this mode is in @ref{Lyrics mode
1820 definition}. The definition itself is ludicrous, and this will remain so
1821 until the authors of LilyPond acquire a deeper understanding of
1822 character encoding, or someone else steps up to fix this.
1823
1824 Syllables are entered like notes, with pitches replaced by text.  For
1825 example, @code{Twin- kle twin- kle} enters four syllables.  Note that
1826 the hyphen has no special meaning for lyrics, and does not introduce
1827 special symbols.
1828
1829 Spaces can be introduced into a lyric either by using quotes
1830 (@code{"}) or by using an underscore without quotes: @code{He_could4
1831 not4}.  All unquoted underscores are converted to spaces.
1832
1833 @c .  {Printing lyrics}
1834 @node Printing lyrics
1835 @subsection Printing lyrics
1836 @cindex lyrics
1837
1838 Normally, you will want to have notes and syllables matched
1839 automatically. This is accomplished using @code{\addlyrics}, which is
1840 documented in @ref{Automatic syllable durations}. Setting
1841 @code{automaticMelismata} in the melody staff, will cause slurs to be
1842 interpreted as melismata. Lyric syllables must be interpreted within a
1843 @code{Lyrics} context in order to printing them.
1844
1845 @lilypond[verbatim,singleline]
1846 \addlyrics \notes \relative c' {
1847         \time 7/4;
1848         \property Staff.automaticMelismata = ##t
1849         d'2 c4 b2 a2
1850         b2 c4 b4 ()  a4 g2 }
1851     \context Lyrics \lyrics { 
1852        Join us now and
1853        share the so -- ftware; }
1854 @end lilypond
1855
1856 @cindex extender
1857 @cindex lyric extender
1858 @cindex melisma
1859
1860 As you can see, extender lines are entered as @code{__}.  This will
1861 create an extender, a line that extends over the entire duration of the
1862 lyric.  This line will run all the way to the start of the next lyric,
1863 so you may want to shorten it by using a blank lyric (using @code{_}).
1864
1865 @cindex hyphen
1866
1867 If you want to have hyphens centered between syllables (rather than
1868 attached to the end of the first syllable) you can use the special
1869 `@code{-}@code{-}' lyric as a separate word between syllables.  This
1870 will result in a hyphen which length varies depending on the space
1871 between syllables, and which will be centered between the syllables. 
1872
1873 @cindex Lyric hyphen
1874
1875 @node Automatic syllable durations
1876 @subsection Automatic syllable durations
1877 @cindex Automatic syllable durations
1878
1879 @cindex automatic lyric durations
1880 @cindex @code{\addlyrics}
1881
1882 If you have lyrics that are set to a melody, you can import the rhythm
1883 of that melody into the lyrics using @code{\addlyrics}.  The syntax for
1884 this is
1885 @example
1886   \addlyrics @var{musicexpr1 musicexpr2}
1887 @end example
1888
1889 This means that both @var{musicexpr1} and @var{musicexpr2} are
1890 interpreted, but that every non-command atomic music expression
1891 (``every syllable'') in @var{musicexpr2} is interpreted using timing
1892 of @var{musicexpr1}.
1893 @cindex @code{automaticMelismata}
1894
1895 If the property @code{automaticMelismata} is set in the
1896 context of @var{musicexpr1}, no lyrics will be put on slurred or tied
1897 notes.
1898
1899 @lilypond[verbatim,fragment]
1900 \addlyrics
1901 \transpose c'' {
1902   \property Voice.automaticMelismata = ##t
1903   c8 () cis d8. e16 f2
1904 }
1905 \context Lyrics \lyrics {
1906  do4 re mi fa }
1907 @end lilypond
1908
1909 If you want the lyric lines to be above the melody staff, or in some
1910 other, more complex configuration, then build that configuration first
1911 using simultaneous music, and use @code{\addlyrics} after that.
1912
1913 @lilypond[verbatim, singleline]
1914 \notes <
1915   \context Lyrics = LA { s1 }
1916   \context Staff = SA { s1 }
1917   \addlyrics
1918         \context Staff = SA \relative c' { c4 e g g }
1919         \context Lyrics  = LA \lyrics { geen ge -- don -- der } >
1920 @end lilypond
1921
1922 For @code{\addlyrics} you should use a single rhythm melody, and single
1923 rhythm lyrics (a constant duration is the obvious choice).  If you do
1924 not, you can get undesired effects when using multiple stanzas:
1925
1926 @lilypond[verbatim,fragment]
1927 \addlyrics
1928 \transpose c'' {
1929   c8 () cis d8. e16 f2
1930 }
1931 \context Lyrics \lyrics
1932 < { do4 re mi fa }
1933   { do8 re mi fa } >
1934 @end lilypond
1935
1936 It is valid (but probably not very useful) to use notes instead of
1937 lyrics for @var{musicexpr2}.
1938
1939 @node More stanzas
1940 @subsection More stanzas
1941
1942 @cindex phrasing
1943
1944 If you have multiple stanzas printed underneath each other, the separate
1945 syllables should be aligned around punctuation. LilyPond can do this if
1946 you explain it which lyric lines belong to which melody.
1947
1948 To this end, give the Voice context an identity, and set the LyricsVoice
1949 to name starting with that identity. In the following example, the Voice
1950 identity is @code{duet}, and the identities of the LyricsVoices are
1951 @code{duet-1} and @code{duet-2}.
1952
1953
1954 @lilypond[singleline,verbatim]
1955 \score {
1956 \addlyrics
1957   \notes \relative c'' \context Voice = duet { \time 3/4;
1958      g2 e4 a2 f4 g2.  }
1959   \lyrics \context Lyrics <
1960   \context LyricsVoice = "duet-1" {
1961     \property LyricsVoice . stanza = "Bert"
1962     Hi, my name is bert.    }
1963   \context LyricsVoice = "duet-2" {
1964     \property LyricsVoice . stanza = "Ernie" 
1965     Ooooo, ch\'e -- ri, je t'aime. }
1966   >
1967 }
1968 @end lilypond
1969
1970 You can add stanza numbers by setting @code{LyricsVoice.Stanza} (for the
1971 first system) and @code{LyricsVoice.stz} for the following systems.
1972
1973 @cindex stanza numbering
1974
1975
1976 @c . {Chords}
1977 @node Chords
1978 @section Chords
1979 @cindex Chords
1980
1981 LilyPond has support for both entering and printing chords.  Chords are
1982 a harmonic device that is characterized by a set of pitches. It is
1983 something different from simultaneous music, although you can express a
1984 chord using simultaneous music. In fact, chords are internally stored as
1985 simultaneous music expressions. This means you can enter chords by name,
1986 and print them as note head, or enter as notes and print as chord names:
1987
1988
1989 @lilypond[verbatim,singleline]
1990 twoWays = \notes \transpose c'' {
1991   \chords {
1992     c1 f:sus4 bes/f
1993   }
1994   <c e g>
1995   <f bes c'>
1996   <f bes d'>
1997   }
1998
1999 \score {
2000    < \context ChordNames \twoWays
2001      \context Staff \twoWays > }
2002 @end lilypond
2003
2004 Note that this example also shows that the LilyPond chord does not
2005 attempt to be intelligent, if you enter @code{f bes d}, it does no
2006 attempt to find out whether it this is an inversion.
2007
2008 @menu
2009 * Chords mode::                 
2010 * Printing named chords::       
2011 @end menu
2012
2013 @c .  {Chords mode}
2014 @node Chords mode
2015 @subsection Chords mode
2016 @cindex Chords mode
2017
2018 Chord mode is a mode where you can input sets of pitches using common
2019 names.  It is introduced by the keyword @code{\chords}.  It is similar
2020 to note mode, but words are also looked up in a chord modifier table
2021 (containing @code{maj}, @code{dim}, etc).
2022
2023 Dashes and carets are used to indicate chord additions and subtractions,
2024 so articulation scripts can not be entered in Chord mode.
2025
2026 The syntax for named chords is as follows:
2027 @example
2028
2029   @var{tonic}[@var{duration}][@code{-}@var{modifiers}][@code{^}@var{subtractions}][@code{/}@var{inversion}][@code{/+}@var{bass}].
2030 @end example
2031
2032 @var{tonic} should be the tonic note of the chord, and @var{duration}
2033 is the chord duration in the usual notation.  There are two kinds of
2034 modifiers.  One type is @emph{chord additions}, which are obtained by
2035 listing intervals separated by dots.  An interval is written by its
2036 number with an optional @code{+} or @code{-} to indicate raising or
2037 lowering by half a step.  Chord additions has two effects: It adds
2038 the specified interval and all lower odd numbered intervals to the
2039 chord, and it may lower or raise the specified interval.  Intervals
2040 must be separated by a dot (@code{.}).
2041
2042 Throughout these examples, chords have been shifted around the staff
2043 using @code{\transpose}.
2044
2045 @lilypond[fragment,verbatim]
2046 \transpose c'' {
2047   \chords {
2048     c1  c:3-       c:7     c:8
2049     c:9 c:9-.5+.7+ c:3-.5- c:4.6.8
2050   }
2051 }
2052 @end lilypond
2053
2054 @cindex @code{aug}
2055 @cindex @code{dim}
2056 @cindex @code{maj}
2057 @cindex @code{sus}
2058
2059 The second type of modifier that may appear after the @code{:} is a
2060 named modifier.  Named modifiers are listed in the file
2061 @file{chord-modifiers.ly}.  The available modifiers are @code{m} and
2062 @code{min} which lower the 3rd half a step, `@code{aug}' which
2063 raises the 5th, `@code{dim}' which lowers the 5th,
2064 `@code{maj}' which adds a raised 7th, and `@code{sus}'
2065 which replaces the 5th with a 4th.
2066
2067 @lilypond[fragment,verbatim]
2068 \transpose c'' {
2069   \chords {
2070     c1:m c:min7 c:maj c:aug c:dim c:sus
2071   }
2072 }
2073 @end lilypond
2074  
2075
2076 Chord subtractions are used to eliminate notes from a chord.  The
2077 notes to be subtracted are listed after a @code{^} character,
2078 separated by dots.
2079
2080 @lilypond[fragment,verbatim,center]
2081   \transpose c'' {
2082     \chords {
2083       c1^3 c:7^5.3 c:8^7
2084     }
2085   }
2086 @end lilypond 
2087 @cindex @code{/}
2088
2089 Chord inversions can be specified by appending `@code{/}' and the name
2090 of a single note to a chord.  In a chord inversion, the inverted note is
2091 transposed down until it is the lowest note in the chord.  If the
2092 specified note is not in the chord, a warning will be printed.
2093
2094 @lilypond[fragment,verbatim,center]
2095   \transpose c''' {
2096     \chords {
2097       c1 c/e c/g c:7/e
2098     }
2099   }
2100
2101 @end lilypond 
2102 @cindex @code{/+}
2103
2104 Bass notes can be added by `@code{/+}' and
2105 the name of a single note to a chord.  This has the effect of
2106 adding the specified note to the chord, lowered by an octave,
2107 so it becomes the lowest note in the chord.
2108
2109 @lilypond[fragment,verbatim,center]
2110   \transpose c''' {
2111     \chords {
2112       c1 c/+c c/+g c:7/+b
2113     }
2114   }
2115
2116 @end lilypond 
2117
2118
2119
2120
2121 @c .  {Printing named chords}
2122 @node Printing named chords
2123 @subsection Printing named chords
2124
2125 @cindex printing chord names
2126 @cindex chord names
2127 @cindex chords
2128 @cindex @code{ChordNames}
2129
2130
2131 For displaying printed chord names, use the @code{ChordNames} context.
2132 The chords may be entered either using the notation described above, or
2133 directly using simultaneous music.
2134
2135 @lilypond[verbatim,singleline]
2136 scheme = \notes {
2137   \chords {a1 b c} <d f g>  <e g b>
2138 }
2139 \score {
2140   \notes<
2141     \context ChordNames \scheme
2142     \context Staff \transpose c'' \scheme
2143   >
2144 }
2145 @end lilypond
2146
2147 You can make the chord changes stand out by setting property
2148 @code{ChordNames.chordChanges} to true.  This will only display chord
2149 names when there's a change in the chords scheme and at the start of the
2150 line.
2151
2152 @lilypond[verbatim]
2153 scheme = \chords {
2154   c1:m \break c:m c:m c:m d
2155 }
2156
2157 \score {
2158   \notes <
2159     \context ChordNames {
2160         \property ChordNames.chordChanges = ##t
2161         \scheme }
2162     \context Staff \transpose c'' \scheme
2163   > }
2164 @end lilypond
2165
2166 LilyPond examines chords specified as lists of notes to determine a name
2167 to give the chord. LilyPond will not try to identify chord inversions or
2168 an added bass note, which may result in strange chord names when chords
2169 are entered as a list of pitches:
2170
2171 @lilypond[verbatim,center,singleline]
2172 scheme = \notes {
2173   <c'1 e' g'>
2174   <e' g' c''>
2175   <e e' g' c''>
2176 }
2177
2178 \score {
2179   <
2180     \context ChordNames \scheme
2181     \context Staff \scheme
2182   >
2183 }
2184 @end lilypond
2185
2186
2187 By default LilyPond uses chord name system proposed by Harald Banter
2188 (See @ref{Literature}). The system is is unambiguous and has a logical
2189 structure.  Typical American style chord names may be selected by
2190 setting the @code{style} property of the @code{ChordNames.ChordName}
2191 grob to @code{'american}. Similarly @code{'jazz} selects Jazz
2192 chordnames.
2193
2194 Routines that determine the names to be printed are written in Scheme,
2195 and may be customized by the user.  The code can be found in
2196 @file{scm/chord-name.scm}.  Here's an example showing the differences in
2197 chord name styles:
2198
2199 @c too long?
2200 @c maybe just junk verbatim option?
2201 @lilypond[verbatim,singleline]
2202 scheme = \chords {
2203   c1 c:5^3 c:4^3 c:5+
2204   c:m7+ c:m5-.7
2205   c:5-.7 c:5+.7
2206   c:9^7
2207 }
2208
2209 \score {
2210   \notes <
2211     \context ChordNames = banter \scheme
2212     \context ChordNames = american {
2213       \property ChordNames.ChordName \override
2214         #'style = #'american \scheme }
2215     \context ChordNames = jazz {
2216       \property ChordNames.ChordName \override
2217         #'style = #'jazz \scheme }
2218     \context Staff \transpose c'' \scheme
2219   >
2220 }
2221 @end lilypond
2222
2223
2224 @node Writing parts
2225 @section Writing parts
2226
2227 Orchestral music involves some special notation, both in the full score,
2228 as in the individual parts. This section explains how to tackle common
2229 problems in orchestral music.
2230
2231
2232 @c .  {Transpose}
2233 @menu
2234 * Rehearsal marks::             
2235 * Bar numbers::                 
2236 * Instrument names::            
2237 * Transpose::                   
2238 * Sound output for transposing instruments::  
2239 * Multi measure rests::         
2240 * Automatic part combining::    
2241 * Hara-kiri staffs::            
2242 @end menu
2243
2244 @c .   {Rehearsal marks}
2245 @node Rehearsal marks
2246 @subsection Rehearsal marks
2247 @cindex Rehearsal marks
2248 @cindex mark
2249 @cindex @code{\mark}
2250 @cindex @code{Mark_engraver}
2251
2252 @example
2253   \mark @var{unsigned};
2254   \mark @var{string};
2255   \mark ; 
2256 @end example
2257
2258 With this command, you can print a rehearsal mark above the system. You
2259 can provide a number, a string or a markup text as argument. If there is
2260 no argument, the property @code{rehearsalMark} is used and automatically
2261 incremented.
2262
2263 @lilypond[fragment,verbatim]
2264 \relative c'' {
2265   c1 \mark "A2";
2266   c1 \mark ; 
2267   c1 \mark ; 
2268   c1 \mark "12";
2269   c1 \mark #'(music "scripts-segno") ;
2270   c1
2271 }
2272 @end lilypond
2273
2274 @node Bar numbers
2275 @subsection Bar numbers
2276
2277 Bar numbers are printed at the start of the line by default. This is
2278 done by the @code{Bar_number_engraver} in the Score context.
2279
2280 @refbugs
2281
2282 It is currently not possible to make boxed bar numbers, or print them at
2283 regular intervals.
2284
2285
2286 @node Instrument names
2287 @subsection Instrument names
2288
2289 You can specify an instrument name for a staff by setting
2290 @code{Staff.instrument} and @code{Staff.instr}. This will print a string
2291 before the start of the staff. For the first start, @code{instrument} is
2292 used, for the next ones @code{instr} is used.
2293
2294 @lilypond[verbatim,singleline]
2295 \score { \notes {
2296   \property Staff.instrument = "ploink " { c''4 } }
2297   \paper { 
2298     \translator { \StaffContext
2299     \consists "Instrument_name_engraver"; } } }
2300 @end lilypond
2301
2302 This requires  that you add the @code{Instrument_name_engraver} to the
2303 staff context. You can also  use markup texts:
2304
2305
2306 @lilypond[verbatim,singleline]
2307 #(define text-flat
2308   '((font-relative-size . -2 ) (music "accidentals--1")))
2309
2310 \score { \notes {
2311   \property Staff.instrument = #`((kern . 0.5) (lines
2312     "2 Clarinetti" (rows "     (B" ,text-flat ")")))
2313     c'' 4 }
2314   \paper { 
2315     \translator { \StaffContext
2316     \consists "Instrument_name_engraver"; } } }
2317 @end lilypond
2318
2319
2320 @node Transpose
2321 @subsection Transpose
2322 @cindex Transpose
2323 @cindex transposition of pitches
2324 @cindex @code{\transpose}
2325
2326 A music expression can be transposed with @code{\transpose}.  The syntax
2327 is
2328 @example
2329   \transpose @var{pitch} @var{musicexpr}
2330 @end example
2331
2332 This means that middle C in @var{musicexpr} is transposed to
2333 @var{pitch}.
2334
2335 @code{\transpose} distinguishes between enharmonic pitches: both
2336 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
2337 a tone.  The first version will print sharps and the second version
2338 will print flats.
2339
2340 @lilypond[fragment,verbatim]
2341 \context Staff {
2342   \clef "F";
2343   { \key e \major; c d e f }
2344   \clef "G";
2345   \transpose des'' { \key e \major; c d e f }
2346   \transpose cis'' { \key e \major; c d e f }
2347 }
2348 @end lilypond
2349
2350 If you want to use both @code{\transpose} and @code{\relative}, then
2351 you must use @code{\transpose} first.  @code{\relative} will have no
2352 effect music that appears inside a @code{\transpose}.
2353
2354 @node Sound output for transposing instruments
2355 @subsection Sound output transposing instruments
2356
2357 When you want to play a score containing transposed and untransposed
2358 instruments, you have to instruct LilyPond the pitch offset (in
2359 semitones) for the transposed instruments. This is done using the
2360 @code{transposing} property. It does not affect printed output.
2361
2362 @cindex @code{transposing}
2363
2364 @example
2365         \property Staff.instrument = #"Cl. in B-flat"
2366         \property Staff.transposing = #-2
2367 @end example
2368
2369
2370 @c .  {Multi measure rests}
2371 @node  Multi measure rests
2372 @subsection Multi measure rests
2373 @cindex Multi measure rests
2374
2375 @cindex @code{R}
2376
2377 Multi measure rests are entered using `@code{R}'. It is specifically
2378 meant for entering parts: the rest can expand to fill a score with
2379 rests, or it can be printed as a single multimeasure rest This expansion
2380 is controlled by the property @code{Score.skipBars}. If this is set to true,
2381 Lily will not expand empty measures, and the appropriate number is added
2382 automatically.
2383
2384 @lilypond[fragment,verbatim]
2385  \time 3/4; R2.*2 \property Score.skipBars = ##t R2.*17  R2.*4
2386 @end lilypond
2387
2388 Currently, there is  no way to condense multiple rests into a single
2389 multimeasure rest.
2390
2391 @cindex condensing rests
2392
2393 @node Automatic part combining
2394 @subsection Automatic part combining
2395 @cindex automatic part combining
2396 @cindex part combiner
2397
2398 Automatic part combining is used to merge two parts of music onto on
2399 staff in an intelligent way.  It is aimed primarily at typesetting Hymns
2400 and orchestral scores.  When the two parts are identical for a period of
2401 time, only one is shown.  In places where the two parts differ, stem
2402 directions are set automatically.  Also, soli and @emph{a due} parts can be
2403 identified and marke.
2404
2405 The syntax for part combining is
2406
2407 @example
2408   \partcombine @var{context} @var{musicexpr1} @var{musicexpr2}
2409 @end example
2410
2411 where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be
2412 combined into one context @var{context}.  The context names of the music
2413 expressions must start with the prefixes @code{one} and @code{two}.
2414
2415 The most useful function of the part combiner to combining threads into
2416 one voice, as common for wind parts in orchestral scores:
2417
2418 @lilypond[verbatim,singleline,fragment]
2419   \context Staff <
2420     \context Voice=one \partcombine Voice
2421       \context Thread=one \relative c'' {
2422         g a b r
2423       }
2424       \context Thread=two \relative c'' {
2425         g r2 f4
2426       }
2427   >
2428 @end lilypond
2429
2430 Notice that the first @code{g} appears only once, although it was
2431 specified twice (once in each Thread). Also note that stem, slur and tie
2432 directions are set automatically, depending whether there is a solo or
2433 unisono. The Thread called @code{one} always gets up stems, and "solo",
2434 while @code{two} always gets down stems and "Solo II".
2435
2436 If you just want the splitting of Threads and setting of directions, and
2437 not the textual markings, you may set the property @var{soloADue} to
2438 false.  This mode can be used to set hymns:
2439
2440 @lilypond[verbatim,singleline,fragment]
2441   \context Staff <
2442     \property Staff.soloADue = ##f
2443     \context Voice=one \partcombine Voice
2444       \context Thread=one \relative c'' {
2445         b4 a c g
2446       }
2447       \context Thread=two \relative c'' {
2448         d,2 a4 g'
2449       }
2450   >
2451 @end lilypond
2452
2453 There are a number of other properties that you can use to tweak
2454 the behavior of part combining, refer to the automatically generated
2455 documentation. Look for @code{Thread_devnull_engraver}
2456 @code{Voice_devnull_engraver} and @code{A2_engraver}. 
2457
2458 @refbugs
2459
2460 In @code{soloADue} mode, when the two voices play the same notes on and
2461 off, the part combiner may typeset @code{a2} more than once in a
2462 measure.
2463
2464 @lilypond[fragment,singleline]
2465   \context Staff <
2466     \context Voice=one \partcombine Voice
2467       \context Thread=one \relative c'' {
2468         c b c b c a c a
2469       }
2470       \context Thread=two \relative c'' {
2471         b b b b f a f a
2472       }
2473   >
2474 @end lilypond
2475
2476 @cindex @code{Thread_devnull_engraver}
2477 @cindex @code{Voice_engraver}
2478 @cindex @code{A2_engraver}
2479
2480 @node Hara-kiri staffs
2481 @subsection Hara-kiri staffs
2482
2483 In orchestral scores, staffs that only have rests are usually removed.
2484 This saves some space.  LilyPond also supports this through the
2485 hara-kiri@footnote{Hara kiri, also called Seppuku, is the ritual suicide
2486 of the Japanese Samourai warriors.} staff. This staff commits suicide
2487 when it finds itself to be empty after the line-breaking process---note
2488 that it will not disappear when it contains normal rests, you must use
2489 multi measure rests.
2490
2491 The hara kiri staff is specialized version of the Staff context. It is
2492 available as the context identifier @code{\HaraKiriStaffContext}.
2493 Observe how the second staff in this example disappears in the second
2494 line.
2495
2496 @lilypond[verbatim]
2497 \score  {
2498   \notes \relative c' <
2499     \context Staff = SA { e4 f g a \break c1 }
2500     \context Staff = SB { c4 d e f \break R1 }
2501   >
2502   \paper {
2503     linewidth = 6.\cm ; 
2504     \translator { \HaraKiriStaffContext }
2505   }
2506 }
2507 @end lilypond
2508
2509
2510
2511 @c . {Custodes}
2512 @node Custodes
2513 @section Custodes
2514 @cindex Custos
2515 @cindex Custodes
2516
2517 A @emph{custos} (plural: @emph{custodes}; latin word for "guard") is a
2518 staff context symbol that appears at the end of a staff line.  It
2519 anticipates the pitch of the first note(s) of the following line and
2520 thus helps the player or singer to manage line breaks during
2521 performance, thus enhancing readability of a score.
2522
2523 @lilypond[verbatim]
2524 \score {
2525   \notes { c'1 d' e' d' \break c' d' e' d' }
2526   \paper {
2527     \translator {
2528       \StaffContext
2529       \consists Custos_engraver;
2530       Custos \override #'style = #'mensural;
2531     }
2532   }
2533 }
2534 @end lilypond
2535
2536 Custodes were frequently used in music notation until the 16th century.
2537 There were different appearences for different notation styles.
2538 Nowadays, they have survived only in special forms of musical notation
2539 such as via the @emph{editio vaticana} dating back to the beginning of
2540 the 20th century.
2541
2542 For typesetting custodes, just put a @code{Custos_engraver} into the
2543 @code{StaffContext} when declaring the @code{\paper} block.  In this
2544 block, you can also globally control the appearance of the custos symbol
2545 by setting the custos @code{style} property.  Currently supported styles
2546 are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
2547 @code{mensural}.
2548
2549 @example
2550 \paper @{
2551   \translator @{
2552       \StaffContext
2553       \consists Custos_engraver;
2554       Custos \override #'style = #'mensural;
2555   @}
2556 @}
2557 @end example
2558
2559 The property can also be set locally, for example in a @code{\notes}
2560 block:
2561
2562 @example
2563 \notes @{
2564   \property Staff.Custos \override #'style = #'vaticana
2565   c'1 d' e' d' \break c' d' e' d'
2566 @}
2567 @end example
2568
2569 @c . {Tuning output}
2570 @node Tuning output
2571 @section Tuning output
2572
2573 LilyPond tries to take as much formatting as possible out of your
2574 hands. Nevertheless, there are situations where it needs some help, or
2575 where you want to override its decisions. In this section we discuss
2576 ways to do just that.
2577
2578 Notation output is specified in so called grobs (graphic objects). Each
2579 grob carries with it a set of properties (grob properties) specific to
2580 that object.  For example, a stem grob has properties that specify its
2581 direction, length and thickness.
2582
2583
2584 The most common way of tuning the output is to alter the values of these
2585 properties. There are two ways of doing that: first, you can temporarily
2586 change the definition of a certain type of grob, thus affecting a whole
2587 set of objects.  Second, you can select one specific object, and set a 
2588 grob property.
2589
2590 @menu
2591 * Tuning groups of grobs ::     
2592 * Tuning per grob ::            
2593 * What to tune?::               
2594 * Font selection::              
2595 * Text markup::                 
2596 * Embedded @TeX{}::             
2597 @end menu
2598
2599 @node Tuning groups of grobs 
2600 @subsection Tuning groups of grobs 
2601
2602 @cindex grob description
2603
2604 A grob definition is a Scheme association list, that is stored in a context
2605 property.  By assigning to that property (using plain @code{\property}),
2606 you can change the resulting grobs.
2607
2608 @lilypond[verbatim, fragment]
2609 c'4 \property Voice.Stem  = #'((meta . ((interfaces . ())))) c'4
2610 @end lilypond
2611
2612 The @code{\property} assignment effectively empties the definition of
2613 the Stem object. One of the effects is that property specifying how it
2614 should be printed is erased, with the effect of rendering it invisible.
2615 The above assignment is available as a standard identifier, lest you
2616 find this useful:
2617 @example
2618   \property Voice.Stem = \turnOff
2619 @end example
2620
2621 @cindex \override
2622 @cindex \revert
2623 @cindex \set
2624
2625 This mechanism is fairly crude, since you can only set, but not modify,
2626 the definition of a grob. For this reason, there is a more advanced
2627 mechanism: you can add a property on top of an existing definition, or
2628 remove a property: @code{\override} adds a settings, @code{\revert}
2629 removes that setting.
2630
2631 @lilypond[verbatim]
2632 c'4 \property Voice.Stem \override #'thickness = #4.0
2633 c'4 \property Voice.Stem \revert #'thickness
2634 c'4
2635 @end lilypond
2636
2637 For the digirati, the grob description is an Scheme association
2638 list. Since it is singly linked, we can treat it as a stack, and
2639 @code{\override} and @code{\revert} are just push and pop
2640 operations. This pushing and popping is also used for overriding automatic
2641 beaming settings.
2642
2643 If you revert a setting which was not set in the first place, then it
2644 has no effect. However, if the setting was set as a system default, it
2645 may remove the default value, and this may give surprising results,
2646 including crashes.  In other words, if you use @code{\override} and
2647 @code{\revert}, be sure to balance the overrides and reverts.
2648
2649 If balancing them is too much work, use the @code{\set} shorthand. It
2650 performs a revert followed by an override:
2651 @example
2652 \property Voice.Stem \set #'thickness = #2.0
2653 @end example
2654
2655 Formally the syntax for these constructions is
2656 @example
2657 \property @var{context}.@var{grobname} \override @var{symbol} = @var{value}
2658 \property @var{context}.@var{grobname} \set @var{symbol} = @var{value}
2659 \property @var{context}.@var{grobname} \revert @var{symbol}
2660 @end example
2661 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
2662 and @var{grobname} are strings and @var{value} is a Scheme expression.
2663
2664 If you want to be
2665 Correct nesting of @code{\override}, @code{\set}, @code{\revert} is as
2666 follows
2667
2668 @example 
2669 \override \set \set \set \set
2670 \revert
2671 @end example
2672
2673 This is always correct, but if you know the default value, you can also use 
2674 @example
2675 \set \set \set \set
2676 \set @var{to default value}
2677 @end example
2678
2679 If there is no default (i.e. by default, the grob property is unset),
2680 then you can use
2681 @example
2682 \set \set \set \set \set
2683 \revert
2684 @end example
2685
2686
2687 @refbugs
2688
2689 LilyPond will hang or crash if @var{value} contains cyclic references.
2690 The backend is not very strict in type-checking grob properties. If you
2691 @code{\revert} properties that are expected to be set by default,
2692 LilyPond may crash.
2693
2694
2695
2696 @node Tuning per grob 
2697 @subsection Tuning per grob 
2698
2699 @cindex \outputproperty
2700
2701 A second way of tuning grobs is the more arcane @code{\outputproperty}
2702 feature.
2703 Syntax is as follows
2704 @example
2705 \outputproperty @var{predicate} @var{symbol} = @var{value}
2706 @end example
2707 Here @code{predicate} is a Scheme function taking a grob argument, and
2708 returning a boolean.  This statement is processed by the
2709 @code{Output_property_engraver}.  It instructs the engraver to feed all
2710 grobs that it sees to @var{predicate}. Whenever the predicate returns
2711 true, the grob property @var{symbol} will be set to @var{value}.
2712
2713 You will need to combine this statement with @code{\context} to select
2714 the appropriate context to apply this to.
2715
2716 If possible, avoid this feature: the semantics are not very clean, and
2717 the syntax and semantics are up for rewrite.
2718
2719 Here are some random examples:
2720
2721 @lilypond[fragment,verbatim,singleline]
2722 \relative c'' { c4
2723   \context Staff \outputproperty
2724   #(make-type-checker 'note-head-interface)
2725   #'extra-offset = #'(0.5 . 0.75)
2726   <c8 e g> }
2727 @end lilypond
2728
2729 @cindex @code{extra-offset}
2730
2731 This selects all note heads occurring at current staff level, and sets
2732 the @code{extra-offset} of those heads to @code{(0.5,0.75)}, shifting
2733 them up and right.
2734
2735 Move the text "m.d.", but not the fingering instruction "2".
2736 @lilypond[verbatim,singleline]
2737 #(define (make-text-checker text)
2738    (lambda (grob) (equal? text (ly-get-grob-property grob 'text))))
2739
2740 \score {    
2741   \notes\relative c''' {
2742     \property Voice.Stem \set #'direction = #1
2743     \outputproperty #(make-text-checker "m.d.")
2744       #'extra-offset = #'(-3.5 . -4.5)
2745     a^2^"m.d."    
2746   }
2747 }
2748 @end lilypond
2749
2750
2751
2752
2753 @node What to tune?
2754 @subsection What to tune?
2755
2756 This all tells you how to tune grobs, but what variables are there? The
2757 question is not  answered in this manual (although you may encounter
2758 some examples.).
2759
2760 Grob properties are tied directly to the implementation of LilyPond, and
2761 they are thus a moving target. Documentation of such variables are part
2762 of the generated documentation: this documentation is generated from the
2763 sourcecode of lily for each version, so it is usually mch more up to
2764 date  than this manual. It should be available from the same place where
2765 you got this manual.
2766
2767 To decide how to tune a grob, you need to find the following information
2768 @itemize @bullet
2769 @item
2770 which grob to modify
2771 @item
2772 which property to modify
2773 @item
2774 which context the grob comes from.
2775 @end itemize
2776
2777 Included with the automatically generated documentation is a master list
2778 of grobs. Each one can be clicked, taking you to a overview of the
2779 available properties.
2780
2781 There is also a master list of contexts. Clicking each takes you to an
2782 overview of the context, listing which grob types are created there.
2783
2784
2785 @node Font selection
2786 @subsection Font selection
2787
2788 Most graphics in LilyPond are composed of characters of fonts.  You can
2789 alter the characteristics of the font by setting certain grob
2790 properties. The mechanism that is used for this resembles LaTeX's New
2791 Font Selection Scheme. Within this scheme, a font is entirely
2792 characterized by its font name.
2793
2794 For each grob that uses fonts (in other words, each grob that supports
2795 @code{font-interface}) a font-name must be selected before it can be
2796 printed.  The font name is selected by looking at a number of grob
2797 properties:
2798
2799 @table @code
2800 @item font-family
2801   The general class of the typeface.  Supported are roman (Computer
2802 Modern), braces (for piano staff braces), music (the standard music
2803 font), dynamic (font for dynamic signs) and typewriter
2804
2805 @item font-shape
2806   A symbol indicating the shape of the font, a finer gradation than
2807   font-family. Choices are italic and upright
2808 @item font-series
2809   Symbol indicating the serie of the font.  Series form a finer gradation
2810   than font-shape. Choices are medium and bold.
2811
2812 @item font-relative-size
2813   A number indicating the size relative the standard size.  For example,
2814   with 20pt staff height, relative size -1  corresponds to 16pt staff
2815   height, and relative size +1 corresponds to 23 pt staff height.
2816
2817 @item font-design-size
2818 A number indicating  the design size of the font. 
2819
2820 This is a feature of the Computer Modern Font: each point size has a
2821 slightly different design. Smaller design sizes are relatively wider,
2822 which enhances readability. Scalable type faces such TrueType and Adobe
2823 Type1 usually come as ``one design fits all sizes''.
2824
2825 @item font-name
2826   The name of the font, without the design size, eg. @code{cmr},
2827 @code{cmti}, etc. Setting this overrides font-family, font-shape and
2828 font-series.
2829
2830 @end table
2831
2832 The font is selected by taking the first font that satisfies all
2833 qualifiers specified. You can override any of these fields through
2834 @code{\override} and @code{\revert}. The special value @code{*} matches
2835 any value for that qualifier.
2836
2837 @example
2838   \property Lyrics.LyricText \override #'font-series = #'bold
2839   \property Lyrics.LyricText \override #'font-shape = #'*
2840 @end example
2841
2842 @cindex @code{font-style}
2843
2844 There are also pre-cooked font selection qualifiers. These are selected
2845 through the grob property @code{font-style}.  For example, the style
2846 @code{finger} selects family @code{number} and relative size @code{-3}.
2847 Styles available include: volta, finger, tuplet, timesig, mmrest,
2848 script, large, Large and dynamic.
2849
2850 The style sheets and tables for selecting fonts are located in
2851 @file{scm/font.scm}. Refer to this file for more information.
2852
2853 @refbugs
2854
2855 Relative size is not linked to any real size.  There is no mechanism to
2856 select magnifications of fonts, meaning that you can not scale fonts
2857 continuoussly. There is no style sheet provided for other fonts besides
2858 the @TeX{} family.
2859
2860 @cindex font selection
2861 @cindex font magnification
2862 @cindex @code{font-interface}
2863
2864
2865 @node Text markup
2866 @subsection Text markup
2867 @cindex text markup
2868 @cindex markup text
2869
2870 LilyPond has an internal mechanism to typeset texts. You can
2871 form text markup expressions by composing scheme expressions
2872 in the following way.
2873
2874 @lilypond[verbatim, singleline]
2875  \relative c' {
2876     \fatText
2877     a^#"upright"
2878     b_#'(bold "bold")
2879     c^#'(italic "italic")
2880     d_#'((bold italic) "ff")
2881     e^#'(dynamic "ff")
2882     f_#'(lines "one" (bold "two"))
2883     g^#'(music "noteheads-2" "flags-u3")
2884   }
2885 @end lilypond
2886
2887 Normally, the Scheme markup text is stored in the @code{text} property
2888 of a grob.  Formally, it is defined as follows:
2889
2890 @example
2891 text: string | (head? text+)
2892 head: markup | (markup+)
2893 markup-item: property | abbrev
2894 property: (@var{key} . @var{value})
2895 abbrev: @code{rows lines roman music bold italic named super sub text}
2896         @code{finger volta timesig mmrest mark script large Large dynamic}
2897 @end example
2898
2899 The markup is broken down and converted into a list of grob properties,
2900 which are prepended to the property list.  The @var{key}-@var{value}
2901 pair is a grob property.
2902
2903 The following abbreviations are currently defined:
2904
2905 @table @code
2906 @item rows
2907 horizontal mode: set all text on one line (default)
2908 @item lines
2909  vertical mode: set every text on new line
2910 @item roman
2911  select roman font
2912 @item music
2913  select feta font
2914 @item bold
2915  select bold series
2916 @item italic
2917  select italic shape
2918 @item named
2919  lookup by character name
2920 @item text
2921  plain text lookup (by character value)
2922 @item super
2923  superscript
2924 @item sub
2925  subscript
2926 @item finger
2927  select fingering number fontstyle
2928 @item volta
2929  select volta number fontstyle
2930 @item timesig
2931  select time signature number fontstyle
2932 @item mmrest
2933  select multi measure rest number fontstyle
2934 @item mark
2935  select mark number fontstyle
2936 @item script
2937  select scriptsize roman fontstyle
2938 @item large
2939  select large roman fontstyle
2940 @item Large
2941  select Large roman fontstyle
2942 @item dynamic
2943  select dynamics fontstyle
2944 @end table
2945
2946 It is possible to use @TeX{} commands in the strings, but this should be
2947 avoided because this makes it impossible for LilyPond to compute the
2948 exact length of the string, which may lead to collisions.  Also, @TeX{}
2949 commands won't work with direct postscript output.
2950
2951 @cindex metronome mark
2952
2953 One practical application of complicated markup is to fake a metronome
2954 marking:
2955
2956 @lilypond[verbatim]
2957 #(define note '(rows
2958   (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
2959 #(define eight-note `(rows ,note ((kern . -0.1)
2960   (music ((raise . 3.5) "flags-u3")))))
2961 #(define dotted-eight-note
2962   `(rows ,eight-note (music "dots-dot")))
2963
2964 \score {
2965   \notes\relative c'' {
2966     a1^#`((rows (font-relative-size . -1)) ,dotted-eight-note " = 64")
2967   }
2968   \paper {
2969     linewidth = -1.;
2970     \translator{
2971       \ScoreContext
2972       TextScript \override #'font-shape = #'upright
2973     }
2974   }
2975 }
2976 @end lilypond
2977
2978 @node Embedded @TeX{}
2979 @subsection Embeded @TeX{}
2980 @cindex embedded tex
2981 @cindex embedded tex
2982
2983 You can use @TeX{} commands in text scripts, but this should be avoided
2984 because this makes it impossible for LilyPond to compute the exact
2985 length of the string, which may lead to collisions.  Also, @TeX{}
2986 commands won't work with direct PostScript output.
2987
2988 @lilypond[fragment,relative,verbatim]
2989   a''^"3 $\\times$ \\`a deux"
2990 @end lilypond
2991
2992 @subsection Embedded PostScript
2993 @cindex embedded postscript
2994 @cindex embedded postscript
2995
2996 You can also use raw PostScript commands embedded in text scripts.  This
2997 offers ultimate flexibitily, but you'll have to learn the arcane
2998 PostScript language.  Currently, embedded PostScript will @strong{not}
2999 work with direct PostScript output.  Note that all dimensions that you
3000 use are in @code{staff-space}s.
3001
3002 @lilypond[verbatim]
3003 \score {
3004   \notes \relative c'' {
3005     a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
3006     -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
3007     b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
3008     s2
3009     a'1
3010   }
3011   \paper { linewidth = 70 * \staffspace; }
3012 }
3013 @end lilypond
3014
3015
3016 @c . {Page layout}
3017 @node Page layout
3018 @section Page layout
3019 @cindex Page layout
3020
3021 @menu
3022 * Paper block::                 
3023 * Paper variables::             
3024 * Font Size::                   
3025 * Paper size::                  
3026 * Line break::                  
3027 * Page break::                  
3028 @end menu
3029
3030 @c .  {Paper block}
3031 @node Paper block
3032 @subsection Paper block
3033 @cindex Paper block
3034
3035 The most important output definition is the @code{\paper} block, for
3036 music notation.  The syntax is
3037
3038 @example
3039   @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}}
3040 @end example
3041
3042 where each of the items is one of
3043
3044 @itemize @bullet
3045   @item  An assignment.  The assignment must be terminated by a
3046        semicolon.  
3047
3048   @item  A context definition.  See @ref{Notation Contexts} for
3049        more information on context definitions.
3050
3051   @item  \stylesheet  declaration.  Its syntax is
3052        @example
3053                 \stylesheet @var{alist}
3054        @end example
3055
3056         See @file{scm/font.scm} for details of @var{alist}.
3057   @item an \elementdescriptions declaration.
3058         @example
3059                 \elementdescriptions @var{alist}
3060         @end example
3061         See @file{scm/grob-description.scm} for details of @var{alist}.
3062
3063 @end itemize
3064
3065 @c .  {Paper variables}
3066 @node Paper variables
3067 @subsection Paper variables 
3068 @cindex Paper variables
3069
3070 The paper block has some variables you may want to use or change:
3071
3072 @table @code
3073 @cindex @code{indent}
3074   @item @code{indent}  
3075     The indentation of the first line of music.
3076 @cindex @code{staffspace}
3077
3078   @item @code{staffspace}
3079     The distance between two staff lines, calculated from the center
3080     of the lines.  If you want scale independent output, then you should
3081 use either this or @code{stafflinethickness}
3082     as a unit for distances you modify.
3083   
3084 @cindex @code{linewidth}
3085   @item @code{linewidth}  
3086     Sets the width of the lines.
3087
3088 If set to a negative value, a single unjustified line is produced.
3089 @c rename to singleLinePaper ?
3090 The shorthand @code{\singleLine} defines a default paper block that
3091 produces a single line.
3092
3093 @cindex @code{textheight}
3094
3095   @item @code{textheight}  
3096     Sets the total height of the music on each page. Only used by
3097 @code{ly2dvi}.
3098
3099 @cindex @code{interscoreline}
3100
3101   @item @code{interscoreline}  
3102     Sets the spacing between systems.
3103 Not set by default.
3104 @cindex @code{interscorelinefill}
3105
3106
3107
3108   @item @code{interscorelinefill}  
3109     If set to a positive number, the distance between the score 
3110     lines will stretch in order to fill the full page. In that
3111     case @code{interscoreline} specifies the minimum spacing.
3112
3113         Not set by default.
3114
3115
3116 @cindex @code{stafflinethickness}
3117
3118   @item @code{stafflinethickness}  
3119     Determines the thickness of staff lines, and also acts as a scaling
3120     parameter for other line thicknesses.
3121 @end table
3122
3123
3124
3125 @c .  {Font size}
3126 @node Font Size
3127 @subsection Font size
3128 @cindex font size
3129
3130 The Feta font provides musical symbols at six different sizes.  These
3131 fonts are 11 point, 13 point, 16 point, 20 point,
3132 23 point, and 26 point.  The point size of a font is the
3133 height of the five lines in a staff when displayed in the font.
3134
3135 Definitions for these sizes are the files @file{paperSZ.ly}, where
3136 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include any of
3137 these files, the identifiers @code{paperEleven}, @code{paperThirteen},
3138 @code{paperSixteen}, @code{paperTwenty}, @code{paperTwentythree}, and
3139 @code{paperTwentysix} are defined respectively.  The default
3140 @code{\paper} block is also set.
3141
3142 The font definitions are generated using a Scheme function. For more
3143 details, see the file @file{font.scm}.
3144
3145
3146
3147 @c .  {Paper size}
3148 @node Paper size
3149 @subsection Paper size
3150 @cindex Paper size
3151
3152 @cindex paper size
3153 @cindex page size
3154 @cindex @code{papersize}
3155
3156 To change the paper size, you must first set the
3157 @code{papersize} variable at top level.  Set it to
3158 the strings @code{a4}, @code{letter}, or @code{legal}.  After this
3159 specification, you must set the font as described above.  If you want
3160 the default font, then use the 20 point font.  The new paper size will
3161 not take effect if the font is not loaded and selected afterwards.
3162
3163 @example
3164         papersize = "a4"
3165         \include "paper16.ly"
3166
3167         \score @{
3168                 ...
3169                 \paper @{ \paperSixteen @}
3170         @}
3171 @end example
3172
3173 The file @code{paper16.ly}  will now include a file named @file{a4.ly}, which
3174 will set the paper variables @code{hsize} and @code{vsize} (used by
3175 @code{ly2dvi})
3176
3177
3178
3179
3180
3181
3182
3183 @c .  {Line break}
3184 @node Line break
3185 @subsection Line break
3186
3187 @cindex line breaks
3188 @cindex breaking lines
3189
3190 Line breaks are normally computed automatically. They are chosen such
3191 that the resulting spacing has low variation, and looks neither cramped
3192 nor loose.
3193
3194 Occasionally you might want to override the automatic breaks; you can do
3195 this by specifying @code{\break}. This will force a line break at this
3196 point. Do remember that line breaks can only occur at places where there
3197 are barlines.  If you want to have a line break where there is no
3198 barline, you can force an invisible barline by entering @code{\bar "";}.
3199
3200 Similarly, @code{\noBreak} forbids a  line break at a certain point.
3201
3202 @cindex @code{\penalty}
3203
3204 The @code{\break} and @code{\noBreak} commands are defined in terms of
3205 the penalty command:
3206 @example
3207   \penalty @var{int} @code{;}
3208 @end example
3209
3210 This encourages or discourages LilyPond to make a line break at this
3211 point.
3212
3213 @refbugs
3214
3215 The scaling of the @code{\penalty} argument is not well-defined.  The
3216 command is rather kludgy, and slated for rewriting.
3217
3218 @c .  {Page break}
3219 @node Page break
3220 @subsection Page break
3221
3222 @cindex page breaks
3223 @cindex breaking pages
3224
3225
3226 Page breaks are normally computed by @TeX{}, so they are not under
3227 direct control of LilyPond.  However, you can insert a commands into the
3228 @file{.tex} output to instruct @TeX{} where to break pages. For more
3229 details, see the example file @file{input/test/between-systems.ly}
3230
3231
3232
3233
3234
3235 @c . {Sound}
3236 @node Sound
3237 @section Sound
3238 @cindex Sound
3239
3240 LilyPond can produce MIDI output.  The performance lacks lots of
3241 interesting effects, such as swing, articulation, slurring, etc., but it
3242 is good enough for proof-hearing the music you have entered.  Ties,
3243 dynamics and tempo changes are interpreted.
3244
3245 The MIDI volume is composed of two elements: the current dynamics of the
3246 voice and the type of musical instrument.
3247
3248 Dynamic marks, crescendi and decrescendi translate into MIDI volume
3249 levels.  Dynamic marks translate to a fixed fraction of the available
3250 MIDI volume range, crescendi and decrescendi make the the volume vary
3251 linearly between their two extremities.  The fractions be adjusted by
3252 overriding the @code{absolute-volume-alist} defined in
3253 @file{scm/midi.scm}.
3254
3255 For each type of musical instrument (that MIDI supports), a volume range
3256 can be defined.  This gives you basic equaliser control, which can
3257 enhance the quality of the MIDI output remarkably.  You can add
3258 instruments and ranges or change the default settings by overriding
3259 the @code{instrument-equaliser-alist} defined in @file{scm/midi.scm}.
3260
3261 @refbugs
3262
3263 It is currently not possible to use the percussion channel (generally
3264 channel 10 of a MIDI file).
3265
3266 @menu
3267 * MIDI block::                  
3268 * MIDI instrument names::       
3269 @end menu
3270
3271 @c .  {MIDI block}
3272 @node MIDI block
3273 @subsection MIDI block
3274 @cindex MIDI block
3275
3276
3277 The MIDI block is analogous to the paper block, but it is somewhat
3278 simpler.  The @code{\midi} block can contain:
3279 @cindex MIDI block
3280
3281 @itemize @bullet
3282   @item  a @code{\tempo} definition
3283   @item  context definitions
3284 @end itemize
3285
3286 Assignments in the @code{\midi} block are not allowed.
3287
3288
3289
3290 @cindex context definition
3291
3292 Context definitions follow precisely the same syntax as within the
3293 \paper block.  Translation modules for sound are called performers.
3294 The contexts for MIDI output are defined in @file{ly/performer.ly}.
3295
3296
3297 @node MIDI instrument names
3298 @subsection MIDI instrument names
3299
3300 @cindex instrument names
3301 @cindex @code{Staff.midiInstrument}
3302 @cindex @code{Staff.instrument}
3303
3304 The MIDI instrument name is set by the @code{Staff.midiInstrument}
3305 property or, if that property is not set, the @code{Staff.instrument}
3306 property.  The instrument name should be chosen from the list in
3307 @ref{MIDI instruments}.
3308
3309 @refbugs
3310
3311 If the selected string does not exactly match, then LilyPond uses the
3312 default piano. It is not possible to select an instrument by number.
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322 @c . {Music entry}
3323 @node Music entry
3324 @section Music entry
3325 @cindex Music entry
3326 @menu
3327 * Relative::                    
3328 * Bar check::                   
3329 * Point and click::             
3330 @end menu
3331
3332 One of the applications of LilyPond is to enter music from existing
3333 written or printed material. When you're doing this kind of copying
3334 work, you can easily make mistakes.  This section deals with tricks and
3335 features that help you enter music, and find and correct mistakes.
3336
3337 @c .  {Relative}
3338 @node Relative
3339 @subsection Relative
3340 @cindex Relative
3341 @cindex relative octave specification
3342
3343 Octaves are specified by adding @code{'} and @code{,} to pitch names.
3344 When you copy existing music, it is easy to accidentally put a pitch in
3345 the wrong octave and hard to find such an error.  To prevent these
3346 errors, LilyPond features octave entry.
3347
3348 @cindex @code{\relative}
3349 @example
3350   \relative @var{startpitch} @var{musicexpr}
3351 @end example
3352
3353 The octave of notes that appear in @var{musicexpr} are calculated as
3354 follows: If no octave changing marks are used, the basic interval
3355 between this and the last note is always taken to be a fourth or less.
3356   The octave changing marks @code{'} and @code{,} can then
3357 be added to raise or lower the pitch by an extra octave.  Upon entering
3358 relative mode, an absolute starting pitch must be specified that will
3359 act as the predecessor of the first note of @var{musicexpr}.
3360
3361 This distance is determined without regarding accidentals: a
3362 @code{fisis} following a @code{ceses} will be put above the
3363 @code{ceses}.
3364
3365 Entering music that changes octave frequently  is easy in relative mode.
3366 @lilypond[fragment,singleline,verbatim,center]
3367   \relative c'' {
3368     b c d c b c bes a 
3369   }
3370 @end lilypond
3371
3372 And octave changing marks are used for intervals greater than a fourth.
3373 @lilypond[fragment,verbatim,center]
3374   \relative c'' {
3375     c g c f, c' a, e'' }
3376 @end lilypond
3377
3378 If the preceding item is a chord, the first note of the chord is used
3379 to determine the first note of the next chord.  But other notes
3380 within the second chord are determined by looking at the immediately
3381 preceding note.
3382
3383 @lilypond[fragment,verbatim,center]
3384   \relative c' {
3385     c <c e g> 
3386     <c' e g>
3387     <c, e' g>
3388   }
3389 @end lilypond 
3390 @cindex @code{\notes}
3391
3392 The pitch after the @code{\relative} contains a notename.  To parse
3393 the pitch as a notename, you have to be in note mode, so there must
3394 be a surrounding @code{\notes} keyword (which is not
3395 shown here).
3396
3397 The relative conversion will not affect @code{\transpose},
3398 @code{\chords} or @code{\relative} sections in its argument.  If you
3399 want to use relative within transposed music, you must place an
3400 additional @code{\relative} inside the @code{\transpose}.
3401
3402
3403 @c .  {Bar check}
3404 @node Bar check
3405 @subsection Bar check
3406 @cindex Bar check
3407
3408 @cindex bar check
3409 @cindex @code{barCheckNoSynchronize}
3410 @cindex @code{|}
3411
3412
3413 Whenever a bar check is encountered during interpretation, a warning
3414 message is issued if it doesn't fall at a measure boundary.  This can
3415 help you find errors in the input.  Depending on the value of
3416 @code{barCheckNoSynchronize}, the beginning of the measure will be
3417 relocated, so this can also be used to shorten measures.
3418
3419 A bar check is entered using the bar symbol, @code{|}
3420
3421 @c .  {Point and click}
3422 @node Point and click
3423 @subsection Point and click
3424
3425 Point and click lets you find notes in the input by clicking on them in
3426 the Xdvi window. This makes it very easy to find input that causes some
3427 error in the sheet music.
3428
3429 To use it, you need the following software
3430
3431 @itemize
3432 @item 
3433 @uref{ftp://ftp.math.berkeley.edu/pub/Software/TeX/xdvi.tar.gz,plain
3434 Xdvi} version 22.36 or newer.
3435
3436   Note that most @TeX{} distributions ship with xdvik, which is a
3437   different and less well maintained program. To find out which xdvi you
3438   are running, try @code{xdvi --version} or @code{xdvi.bin --version}.
3439 @item emacs
3440 @end itemize
3441
3442
3443 Add one these lines to the top of your .ly file. The first one is for
3444 line location only. The second one is more convenient, but requires
3445 patching @code{emacsclient}.
3446
3447 @example
3448 #(set! point-and-click line-location)
3449 #(set! point-and-click line-column-location)
3450 @end example
3451
3452 In the emacs startup file (usually @file{~/.emacs}), add the following
3453 @example
3454 (server-start)
3455 @end example
3456
3457 If you want emacs to jump to the exact spot (and not just the line) on a
3458 click, you must enable column positioning. To do so, you need to patch
3459 emacsclient. Apply @file{emacsclient.patch} (included with the source
3460 package) to @file{emacsclient.c} and @file{server.el} from the emacs
3461 source code. Recompile and stick the recompiled emacsclient into a bin
3462 directory, and put @file{server.el} into a elisp directory
3463 (eg. @file{~/usr/share/emacs/}). Add the following to your @file{.emacs}
3464 init file, before invoking server-start.
3465
3466 @example
3467  (setq load-path (cons "~/usr/share/emacs" load-path))
3468 @end example
3469
3470
3471 Xdvi must be configured to use the emacs editor.  Before starting, set
3472 the environment variable @code{XEDITOR} to
3473 @example
3474 emacsclient --no-wait +%c:%l %f
3475 @end example
3476 Xdvi also must be configured to find the fonts. Refer to the
3477 xdvi documentation for more information.
3478
3479 When viewing, control-mousebutton 1 will take you to the originating
3480 line and column. Control-mousebutton 2 will show all clickable boxes.
3481
3482 @refbugs
3483
3484 When you convert the TeX file to PostScript using dvips, dvips
3485 will complain about not finding @code{src:X:Y} files. Those complaints are
3486 harmless, and can be ignored.
3487
3488
3489 @node Skipping corrected music
3490 @section Skipping corrected music
3491
3492 The property @code{Score.skipTypesetting} can be used to switch on and
3493 off typesetting completely during the interpretation phase. When
3494 typesetting is switched off, the music is processed much more quickly.
3495 You can use this to skip over the parts of a score that you have already
3496 checked for errors. 
3497
3498 @lilypond[fragment,singleline,verbatim]
3499 \relative c'' { c8 d
3500 \property Score.skipTypesetting = ##t
3501   e f g a g c, f e d
3502 \property Score.skipTypesetting = ##f
3503 c d b bes a g c2 } 
3504 @end lilypond
3505
3506
3507 @node Interpretation context
3508 @section Interpretation context
3509
3510 @menu
3511 * Notation Contexts::           
3512 * Creating contexts::           
3513 * Default contexts::            
3514 * Context properties::          
3515 * Changing context definitions::  
3516 * Defining new contexts::       
3517 @end menu
3518
3519
3520 @c .  {Notation Contexts}
3521 @node Notation Contexts
3522 @subsection Notation Contexts
3523
3524 @cindex notation contexts
3525
3526 Notation contexts are objects that only exist during a run of LilyPond.
3527 During the interpretation phase of LilyPond (when it prints
3528 "interpreting music"), the music expresiion in a @code{\score} block is
3529 interpreted in time order. This is the same order that humans hear and
3530 play music.
3531
3532 During this interpretation, the notation context is holds the state for
3533 the current point within the music. It contains information like
3534
3535 @itemize @bullet
3536   @item What notes are playing at this point?
3537   @item What symbols will be printed at this point?
3538   @item What is the current key signature, time signature, point within
3539        the measure, etc.?
3540 @end itemize
3541
3542 Contexts are grouped hierarchically: A @code{Voice} context is
3543 contained in a @code{Staff} context (because a staff can contain
3544 multiple voices at any point), a @code{Staff} context is contained in
3545 a @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context (because
3546 these can all contain multiple staffs).
3547
3548
3549 Contexts associated with sheet music output are called @emph{notation
3550 contexts}, those for sound output are called performance contexts.
3551
3552
3553 @node Creating contexts
3554 @subsection Creating contexts
3555
3556 @cindex @code{\context}
3557 @cindex context selection
3558
3559 Contexts for a music expression can be selected manually, using the
3560 following music expression.
3561
3562 @example
3563   \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
3564 @end example
3565
3566 This instructs lilypond to interpret @var{musicexpr} within the context
3567  of type @var{contexttype} and with name @var{contextname}.  If this
3568 context does not exist, it will be created.  
3569
3570 @lilypond[verbatim,singleline]
3571 \score {
3572   \notes \relative c'' {
3573     c4 <d4 \context Staff = "another" e4> f
3574   }
3575 }
3576
3577 @end lilypond
3578
3579 In this example, the @code{c} and @code{d} are printed on the
3580 default staff.  For the @code{e}, a context Staff called
3581 @code{another} is specified; since that does not exist, a new
3582 context is created.  Within @code{another}, a (default) Voice context
3583 is created for the @code{e4}.  When all music referring to a
3584 context is finished, the context is ended as well.  So after the
3585 third quarter, @code{another} is removed.
3586
3587
3588
3589 @node Default contexts
3590 @subsection Default contexts
3591
3592 Most music expressions don't need @code{\context}: they inherit the
3593 notation context from their parent. Each note is a music expression, and
3594 as you can see in the following example, only the sequential music
3595 enclosing the three notes has an explicit context. 
3596
3597 @lilypond[verbatim,singleline]
3598 \score { \notes \context Voice = goUp { c'4 d' e' } } 
3599 @end lilypond
3600
3601 There are some quirks that you must keep in mind when dealing with
3602 defaults:
3603
3604 First, every top-level music is interpreted by the Score context, in other
3605 words, you may think of @code{\score} working like
3606 @example
3607         \score @{
3608                 \context Score @var{music}
3609         @}
3610 @end example
3611
3612 Second, sequential music follows the contexts of its
3613 ``children''. Consider the following  example.
3614
3615 @lilypond[verbatim, singleline]
3616 \score { \context Score \notes { c'4 (  d' )e' } }
3617 @end lilypond
3618
3619 The sequential music is interpreted by the Score context initially
3620 (notice that the @code{\context} specification is redundant), but when a
3621 note is encountered, contexts are setup to accept that note. In this
3622 case, a Thread, Voice and Staff are created. The rest of the sequential
3623 music is also interpreted with the same Thread, Voice and Staff context,
3624 putting the notes on the same staff, in the same voice.
3625
3626 This is a convenient mechanism, but do not expect opening chords to work
3627 without @code{\context}. For every note, a separate staff is
3628 instantiated.
3629
3630 @lilypond[verbatim, singleline]
3631 \score { \notes <c'4 es'> } 
3632 @end lilypond
3633
3634 Of course, if the chord is preceded by a normal note in sequential
3635 music, the chord will be interpreted by the Thread of the preceding
3636 note:
3637 @lilypond[verbatim,singleline]
3638 \score { \notes { c'4 <c'4 es'> }  }
3639 @end lilypond
3640
3641
3642
3643 @node Context properties
3644 @subsection Context properties
3645
3646 Notation contexts can be modified from within the @file{.ly} file. The
3647 following music expression does that job:
3648
3649 @cindex @code{\property}
3650 @example
3651   \property @var{contextname}.@var{propname} =  @var{value}
3652 @end example
3653
3654 Sets the @var{propname} property of the context @var{contextname} to the
3655 specified Scheme expression @var{value}.  All @var{propname} and
3656 @var{contextname} are strings, which are typically unquoted.
3657
3658 Properties that are set in one context are inherited by all of the
3659 contained contexts.  This means that a property valid for the
3660 @code{Voice} context can be set in the @code{Score} context (for
3661 example) and thus take effect in all @code{Voice} contexts.
3662
3663 Properties can be unset using the following expression:
3664 @example
3665   \property @var{contextname}.@var{propname} \unset
3666 @end example
3667
3668 This removes the definition of @var{propname} in @var{contextname}. If
3669 @var{propname} was not defined in @var{contextname} (but was inherited
3670 from a higher context), then this has no effect.
3671
3672
3673 @refbugs
3674
3675 @code{\property \unset} is not the inverse of @code{\property \set}
3676
3677
3678
3679
3680 @c .  {Context definitions}
3681 @node Changing context definitions
3682 @subsection Changing context definitions
3683
3684 @cindex context definition
3685 @cindex translator definition
3686
3687 The most common way to define a context is by extending an existing
3688 context.  You can change an existing context from the paper block, by
3689 first initializing a translator with an existing context identifier:
3690 @example
3691 \paper @{
3692   \translator @{
3693     @var{context-identifier}
3694   @} @}
3695 @end example
3696 Then you can add engravers, remove engravers.
3697 The syntax for these operations are respectively
3698 @example
3699  \remove @var{engravername}
3700  \consists @var{engravername}
3701 @end example
3702
3703
3704 Here @var{engravername} is a string, the name of an engraver in the
3705 system.
3706 @example
3707  @var{propname} = @var{value} 
3708 @end example
3709
3710
3711 @lilypond[verbatim,singleline]
3712 \score {  \notes {
3713         c'4 c'4 }
3714   \paper {
3715     \translator  { \StaffContext
3716         \remove Clef_engraver;
3717        } } }
3718 @end lilypond
3719
3720 @cindex engraver
3721
3722 You can also set properties in a translator definition. The syntax is as
3723 follows:
3724
3725 @var{propname} is a string and @var{value} is a Scheme
3726 expression.
3727 @example
3728  @var{propname} = @var{value}
3729  @var{propname} \set  @var{symbol} = @var{value}
3730  @var{propname} \override @var{symbol} =  @var{value}
3731  @var{propname} \revert @var{symbol} 
3732
3733 @end example
3734
3735 These type of property assignments happen before interpretation starts,
3736 so a @code{\property} expression will override any predefined settings.
3737
3738
3739  To simplify editing translators, all standard contexts have standard
3740 identifiers called @var{name}@code{Context}, e.g. @code{StaffContext},
3741 @code{VoiceContext}.
3742
3743 @node Defining new contexts
3744 @subsection Defining new contexts
3745
3746 If you want to build a context from scratch, you must also supply the
3747 following extra information:
3748 @itemize @bullet
3749   @item  A name, specified by @code{\name @var{contextname};}.
3750
3751   @item A cooperation module. This is specified by   @code{\type
3752 @var{typename};}.
3753 @end itemize
3754
3755 This is an example:
3756 @example
3757 \translator @code{
3758   \type "Engraver_group_engraver";
3759   \name "SimpleStaff";
3760   \alias "Staff";
3761   \consists "Staff_symbol_engraver";
3762   \consists "Note_head_engraver";
3763   \consistsend "Axis_group_engraver";
3764 }@
3765 @end example
3766
3767 Basic building blocks of translation are called engravers; they are
3768 special C++ classes.
3769
3770 The argument of @code{\type} is the name for a special engraver that
3771 handles cooperation between simple engravers such as
3772 @code{Note_head_engraver} and @code{Staff_symbol_engraver}. Alternatives
3773 for this engraver are the following:
3774 @table @code
3775 @cindex @code{Engraver_group_engraver}
3776   @item @code{Engraver_group_engraver}  
3777     The standard cooperation engraver.
3778
3779 @cindex @code{Score_engraver}
3780
3781   @item @code{Score_engraver}  
3782     This is cooperation module that should be in the top level context,
3783 and only the toplevel context.
3784
3785 @cindex @code{Grace_engraver_group}
3786
3787   @item @code{Grace_engraver_group}  
3788     This is a special cooperation module (resembling
3789     @code{Score_engraver}) that is used to created an embedded
3790     `miniscore'.
3791 @end table 
3792
3793 Other modifiers   are
3794
3795 @itemize @bullet
3796   @item @code{\alias} @var{alternate-name} @code{;}
3797     This specifies a different name. In the above example,
3798 @code{\property Staff.X = Y} will also work on @code{SimpleStaff}s
3799
3800   @item  @code{\consistsend} @var{engravername} @code{;}  
3801     Analogous to @code{\consists}, but makes sure that
3802     @var{engravername} is always added to the end of the list of
3803     engravers.
3804
3805     Some engraver types need to be at the end of the list; this
3806     insures they are put there, and stay there, if a user adds or
3807     removes engravers.  This command is usually not needed for
3808     end-users.
3809     
3810   @item  @code{\accepts} @var{contextname} @code{;}  
3811     Add @var{contextname} to the list of  context this context can
3812     contain.  The first listed context is the context to create by
3813     default.
3814
3815   @item @code{\denies}. The opposite of @code{\accepts}. Added for
3816 completeness, but is never used in practice.
3817  
3818   
3819   @item  @code{\name} @var{contextname} @code{;}  
3820     This sets name of the context, e.g. @code{Staff}, @code{Voice}.  If
3821     the name is not specified, the translator won't do anything.
3822 @end itemize
3823
3824 In the @code{\paper} block, it is also possible to define translator
3825 identifiers.  Like other block identifiers, the identifier can only
3826 be used as the very first item of a translator.  In order to define
3827 such an identifier outside of @code{\score}, you must do
3828
3829 @quotation
3830 @example 
3831 \paper @{
3832   foo = \translator @{ @dots{} @}
3833 @}
3834 \score @{
3835   \notes @{
3836     @dots{}
3837   @}
3838   \paper @{
3839     \translator @{ \foo @dots{} @}
3840   @}
3841 @} 
3842 @end example 
3843
3844 @end quotation
3845
3846
3847 @cindex paper types, engravers, and pre-defined translators
3848
3849       
3850
3851
3852
3853
3854 @c . {Syntactic details}
3855 @node Syntactic details
3856 @section Syntactic details
3857 @cindex Syntactic details
3858
3859 This section describes details that were too boring to be put elsewhere.
3860
3861 @menu
3862 * Top level::                   
3863 * Identifiers::                 
3864 * Music expressions::           
3865 * Manipulating music expressions::  
3866 * Assignments::                 
3867 * Lexical modes::               
3868 * Ambiguities::                 
3869 @end menu
3870
3871 @c .  {Top level}
3872 @node Top level
3873 @subsection Top level
3874 @cindex Top level
3875
3876 This section describes what you may enter at top level.
3877
3878
3879 @c .   {Score}
3880 @subsubsection Score
3881 @cindex Score
3882
3883 @cindex score definition
3884
3885 The output is generated combining a music expression with an output
3886 definition.  A score block has the following syntax:
3887
3888 @example
3889   \score @{ @var{musicexpr} @var{outputdefs} @}
3890 @end example
3891
3892 @var{outputdefs} are zero or more output definitions.  If none is
3893 supplied, the default @code{\paper} block will be added.
3894
3895
3896
3897 @c .   {Default output}
3898 @subsubsection Default output
3899
3900 Default values for the @code{\paper} and @code{\midi} block are set by
3901 entering such a block at top-level.
3902
3903 @c .   {Header}
3904 @subsubsection Header
3905 @cindex Header
3906 @cindex @code{\header}
3907
3908
3909 A header describes bibilographic information of the file's contents.  It
3910 can also appear in a @code{\score} block.  Tools like @code{ly2dvi} can
3911 use this information for generating titles.  Key values that are used by
3912 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
3913 metre, arranger, piece and tagline.
3914
3915 @cindex @code{ly2dvi}
3916
3917 The syntax is
3918 @example
3919   \header @{ @var{key1} = @var{val1};
3920              @var{key2} = @var{val2}; @dots{} @}
3921 @end example
3922
3923 It is customary to put the @code{\header} at the top of the file.
3924
3925 @subsubsection Default output
3926
3927 A @code{\midi} or @code{\paper} block at top-level sets the default
3928
3929 paper block for all scores that lack an explicit paper block.
3930
3931 @c .  {Identifiers}
3932 @node Identifiers
3933 @subsection Identifiers
3934 @cindex  Identifiers
3935
3936 All of the information in a LilyPond input file, is represented as a
3937 Scheme value. In addition to normal Scheme data types (such as pair,
3938 number, boolean, etc.), LilyPond has a number of specialized data types,
3939
3940 @itemize @bullet
3941 @item Input
3942 @item c++-function
3943 @item Music
3944 @item Identifier
3945 @item Translator_def
3946 @item Duration
3947 @item Pitch
3948 @item Score
3949 @item Music_output_def
3950 @item Moment (rational number)
3951 @end itemize
3952
3953 LilyPond also includes some transient object types. Objects of these
3954 types are built during a LilyPond run, and do not `exist' per se within
3955 your input file. These objects are created as a result of your input
3956 file, so you can include commands in the input to manipulate them,
3957 during a lilypond run.
3958
3959 @itemize @bullet
3960 @item Grob: short for Graphical object. See @ref{Grobs}. 
3961 @item Molecule: device-independent page output object,
3962 including dimensions.  Produced by some Grob functions
3963 See @ref{Molecules}
3964 @item Translator: object that produces audio objects or Grobs. This is
3965 not yet user accessible.
3966 @item Font_metric: object representing a font. (See @ref{Font metrics})
3967
3968 @end itemize
3969
3970
3971 @node Music expressions
3972 @subsection Music expressions
3973
3974 @cindex music expressions
3975
3976 Music in LilyPond is entered as a music expression.  Notes, rests, lyric
3977 syllables are music expressions, and you can combine music expressions
3978 to form new ones, for example by enclosing a list of expressions in
3979 @code{\sequential @{ @}} or @code{< >}.  In the following example, a
3980 compound expression is formed out of the quarter note @code{c} and a
3981 quarter note @code{d}:
3982
3983 @example 
3984 \sequential @{ c4 d4 @} 
3985 @end example 
3986
3987 @cindex Sequential music
3988 @cindex @code{\sequential}
3989 @cindex sequential music
3990 @cindex @code{<}
3991 @cindex @code{>}
3992 @cindex Simultaneous music
3993 @cindex @code{\simultaneous}
3994
3995 The two basic compound  music expressions are simultaneous  and
3996 sequential music.
3997
3998 @example
3999   \sequential @code{@{} @var{musicexprlist} @code{@}}
4000   \simultaneous @code{@{} @var{musicexprlist} @code{@}}
4001 @end example
4002 For both, there is a shorthand:
4003 @example
4004   @code{@{} @var{musicexprlist} @code{@}}
4005 @end example
4006 for sequential and
4007 @example
4008   @code{<} @var{musicexprlist} @code{>}
4009 @end example
4010 for simultaneous music.
4011 In principle, the way in which you nest sequential and simultaneous to
4012 produce music is not relevant.  In the following example, three chords
4013 are expressed in two different ways:
4014
4015 @lilypond[fragment,verbatim,center]
4016   \notes \context Voice {
4017     <a c'> <b  d' > <c' e'>
4018     < { a b  c' } { c' d' e' } >
4019   }
4020 @end lilypond
4021
4022
4023 Other compound music expressions include
4024 @example
4025  \repeat @var{expr}
4026  \transpose @var{pitch} @var{expr}
4027  \apply @var{func} @var{expr}
4028  \context @var{type} = @var{id} @var{expr}
4029  \times @var{fraction} @var{expr}
4030 @end example
4031
4032
4033 @c . {Manipulating music expressions}
4034 @node Manipulating music expressions
4035 @subsection  Manipulating music expressions
4036
4037 The @code{\apply} mechanism gives you access to the internal
4038 representation of music. You can write Scheme-functions that operate
4039 directly on it. The syntax is 
4040 @example
4041         \apply #@var{func} @var{music}
4042 @end example
4043 This means that @var{func} is applied to @var{music}.  The function
4044 @var{func} should return a music expression.
4045
4046 This example replaces the text string of a script. It also shows a dump
4047 of the music it processes, which is useful if you want to know more
4048 about how music is stored.
4049
4050 @lilypond[verbatim,singleline]
4051 #(define (testfunc x)
4052         (if (equal? (ly-get-mus-property x 'text) "foo")
4053                 (ly-set-mus-property x 'text "bar"))
4054         ;; recurse
4055         (ly-set-mus-property x 'elements
4056           (map testfunc (ly-get-mus-property x 'elements)))
4057         (display x)
4058         x        
4059 )
4060 \score { \notes
4061   \apply #testfunc { c4_"foo" }
4062
4063 @end lilypond
4064
4065 For more information on what is possible, see the automatically
4066 generated documentation.
4067
4068
4069 Directly accessing internal representations is dangerous: the
4070 implementation is subject to changes, so you should avoid this feature
4071 if possible.
4072
4073 A final example is a function that reverses a piece of music in time:
4074
4075 @lilypond[verbatim,singleline]
4076 #(define (reverse-music music)
4077   (let* ((elements (ly-get-mus-property music 'elements))
4078          (reversed (reverse elements))
4079          (span-dir (ly-get-mus-property music 'span-direction)))
4080     (ly-set-mus-property music 'elements reversed)
4081     (if (dir? span-dir)
4082         (ly-set-mus-property music 'span-direction (- span-dir)))
4083     (map reverse-music reversed)
4084     music))
4085
4086 music = \notes { c'4 d'4( e'4 f'4 }
4087
4088 \score { \context Voice {
4089     \music
4090     \apply #reverse-music \music
4091   }
4092 }
4093 @end lilypond
4094
4095
4096 @c .   {Span requests}
4097 @menu
4098 * Span requests::               
4099 @end menu
4100
4101 @node Span requests
4102 @subsubsection Span requests
4103 @cindex Span requests
4104
4105 Notational constructs that start and end on different notes can be
4106 entered using span requests. The syntax is as follows:
4107
4108
4109 @example
4110   \spanrequest @var{startstop} @var{type}
4111 @end example
4112
4113
4114 @cindex @code{\start}
4115 @cindex @code{\stop}
4116
4117 This defines a spanning request. The @var{startstop} parameter is either
4118 -1 (@code{\start}) or 1 (@code{\stop}) and @var{type} is a string that
4119 describes what should be started.  Much of the syntactic sugar is a
4120 shorthand for @code{\spanrequest}, for example,
4121
4122 @lilypond[fragment,verbatim,center]
4123   c'4-\spanrequest \start "slur"
4124   c'4-\spanrequest \stop "slur"
4125 @end lilypond
4126
4127 Among the supported types are @code{crescendo}, @code{decrescendo},
4128 @code{beam}, @code{slur}. This is an internal command.  Users are
4129 encouraged to use the shorthands which are defined in the initialization
4130 file @file{spanners.ly}.
4131
4132
4133 @c .   {Assignments}
4134 @node Assignments
4135 @subsection Assignments
4136 @cindex Assignments
4137
4138 Identifiers allow objects to be assigned to names during the parse
4139 stage.  To assign an identifier, you use @var{name}@code{=}@var{value}
4140 and to refer to an identifier, you preceed its name with a backslash:
4141 `@code{\}@var{name}'.  @var{value} is any valid Scheme value or any of
4142 the input-types listed above.  Identifier assignments can appear at top
4143 level in the LilyPond file, but also in @code{\paper} blocks.
4144
4145 Semicolons are forbidden after top level assignments, but mandatory in
4146 other places. The rules about semicolons and assignments are very
4147 confusing, but when LilyPond input evolves more towards Scheme, we hope
4148 that this problem will grow smaller.
4149
4150 An identifier can be created with any string for its name, but you will
4151 only be able to refer to identifiers whose names begin with a letter,
4152 being entirely alphabetical.  It is impossible to refer to an identifier
4153 whose name is the same as the name of a keyword.
4154
4155 The right hand side of an identifier assignment is parsed completely
4156 before the assignment is done, so it is allowed to redefine an
4157 identifier in terms of its old value, e.g.
4158
4159 @example
4160 foo = \foo * 2.0
4161 @end example
4162
4163 When an identifier is referenced, the information it points to is
4164 copied.  For this reason, an identifier reference must always be the
4165 first item in a block.
4166 @example
4167 \paper  @{
4168   foo = 1.0
4169   \paperIdent % wrong and invalid
4170 @}
4171
4172 \paper @{
4173   \paperIdent % correct
4174   foo = 1.0 @}
4175 @end example
4176
4177
4178 @c .  {Lexical modes}
4179 @node Lexical modes
4180 @subsection Lexical modes
4181 @cindex Lexical modes
4182 @cindex input mode
4183 @cindex mode, input 
4184 @cindex @code{\notes}
4185 @cindex @code{\chords}
4186 @cindex @code{\lyrics}
4187
4188 To simplify entering notes, lyrics, and chords, LilyPond has three
4189 special input modes on top of the default mode: note, lyrics and chords
4190 mode.  These input modes change the way that normal, unquoted words are
4191 interpreted: for example, the word @code{cis} may be interpreted as a
4192 C-sharp, as a lyric syllable `cis' or as a C-sharp major triad
4193 respectively.
4194
4195 A mode switch is entered as a compound music expressions
4196 @example
4197 @code{\notes} @var{musicexpr}
4198 @code{\chords} @var{musicexpr}
4199 @code{\lyrics}  @var{musicexpr}.
4200 @end example
4201
4202 In each of these cases, these expressions do not add anything to the
4203 meaning of their arguments.  They are just a way to indicate that the
4204 arguments should be parsed in indicated mode.  The modes are treated in
4205 more detail in the @ref{Note entry}, @ref{Lyrics} and
4206 @ref{Chords}.
4207
4208 You may nest different input modes.
4209
4210 @c .  {Ambiguities}
4211 @node Ambiguities
4212 @subsection Ambiguities
4213 @cindex ambiguities
4214 @cindex grammar
4215
4216
4217 The grammar contains a number of ambiguities. We hope to resolve them at
4218 some time.
4219
4220 @itemize @bullet
4221   @item  The assignment
4222
4223          @example 
4224 foo = bar 
4225 @end example 
4226
4227        can be interpreted as making a string identifier @code{\foo}
4228        containing @code{"bar"}, or a music identifier @code{\foo}
4229        containing the syllable `bar'.
4230
4231   @item  The assignment
4232
4233          @example 
4234 foo = -6 
4235 @end example 
4236
4237        can be interpreted as making an integer identifier
4238        containing -6, or a Request identifier containing the
4239        fingering `6' (with neutral direction).
4240
4241   @item  If you do a nested repeat like
4242
4243        @quotation
4244
4245 @example 
4246 \repeat @dots{}
4247 \repeat @dots{}
4248 \alternative 
4249 @end example 
4250
4251        @end quotation
4252
4253        then it is ambiguous to which @code{\repeat} the
4254        @code{\alternative} belongs.  This is the classic if-then-else
4255        dilemma.  It may be solved by using braces.
4256
4257   @item  (an as yet unidentified ambiguity :-)
4258 @end itemize
4259
4260
4261 @c .  {Lexical details}
4262 @node Lexical details
4263 @section Lexical details
4264
4265 Even more boring details, now on lexical side of the input parser.
4266
4267 @menu
4268 * Comments::                    
4269 * Direct Scheme::               
4270 * Keywords::                    
4271 * Integers::                    
4272 * Reals::                       
4273 * Strings::                     
4274 * Main input::                  
4275 * File inclusion::              
4276 * Version information::         
4277 @end menu
4278
4279
4280 @node Comments
4281 @subsection Comments
4282
4283 @cindex comments
4284 @cindex block comment
4285 @cindex line comment
4286
4287 @cindex @code{%}
4288
4289 A one line comment is introduced by a @code{%} character. 
4290 Block comments are started by @code{%@{} and ended by @code{%@}}. 
4291 They cannot be nested.
4292
4293 @node Direct Scheme
4294 @subsection Direct Scheme
4295
4296 @cindex Scheme
4297 @cindex GUILE
4298 @cindex Scheme, in-line code
4299
4300
4301 LilyPond contains a Scheme interpreter (the GUILE library) for
4302 internal use. In some places Scheme expressions also form valid syntax:
4303 whereever it is allowed,
4304 @example
4305   #@var{scheme}
4306 @end example
4307 evaluates the specified Scheme code. If this is used at toplevel, then
4308 the result is discarded. Example:
4309 @example
4310   \property Staff.TestObject \override #'foobar =  #(+ 1 2)
4311 @end example
4312
4313 @code{\override} expects two Scheme expressions, so there are two Scheme
4314 expressions. The first one is a symbol (@code{foobar}), the second one
4315 an integer (namely, 3).
4316
4317 Scheme is a full-blown programming language, and a full discussion is
4318 outside the scope of this document. Interested readers are referred to
4319 the website @uref{http://www.schemers.org/} for more information on
4320 Scheme.
4321
4322
4323 @node Keywords
4324 @subsection Keywords
4325 @cindex Keywords
4326
4327
4328 Keywords start with a backslash, followed by a number of lower case
4329 alphabetic characters.  These are all the keywords.
4330
4331 @example
4332 apply arpeggio autochange spanrequest commandspanrequest
4333 simultaneous sequential accepts alternative bar breathe
4334 char chordmodifiers chords clef cm consists consistsend
4335 context denies duration dynamicscript elementdescriptions
4336 font grace header in lyrics key mark pitch
4337 time times midi mm name pitchnames notes outputproperty
4338 override set revert partial paper penalty property pt
4339 relative remove repeat addlyrics partcombine score
4340 script stylesheet skip textscript tempo translator
4341 transpose type
4342 @end example
4343
4344 @node Integers
4345 @subsection Integers
4346
4347 @cindex integers
4348 @cindex @code{+}
4349 @cindex @code{-}
4350 @cindex @code{*}
4351 @cindex @code{/}
4352
4353 Formed from an optional minus sign followed by digits.  Arithmetic
4354 operations cannot be done with integers, and integers cannot be mixed
4355 with reals.
4356
4357 @node Reals
4358 @subsection Reals
4359 @cindex real numbers
4360
4361
4362
4363
4364
4365 Formed from an optional minus sign and a sequence of digits followed
4366 by a @emph{required} decimal point and an optional exponent such as
4367 @code{-1.2e3}.  Reals can be built up using the usual operations:
4368 `@code{+}', `@code{-}', `@code{*}', and
4369 `@code{/}', with parentheses for grouping.
4370
4371 @cindex @code{\mm},
4372 @cindex @code{\in}
4373 @cindex @code{\cm}
4374 @cindex @code{\pt}
4375 @cindex dimensions
4376
4377 A real constant can be followed by one of the dimension keywords:
4378 @code{\mm} @code{\pt}, @code{\in}, or @code{\cm}, for millimeters,
4379 points, inches and centimeters, respectively.  This converts the number
4380 a number that is the internal representation of that dimension.
4381
4382
4383 @node Strings
4384 @subsection Strings
4385 @cindex string
4386 @cindex concatenate
4387
4388 Begins and ends with the @code{"} character.  To include a @code{"}
4389 character in a string write @code{\"}.  Various other backslash
4390 sequences have special interpretations as in the C language.  A string
4391 that contains no spaces can be written without the quotes.  See
4392 @ref{Lexical modes} for details on unquoted strings; their
4393 interpretation varies depending on the situation.  Strings can be
4394 concatenated with the @code{+} operator.
4395
4396 The tokenizer accepts the following commands. They have no grammatical
4397 function, hence they can appear anywhere in the input.
4398
4399
4400 @node Main input
4401 @subsection Main input
4402 @cindex Main input
4403
4404 @cindex @code{\maininput}
4405
4406 The @code{\maininput} command is used in init files to signal that the
4407 user file must be read. This command cannot be used in a user file.
4408
4409 @node File inclusion
4410 @subsection File inclusion
4411 @cindex @code{\include}
4412 @example
4413   \include @var{filename}
4414 @end example
4415
4416 Include @var{filename}.  The argument @var{filename} may be a quoted string (an
4417 unquoted string will not work here!) or a string identifier.  The full
4418 filename including the @file{.ly} extension must be given,
4419
4420
4421 @node Version information
4422 @subsection Version information 
4423 @cindex @code{\version}
4424 @example
4425   \version @var{string} ;
4426 @end example
4427
4428 Specify the version of LilyPond that a file was written for.  The
4429 argument is a version string in quotes, for example @code{"1.2.0"}. 
4430 This is used to detect invalid input, and to aid
4431 @code{convert-ly}  a tool that automatically upgrades input files. See
4432 See @ref{convert-ly} for more information on @code{convert-ly}.
4433
4434 @cindex convert-ly
4435
4436
4437
4438
4439
4440
4441 @c .{Local emacs vars}
4442 @c Local variables:
4443 @c mode: texinfo
4444 @c minor-mode: font-lock
4445 @c minor-mode: outline
4446 @c outline-layout: (-1 : 0)
4447 @c outline-use-mode-specific-leader: "@c \."
4448 @c outline-primary-bullet: "{"
4449 @c outline-stylish-prefixes: nil
4450 @c outline-override-protect: t
4451 @c End:
4452