]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/tex/reference-manual.yo
release: 1.2.4
[lilypond.git] / Documentation / tex / reference-manual.yo
1 mailto(gnu-music-discuss@gnu.org)
2 COMMENT(-*-text-*-)
3
4 redef(var)(1)(\
5   whenlatex(latexcommand({\normalfont\scshape )ARG1+latexcommand(}))\
6   whenhtml(sc(ARG1))\
7 )
8
9 def(indexcode)(1)(cindex(ARG1@code(ARG1)))
10 def(indexandcode)(1)(code(ARG1)indexcode(ARG1))
11 def(keyindex)(1)(cindex(ARG1@code(\ARG1)))
12
13 redef(code)(1)(tt(ARG1))
14 redef(cindex)(1)(\
15   whenlatex(latexcommand(\index{)ARG1+latexcommand(}))\
16   whentexinfo(XXnl()texinfocommand(@cindex )ARG1XXnl())\
17 )
18
19
20 COMMENT(
21   BUGS:
22
23     restStyle=mensural doesn't seem to work (lots of characters not found
24     for rests.fly)
25
26   TODO:
27   
28     accordeon symbols
29     Music expression / music expression
30     property lists  should be alphabetic.
31     
32 )
33
34
35 COMMENT( 
36   This document contains Mudela fragments.  You need at least
37   Yodl-1.30.18 to convert this to tex or html.
38 )
39
40 htmlbodyopt(bgcolor)(white)
41 htmlcommand(<font color=black>)
42
43 latexlayoutcmds(
44   \setlength{\topmargin}{-0.25in}
45   \setlength{\textheight}{9in}
46   \setlength{\textwidth}{5.875in} 
47   \setlength{\oddsidemargin}{0.25in}   
48   \setlength{\evensidemargin}{0.25in}
49   \input mudela-book
50   \usepackage{makeidx}
51   \makeindex
52 )
53
54 whentexinfo(notableofcontents())
55
56
57 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
58 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
59 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
60
61 article(LilyPond 1.2.0 Reference Manual)
62        (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen)
63        (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop())
64
65
66 latexcommand(\def\interexample{})
67 latexcommand(\def\preexample{\par})
68 latexcommand(\def\postexample{\par\medskip})
69 latexcommand(\def\file#1{{code(#1)}})
70 COMMENT(
71   latexcommand(\def\texttt#1{\tt #1})
72   latexcommand(\def\textbf#1{\bf #1})
73 )
74
75 COMMENT(urg, texinfo include breaks)
76 whenhtml(includefile(html-disclaimer.yo-urg))
77
78
79 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
80 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
81
82 sect(Overview)
83
84 This nop(document)footnote(This document has been revised for
85 LilyPond 1.2.) describes the the GNU LilyPond input format, which is
86 a language for defining music.  We call this language em(Music
87 Definition Language) or em(Mudela), for short.footnote(If anybody
88 comes up with a better name, we'd gladly take this.  Gourlay already
89 uses a ``Musical Description Language,'' ISO standard 10743 defines a
90 ``Standard Music Description Language.''  We're not being original
91 here.)
92
93 em(Mudela) is a language that allows you to
94
95 itemize(
96   it() create musical expressions by combining pitches, durations 
97   it() output those musical expressions to various formats
98   it() give those musical expressions and output definitions names, so
99        you can enter them in manageable chunks.
100 )
101
102 em(Mudela) aims to define a piece of music completely, both from
103 typesetting and from a performance point of view.
104
105
106 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
107 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
108
109 sect(Top level)
110 cindex(top level)
111
112 This section describes what you may enter at top level.
113
114 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
115
116 subsect(Score definitions)
117 cindex(score definition)
118
119 The output is generated combining a music expression with an output
120 definition.  A score block has the following syntax:
121
122 quote(
123   code(\score {) var(musicexpr) var(outputdefs) code(})
124 )
125
126 var(outputdefs) are zero or more output definitions.  If no output
127 definition is supplied, the default code(\paper) block will be added.
128
129 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
130
131 subsect(Information header)
132 cindex(header)
133 keyindex(header)
134
135 The syntax is
136
137 quote(
138   code(\header) code({) var(key1) = var(val1);
139                         var(key2) = var(val2); ellipsis() code(})
140 )
141
142 A header describes the file's contents.  It can also appear in a
143 code(\score) block.  Tools like indexandcode(ly2dvi) can use this
144 information for generating titles.  Key values that are used by
145 code(ly2dvi) are: title, subtitle, composer, opus, poet, instrument,
146 metre, arranger, piece and tagline.
147
148 It is customary to put the code(\header) at the top of the file.
149
150 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
151
152 subsect(Setting notenames and chordnames)
153 label(notenames)
154
155 Note name tables can be specified using
156
157 quote(
158   code(\notenames)keyindex(notenames)
159     code({) var(assignmentlist) code(})
160 )
161
162 var(assignmentlist) is a list of definitions of the form
163
164 quote(
165   var(name) = var(pitch)
166 )
167
168 Chord modifiers can be set analogously, with
169 code(\chordmodifiers)keyindex(chordmodifiers).
170
171 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
172
173 subsect(Output definitions)
174
175 A code(\paper) block at top level sets the default paper block.  A
176 code(\midi) block at top level works similarly.
177
178 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
179
180 subsect(GUILE and Scheme)
181
182 LilyPond contains a Scheme interpreter (the GUILE library) for
183 internal use.  The following commands access the interpreter
184 directly.
185
186 quote(
187   code(\scm)keyindex(scm) var(scheme) code(;)
188 )
189
190 Evaluates the specified Scheme code.  The result is discarded.
191
192 quote(
193   code(\scmfile)keyindex(scmfile) var(filename) code(;)
194 )
195
196 Reads Scheme code from the specified file.  The result is discarded.
197
198
199 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
200
201 subsect(Identifiers)
202
203 Identifier assignments may appear at top level.  Semicolons are
204 forbidden after top level assignments.
205
206
207 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
208 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
209
210 sect(Lexical conventions)
211 cindex(lexical conventions)
212
213 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
214
215 subsect(Comments)
216 cindex(comment)
217 indexcode(%)
218 whenlatex(cindex(%A@latexcommand(\texttt{\%\textbraceleft})))
219 whenlatex(cindex(%B@latexcommand(\texttt{\%\textbraceright})))
220
221 A one line comment is introduced by a `code(%)' character. 
222 Block comments are started by `code(%{)' and ended by `code(%})'. 
223 They cannot be nested.
224
225 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
226
227 subsect(Keywords)
228 cindex(keyword)
229
230 Keywords start with a backslash, followed by a number of lower case
231 alphabetic characters.  These are all the keywords.
232
233 latexcommand(\begin{raggedright})
234 quote(
235   code(\accepts)
236   code(\addlyrics)
237   code(\alternative)
238   code(\bar)
239   code(\breathe)
240   code(\cadenza)
241   code(\chordmodifiers)
242   code(\chords)
243   code(\clef)
244   code(\cm)
245   code(\consists)
246   code(\consistsend)
247   code(\context)
248   code(\duration)
249   code(\font)
250   code(\grace)
251   code(\header)
252   code(\in)
253   code(\key)
254   code(\keysignature)
255   code(\lyrics)
256   code(\mark)
257   code(\midi)
258   code(\mm)
259   code(\musicalpitch)
260   code(\name)
261   code(\notenames)
262   code(\notes)
263   code(\paper)
264   code(\partial)
265   code(\penalty)
266   code(\property)
267   code(\pt)
268   code(\relative)
269   code(\remove)
270   code(\repeat)
271   code(\repetitions)
272   code(\scm)
273   code(\scmfile)
274   code(\score)
275   code(\script)
276   code(\sequential)
277   code(\shape)
278   code(\simultaneous)
279   code(\skip)
280   code(\spanrequest)
281   code(\tempo)
282   code(\textscript)
283   code(\time)
284   code(\times)
285   code(\translator)
286   code(\transpose)
287   code(\type)
288 )
289 latexcommand(\end{raggedright})
290
291 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
292
293 subsect(Integers)
294 cindex(integer)
295
296 Formed from an optional minus sign followed by digits.  Arithmetic
297 operations cannot be done with integers, and integers cannot be mixed
298 with reals.
299
300 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
301
302 subsect(Reals)
303 cindex(real) 
304
305 Formed from an optional minus sign and a sequence of digits followed
306 by a em(required) decimal point and an optional exponent such as
307 code(-1.2e3).  Reals can be built up using the usual operations:
308 `indexandcode(+)', `indexandcode(-)', `indexandcode(*)', and
309 `indexandcode(/)', with parentheses for grouping.
310
311 A real constant can be followed by one of the dimension
312 keywords:cindex(dimensions) code(\mm)keyindex(mm),
313 code(\pt)keyindex(pt), code(\in)keyindex(in), or
314 code(\cm)keyindex(cm), for millimeters, points, inches and
315 centimeters, respectively.  This converts the number to a real that
316 is the internal representation of dimensions.
317
318 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
319
320 subsect(String)
321 cindex(string) 
322
323 Begins and ends with the `code(")' character.  To include a `code(")'
324 character in a string write `code(\")'.  Various other backslash
325 sequences have special interpretations as in the C language.  A
326 string that contains no spaces can be written without the quotes. 
327 See bind(section)ref(modes) for details on unquoted strings; their
328 interpretation varies depending on the situation.  Strings can be
329 concatenated with the `code(+)' operator.
330
331 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
332
333 subsect(Tokenizer commands)
334
335 The tokenizer accepts the following commands.  They can appear
336 anywhere.
337
338 quote(
339   code(\maininput)keyindex(maininput)
340 )
341
342 This command is used in init files to signal that the user file must
343 be read. This command cannot be used in a user file.
344
345 quote(
346   code(\include)keyindex(include) var(file)
347 )
348
349 Include var(file).  The argument var(file) may be a quoted string (an
350 unquoted string will not work here!) or a string identifier.  The full
351 filename including the file(.ly) extension must be given,
352
353 quote(
354   code(\version)keyindex(version) var(string) code(;)
355 )
356
357 Specify the version of LilyPond that a file was written for.  The
358 argument is a version string in quotes, for example code("1.2.0"). 
359 This is used to detect invalid input, and to aid
360 code(convert-mudela), a tool that automatically upgrades input files.
361
362 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
363
364 subsect(Pitch Names in Other Languages)
365 cindex(other languages)
366 label(notelang)
367
368 Note name definitions have been provided in various languages. 
369 Simply include the language specific init file.  For example:
370 `code(\include "english.ly")'.  The available language files and the
371 names they define are:
372
373 quote(
374 verb(                        Note Names               sharp       flat
375
376 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
377 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
378 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
379 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
380 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
381 italiano.ly    do  re  mi  fa  sol la  sid si  -d          -b
382 catalan.ly     do  re  mi  fa  sol la  sid si  -d/-s       -b)
383 )
384
385 Pitch names can be redefined using the
386 code(\notenames)keyindex(notenames) command, see
387 bind(subsection)ref(notenames).
388
389 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
390
391 subsect(Lexical modes)
392 cindex(lexical modes)
393 cindex(modes)
394 label(modes)
395
396 To simplify entering notes, lyrics, and chords, em(Mudela) has three
397 special input modes on top of the default mode.  In each mode, words
398 are identified on the input.  If code("word") is encountered, it is
399 treated as a string.  If code(\word) is encountered, it is treated as
400 a keyword or as an identifier.  The behavior of the modes differs in
401 two ways: Different modes treat unquoted words differently, and
402 different modes have different rules for deciding what is a word.
403
404 description(
405   dit(Normal mode.)cindex(mode!normal) 
406     At the start of parsing, em(Mudela) is in Normal mode.  In Normal
407     mode, a word is an alphabetic character followed by alphanumeric
408     characters.  If code(word) is encountered on the input it is
409     treated as a string.
410
411   dit(Note mode.)cindex(mode!note)
412
413     Note mode is introduced by the keyword
414     code(\notes)keyindex(notes).  In Note mode, words can only
415     contain alphabetic characters.  If code(word) is encountered,
416     LilyPond first checks for a notename of code(word).  If no
417     notename is found, then code(word) is treated as a string.
418
419     Since combinations of numbers and dots are used for indicating
420     durations, it is not possible to enter real numbers in this mode.
421
422   dit(Chord mode.)cindex(mode!chord)
423     Chord mode is introduced by the keyword
424     code(\chords)keyindex(chords).  It is similar to Note mode, but
425     words are also looked up in a chord modifier table (containing
426     code(maj), code(dim), etc).
427
428     Since combinations of numbers and dots are used for indicating
429     durations, you can not enter real numbers in this mode.  Dashes
430     and carets are used to indicate chord additions and subtractions,
431     so scripts can not be entered in Chord mode.
432
433   dit(Lyrics mode.) cindex(mode!lyric)
434
435     Lyrics mode is introduced by the keyword
436     code(\lyrics)keyindex(lyrics).  This mode has rules that make it
437     easy to include punctuation and diacritical marks in words.  A
438     word in Lyrics mode begins with: an alphabetic character,
439     `code(_)', `code(?)', `code(!)', `code(:)', `code(')', the
440     control characters code(^A) through code(^F), code(^Q) through
441     code(^W), code(^Y), code(^^), any 8-bit character with ASCII code
442     over 127, or a two-character combination of a backslash followed
443     by one of `code(`)', `code(')', `code(")', or
444     `code(^)'.footnote(The purpose of Lyrics mode is that you can
445     enter lyrics in TeX() format or a standard encoding without
446     needing quotes.  The precise definition of this mode indeed is
447     ludicrous.  This will remain so until the authors of LilyPond
448     acquire a deeper understanding of character encoding, or someone
449     else steps up to fix this.)
450
451     Subsequent characters of a word can be any character that is not
452     a digit and not white space.  One important consequence of this
453     is that a word can end with `code(})', which may be confusing if
454     you thought the closing brace was going to terminate Lyrics
455     mode.footnote(LilyPond will issue a warning, though.)  Any
456     `code(_)' characters which appear in an unquoted word are
457     converted to spaces.  This provides a mechanism for introducing
458     spaces into words without using quotes.  Quoted words can also be
459     used in Lyrics mode to specify words that cannot be written with
460     the above rules.  Here are some examples.  Not all of these words
461     are printable by TeX().
462
463 COMMENT(
464 DOEXPAND(muckslash)^etre          % a word
465 )
466
467     quote(
468 verb(Ah!             % a word
469 2B_||_!2B       % not a word because it starts with a digit
470 ``Hello''       % not a word because it starts with `
471 _ _ _ _         % 4 words, each one a space)
472     )
473
474     Since combinations of numbers and dots are used for indicating
475     durations, you can not enter real numbers in this mode.
476 )
477
478 It is possible to create words that break the rules by prefixing them
479 with the dollar sign `indexandcode($)'.  Regardless of the context, a
480 word beginning with `code($)' extends until the next white space
481 character.  Such words can contain numbers (even in Note mode), or
482 other forbidden characters.  The dollar sign can be used to create
483 and access identifiers that could not otherwise be used.footnote(Use
484 of `code($)' hampers readability and portability to future LilyPond
485 versions, thus the use of the dollar sign is discouraged.)
486
487
488 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
489 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
490
491 sect(Types)
492 cindex(types and identifiers)
493
494 em(Mudela) has a limited set of types:
495
496 itemize(
497   it() integers
498   it() reals
499   it() strings
500   it() music expressions
501   it() durations of notes and rests (specified with
502        code(\notenames)keyindex(notenames))
503   it() note name tables
504   it() context definitions, part of output definitions.  See
505        bind(section)ref(contextdefs) for more information
506   it() output definitions (like code(\paper)keyindex(paper) blocks
507        and code(\midi)keyindex(midi) blocks)
508   it() score definitions (code(\score)keyindex(score) blocks)
509 )
510
511 Type is a syntactical property: em(Mudela) has no real type system,
512 so there is no support for generic expressions, functions, or user
513 defined types.  For the same reason, it is not possible to mix reals
514 and integers in arithmetic expressions, and ``type
515 errors''cindex(type error) (e.g., using a string identifier to
516 initialize a code(\paper)keyindex(paper) block) will yield a ``parse
517 error''.
518
519 Identifiers allow objects to be assigned to names.  To assign an
520 identifier, you use `var(name)=var(value)' and to refer to an
521 identifier, you preceed its name with a backslash:
522 `code(\)var(name)'.  Identifier assignments must appear at top level
523 in the em(Mudela) file.  Semicolons are forbidden after assignments
524 appearing at top level but they are obligatory after assignments
525 appearing in the code(\paper) block, see bind(Section)ref(paper).
526
527 var(value) is any of the types listed above.
528
529 An identifier can be created with any string for its name, but you
530 will only be able to refer to identifiers whose names begin with a
531 letter, being entirely alphanumeric.  It is impossible to refer to an
532 identifier whose name is the same as the name of a keyword.
533
534 The right hand side of an identifier assignment is parsed completely
535 before the assignment is done, so it is allowed to redefine an
536 identifier in terms of its old value, e.g.
537
538 quote(
539   code(foo = \foo * 2.0)
540 )
541
542 When an identifier is referenced, the information it points to is
543 copied.  Therefore it only makes sense to put identifiers for
544 translators, output definitions, and code(\score)keyindex(score)
545 blocks as the first item in a block.  For this reason, if you
546 reference a code(\foo) variable in a code(\foo) block, it must be the
547 first item in the list following code(\foo).footnote(code(\paper{\one
548 \two}) does not make sense, because the information of code(\two)
549 would overwrite the information of code(\one), thereby making the
550 reference to the first identifier useless.)
551
552
553 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
554 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
555
556 sect(Music expressions)
557 cindex(music expressions)
558
559 Music in em(Mudela) is entered as a music expression.  Notes, rests,
560 lyric syllables are music expressions (the atomic
561 expressions)cindex(atomic music expressions), and you can combine
562 music expressions to form new ones.  This example forms a compound
563 expressions out of the quarter code(c) note and a code(d)
564 note:
565
566 quote(
567   verb(\sequential { c4 d4 })
568 )
569
570 The meaning of this compound expression is to play the `code(c)'
571 first, and then the `code(d)' (as opposed to playing them
572 simultaneously, for instance).
573
574 Atomic music expression are discussed in
575 bind(subsection)ref(atomicmusic).  Compound music expressions are
576 discussed in bind(subsection)ref(compoundmusic).
577
578
579 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
580 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
581
582 sect(Atomic music expressions)
583 label(atomicmusic)
584
585 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
586
587 subsect(Pitch and duration)
588 cindex(pitch)
589 cindex(duration) 
590
591 The syntax for pitch specification is
592
593 quote(
594   code(\musicalpitch)keyindex(musicalpitch)
595     code({) var(octave) var(note) var(shift) code(})
596 )
597
598 var(octave) is specified by an integer, zero for the octave
599 containing middle C.  var(note) is a number from 0 to 7, with 0
600 corresponding to C and 7 corresponding to B.  The shift is zero for a
601 natural, negative to add flats, or positive to add sharps.
602
603 In Note and Chord mode, pitches may be designated by names.  See
604 bind(section)ref(notelang) for pitch names in different languages.
605
606 The syntax for duration specification is
607
608 quote(
609   code(\duration)keyindex(duration)
610     code({) var(length) var(dotcount) code(})
611 )
612
613 var(length) is the negative logarithm (base 2) of the duration:
614 bind(1)is a half note, bind(2)is a quarter note, bind(3)is an eighth
615 note, etc.  The number of dots after the note is given by
616 var(dotcount).
617
618 In Note, Chord, and Lyrics mode, durations may be designated by
619 numbers and dots.  See bind(Section)ref(notelang) for details.
620
621 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
622
623 subsect(Note specification)
624 label(notedesc)
625 cindex(note specification)
626 cindex(pitches)
627 cindex(entering notes)
628
629 A note specification has the form
630
631 quote(
632   var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)]
633 )
634
635 The pitch of the note is specified by the note's name.
636
637 subsubsect(Pitches)
638
639 The default names are the Dutch note names.  The notes are specified
640 by the letters `code(c)' through `code(b)', where `code(c)' is an
641 octave below middle C and the letters span the octave above that C. 
642 In Dutchcindex(notenames!Dutch), a sharp is formed by adding
643 `code(-is)' to the end of a pitch name.  A flat is formed by adding
644 `code(-es)'. Double sharps and double flats are obtained by adding
645 `code(-isis)' or `code(-eses)'.  `code(aes)' and `code(ees)' are
646 contracted to `code(as)' and `code(es)' in Dutch, but both forms will
647 be accepted.
648
649 LilyPond has predefined sets of notenames for various languages.  See
650 bind(section)ref(notelang) for details.
651
652 subsubsect(Octaves)
653
654 The optional octave specification takes the form of a series of
655 single quote (`indexandcode(')') characters or a series of comma
656 (`indexandcode(,)') characters.  Each code(') raises the pitch by one
657 octave; each code(,) lowers the pitch by an octave.
658
659 mudela(fragment,verbatim,center)(  c' d' e' f' g' a' b' c'')
660
661 mudela(fragment,verbatim,center)(  cis' dis' eis' fis' gis' ais' bis')
662
663 mudela(fragment,verbatim,center)(  ces' des' es' fes' ges' as' bes')
664
665 mudela(fragment,verbatim,center)(  cisis' eisis' gisis' aisis' beses')
666
667 mudela(fragment,verbatim,center)(  ceses' eses' geses' ases' beses')
668
669 Whenever a C-sharp is desired,  you must specify a C-sharp.  LilyPond
670 will determine what accidentals to typeset depending on the key and
671 context.  A reminder accidental cindex(reminder accidental) can be
672 forced by adding an exclamation mark `code(!)' after the pitch.  A
673 cautionary accidental, cindex(cautionary accidental) i.e., an
674 accidental within parentheses can be obtained by adding the question
675 mark `indexandcode(?)' after the pitch.
676
677 mudela(fragment,verbatim,center)(  cis' d' e' cis'  c'? d' e' c'!)
678
679 subsubsect(Duration)
680 cindex(duration)
681
682 Durations are entered as their reciprocal values.  For notes longer
683 than a whole note, use identifiers.
684
685 quote(
686 verb(c'\longa c'\breve  
687 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64)
688 )
689
690 quote(
691 mudela()(\score {
692   \notes \relative c'' {
693     a\longa a\breve  
694     a1 a2 a4 a8 a16 a32 a64 a64 
695   }
696   \paper {
697     loose_column_distance = 2.5 * \interline;
698     linewidth = -1.0;
699     \translator {
700       \type "Score_engraver";
701       \name "Score";
702       \consists "Note_heads_engraver";
703       \consists "Stem_engraver";
704       \consists "Rhythmic_column_engraver";
705     }
706   }
707 })
708 )
709
710 quote(
711 verb(r\longa r\breve  
712 r1 r2 r4 r8 r16 r32 r64 r64)
713 )
714
715 quote(
716 mudela()(\score {
717   \notes \relative c'' {
718     r\longa r\breve  
719     r1 r2 r4 r8 r16 r32 r64 r64 
720   }
721   \paper {
722     loose_column_distance = 2.5 * \interline;
723     linewidth = -1.0;
724     \translator {
725       \type "Score_engraver";
726       \name "Score";
727       \consists "Rest_engraver";
728       \consists "Stem_engraver";
729       \consists "Rhythmic_column_engraver";
730     }
731   }
732 })
733 )
734
735 If the duration is omitted then it is set equal to the previous
736 duration.  If there is no previous duration, a quarter note is
737 assumed.  The duration can be followed by a dot (`indexandcode(.)')
738 to obtain dotted note lengths.
739
740 mudela(fragment,verbatim,center)(  a'4. b'4.)
741
742 You can alter the length of duration by writing
743 `code(*)var(fraction)' after it.  This will not affect the
744 appearance of note heads or rests.
745
746 subsubsect(Rests)
747
748 Rests are entered like notes, with note name `indexandcode(r)',
749 or `indexandcode(R)'.  There is also a note name `indexandcode(s)',
750 which produces a space of the specified duration. 
751 `code(R)' is specifically meant for entering parts: the code(R) rest
752 can expand to fill a score with rests, or it can be printed as a
753 single multimeasure rest.
754
755 subsubsect(Lyrics syllables)
756 cindex(lyrics expressions)
757
758 Syllables are entered like notes, with pitches replaced by text.  For
759 example, `code(Twin-4 kle4 twin-4 kle4)' enters four syllables, each
760 with quarter note duration.  Note that the hyphen has no special
761 meaning for lyrics, and does not introduce special symbols.  See
762 bind(section)ref(modes) for a description of what is interpreted as
763 lyrics.
764
765 Spaces can be introduced into a lyric either by using quotes
766 (`code(")') or by using an underscore without quotes: `code(He_could4
767 not4)'.  All unquoted underscores are converted to spaces.  Printing
768 lyrics is discussed in bind(section)ref(lyricprint).
769
770 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
771
772 subsect(Properties)
773 cindex(properties)
774
775 quote(
776   code(\property)keyindex(property)
777     var(contextname)code(.)var(propname) code(=) var(value)
778 )
779
780 Sets the var(propname) property of the context var(contextname) to
781 the specified var(value).  All three arguments are strings. 
782 Depending on the context, it may be necessary to quote the strings or
783 to leave space on both sides of the dot.
784
785 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
786
787 subsect(Translator switches)
788 cindex(translator switches)
789
790 quote(
791   code(\translator)keyindex(translator)
792     var(contexttype) = var(name)
793 )
794
795 A music expression indicating that the context which is a direct
796 child of the a context of type var(contexttype) should be shifted to
797 a context of type var(contexttype) and the specified name.
798
799 Usually this is used to switch staffs in Piano music, e.g.
800
801 quote(
802   code(\translator Staff = top) var(Music)
803 )
804
805 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
806
807 subsect(Commands)
808 cindex(commands)
809
810 Commands are music expressions that have no duration.   
811
812 subsubsect(Key signatures)
813
814 quote(
815   code(\key)keyindex(key) var(pitch) var(type) code(;)
816 )
817
818 Change the key signature.  var(type) should be
819 code(\major)keyindex(major) or code(\minor)keyindex(minor) to get
820 var(pitch)-major or var(pitch)-minor, respectively.  The second
821 argument is optional; the default is major keys.  The var(\context)
822 argument can also be given as an integer, which tells the number of
823 semitones that should be added to the pitch given in the subsequent
824 code(\key)keyindex(key) commands to get the corresponding major key,
825 e.g., code(\minor)keyindex(minor) is defined bind(as)3.  The standard
826 mode names code(\ionian)keyindex(ionian),
827 code(\locrian)keyindex(locrian), code(\aeolian)keyindex(aeolian),
828 code(\mixolydian)keyindex(mixolydian), code(\lydian)keyindex(lydian),
829 code(\phrygian)keyindex(phrygian), and code(\dorian)keyindex(dorian)
830 are also defined.
831
832 quote(
833   code(\keysignature)keyindex(keysignature) var(pitchseq) code(;)
834 )
835
836 Specify an arbitrary key signature.  The pitches from var(pitch) will
837 be printed in the key signature in the order that they appear on the
838 list.
839
840 subsubsect(Rehearsal marks)
841         
842 quote(
843   code(\mark)keyindex(mark) var(unsigned) code(;) nl()
844   code(\mark) var(string) code(;)
845 )
846
847 Prints a mark over or under (depending on the
848 indexandcode(markDirection) property) the staff.  You must add
849 indexandcode(Mark_engraver) to either the Score or Staff context for
850 this to work.
851
852 subsubsect(Bar lines)
853 label(barlines)
854
855 quote(
856   code(\bar)keyindex(bar) var(bartype) code(;)
857 )
858
859 This is a request to print a special bar symbol. It replaces the 
860 regular bar symbol with a special
861 symbol.  The argument var(bartype) is a string which specifies the
862 kind of bar to print.  Options are code(":|")cindex("|A@code(:|)),
863 code("|:")cindex("|B@code(|:)), code(":|:")cindex("|C@code(:|:)),
864 code("||")cindex("|D@code(||)), code("|.")cindex("|E@code(|.)),
865 code(".|")cindex("|F@code(.|)), and code(".|.")cindex("|G@code(.|.)). 
866 These produce, respectively, a right repeat, a left repeat, a double
867 repeat, a double bar, a start bar, an end bar, and a thick double
868 bar.  If var(bartype) is set to code("empty") then nothing is
869 printed, but a line break is allowed at that spot.
870
871 You are encouraged to use code(\repeat) for repetitions.
872 See bind(section)ref(sec:repeats).
873
874 subsubsect(Timing commands) 
875
876 quote(
877   code(\cadenza)keyindex(cadenza) var(togglevalue) code(;)
878 )
879
880 Music expression that toggles the automatic generation of bar lines. 
881 If var(togglevalue) bind(is)1, bar line generation is turned off.  If
882 var(togglevalue) bind(is)0, a bar line is immediately printed and 
883 automatic bar generation is turned on.
884
885 quote(
886   code(\time)keyindex(time) var(numerator)code(/)var(denominator) code(;)
887 )
888
889 Change the time signature.  The default time signature bind(is)4/4. 
890 The time signature is used to generate bar lines.
891
892 quote(
893   code(\tempo)keyindex(tempo) var(duration) = var(perminute) code(;)
894 )
895
896 Used to specify the tempo.  For example, `code(\tempo 4 = 76;)'
897 requests output with bind(76)quarter notes per minute.
898
899 quote(
900   code(\partial)keyindex(partial) var(duration) code(;)
901 )
902 cindex(anacrusis)
903 cindex(upstep)
904
905 This creates an incomplete measure (anacrusis, upbeat) at the start of 
906 the music, e.g., `code(\partial 8*2;)' creates a starting measure 
907 lasting two eighth notes.
908
909 quote(
910   code(|)indexcode(|)cindex(bar check)
911 )
912 cindex(shorten measures)
913 cindex(upstep)
914
915 `code(|)' is a barcheck.  Whenever a barcheck is encountered during
916 interpretation, a warning message is issued if it doesn't fall at a
917 measure boundary.  This can help you finding errors in the input. 
918 The beginning of the measure will be relocated, so this can also
919 be used to shorten measures.
920
921 subsubsect(Other commands)
922
923 quote(
924   code(\penalty)keyindex(penalty) var(int) code(;)
925 )
926
927 Discourage or encourage line breaks.  See identifiers
928 code(\break)keyindex(break) and code(\nobreak)keyindex(nobreak) in
929 bind(section)ref(ident).
930
931 quote(
932   code(\clef)keyindex(clef) var(clefname) code(;)
933 )
934
935 Music expression that sets the current clef.  The argument is a
936 string which specifies the name of the clef.  Several clef names are
937 supported.  If `code(_8)' or `code(^8)' is added to the end of a clef
938 name, then the clef lowered or raised an octave will be generated. 
939 Here are the supported clef names with bind(middle)C shown in each
940 clef:
941
942 quote(
943 mudela()(\score {
944   \notes {
945     \cadenza 1;
946     %\property Voice.textStyle = typewriter
947     \clef subbass;     c'4-"\kern -5mm subbass" 
948     \clef bass;        c'4^"\kern -2mm bass"
949     \clef baritone;    c'4_"\kern -5mm baritone"
950     \clef varbaritone; c'4^"\kern -6mm varbaritone"
951     \clef tenor;       c'4_"\kern -3mm tenor"
952     \clef "G_8";       c'4^"\kern -2mm G\\texttt{\\_}8" 
953   }  
954   \paper {
955     linewidth = 4.5 \in;
956   }
957 })
958 )
959
960 quote(
961 mudela()(\score {
962   \notes {
963     \cadenza 1;
964     \clef alto;         c'4_"\kern -2mm alto"
965     \clef mezzosoprano; c'4^"\kern -9mm mezzosoprano"
966     \clef soprano;      c'4_"\kern -6mm soprano"
967     \clef treble;       c'4^"\kern -4mm treble"
968     \clef french;       c'4_"\kern -4mm french"
969   }
970   \paper {
971     linewidth = 4.5 \in;
972   }
973 })
974 )
975
976 The three clef symbols can also be obtained using the names `code(G)', 
977 `code(C)' or `code(F)', optionally followed by an integer which 
978 indicates at which note line the clef is located. An as example, the 
979 code(mezzosoprano) clef can also be given as `code(C2)'.
980
981 quote(
982   code(\skip)keyindex(skip) var(duration) code(;)
983 )
984
985 Skips the amount of time specified by var(duration).  If no other
986 music is played, a gap will be left for the skipped time with no
987 notes printed.  It works in Note Mode or Lyrics Mode.  In Note mode,
988 this has the same effect as the space rest `code(s)'.
989
990 subsubsect(Beams)
991 cindex(beams)
992 label(manualbeam)
993
994 A beam is specified by surrounding the beamed notes with brackets
995 `indexandcode([)' and `indexandcode(])'.  
996
997 mudela(fragment,verbatim,center)(  [a'8 a'] [a'16 a' a' a'])
998
999 Some more elaborate constructions:
1000
1001 mudela(fragment,verbatim,center)(  [a'16 <a' c''> c'' <a' c''>]
1002   \times 2/3 { [e'8 f' g'] })
1003
1004 Beaming can be generated automatically; see bind(section)ref(autobeam).
1005
1006 To place tremolo marks cindex(tremolo beams) between two notes, begin
1007 with `code([:)var(length)' and end with `code(])'.  Tremolo marks
1008 will appear instead of beams.  Putting more than two notes in such a
1009 construction will produce odd effects.  To create tremolo beams on a
1010 single note, simply attach `code(:)var(length)' to the note itself
1011 (see also bind(section)ref(tremolo)).
1012   
1013 mudela(fragment,verbatim,center)(  [:16 e'1 g'] [:8 e'4 f'])
1014   
1015 mudela(fragment,verbatim,center)(  c'4:32 [:16 c'8 d'8])
1016
1017 subsubsect(Lyric helpers)
1018 cindex(--@code(-)code(-))
1019 indexcode(__)
1020 cindex(extender)
1021 cindex(hyphen)
1022
1023 The syntax for an extender mark is `code(__)'.  This syntax can only
1024 be used within lyrics mode.  The syntax for a spanning hyphen (i.e.,
1025 a hyphen that will be printed between two lyric syllables) is
1026 `code(-)code(-)'.
1027
1028 subsubsect(Ties)
1029 cindex(ties)
1030
1031 A tie connects two adjacent note heads of the same pitch.  When used
1032 with chords, it connects all of the note heads whose pitches match.
1033 Ties are indicated using the tilde symbol `indexandcode(~)'.
1034 If you try to tie together chords which have no common pitches, a
1035 warning message will appear and no ties will be created.
1036
1037 mudela(fragment,verbatim,center)(  e' ~ e' <c' e' g'> ~ <c' e' g'>)
1038
1039 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1040
1041 subsect(Atomic music expressions: add-ons)
1042
1043 [TODO: explain Requests]
1044
1045 subsubsect(Articulations)
1046 cindex(articulations)
1047 cindex(scripts)
1048 cindex(ornaments)
1049
1050 A variety of symbols can appear above and below notes to indicate
1051 different characteristics of the performance.  These symbols can be
1052 added to a note with `var(note)code(-\)var(name)'.  Numerous symbols
1053 are defined in file(script.ly) and file(script.scm).  Symbols can be
1054 forced to appear above or below the note by writing
1055 `var(note)code(^\)var(name)' and `var(note)code(_\)var(name)'
1056 respectively.  Here is a chart showing symbols above notes, with the
1057 name of the corresponding symbol appearing underneath.
1058
1059 mudela()(
1060   \score {
1061     < \notes {
1062         c''-\accent      c''-\marcato      c''-\staccatissimo c''-\fermata 
1063         c''-\stopped     c''-\staccato     c''-\tenuto        c''-\upbow
1064         c''-\downbow     c''^\lheel        c''-\rheel         c''^\ltoe
1065         c''-\rtoe        c''-\turn         c''-\open          c''-\flageolet
1066         c''-\reverseturn c''-\trill        c''-\prall         c''-\mordent
1067         c''-\prallprall  c''-\prallmordent c''-\upprall       c''-\downprall
1068         c''-\thumb       c''-\segno        c''-\coda
1069       }
1070       \context Lyrics \lyrics {  
1071         accent__      marcato__      staccatissimo__ fermata
1072         stopped__     staccato__     tenuto__        upbow
1073         downbow__     lheel__        rheel__         ltoe
1074         rtoe__        turn__         open__          flageolet
1075         reverseturn__ trill__        prall__         mordent
1076         prallprall__  prallmordent__ uprall__        downprall
1077         thumb__       segno__        coda
1078       }
1079     >
1080     \paper {
1081       linewidth = 5.875\in;          
1082       indent    = 0.0;
1083     }
1084   }
1085 )
1086
1087 In addition, it is possible to place arbitrary strings of text or
1088 TeX() above or below notes by using a string instead of an
1089 identifier: `code(c^"text")'.  Fingerings cindex(fingering) can be
1090 placed by simply using digits.  All of these note ornaments appear in
1091 the printed output but have no effect on the MIDI rendering of the
1092 music.
1093
1094 To save typing, fingering instructions (digits 0 bind(to)9 are
1095 supported) and single characters shorthands exist for a few
1096 common symbols
1097
1098 mudela()(
1099   \score {
1100     \notes {
1101       \property Voice.textStyle = typewriter
1102       c''4-._"c-."      s4
1103       c''4--_"c-{}-"    s4
1104       c''4-+_"c-+"      s4
1105       c''4-|_"c-|"      s4
1106       c''4->_"c->"      s4
1107       c''4-^_"c-\\^{ }" s4
1108       c''4-1_"c-1"      s4
1109       c''4-2_"c-2"      s4
1110       c''4-3_"c-3"      s4
1111       c''4-4_"c-4"      s4
1112     }
1113     \paper {
1114       linewidth = 5.875 \in;
1115       indent    = 0.0;
1116     }
1117   }
1118 )
1119
1120 Dynamic marks are specified by using an identifier after a note:
1121 `code(c4-\ff)' (the dash is optional for dynamics: `code(c4 \ff))'.  
1122 The available dynamic marks are:
1123 code(\ppp)keyindex(ppp),
1124 code(\pp)keyindex(pp), code(\p)keyindex(p), code(\mp)keyindex(mp),
1125 code(\mf)keyindex(mf), code(\f)keyindex(f), code(\ff)keyindex(ff),
1126 code(\fff)keyindex(fff), code(\fff)keyindex(ffff),
1127 code(\fp)keyindex(fp), code(\sf)keyindex(sf),
1128 code(\sff)keyindex(sff), code(\sp)keyindex(sp),
1129 code(\spp)keyindex(spp), code(\sfz)keyindex(sfz), and
1130 code(\rfz)keyindex(rfz).
1131
1132 subsubsect(General text scripts)
1133
1134 quote(
1135   code(\textscript)keyindex(textscript) var(text) var(style)
1136 )
1137
1138 Defines a text to be printed over or under a note.  var(style) is a
1139 string that may be one of code(roman), code(italic), code(typewriter), 
1140 code(bold), code(Large), code(large), code(dynamic) or code(finger).
1141
1142 You can attach a general textscript request using this syntax:
1143
1144 quote(
1145 verb(c4-\textscript "6" "finger"
1146 c4-\textscript "foo" "normal")
1147 )
1148
1149 This is equivalent to `code(c4-6 c4-"foo")'.  
1150
1151 subsubsect(General scripts)
1152 cindex(scripts)
1153
1154 quote(
1155   code(\script)keyindex(script) var(alias)
1156 )
1157
1158 Prints a symbol above or below a note.  The argument is a string
1159 which points into the script-alias table defined in file(script.scm).
1160 The scheme definitions specify whether the symbol follows notes into
1161 the staff, dependence of symbol placement on staff direction, and a
1162 priority for placing several symbols over one note.  Usually the
1163 code(\script)keyindex(script) keyword is not used directly.  Various
1164 helpful identifier definitions appear in file(script.ly).
1165
1166 subsubsect(Slurs)
1167 cindex(slur)
1168
1169 Slurs connects chords and try to avoid crossing stems.  A slur is
1170 started with `code(CHAR(40))' and stopped with `code(CHAR(41))'.  The
1171 starting `code(CHAR(40))' appears to the right of the first note in
1172 the slur.  The terminal `code(CHAR(41))' appears to the left of the
1173 first note in the slur.  This makes it possible to put a note in
1174 slurs from both sides:
1175
1176 mudela(fragment,verbatim,center)(  f'()g'()a' [a'8 b'(] a'4 g'2 )f'4)
1177
1178 subsubsect(Crescendo)
1179 cindex(crescendo)
1180
1181 A crescendo mark is started with code(\cr)keyindex(cr) and terminated
1182 with code(\rc)keyindex(rc).  A decrescendo mark is started with
1183 code(\decr)keyindex(decr) and terminated with
1184 code(\rced)keyindex(rced).  There are also shorthands for these
1185 marks.  A crescendo can be started with code(\<)keyindex(<) and a
1186 decrescendo can be started with code(\>)keyindex(>).  Either one can
1187 be terminated with code(\!)keyindex("!).  Note that code(\!)
1188 must go before the last note of the dynamic mark whereas code(\rc)
1189 and code(\rced) go after the last note.  Because these marks are
1190 bound to notes, if you want to get several marks during one note, you
1191 must use spacer notes.
1192
1193 mudela(fragment,verbatim,center)(  c'' \< \! c''   d'' \decr e'' \rced 
1194   < f''1 { s4 \< \! s2 \> \! s4 } >)
1195
1196 subsubsect(General spanners)
1197
1198 quote(
1199   code(\spanrequest)keyindex(spanrequest) var(startstop) var(type)
1200 )
1201
1202 Define a spanning request. The var(startstop) parameter is bind(either)-1
1203 (code(\start)keyindex(start)) bind(or)1 (code(\stop)keyindex(stop)) and
1204 var(type) is a string that describes what should be started.
1205 Supported types are code(crescendo), code(decrescendo),
1206 code(beam), code(slur).  This is an internal command.  Users should
1207 use the shorthands which are defined in the initialization file
1208 file(spanners.ly).
1209
1210 You can attach a (general) span request to a note using
1211
1212 mudela(fragment,verbatim,center)(  c'4-\spanrequest \start "slur"
1213   c'4-\spanrequest \stop "slur")
1214
1215 The slur syntax with parentheses is a shorthand for this.
1216
1217 COMMENT(came till here with indexifying)
1218
1219 subsubsect(Tremolo marks)
1220 cindex(tremolo marks)
1221 label(tremolo)
1222
1223 Tremolo marks can be printed on a single note by adding
1224 `code(:)[var(length)]' after the note.  The length must be at
1225 bind(least)8.  A var(length) value bind(of)8 gives one line across
1226 the note stem.  If the length is omitted, then the last value is
1227 used, or the value of the indexandcode(abbrev) property if there was
1228 no last value.
1229
1230 mudela(verbatim,fragment,center)(  c'2:8 c':32)
1231
1232
1233 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1234 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1235
1236 sect(Compound music expressions)
1237 cindex(compound music expressions)
1238 label(compoundmusic)
1239
1240 Music expressions are compound data structures.  You can nest music
1241 expressions any way you like.  This simple example shows how three
1242 chords can be expressed in two different ways:
1243
1244 mudela(fragment,verbatim,center)(  \notes \context Staff {
1245     \cadenza 1;
1246     <a c'> <b  d' > <c' e' >
1247     <{a b  c'}{c' d' e'}>
1248   })
1249
1250 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1251
1252 subsect(Context selection)
1253 cindex(context selection)
1254
1255 quote(
1256   code(\context)keyindex(context)
1257     var(contexttype) [code(=) var(contextname)] var(musicexpr)
1258 )
1259
1260 Interpret var(musicexpr) within a context of type var(contexttype). 
1261 If the context does not exist, it will be created.  The new context
1262 can optionally be given a name.  See
1263 bind(section)ref(contextselection) bind(and)ref(contextdefs) for more
1264 information on interpretation contexts.
1265
1266 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1267
1268 subsect(Music entry modes)
1269 cindex(input modes)
1270 cindex(mode switch)
1271
1272 Mode switching keywords form compound music expressions: code(\notes)
1273 keyindex(notes) var(musicexpr), code(\chords) keyindex(chords)
1274 var(musicexpr), and code(\lyrics) keyindex(lyrics) var(musicexpr). 
1275 These expressions do not add anything to the meaning of their
1276 arguments.  They are just a way to indicate that the arguments should
1277 be parsed in indicated mode.  See bind(section)ref(modes) for more
1278 information on modes.
1279
1280 More information on context selection can be found in
1281 bind(section)ref(contextselection).
1282
1283 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1284
1285 subsect(Sequential music)
1286 cindex(sequential music)
1287 COMMENT(It's not possible to index `{' and `}' directly, thus we
1288         must construct it.)
1289 whenlatex(cindex(?A@latexcommand(\texttt{\textbraceleft})))
1290 whenlatex(cindex(?B@latexcommand(\texttt{\textbraceright})))
1291
1292 quote(
1293   code(\sequential)keyindex(sequential)
1294     code({) var(musicexprlist) code(})
1295 )
1296
1297 This means that list should be played or written in sequence, i.e.,
1298 the second after the first, the third after the second.  The duration
1299 of sequential music is the the sum of the durations of the elements. 
1300 There is a shorthand, which leaves out the keyword:
1301
1302 quote(
1303   code({) var(musicexprlist) code(})
1304 )
1305
1306 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1307
1308 subsect(Simultaneous music)
1309 cindex(simultaneous music)
1310 indexcode(<)
1311 indexcode(>)
1312
1313 quote(
1314   code(\simultaneous)keyindex(simultaneous)
1315     code({) var(musicexprlist) code(})
1316 )
1317
1318 It constructs a music expression where all of its arguments start at
1319 the same moment.  The duration is the maximum of the durations of the
1320 elements.  The following shorthand is a common idiom:
1321
1322 quote(
1323   code(<) var(musicexprlist) code(>)
1324 )
1325
1326 If you try to use a chord as the first thing in your score, you might
1327 get multiple staffs instead of a chord.
1328
1329 mudela(verbatim,center)(  \score {
1330     \notes <c''4 e''>
1331     \paper {
1332       linewidth = -1.;
1333     }
1334   })
1335
1336 This happens because the chord is interpreted by a score context.
1337 Each time a note is encountered a default Voice context (along with a
1338 Staff context) is created.  The solution is to explicitly instantiate
1339 a Voice context:
1340
1341 mudela(verbatim,center)(  \score {
1342     \notes\context Voice <c''4 e''>
1343     \paper {
1344       linewidth = -1.;
1345     }
1346   })
1347
1348 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1349
1350 subsect(Relative Pitch Specification)
1351 cindex(relative pitch specification)
1352 label(relative)
1353
1354 It is easy to get confused by octave changing marks and accidentally
1355 putting a pitch in the wrong octave.  A much better way of entering a
1356 note's octave is `the relative octave' mode.
1357
1358 quote(
1359   code(\relative)keyindex(relative) var(startpitch) var(musicexpr)
1360 )
1361
1362 The octave of notes that appear in var(musicexpr) are calculated as
1363 follows: If no octave changing marks are used, the basic interval
1364 between this and the last note is always taken to be a fourth or
1365 less.footnote(The interval is determined without regarding
1366 accidentals.  A code(fisis) following a code(ceses) will be put above
1367 the code(ceses).)  The octave changing marks `code(')' and `code(,)'
1368 can then be added to raise or lower the pitch by an extra octave. 
1369 Upon entering relative mode, an absolute starting pitch must be
1370 specified that will act as the predecessor of the first note of
1371 var(musicexpr).
1372
1373 Entering scales is straightforward in relative mode.
1374
1375 mudela(fragment,verbatim,center)(  \relative c' {
1376     c d e f g a b c c,
1377   })
1378
1379 And octave changing marks are used for intervals greater than a fourth.
1380
1381 mudela(fragment,verbatim,center)(  \relative c'' {
1382     c g c f, c' a, e'' })
1383
1384 If the preceding item is a chord, the first note of the chord is used
1385 to determine the first note of the next chord.  But other notes
1386 within the second chord are determined by looking at the immediately
1387 preceding note.
1388
1389 mudela(fragment,verbatim,center)(  \relative c' {
1390     c <c e g> 
1391     <c' e g>
1392     <c, e' g>
1393   }) 
1394
1395 The pitch after the code(\relative) contains a notename.  To parse
1396 the pitch as a notename, you have to be in note mode, so there must
1397 be a surrounding code(\notes)keyindex(notes) keyword (which is not
1398 shown here).
1399
1400 The relative conversion will not affect code(\transpose) or
1401 code(\relative) sections in its argument.  If you want to use
1402 relative within transposed music, you must place an additional
1403 code(\relative) inside the code(\transpose).
1404
1405 It is strongly recommended to use relative pitch mode: less work,
1406 less error-prone, and more readable.
1407
1408 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1409
1410 subsect(Chord names)
1411
1412 Chord names are a way to generate simultaneous music expressions that
1413 correspond with traditional chord names.  It can only be used in
1414 Chord mode (see bind(section)ref(modes)).
1415
1416 quote(
1417   var(tonic)[var(duration)][code(-)var(modifiers)]\
1418                            [code(^)var(subtractions)]\
1419                            [code(/)var(inversion)].
1420 )
1421
1422 var(tonic) should be the tonic note of the chord, and var(duration)
1423 is the chord duration in the usual notation.  There are two kinds of
1424 modifiers.  One type is em(chord additions), which are obtained by
1425 listing intervals separated by dots.  An interval is written by its
1426 number with an optional `code(+)' or `code(-)' to indicate raising or
1427 lowering by half a step.  Chord additions has two effects: It adds
1428 the specified interval and all lower odd numbered intervals to the
1429 chord, and it may lower or raise the specified interval.  Intervals
1430 must be separated by a dot (`code(.)').
1431
1432 quote(
1433 mudela(fragment,verbatim)(\transpose c'' {
1434   \chords {
1435     c1  c-3-       c-7     c-8
1436     c-9 c-9-.5+.7+ c-3-.5- c-4.6.8
1437   }
1438 }
1439 )
1440 )
1441
1442 The second type of modifier that may appear after the `code(-)' is a
1443 named modifier.  Named modifiers are listed in the file
1444 file(chord-modifiers.ly).  The available modifiers are `code(m)' and
1445 `code(min)' which lower the 3rd half a step, `indexandcode(aug)' which
1446 raises the 5th, `indexandcode(dim)' which lowers the 5th,
1447 `indexandcode(maj)' which adds a raised 7th, and `indexandcode(sus)'
1448 which replaces the 5th with a 4th.
1449
1450 quote(
1451 mudela(fragment,verbatim)(\transpose c'' {
1452   \chords {
1453     c1-m c-min7 c-maj c-aug c-dim c-sus
1454   }
1455 }
1456 )
1457
1458
1459 Chord subtractions are used to eliminate notes from a chord.  The
1460 notes to be subtracted are listed after a `code(^)' character,
1461 separated by dots.
1462
1463 mudela(fragment,verbatim,center)(  \transpose c'' {
1464     \chords {
1465       c1^3 c-7^5.3 c-8^7
1466     }
1467   }) 
1468
1469 Chord inversions can be specified by appending `indexandcode(/)' and
1470 the name of a single note to a chord.  This has the effect of
1471 lowering the specified note by an octave so it becomes the lowest
1472 note in the chord.  If the specified note is not in the chord, a
1473 warning will be printed.
1474
1475 mudela(fragment,verbatim,center)(  \transpose c''' {
1476     \chords {
1477       c1 c/e c/g c-7/e
1478     }
1479   }
1480
1481
1482 Throughout these examples, chords have been shifted around the staff
1483 using code(\transpose).
1484
1485 You should not combine code(\relative) with named chords. 
1486
1487 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1488
1489 subsect(Tuplets)
1490 cindex(tuplets)
1491
1492 Tuplets are made out of a music expression by multiplying their
1493 duration with a fraction.
1494
1495 quote(
1496   code(\times)keyindex(times) var(fraction) var(musicexpr)
1497 )
1498
1499 The duration of var(musicexpr) will be multiplied by the fraction. 
1500 In print, the fraction's denominator will be printed over the notes,
1501 optionally with a bracket.  The most common tuplet is the triplet in
1502 which bind(3)notes have the length bind(of)2, so the notes are 2/3 of
1503 their written length:
1504
1505 mudela(fragment,verbatim,center)(  g'4 \times 2/3 {c'4 c' c'} d'4 d'4)
1506
1507 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1508
1509 subsect(Grace notes)
1510 cindex(grace notes)
1511
1512 quote(
1513   code(\grace)keyindex(grace) var(musicexpr)
1514 )
1515
1516 A grace note expression has bind(duration)0; the next real note is
1517 assumed to be the main note.
1518
1519 You cannot have the grace note after the main note, in terms of
1520 duration, and main notes, but you can typeset the grace notes to the
1521 right of the main note using the property
1522 indexandcode(graceAlignPosition).
1523
1524 When grace music is interpreted, a score-within-a-score is set up:
1525 var(musicexpr) has its own time bookkeeping, and you could (for
1526 example) have a separate time signature within grace notes.  While in
1527 this score-within-a-score, you can create notes, beams, slurs, etc.
1528 Unbeamed eighth notes and shorter by default have a slash through the
1529 stem.  This behavior can be controlled with the
1530 indexandcode(stemStyle) property.
1531
1532 quote(
1533 mudela(fragment,verbatim)(\relative c'' {
1534   \grace c8 c4 \grace { [c16 c16] } c4
1535   \grace { \property Grace.stemStyle = "" c16 } c4
1536 }
1537 )
1538 )
1539
1540 At present, nesting code(\grace)keyindex(grace) notes, e.g.
1541
1542 quote(
1543   code(\grace { \grace c32 c16 } c4)
1544 )
1545
1546 may result in run-time errors of LilyPond.  Since the meaning of such
1547 a construct is unclear, we don't consider this a loss.  Similarly,
1548 juxtaposing two code(\grace) sections is syntactically valid, but
1549 makes no sense and may cause runtime errors.
1550
1551 Ending a staff or score with grace notes may also generate a run-time
1552 error, since there will be no main note to attach the grace notes to.
1553
1554 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1555
1556 subsect(Repeats)
1557 cindex(repeats)
1558 label(sec:repeats)
1559
1560 In order to specify repeats, use the code(\repeat)keyindex(repeat)
1561 keyword.  Since repeats look and sound differently when played or
1562 printed, there are a few different variants of repeats.
1563
1564 description(
1565   dit(unfolded) nl()
1566     Repeated music is fully written (played) out.  Useful for MIDI
1567     output.
1568
1569   dit(volta) nl()
1570     This is the normal notation: Repeats are not written out, but
1571     alternative endings (voltas) are printed, left to right.
1572
1573   dit(folded) nl()
1574     Alternative endings are written stacked, which is useful for
1575     lyrics.
1576 )  
1577
1578 The syntax for repeats is
1579
1580 quote(
1581   code(\repeat) var(variant) var(repeatcount) var(repeatbody)
1582 )
1583
1584 If you have alternative endings, you may add
1585
1586 quote(
1587   code(\alternative)keyindex(alternative)
1588     code({) var(alternative1)
1589             var(alternative2)
1590             var(alternative3) ellipsis() code(})
1591 )
1592
1593 where each var(alternative) is a Music expression.
1594
1595 Normal notation repeats are used like this:
1596
1597 quote(
1598 mudela(fragment,verbatim)(  c'1
1599   \repeat volta 2 { c'4 d' e' f' }
1600   \repeat volta 2 { f' e' d' c' }
1601 )
1602 )
1603
1604 With alternative endings:
1605
1606 quote(
1607 mudela(fragment,verbatim)(  c'1
1608   \repeat volta 2 {c'4 d' e' f'} 
1609   \alternative { {d'2 d'} {f' f} }
1610 )
1611 )
1612
1613 Folded repeats look like this:footnote(Folded repeats offer little
1614 more over simultaneous music.  However, it is to be expected that
1615 more functionality -- especially for the MIDI backend -- will be
1616 implemented.)
1617
1618 quote(
1619 mudela(fragment,verbatim)(  c'1
1620   \repeat fold 2 {c'4 d' e' f'} 
1621   \alternative { {d'2 d'} {f' f} }
1622 )
1623 )
1624
1625 quote(
1626 mudela(fragment,verbatim)(\context Staff {
1627   \relative c' {
1628     \partial 4;
1629     \repeat volta 2 { e | c2 d2 | e2 f2 | }
1630     \alternative { { g4 g g } { a | a a a a | b1 } }
1631   }
1632 }
1633 )
1634 )
1635
1636 If you don't give enough alternatives for all of the repeats, then
1637 the first alternative is assumed to be repeated often enough to equal
1638 the specified number of repeats.
1639
1640 quote(
1641 mudela(fragment,verbatim)(\context Staff {
1642   \relative c' {
1643     \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1644     \alternative { { g4 g g }
1645                    {\partial 1; e4 e e } 
1646                    {\partial 1; a a a a | b1 } }
1647   }
1648 }
1649 )
1650 )
1651
1652 It is possible to nest code(\repeat).  This is not entirely
1653 supported: the notes will come be in the right places, but the repeat
1654 bars will not.
1655
1656 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1657
1658 subsect(Transposition of Pitches)
1659 cindex(transposition of pitches)
1660 label(transpose)
1661
1662 A music expression can be transposed with
1663 code(\transpose)keyindex(transpose).  The syntax is
1664
1665 quote(
1666   code(\transpose) var(pitch) var(musicexpr)
1667 )
1668
1669 This means that middle C in var(musicexpr) is transposed to
1670 var(pitch).
1671
1672 code(\transpose) distinguishes between enharmonic pitches: both
1673 code(\transpose cis') or code(\transpose des') will transpose up half
1674 a tone.  The first version will print sharps and the second version
1675 will print flats.
1676
1677 quote(
1678 mudela(fragment,verbatim)(\context Staff {
1679   \clef "F";
1680   { \key e; c d e f }
1681   \clef "G";
1682   \transpose des'' { \key e; c d e f }
1683   \transpose cis'' { \key e; c d e f }
1684 }
1685 )
1686 )
1687
1688 If you want to use both code(\transpose) and code(\relative), then
1689 you must use code(\transpose) first.  code(\relative) will have no
1690 effect music that appears inside a code(\transpose).
1691
1692 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1693
1694 subsect(Automatic lyric durations)
1695 cindex(automatic lyric durations)
1696
1697 If you have lyrics that are set to a melody, you can import the
1698 rhythm of that melody into the lyrics using code(\addlyrics).
1699 keyindex(addlyrics) The syntax for this is
1700
1701 quote(
1702   code(\addlyrics) var(musicexpr1 musicexpr2)
1703 )
1704
1705 This means that both var(musicexpr1) and var(musicexpr2) are
1706 interpreted, but that every non-command atomic music expression
1707 (``every syllable'') in var(musicexpr2) is interpreted using timing
1708 of var(musicexpr1).
1709
1710 If the property indexandcode(automaticMelismata) is set in the
1711 context of var(musicexpr1), no lyrics will be put on slurred or tied
1712 notes.
1713
1714 quote(
1715 mudela(verbatim,fragment)(\addlyrics
1716 \transpose c'' {
1717   \property Voice.automaticMelismata = "1"
1718   c8 () cis d8. e16 f2
1719 }
1720 \context Lyrics \lyrics {
1721  do4 re mi fa }
1722 )
1723 )
1724
1725 You should use a single rhythm melody, and single rhythm lyrics (a
1726 constant duration is the obvious choice).  If you do not, you will get
1727 undesired effects when using multiple stanzas:
1728
1729 quote(
1730 mudela(verbatim,fragment)(\addlyrics
1731 \transpose c'' {
1732   c8 () cis d8. e16 f2
1733 }
1734 \context Lyrics \lyrics
1735 < { do4 re mi fa }
1736   { do8 re mi fa } >
1737 )
1738 )
1739
1740 It is valid (but probably not very useful) to use notes instead of
1741 lyrics for var(musicexpr2).
1742
1743 COMMENT(
1744   mudela(verbatim,fragment)(
1745     \context Voice \addlyrics
1746       { s4 s8 s16 s32 }
1747       { [c16 c c c] }
1748   )
1749 )
1750
1751
1752 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1753 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1754
1755 sect(Ambiguities)
1756 cindex(ambiguities)
1757
1758 The grammar contains a number of ambiguities.footnote(The authors
1759 hope to resolve them at a later time.)
1760
1761 itemize(
1762   it() The assignment
1763
1764        quote(
1765          verb(foo = bar)
1766        )
1767
1768        can be interpreted as making a string identifier code(\foo)
1769        containing code("bar"), or a music identifier code(\foo)
1770        containing the syllable `bar'.
1771
1772   it() The assignment
1773
1774        quote(
1775          verb(foo = -6)
1776        )
1777
1778        can be interpreted as making an integer identifier
1779        bind(containing)-6, or a Request identifier containing the
1780        bind(fingering)`6' (with neutral direction).
1781
1782   it() If you do a nested repeat like
1783
1784        quote(
1785 verb(\repeat ...
1786 \repeat ...
1787 \alternative)
1788        )
1789
1790        then it is ambiguous to which code(\repeat) the
1791        code(\alternative) belongs.  This is the classic if-then-else
1792        dilemma.  It may be solved by using braces.
1793
1794   it() (an as yet unidentified ambiguity :-)
1795 )
1796
1797
1798 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1799 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1800
1801 sect(Notation conversion specifics)
1802
1803 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1804
1805 subsect(Automatic Beam Generation)
1806 cindex(automatic beam generation)
1807 label(autobeam)
1808
1809 By default, LilyPond will generate beams automatically.  This feature
1810 can be disabled by setting the indexandcode(Voice.noAutoBeaming)
1811 property bind(to)1.  It can be overridden for specific cases by
1812 specifying explicit beams as described in
1813 bind(section)ref(manualbeam).
1814
1815 A large number of Voice properties are used to decide how to generate
1816 beams.  Their default values appear in file(auto-beam-settings.ly).
1817 In general, beams can begin anywhere, but their ending location is
1818 significant.  Beams can end on a beat, or at durations specified by
1819 the indexandcode(Voice.beamAutoEnd) property.  To end beams every
1820 quarter note, for example, you could set
1821 indexandcode(Voice.beamAutoEnd) equal to `code("1/4")'.  To end beams
1822 at every three eighth notes you would set it to `code("3/8")'.  The
1823 same syntax can be used to specify beam starting points using
1824 indexandcode(Voice.beamAutoBegin).
1825
1826 To allow different settings for different time signatures, these
1827 property names can start with `code(time)var(N)code(_)var(M)' to
1828 restrict the definition to `var(N)code(/)var(M)' time.  For example,
1829 to specify beams ending only for bind(6/8)time you would use the
1830 property code(Voice.time6_8beamAutoEnd).  To allow different endings
1831 for notes of different durations, the duration can be tacked onto the
1832 end of the property.  To specify beam endings for beams that contain
1833 bind(32nd)notes, you would use code(Voice.beamAutoEnd_32).
1834
1835 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1836
1837 subsect(Printing chord names)
1838 cindex(chord names)
1839 cindex(chords)
1840 cindex(printing!chord names)
1841
1842 For displaying printed chord names, use the indexandcode(ChordNames)
1843 and indexandcode(ChordNameVoice) contexts.  The chords may be entered
1844 either using the notation described above, or directly using
1845 simultaneous music.
1846
1847 quote(
1848 mudela(fragment,verbatim)(<
1849   \context ChordNames {
1850     \chords{a b c} \notes{<d f g>  <e g b>}
1851   }
1852   \context Staff \notes {
1853     a b c' d' e'
1854   }
1855 >
1856 )
1857 )
1858
1859 LilyPond examines chords specified as lists of notes to determine a
1860 name to give the chord.  By default, LilyPond will not try to
1861 identify chord inversions:
1862
1863 mudela(fragment,verbatim,center)(  <
1864     \context ChordNameVoice \notes {
1865       <e'1 g' c''>
1866     }
1867     \context Thread \notes {
1868       <e'1 g' c''>
1869     }
1870   >)
1871
1872 If you want inversions to be recognized, you must set the property
1873 indexandcode(ChordNames.chordInversion):
1874
1875 mudela(fragment,verbatim,center)(  <
1876     \property Score.chordInversion = 1
1877     \context ChordNameVoice \notes {
1878       <e'1 g' c''>
1879     }
1880     \context Thread \notes {
1881       <e'1 g' c''>
1882     }
1883   >)
1884
1885 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1886
1887 subsect(Printing lyrics)
1888 cindex(lyrics)
1889 cindex(printing!lyrics)
1890 label(lyricprint)
1891
1892 Lyric syllables must be interpreted within a code(Lyrics) context
1893 cindex(context!Lyrics) for printing them.
1894
1895 Here is a full example: 
1896
1897 quote(
1898 mudela(verbatim)(\score {
1899   <
1900     \notes \transpose c'' {
1901       c d e c | c d e c |
1902       e f g2 | e4 f g2 \bar "|.";
1903     }
1904     \context Lyrics \lyrics { 
1905       Va-4 der Ja- cob Va- der Ja- cob
1906       Slaapt gij nog?2 Slaapt4 gij nog?2
1907     }
1908   >
1909 }
1910 )
1911 )
1912
1913 You may want a continuous line after the syllables to show melismata. 
1914 To achieve this effect, add a `code(__)' lyric as a separate word
1915 after the lyric to be extended.  This will create an extender, a line
1916 that extends over the entire duration of the lyric.  This line will
1917 run all the way to the start of the next lyric, so you may want to
1918 shorten it by using a blank lyric (using `code(_)').
1919
1920 quote(
1921 mudela(verbatim)(\score {
1922   <
1923     \notes \relative c'' {
1924       a4 () b () c () d | c () d () b () a | c () d () b () a
1925     }
1926     \context Lyrics \lyrics {
1927       foo1 __ | bar2. __ _4 | baz1 __
1928     }
1929   >
1930 }
1931 )
1932 )
1933      
1934 If you want to have hyphens centered between syllables (rather than
1935 attached to the end of the first syllable) you can use the special
1936 `code(-)code(-)' lyric as a separate word between syllables.  This
1937 will result in a hyphen which length varies depending on the space
1938 between syllables, and which will be centered between the syllables. 
1939 For example:
1940
1941 quote(
1942 mudela(verbatim)(\score {
1943   <
1944     \notes \transpose c'' {
1945       c d e c | c d e c |
1946       e f g2 | e4 f g2 \bar "|.";
1947     }
1948     \context Lyrics \lyrics {
1949       Va4 -- der Ja -- cob | Va -- der Ja -- cob |
1950       Slaapt gij nog?2 | Slaapt4 gij nog?2
1951     }
1952   >
1953 }
1954 )
1955 )
1956
1957
1958 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1959 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1960
1961 sect(Notation Contexts)
1962 cindex(notation contexts)
1963
1964 Notation contexts are objects that only exist during a run of
1965 LilyPond.  During the interpretation phase of LilyPond, the Music
1966 expression contained in a code(\score) block is interpreted in time
1967 order.  This is the order in which humans read, play, and write
1968 music.
1969
1970 A context is an object that holds the reading state of the
1971 expression; it contains information like
1972
1973 itemize(
1974   it() What notes are playing at this point?
1975   it() What symbols will be printed at this point?
1976   it() In what style will they printed?
1977   it() What is the current key signature, time signature, point within
1978        the measure, etc.?
1979 )
1980
1981 Contexts are grouped hierarchically: A code(Voice) context is
1982 contained in a code(Staff) context (because a staff can contain
1983 multiple voices at any point), a code(Staff) context is contained in
1984 a code(Score), code(StaffGroup), or code(ChoirStaff) context (because
1985 these can all contain multiple staffs).
1986
1987 Contexts associated with sheet music output are called em(notation
1988 contexts), those for sound output are called playing contexts.
1989
1990 Contexts are created either manually or automatically.  Initially,
1991 the top level music expression is interpreted by the top level
1992 context (the code(Score) context).  When a atomic music expression
1993 (i.e. a note, a rest, code(\bar), or code(\time) commands), a nested
1994 set of contexts is created that can process these atomic expressions,
1995 as in this example:
1996
1997 quote(
1998   verb(\score { \notes < c4 > })
1999 )
2000
2001 The sequential music, `code({ c4 })' is interpreted by code(Score)
2002 context. When the note `code(c4)' itself is interpreted, a set of
2003 contexts is needed that will accept notes.  The default for this is a
2004 code(Voice) context, contained in a code(Staff) context.  Creation of
2005 these contexts results in the staff being printed.
2006
2007 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2008
2009 subsect(Context selection)
2010 label(contextselection)
2011 cindex(context)
2012
2013 You can also create contexts manually, and you probably have to do so
2014 if you want to typeset complicated multiple part material.  If a
2015 `code(\context) var(name) var(musicexpr)' expression is encountered
2016 during the interpretation phase, the var(musicexpr) argument will be
2017 interpreted with a context of type var(name).  If you specify a name,
2018 the specific context with that name is searched.
2019
2020 If a context of the specified type and name can not be found, a new
2021 one is created.  For example,
2022
2023 quote(
2024 mudela(verbatim)(\score {
2025   \notes \relative c'' {
2026     c4 <d4 \context Staff = "another" e4> f
2027   }
2028 }
2029 )
2030 )
2031
2032 In this example, the code(c) bind(and)code(d) are printed on the
2033 default staff.  For bind(the)code(e), a context Staff called
2034 `code(another)' is specified; since that does not exist, a new
2035 context is created.  Within code(another), a (default) Voice context
2036 is created for bind(the)code(e4).  When all music referring to a
2037 context is finished, the context is ended as well.  So after the
2038 third quarter, code(another) is removed.
2039
2040 Almost all music expressions inherit their interpretation context
2041 from their parent.  In other words, suppose that the syntax for a
2042 music expression is
2043
2044 quote(
2045   code(\keyword) var(musicexpr1) var(musicexpr2) ellipsis()
2046 )
2047
2048 When the interpretation of this music expression starts, the context
2049 for var(musicexpr1), var(musicexpr2), etc. is that of the total
2050 expression.
2051
2052 Lastly, you may wonder, why this:
2053
2054 quote(
2055 verb(\score {
2056   \notes \relative c'' {
2057     c4 d4 e4
2058   }
2059 })
2060 )
2061
2062 doesn't result in this:
2063
2064 mudela()(
2065   \score {
2066     \notes \relative c'' {
2067       <c4> <d4> <e4>
2068     }
2069   }
2070 )
2071
2072 For bind(the)code(c4), a default code(Staff) (with a contained
2073 code(Voice)) context is created.  After bind(the)code(c4) ends, no
2074 music refers to this default staff, so it would be ended, with the
2075 result shown.  To prevent this inconvenient behavior, the context to
2076 which the sequential music refers is adjusted during the
2077 interpretation.  So after bind(the)code(c4) ends, the context of the
2078 sequential music is also the default code(Voice) context. 
2079 bind(The)code(d4) gets interpreted in the same context
2080 bind(as)code(c4).
2081
2082 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2083
2084 subsect(Predefined contexts)
2085
2086 These are the contexts supplied with the package.  They are defined
2087 in the initialization file file(ly/engraver.ly).
2088
2089 description(
2090   dit(code(Grace))indexcode(Grace) nl()
2091     The context for handling grace notes.  It is instantiated
2092     automatically when you use code(\grace).  Basically, it is an
2093     `embedded' miniature of the Score context.  Since this context
2094     needs special interaction with the rest of LilyPond, you should
2095     not explicitly instantiate it.
2096
2097   dit(code(LyricVoice))indexcode(LyricVoice) nl()
2098     Corresponds to a voice with lyrics.  Handles the printing of a
2099     single line of lyrics.
2100
2101   dit(code(Thread))indexcode(Thread) nl()
2102     Handles note heads, and is contained in the Voice context.  You
2103     have to instantiate this explicitly if you want to adjust the
2104     style of individual note heads.
2105
2106   dit(code(Voice))indexcode(Voice) nl()
2107     Corresponds to a voice on a staff.  This context handles the
2108     conversion of dynamic signs, stems, beams, super- and subscripts,
2109     slurs, ties, and rests.
2110
2111     You have to instantiate this explicitly if you want to have
2112     multiple voices on the same staff.
2113
2114   dit(code(ChordNamesVoice))indexcode(ChordNamesVoice) nl()
2115     A voice with chord names.  Handles printing of a line of chord
2116     names.
2117
2118   dit(code(ChordNames))indexcode(ChordNames) nl()
2119     Typesets chord names.  Can contain code(ChordNamesVoice)
2120     contexts.
2121
2122   dit(code(Lyrics))indexcode(Lyrics) nl()
2123     Typesets lyrics.  It can contain code(LyricVoice) contexts.
2124
2125   dit(code(Staff))indexcode(Staff) nl()
2126     Handles clefs, bar lines, keys, accidentals.  It can contain
2127     code(Voice) contexts.
2128
2129   dit(code(RhythmicStaff))indexcode(RhythmicStaff) nl()
2130     A context like code(Staff) but for printing rhythms.  Pitches are
2131     ignored; the notes are printed on one line.  It can contain
2132     code(Voice) contexts.
2133
2134   dit(code(GrandStaff))indexcode(GrandStaff) nl()
2135     Contains code(Staff) or code(RhythmicStaff) contexts.  It adds a
2136     brace on the left side, grouping the staffs together.  The bar
2137     lines of the contained staffs are connected vertically.  It can
2138     contain code(Staff) contexts.
2139
2140   dit(code(PianoStaff))indexcode(PianoStaff) nl()
2141     Just like code(GrandStaff) but with code(minVerticalAlign) set
2142     equal to code(maxVerticalAlign) so that interstaff beaming and
2143     slurring can be used.
2144
2145   dit(code(StaffGroup))indexcode(StaffGroup) nl()
2146     Contains code(Staff) or code(RhythmicStaff) contexts.  Adds a
2147     bracket on the left side, grouping the staffs together.  The bar
2148     lines of the contained staffs are connected vertically.  It can
2149     contain code(Staff), code(RhythmicStaff), code(GrandStaff), or
2150     code(Lyrics) contexts.
2151
2152   dit(code(ChoirStaff))indexcode(ChoirStaff) nl()
2153     Identical to code(StaffGroup) except that the contained staffs
2154     are not connected vertically.
2155
2156   dit(code(Score))indexcode(Score) nl()
2157     This is the top level notation context.  No other context can
2158     contain a code(Score) context.  This context handles the
2159     administration of time signatures.  It also makes sure that items
2160     such as clefs, time signatures, and key-signatures are aligned
2161     across staffs.  It can contain code(Lyrics), code(Staff),
2162     code(RhythmicStaff), code(GrandStaff), code(StaffGroup), and
2163     code(ChoirStaff) contexts.
2164
2165     You cannot explicitly instantiate a Score context (since it is
2166     not contained in any other context).  It is instantiated
2167     automatically when an output definition (a code(\score) or
2168     code(\paper) block) is processed.
2169 )
2170
2171 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2172
2173 subsect(Context properties)
2174
2175 Properties that are set in one context are inherited by all of the
2176 contained contexts.  This means that a property valid for the
2177 code(Voice) context can be set in the code(Score) context (for
2178 example) and thus take effect in all code(Voice) contexts.
2179
2180 Properties can be preset within the code(\translator) block
2181 corresponding to the appropriate context.  In this case, the syntax
2182 is
2183
2184 quote(
2185   var(propname) code(=) var(value)
2186 )
2187
2188 This assignment happens before interpretation starts, so a
2189 code(\property) expression will override any predefined settings.
2190
2191 The code(\property) expression will create any property you specify.
2192 There is no guarantee that a property will be used.  So if you spell
2193 a property name wrong, there will be no error message.
2194
2195 The property settings are used during the interpretation phase.  They
2196 are read by the LilyPond modules where interpretation contexts are
2197 built of.  These modules are called em(translators).  Translators for
2198 notation are called em(engravers), and translators for sound are
2199 called em(performers).
2200
2201 The precise result of a property is determined by the implementation
2202 of the translator that reads them.  Therefore, the result of a
2203 property can vary, since it is implementation and configuration
2204 dependent.
2205
2206 In order to fully find out what properties are used, you must
2207 currently search the source code for calls to code(get_property). 
2208 The rest of the section is devoted to an (incomplete) overview of
2209 available properties.
2210
2211 subsubsect(Lyrics properties)
2212 cindex(properties!Lyrics)
2213
2214 description(
2215   dit(code(textStyle))indexcode(textStyle) nl()
2216     Set the font for lyrics.  The available font choices are
2217     code(roman), code(italic), code(bold), code(large), code(Large),
2218     code(typewriter), and code(finger).  The code(finger) font can
2219     only display numbers.  Note also that you must be careful when
2220     using code(\property) in Lyrics mode, because of the way strings
2221     are parsed.  Either put quotes around the arguments to
2222     code(\property) or be sure to leave a space on both sides of the
2223     dot.
2224 )
2225
2226 subsubsect(Thread properties)
2227 cindex(properties!Thread)
2228
2229 description(
2230   dit(code(noteheadStyle))indexcode(noteheadStyle) nl()
2231     Selects type of note head.  Choices are code(cross),
2232     code(diamond), code(harmonic), code(transparent), and code(""). 
2233     They are shown in that order below.
2234
2235     mudela(center)(
2236       \score {
2237         \notes { 
2238           \property Staff.barNonAuto = 1
2239           \property Voice.noteHeadStyle = cross 
2240           a'
2241           \property Voice.noteHeadStyle = diamond
2242           a'
2243           \property Voice.noteHeadStyle = harmonic
2244           a'
2245           \property Voice.noteHeadStyle = transparent
2246           a' 
2247           \property Voice.noteHeadStyle = ""
2248           a'
2249         }
2250         \paper {
2251           linewidth = -1.;
2252         }
2253       }
2254     )
2255 )
2256
2257 subsubsubsect(Grace properties)
2258 cindex(properties!Grace)
2259  
2260 description(  
2261   dit(indexandcode(stemStyle)) nl()
2262     By default set to code("grace") meaning that all unbeamed 
2263     notes with flags are typeset with a slash through the flag. 
2264     Setting to code("") gives standard flags.
2265 )
2266
2267 subsubsect(Voice properties)
2268 cindex(properties!Voice)
2269
2270 description(  
2271   dit(code(abbrev))indexcode(abbrev) nl()
2272     Set length for tremolo to be used if no length is explicitly
2273     specified. 
2274
2275   dit(code(articulationScriptPadding))indexcode(articulationScriptPadding)
2276     nl()
2277     Determines the extra space added between articulation marks, such
2278     as staccato, tenuto, trill, up/down bow or fermata, and the
2279     closest staff line or note.
2280
2281   dit(code(articulationScriptVerticalDirection))
2282     indexcode(articulationScriptVerticalDirection) nl()
2283     Determines the location of articulation marks.  Set to code(\up)
2284     to print marks above the staff; set to code(\down) to print marks
2285     below the staff.  This property does not override explicit
2286     directions marked with `code(^)' or `code(_)' in the mudela file.
2287     
2288   dit(code(noAutoBeaming))indexcode(beamAuto) nl()
2289     If set bind(to)1 then beams are not generated automatically.
2290
2291   dit(code(beamAutoEnd))indexcode(beamAutoEnd) nl()
2292     Specifies when automatically generated beams can end.  See
2293     bind(section)ref(autobeam).
2294
2295   dit(code(beamAutoBegin))indexcode(beamAutoBegin) nl()
2296     Specifies when automatically generated beams can start.  See
2297     bind(section)ref(autobeam).
2298
2299   dit(code(beamquantisation))indexcode(beamquantisation) nl()
2300     Set to code(\none) for no quantization.  Set to code(\normal) to
2301     quantize position and slope.  Set to code(\traditional) to avoid
2302     wedges.  These three settings are available via
2303     code(\beamposfree)keyindex(beamposfree),
2304     code(\beamposnormal)keyindex(beamposnormal), and
2305     code(\beampostraditional)keyindex(beampostraditional).
2306
2307   dit(code(beamslopedamping))indexcode(beamslopedamping) nl()
2308     Set to code(\none) for undamped beams.  Set to code(\normal) for
2309     damped beams.  Set to code(\infinity) for beams with zero slope. 
2310     The identifiers
2311     code(\beamslopeproportional)keyindex(beamslopeproportional),
2312     code(\beamslopedamped)keyindex(beamslopedamped), and
2313     code(\beamslopezero)keyindex(beamslopezero) each set the
2314     corresponding value.
2315
2316   dit(code(dynamicDirection))indexcode(dynamicDirection) nl()
2317     Determines location of dynamic marks.  Set to code(\up) to print
2318     marks above the staff; set to code(\down) to print marks below
2319     the staff.
2320
2321   dit(code(dynamicStyle))indexcode(dynamicStyle) nl()
2322     Set the text style for dynamics.  
2323
2324   dit(code(fontSize))indexcode(fontSize) nl()
2325     Can be used to select smaller font sizes for music.  The normal
2326     font size bind(is)0, and the two smaller sizes are -1
2327     bind(and)-2.
2328
2329
2330    dit(code(forceHorizontalShift))indexcode(forceHorizontalShift) nl()
2331     Force horizontal shift for collision resolution.  It overrides
2332     automatic collision resolution.  The value is the shift amount
2333     expressed in code(note_width), as set in the paper section.
2334     
2335
2336   dit(code(horizontalNoteShift))indexcode(horizontalNoteShift) nl()
2337     Enable LilyPond to shift notes horizontally if they collide with
2338     other notes.  This is useful when typesetting many voices on one
2339     staff.  The identifier code(\shift)keyindex(shift) is defined to
2340     enable this.  Traditionally, the outer chords (the upmost and
2341     downmost voices), should have no code(horizontalNoteShift).
2342
2343   dit(code(markScriptPadding))indexcode(markScriptPadding) nl()
2344     Determines the extra space added between the mark and the closest
2345     staff line or note.
2346
2347   dit(code(markDirection))indexcode(markDirection) nl()
2348     Determines if marks should be printed above or below the staff.
2349     Set to code(\up) to print marks above the staff; set to
2350     code(\down) to print marks below the staff.
2351
2352   dit(code(midiInstrument))indexcode(midiInstrument) nl()
2353     Sets the instrument for MIDI output.  If this property is not set
2354     then LilyPond will use the code(instrument) property.  This must
2355     be set to one of the strings on the list of MIDI instruments that
2356     appears in bind(section)ref(midilist).  If you use a string which
2357     is not listed, LilyPond will silently substitute piano.
2358
2359
2360   dit(code(oldTieBehavior))indexcode(oldTieBehavior) nl()
2361     Set bind(to)1 in order to get old tie behavior where ties would
2362     connect unequal pitches.  This property is deprecated, and its
2363     use is not recommended.
2364
2365   dit(code(restStyle))indexcode(restStyle) nl()
2366     Change the layout of rests shorter than quarter notes. 
2367     Currently, the standard layout code("") and mensural notation
2368     code("mensural") are available. Mensural rests of duration
2369     32 or shorter are not available.
2370     
2371   dit(code(scriptHorizontal))indexcode(scriptHorizontal) nl()
2372     Put scripts left or right of note heads.  Support for this is
2373     limited.  Accidentals will collide with scripts.
2374     
2375   dit(code(slurVerticalDirection))indexcode(slurVerticalDirection) nl()
2376     Set to code(\free) for free choice of slur direction, set to
2377     code(\up) to force slurs up, set to code(\down) to force slurs
2378     down.  The shorthands code(\slurup)keyindex(slurup),
2379     code(\slurdown)keyindex(slurdown), and
2380     code(\slurboth)keyindex(slurboth) are available.
2381
2382
2383   dit(code(slurDash))indexcode(slurDash) nl()
2384     Set bind(to)0 for normal slurs, bind(1)for dotted slurs, and a
2385     larger value for dashed slurs.  Identifiers
2386     code(\slurnormal)keyindex(slurnormal) and
2387     code(\slurdotted)keyindex(slurdotted) are predefined to set the
2388     first two settings.
2389
2390 dit(code(stemLength))indexcode(stemLength) nl()
2391     Set length of stems.  Unit is `code(interline)/2', so
2392     code(stemLength) defaults bind(to)7.
2393
2394   dit(code(stemLeftBeamCount))indexcode(stemLeftBeamCount) nl()
2395     Specify the number of beams to draw on the left side of the next
2396     note.  Overrides automatic beaming.  The value is only used once,
2397     and then it is erased.
2398
2399   dit(code(stemRightBeamCount))indexcode(stemRightBeamCount) nl()
2400     Specify the number of beams to draw on the right side of the next
2401     note.  Overrides automatic beaming.  The value is only used once,
2402     and then it is erased.
2403   dit(code(tieVerticalDirection))indexcode(tieVerticalDirection) nl()
2404     Set to code(\free) for free choice of tie direction, set to
2405     code(\up) to force ties up, set to code(\down) to force ties
2406     down.
2407
2408   dit(code(transposing))indexcode(transposing) nl()
2409     Transpose the MIDI output.  Set this property to the number of
2410     half-steps to transpose by.
2411
2412   
2413   dit(code(textEmptyDimension))indexcode(textEmptyDimension) nl()
2414     If set bind(to)1 then text placed above or below the staff is
2415     assumed to have zero width.
2416   
2417   dit(code(textStyle))indexcode(textStyle) nl()
2418     Set the text style for superscripts and subscripts.  See above
2419     for list of text styles.
2420
2421   dit(code(textScriptPadding))indexcode(textScriptPadding) nl()
2422     Determines the extra space added between superscripted resp.
2423     subscripted text and the closest staff line or note.
2424
2425   dit(code(verticalDirection))indexcode(verticalDirection) nl()
2426     Determines the direction of stems, subscripts, beams, slurs, and
2427     ties.  Set to code(\down) to force them down, code(\up) to force
2428     them up, or code(\free) to let LilyPond decide.  This can be used
2429     to distinguish between voices on the same staff.  The
2430     code(\stemdown)keyindex(stemdown), code(\stemup)keyindex(stemup),
2431     and code(\stemboth)keyindex(stemboth) identifiers set this
2432     property.
2433     
2434
2435   dit(code(tupletDirection))indexcode(tupletDirection) nl()
2436     Determines the direction of triplets and other tuplets.  Set to
2437     code(\down) to force them below the staff, code(\up) to force
2438     them above, or code(\free) to let LilyPond decide.
2439
2440   dit(code(tupletVisibility))indexcode(tupletVisibility) nl()
2441     Determines whether tuplets of notes are labelled.  Setting
2442     bind(to)0 shows nothing; setting bind(to)1 shows a number;
2443     setting bind(to)2 shows a number and a bracket if there is no
2444     beam; setting bind(to)3 shows a number, and if there is no beam
2445     it adds a bracket; setting bind(to)4 shows both a number and a
2446     bracket unconditionally.
2447
2448 )
2449
2450 subsubsubsect(Staff properties)
2451 cindex(properties!Staff)
2452
2453 description(
2454  
2455   dit(code(barNonAuto))indexcode(barNonAuto) nl()
2456     If set bind(to)1 then bar lines will not be printed
2457     automatically; they must be explicitly created with code(\bar)
2458     keywords.  Unlike with the code(\cadenza) keyword, measures are
2459     still counted.  Bar generation will resume according to that
2460     count if this property is set to zero.
2461
2462   dit(code(barNumberDirection))indexcode(barNumberDirection) nl()
2463     Set to code(\up) or code(\down) to put bar numbers above or below
2464     the staff.
2465
2466   dit(code(barNumberHangOnClef))indexcode(barNumberHangOnClef) nl()
2467     Set bind(to)1 to cause bar numbers to appear above or below the
2468     clef instead of on the bar line.  This property is deprecated. 
2469     Do not use.
2470
2471   dit(code(barNumberScriptPadding))indexcode(barNumberScriptPadding) nl()
2472     Sets extra space between the bar number and the bar it labels.
2473
2474   dit(code(barSize))indexcode(barSize) nl()
2475     Specify the height of the bar lines if it should be different
2476     than the staff height.
2477
2478   dit(code(barAtLineStart))indexcode(barAtLineStart) nl()
2479     Set bind(to)1 to produce a bar line after the clef at the start
2480     of each line (but not at the beginning of the music).
2481
2482   dit(code(clefStyle))indexcode(clefStyle) nl()
2483     Determines how clefs are typeset.  If set to code(transparent),
2484     the clefs are not printed at all, if set to
2485     code(fullSizeChanges), clef changes in the middle of a line are
2486     typeset with a full size clef.  By default, clef changes are
2487     typeset in smaller size.
2488
2489   dit(code(createKeyOnClefChange))indexcode(createKeyOnClefChange) nl()
2490     Set to a nonempty string if you want key signatures to be printed
2491     when the clef changes.  Set to the empty string if you do not
2492     want key signatures printed.
2493
2494   dit(code(createInitdefaultClef))indexcode(createInitdefaultClef) nl()
2495     Specify whether clefs are created on default?  (Doesn't seem to
2496     do anything.)
2497
2498   dit(code(defaultClef))indexcode(defaultClef) nl()
2499     Determines the default clef.  See code(\clef) keyword.
2500
2501   dit(code(markHangOnClef))indexcode(markHangOnClef) nl()
2502     Set bind(to)1 to cause marks to appear by clefs instead of by bar
2503     lines.  Deprecated, use is not recommended.
2504
2505   dit(code(marginDirection))indexcode(marginDirection) nl()
2506     Set to code(\left) or code(\right) to specify location of
2507     marginal scripts.
2508
2509   dit(code(marginScriptPadding))indexcode(marginScriptPadding) nl()
2510     Specify extra space for marginal scripts.
2511
2512   dit(code(forgetAccidentals))indexcode(forgetAccidentals) nl()
2513     Causes accidentals to be printed at every note instead of
2514     remembered for the duration of a measure.
2515
2516   dit(code(noResetKey))indexcode(noResetKey) nl()
2517     Do not reset the key at the start of a measure.  Accidentals will
2518     be printed only once and are in effect until overridden, possibly
2519     many measures later.
2520
2521   dit(code(staffLineLeading))indexcode(staffLineLeading) nl()
2522     Specifies the distance (in points) between lines of the staff.
2523
2524   dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) nl()
2525     Specifies the number of staff lines.  The default bind(is)5.
2526
2527   dit(code(postBreakPadding))indexcode(postBreakPadding) nl()
2528     Extra space in points to be added after the clef, time signature
2529     and key signature on the staff.  Deprecated, do not use.
2530
2531   dit(code(noVoltaBraces))indexcode(noVoltaBraces) nl()
2532     Set to true to suppress the printing of brackets over alternate
2533     endings specified by the command code(\alternative).
2534
2535   dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) nl()
2536     Sets the number of lines that the staff has.
2537  
2538   dit(code(barAlways))indexcode(barAlways) nl()
2539     If set bind(to)1 a bar line is drawn after each note.
2540
2541   dit(code(defaultBarType))indexcode(defaultBarType) nl()
2542     Sets the default type of bar line. See bind(Section)ref(barlines) 
2543     for a list of available bar types.
2544
2545   dit(code(instrument), code(instr))
2546     indexcode(instrument)indexcode(instr) nl()
2547     If code(Staff_margin_engraver)cindex(Staff_margin_engraver) is
2548     added to the Staff translator, then the code(instrument) property
2549     is used to label the first line of the staff and the code(instr)
2550     property is used to label subsequent lines.  If the
2551     code(midiInstrument) property is not set, then code(instrument)
2552     is used to determine the instrument for MIDI output.
2553
2554   dit(code(keyOctaviation))indexcode(keyOctaviation) nl()
2555     If set bind(to)1, then keys are the same in all octaves.  If set
2556     bind(to)0 then the key signature for different octaves can be
2557     different and is specified independently:
2558
2559     quote(
2560       code(\keysignature bes fis')
2561     )
2562
2563     The default value bind(is)1.  Can be set to zero with
2564     code(\specialkey) or reset bind(to)1 with code(\normalkey).
2565
2566   dit(code(timeSignatureStyle))indexcode(timeSignatureStyle) nl()
2567     Changes the default two-digit layout for time signatures.  The
2568     following values are recognized:
2569
2570     description(
2571       dit(code(C))indexcode(C) nl()
2572         4/4 and 2/2 are typeset as C and struck C, respectively.  All
2573         other time signatures are written with two digits.
2574
2575       dit(code(old))indexcode(old) nl()
2576         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
2577         typeset with old-style mensuration marks.  All other time
2578         signatures are written with two digits.
2579
2580       dit(code(1))indexcode(1) nl()
2581         All time signatures are typeset with a single
2582         digit, e.g. 3/2 is written bind(as)3.
2583
2584       dit(indexcode(CM/N)code(C)var(M)code(/)var(N), 
2585       indexcode(oldM/N)code(old)var(M)code(/)var(N) or
2586       indexandcode(old6/8alt)) nl()
2587         Tells LilyPond to use a specific symbol as time signature.
2588     )
2589
2590     The different time signature characters are shown below with its
2591     names:
2592
2593     mudela(center)(
2594       \score {
2595         \notes\relative c'' {
2596           \property Voice.textStyle = typewriter
2597           \property Staff.timeSignatureStyle = "C2/2"
2598           \time 2/2; a2^"C2/2" a2 
2599           \property Staff.timeSignatureStyle = "C4/4"
2600           \time 2/2; a2^"C4/4" a2 
2601           \property Staff.timeSignatureStyle = "old2/2"
2602           \time 2/2; a2^"old2/2" a2 
2603           \property Staff.timeSignatureStyle = "old3/2"
2604           \time 2/2; a2^"old3/2" a2 
2605           \property Staff.timeSignatureStyle = "old2/4"
2606           \time 2/2; a2^"old2/4" a2 
2607           \property Staff.timeSignatureStyle = "old4/4"
2608           \time 2/2; a2^"old4/4" a2 
2609           \property Staff.timeSignatureStyle = "old6/4"
2610           \time 2/2; a2^"old6/4" a2 
2611           \property Staff.timeSignatureStyle = "old9/4"
2612           \time 2/2; a2^"old9/4" a2 
2613           \property Staff.timeSignatureStyle = "old4/8"
2614           \time 2/2; a2^"old4/8" a2 
2615           \property Staff.timeSignatureStyle = "old6/8"
2616           \time 2/2; a2^"old6/8" a2 
2617           \property Staff.timeSignatureStyle = "old6/8alt"
2618           \time 2/2; a2^"old6/8alt" a2 
2619           \property Staff.timeSignatureStyle = "old9/8"
2620           \time 2/2; a2^"old9/8" a2 
2621         }
2622         \paper {
2623           linewidth = 4.5 \in;
2624         }
2625       }
2626     )
2627
2628   dit(code(voltaSpannerDuration))indexcode(voltaSpannerDuration) nl()
2629     Set to an integer to control the size of the brackets printed by
2630     code(\alternative).  The integer specifies the number of whole
2631     notes duration to use for the brackets.  It is rounded to the
2632     nearest measure.  This can be used to shrink the length of
2633     brackets in the situation where one alternative is very large. 
2634     It may have odd effects if the specified duration is longer than
2635     the music given in an code(\alternative).
2636 )
2637    
2638 subsubsect(GrandStaff properties)
2639 cindex(properties!GrandStaff)
2640
2641 description( 
2642   dit(code(alignmentReference))indexcode(alignmentReference) nl()
2643     Set to code(\center) for vertical alignment reference point to be
2644     in the center of the vertical group.  Set to code(\up) to put the
2645     reference point at the top of the group.
2646
2647   dit(code(maxVerticalAlign))indexcode(maxVerticalAlign) nl()
2648     Set the maximum vertical distance between staffs.
2649
2650   dit(code(minVerticalAlign))indexcode(minVerticalAlign) nl()
2651     Set the minimum vertical distance between staffs.  
2652 )
2653
2654 subsubsect(Score properties)
2655 cindex(properties!Score)
2656
2657 description(
2658   dit(code(skipBars))indexcode(skipBars) nl()
2659     Set bind(to)1 to skip the empty bars that are produced by
2660     multimeasure notes and rests.  These bars will not appear on the
2661     printed output.  Set to zero (the default) to expand multimeasure
2662     notes and rests into their full length, printing the appropriate
2663     number of empty bars so that synchronization with other voices is
2664     preserved.
2665
2666     quote(
2667 mudela(fragment,verbatim,center)\
2668   (r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
2669 )
2670     )
2671 )
2672
2673 subsubsect(ChordNamesVoice properties)
2674 cindex(properties!ChordNamesVoice)
2675
2676 description(
2677   dit(code(chordInversion))indexcode(chordInversion) nl()
2678     Determines whether LilyPond should look for chord inversions when
2679     translating from notes to chord names.  Set bind(to)1 to find
2680     inversions.  The default bind(is)0 which does not look for
2681     inversions.
2682 )
2683
2684
2685 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2686 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2687
2688 sect(Notation output definitions)
2689 cindex(output)
2690 cindex(notation output)
2691 cindex(output definition)
2692 label(output)
2693 label(paper)
2694
2695 The most important output definition is the code(\paper) block, for
2696 music notation.  The syntax is
2697
2698 quote(
2699   code(\paper {) [var(paperidentifier)] var(items) code(})
2700 )
2701
2702 where each of the items is one of
2703
2704 itemize(
2705   it() An assignment.  The assignment must be terminated by a
2706        semicolon.  See bind(section)ref(papervars) for information on
2707        paper variables.
2708
2709   it() A context definition.  See bind(section)ref(contextdefs) for
2710        more information on context definitions.
2711
2712   it() A margin shape declaration.  The syntax is
2713
2714        quote(
2715          code(\shape) var(indent1)code(,) var(width1)code(,)
2716                       var(indent2)code(,) var(width2) ellipsis() code(;)
2717        )
2718        keyindex(shape)
2719
2720        Each pair of var(indent) and var(width) values is a dimension
2721        specifying how far to indent and how wide to make the line. 
2722        The indentation and width of successive lines are specified by
2723        the successive pairs of dimensions.  The last pair of
2724        dimensions will define the characeristics of all lines beyond
2725        those explicitly specified.
2726
2727   it() A font declaration.  Its syntax is
2728
2729        quote(
2730          var(fontsize) code(=) code(\font)keyindex(font) var(fontname)
2731        )
2732
2733        var(fontsize) is an integer describing the font to be used. 
2734        bind(0)is the default font.  var(fontname) is the basename of
2735        a font (usually a member of the Feta family).
2736 )
2737
2738 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2739
2740 subsect(Changing Font Size and Paper Size)
2741 cindex(changing font size and paper size)
2742
2743 The Feta font provides musical symbols at six different sizes.  These
2744 fonts are bind(11)point, bind(13)point, bind(16)point, bind(20)point,
2745 bind(23)point, and bind(26)point.  The point size of a font is the
2746 height of the five lines in a staff when displayed in the font.
2747
2748 Definitions for these sizes are the files file(paperSZ.ly), where
2749 code(SZ) is one of 11, 13, 16, 20, 23 bind(and)26.  If you include
2750 any of these files, the identifiers code(paper_eleven),
2751 code(paper_thirteen), code(paper_sixteen), code(paper_twenty),
2752 code(paper_twentythree), and code(paper_twentysix) are defined
2753 respectively.  The default code(\paper) block is also set.
2754
2755 To change the paper size, you must first set the
2756 indexandcode(papersize) variable at top level.  Set it to the strings
2757 code(a4), code(letter), or code(legal).  After this specification,
2758 you must set the font as described above.  If you want the default
2759 font, then use the bind(20)point font.  The new paper size will not
2760 take effect if the font is not loaded and selected afterwards.  Paper
2761 size selection works by loading a file named after the paper size you
2762 select.
2763
2764 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2765
2766 subsect(Paper variables)
2767 cindex(paper variables)
2768 label(papervars)
2769
2770 There is a large number of paper variables that are used to control
2771 details of the layout.  These variables control the defaults for the
2772 entire score.  Usually, they do not have to be changed; they are by
2773 default set to values that depend on the font size in use.  The
2774 values are used by the graphic objects while formatting the score;
2775 they are therefore implementation dependent.  Most variables are
2776 accompanied by documentation in the initalization file
2777 file(params.ly) or file(paperSZ.ly), where code(SZ) is the staff
2778 height in points.
2779
2780 Nevertheless, here are some variables you may want to use or change:
2781
2782 description(
2783   dit(code(indent))indexcode(indent) nl()
2784     The indentation of the first line of music.
2785
2786   dit(code(interline))indexcode(interline) nl()
2787     The distance between two staff lines, calculated from the center
2788     of the lines.  You should use either this or code(rulethickness)
2789     as a unit for distances you modify.
2790   
2791   dit(code(linewidth))indexcode(linewidth) nl()
2792     Sets the width of the lines.  If set bind(to)-1.0, a single
2793     unjustified line is produced.
2794
2795   dit(code(output))indexcode(output) nl()
2796     Specifies an alternate name for the the output file(s).
2797     A file(.tex), file(.midi) or file(.ps) extension will be 
2798     added to the string you specify.
2799
2800   dit(code(rulethickness))indexcode(rulethickness) nl()
2801     Determines the thickness of staff and bar lines. 
2802
2803   dit(code(castingalgorithm))indexcode(castingalgorithm) nl()
2804     The algorithm to use for breaking lines.  Choices are
2805     code(\Gourlay)keyindex(Gourlay) for a TeX()-like dynamic
2806     programming algorithm, and code(\Wordwrap)keyindex(Wordwrap) for
2807     a simple algorithm.  Gourlay breaking looks much better, but
2808     takes a lot more resources.  Wordwrap leaves loosely spaced lines
2809     at the end.
2810 )
2811
2812 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2813
2814 subsect(Context definitions)
2815 label(contextdefs)
2816 cindex(context definition)
2817
2818 A notation contexts is defined by the following information
2819
2820 enumerate(
2821   it() A name.
2822
2823   it() The LilyPond modules that do the actual conversion of music to
2824        notation.  Each module is a so-called
2825        em(engraver)cindex(engraver).
2826
2827   it() How these modules should cooperate, i.e. which ``cooperation
2828        module'' should be used.  This cooperation module is a special
2829        type of engraver.
2830
2831   it() What other contexts the context can contain,
2832
2833   it() What properties are defined.
2834 )
2835
2836 A context definition has this syntax:
2837
2838 quote(
2839   code(\translator) code({)
2840                       var(translatorinit) var(translatormodifierlist)
2841                     code(})
2842 )
2843
2844 var(translatorinit) can be an identifier or of the form
2845
2846 quote(
2847   code(\type) var(typename) code(;)
2848 )
2849
2850 var(typename) is one of
2851
2852 description(
2853   dit(code(Engraver_group_engraver))indexcode(Engraver_group_engraver) nl()
2854     The standard cooperation engraver.
2855
2856   dit(code(Score_engraver))indexcode(Score_engraver) nl()
2857     This is cooperation module that should be in the top level context.
2858
2859   dit(code(Grace_engraver_group))indexcode(Grace_engraver_group) nl()
2860     This is a special cooperation module (resembling
2861     code(Score_engraver)) that is used to created an embedded
2862     `miniscore'.
2863
2864
2865 var(translatormodifierlist) is a list of items where each item is
2866 one of
2867
2868 itemize(
2869   it() code(\consists) var(engravername) code(;) nl()
2870     Add var(engravername) to the list of modules in this context. 
2871     bind(Section)ref(engravers) contains an overview of the engravers
2872     available.  The order of engravers added with code(\consists) is
2873     significant.
2874   
2875   it() code(\consistsend) var(engravername) code(;) nl()
2876     Analogous to code(\consists), but makes sure that
2877     var(engravername) is always added to the end of the list of
2878     engravers.
2879
2880     Some engraver types need to be at the end of the list; this
2881     insures they are put there, and stay there, if a user adds or
2882     removes engravers.  This command is usually not needed for
2883     end-users.
2884     
2885   it() code(\accepts) var(contextname) code(;) nl()
2886     Add var(contextname) to the list of  context this context can
2887     contain.  The first listed context the context to create by
2888     default.
2889   
2890   it() code(\remove) var(engravername) code(;) nl()
2891     Remove a previously added (with code(\consists)) engraver.
2892   
2893   it() code(\name) var(contextname) code(;) nl()
2894     This sets name of the context, e.g. code(Staff), code(Voice).  If
2895     the name is not specified, the translator won't do anything.
2896
2897   it() var(propname) code(=) var(value) code(;) nl()
2898     A property assignment.  It is allowed to use reals for
2899     var(value).
2900 )
2901
2902 In the code(\paper) block, it is also possible to define translator
2903 identifiers.  Like other block identifiers, the identifier can only
2904 be used as the very first item of a translator.  In order to define
2905 such an identifier outside of code(\score), you must do
2906
2907 quote(
2908 verb(\paper {
2909   foo = \translator { ... }
2910 }
2911 \score {
2912   \notes {
2913     ...
2914   }
2915   \paper {
2916     \translator { \foo ... }
2917   }
2918 })
2919 )
2920
2921 subsubsect(Paper Types, Engravers, and Pre-defined Translators)
2922 cindex(paper types, engravers, and pre-defined translators)
2923
2924 Some pre-defined identifiers can simplify modification of
2925 translators.  The pre-defined identifiers are:
2926
2927 description(
2928   dit(code(StaffContext))indexcode(StaffContext) nl()
2929     Default Staff context. 
2930
2931   dit(code(RhythmicStaffContext))indexcode(RhythmicStaffContext) nl()
2932     Default RhythmicStaff context. 
2933
2934   dit(code(VoiceContext))indexcode(VoiceContext) nl()
2935     Default Voice context.  
2936
2937   dit(code(ScoreContext))indexcode(ScoreContext) nl()
2938     Default Score context. 
2939
2940   dit(code(ScoreWithNumbers))indexcode(ScoreWithNumbers) nl()
2941     Score context with numbering at the Score level.
2942
2943   dit(code(BarNumberingStaffContext))indexcode(BarNumberingStaffContext) nl()
2944     Staff context with numbering at the Staff level.
2945
2946   dit(code(HaraKiriStaffContext))indexcode(HaraKiriStaffContext) nl()
2947     Staff context that does not print if it only contains rests. 
2948     Useful for orchestral scores.footnote(Harakiri, also called
2949     Seppuku, is the ritual suicide of the Samourai.)
2950
2951   dit(code(OrchestralPartStaffContext))indexcode(OrchestralPartStaffContext)
2952
2953   dit(code(OrchestralScoreContext))indexcode(OrchestralScoreContext)
2954 )
2955
2956 Using these pre-defined values, you can remove or add items to the
2957 translator:
2958
2959 quote(
2960 verb(\paper {
2961   \translator {
2962     \StaffContext
2963     \remove Some_engraver;
2964     \consists Different_engraver;
2965   }
2966 })
2967 )
2968       
2969 subsubsect(Engravers)
2970 label(engravers)
2971
2972 The engravers for paper output are:
2973
2974 [incomplete, FIXME]
2975
2976 description(
2977   dit(code(Bar_engraver))indexcode(Bar_engraver) nl()
2978     Engraves bar lines.  Normally in code(Staff) and
2979     code(RhythmicStaff).
2980
2981   dit(code(Bar_number_engraver))indexcode(Bar_number_engraver) nl()
2982     Engrave bar numbers.  These numbers appear at the start of each
2983     line.  Not normally in any translator.  Can be added to
2984     code(Score) for score-wide numbering or to code(Staff) for
2985     numbering on each staff.
2986
2987   dit(code(Beam_engraver))indexcode(Beam_engraver) nl()
2988     Handles beam requests by engraving beams.  Normally appears in
2989     the code(Voice) translator.  If omitted, then notes will be
2990     printed with flags instead of beams.
2991
2992   dit(code(Beam_req_swallow_translator))
2993     indexcode(Beam_req_swallow_translator) nl()
2994     Swallows beam requests.  In code(LyricVoice).  
2995
2996   dit(code(Chord_name_engraver))indexcode(Chord_name_engraver) nl()
2997     Engraves chord names.  Normally in code(ChordNameVoice) .
2998
2999   dit(code(Chord_tremolo_engraver))indexcode(Chord_tremolo_engraver)
3000
3001   dit(code(Clef_engraver))indexcode(Clef_engraver) nl()
3002     Engraves the clef symbol.  Normally in code(Staff).
3003
3004   dit(code(Collision_engraver))indexcode(Collision_engraver)
3005
3006   dit(code(Dot_column_engraver))indexcode(Dot_column_engraver) nl()
3007     Engraves dots on dotted notes shifted to the right of the note. 
3008     Normally in code(Voice).  If omitted, then dots appear on top of
3009     the notes.
3010
3011   dit(code(Dynamic_engraver))indexcode(Dynamic_engraver) nl()
3012     Engraves dynamics symbols.  Normally in code(Voice).
3013
3014   dit(code(Font_size_engraver))indexcode(Font_size_engraver)
3015
3016   dit(code(Key_engraver))indexcode(Key_engraver) nl()
3017     Engraves the key signature.  Normally in code(Staff).
3018
3019   dit(code(Local_key_engraver))indexcode(Local_key_engraver)
3020
3021   dit(code(Lyric_engraver))indexcode(Lyric_engraver) nl()
3022     Engraves lyrics.  Normally in code(LyricVoice).
3023
3024   dit(code(Multi_measure_rest_engraver))
3025     indexcode(Multi_measure_rest_engraver) nl()
3026     Engraves multi-measure rests that are produced with code(R). 
3027     Normally in code(Voice).
3028
3029   dit(code(Piano_bar_engraver))indexcode(Piano_bar_engraver)
3030
3031   dit(code(Pitch_squash_engraver))indexcode(Pitch_squash_engraver) nl()
3032     Treat all pitches as middle C.  Used in code(RhythmicStaff). 
3033     Note that the notes move, but the locations of accidentals stay
3034     the same.
3035
3036   dit(code(Priority_horizontal_align_engraver))
3037     indexcode(Priority_horizontal_align_engraver)
3038
3039   dit(code(Repeat_engraver))indexcode(Repeat_engraver) nl()
3040     Handles repeats?  In code(Staff) and code(RhythmicStaff).
3041
3042   dit(code(Rest_collision_engraver))indexcode(Rest_collision_engraver) nl()
3043     Handles collisions of rests.  In code(Staff).
3044
3045   dit(code(Rest_engraver))indexcode(Rest_engraver) nl()
3046     Engraves rests.  Normally in code(Voice).
3047
3048   dit(code(Rhythmic_column_engraver))indexcode(Rhythmic_column_engraver)
3049
3050   dit(code(Score_priority_engraver))indexcode(Score_priority_engraver)
3051
3052   dit(code(Script_engraver))indexcode(Script_engraver) nl()
3053     Handles note ornaments generated by code(\script).  Normally in
3054     code(Voice).
3055
3056   dit(code(Separating_line_group_engraver))
3057     indexcode(Separating_line_group_engraver)
3058
3059   dit(code(Skip_req_swallow_translator))
3060     indexcode(Skip_req_swallow_translator)
3061
3062   dit(code(Slur_engraver))indexcode(Slur_engraver) nl()
3063     Engraves slurs.  Normally in code(Voice).
3064
3065   dit(code(Span_bar_engraver))indexcode(Span_bar_engraver) nl()
3066     Engraves lines across multiple staffs.  Normally in
3067     code(Staffgroup) and code(GrandStaff).  Removing this from
3068     code(StaffGroup) gives the definition of code(ChoirStaff).
3069
3070   dit(code(Span_score_bar_engraver))indexcode(Span_score_bar_engraver)
3071
3072   dit(code(Staff_group_bar_engraver))indexcode(Staff_group_bar_engraver)
3073
3074   dit(code(Staff_margin_engraver))indexcode(Staff_margin_engraver) nl()
3075     Prints the name of the instrument (specified by
3076     code(Staff.instrument) and code(Staff.instr)) at the left of the
3077     staff.
3078
3079   dit(code(Staff_sym_engraver))indexcode(Staff_sym_engraver)
3080
3081   dit(code(Stem_engraver))indexcode(Stem_engraver) nl()
3082     Engraves stems.  Normally in code(Voice).
3083
3084   dit(code(Ties_engraver))indexcode(Ties_engraver) nl()
3085     Engraves ties.  Normally in code(Voice).
3086
3087   dit(code(Time_signature_engraver))indexcode(Time_signature_engraver) nl()
3088     Engraves the time signature.  Normally in code(Staff) and
3089     code(RhythmicStaff).
3090
3091   dit(code(Timing_engraver))indexcode(Timing_engraver) nl()
3092     Responsible for synchronizing timing information from staffs. 
3093     Normally in code(Score).  In order to create polyrhythmic music,
3094     this engraver should be removed from code(Score) and placed in
3095     code(Staff).
3096
3097   dit(code(Tuplet_engraver))indexcode(Tuplet_engraver) nl()
3098     Engraves tuplet brackets?  In code(Staff).
3099
3100   dit(code(Vertical_align_engraver))indexcode(Vertical_align_engraver) 
3101 )
3102
3103
3104 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3105 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3106
3107 sect(Sound output)
3108
3109 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3110
3111 subsect(output definition)
3112
3113 The MIDI block is analogous to the paper block, but it is simpler.
3114 The code(\midi) block can contain:cindex(MIDI block)
3115
3116 itemize(
3117   it() a code(\tempo) definition
3118   it() context definitions
3119 )
3120
3121 Assignments in the code(\midi) block are not allowed.
3122
3123 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3124
3125 subsect(Context definitions)
3126 cindex(context definition)
3127
3128 Context definitions follow precisely the same syntax as within the
3129 \paper block.  Translation modules for sound are called performers.
3130 The contexts for MIDI output are defined in file(ly/performer.ly).
3131
3132 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3133
3134 subsect(MIDI Instrument Names)
3135 cindex(MIDI instrument names)
3136 label(midilist)
3137
3138 The MIDI instrument name is set by the
3139 indexandcode(Staff.midiInstrument) property or, if that property is
3140 not set, the indexandcode(Staff.instrument) property.  The instrument
3141 name should be chosen from the following list.  If the selected
3142 string does not exactly match, then LilyPond uses the default piano.
3143
3144 COMMENT( acordina = accordion, tango accordian = concertina
3145          distortion guitar = distorted guitar
3146          orchestral strings = harp 
3147          pan flute = wood flute? )
3148
3149 quote(
3150 verb("acoustic grand"            "contrabass"           "lead 7 (fifths)"
3151 "bright acoustic"           "tremolo strings"      "lead 8 (bass+lead)"
3152 "electric grand"            "pizzicato strings"    "pad 1 (new age)"
3153 "honky-tonk"                "orchestral strings"   "pad 2 (warm)"
3154 "electric piano 1"          "timpani"              "pad 3 (polysynth)"
3155 "electric piano 2"          "string ensemble 1"    "pad 4 (choir)"
3156 "harpsichord"               "string ensemble 2"    "pad 5 (bowed)"
3157 "clav"                      "synthstrings 1"       "pad 6 (metallic)"
3158 "celesta"                   "synthstrings 2"       "pad 7 (halo)"
3159 "glockenspiel"              "choir aahs"           "pad 8 (sweep)"
3160 "music box"                 "voice oohs"           "fx 1 (rain)"
3161 "vibraphone"                "synth voice"          "fx 2 (soundtrack)"
3162 "marimba"                   "orchestra hit"        "fx 3 (crystal)"
3163 "xylophone"                 "trumpet"              "fx 4 (atmosphere)"
3164 "tubular bells"             "trombone"             "fx 5 (brightness)"
3165 "dulcimer"                  "tuba"                 "fx 6 (goblins)"
3166 "drawbar organ"             "muted trumpet"        "fx 7 (echoes)"
3167 "percussive organ"          "french horn"          "fx 8 (sci-fi)"
3168 "rock organ"                "brass section"        "sitar"
3169 "church organ"              "synthbrass 1"         "banjo"
3170 "reed organ"                "synthbrass 2"         "shamisen"
3171 "accordion"                 "soprano sax"          "koto"
3172 "harmonica"                 "alto sax"             "kalimba"
3173 "concertina"                "tenor sax"            "bagpipe"
3174 "acoustic guitar (nylon)"   "baritone sax"         "fiddle"
3175 "acoustic guitar (steel)"   "oboe"                 "shanai"
3176 "electric guitar (jazz)"    "english horn"         "tinkle bell"
3177 "electric guitar (clean)"   "bassoon"              "agogo"
3178 "electric guitar (muted)"   "clarinet"             "steel drums"
3179 "overdriven guitar"         "piccolo"              "woodblock"
3180 "distorted guitar"          "flute"                "taiko drum"
3181 "guitar harmonics"          "recorder"             "melodic tom"
3182 "acoustic bass"             "pan flute"            "synth drum"
3183 "electric bass (finger)"    "blown bottle"         "reverse cymbal"
3184 "electric bass (pick)"      "skakuhachi"           "guitar fret noise"
3185 "fretless bass"             "whistle"              "breath noise"
3186 "slap bass 1"               "ocarina"              "seashore"
3187 "slap bass 2"               "lead 1 (square)"      "bird tweet"
3188 "synth bass 1"              "lead 2 (sawtooth)"    "telephone ring"
3189 "synth bass 2"              "lead 3 (calliope)"    "helicopter"
3190 "violin"                    "lead 4 (chiff)"       "applause"
3191 "viola"                     "lead 5 (charang)"     "gunshot"
3192 "cello"                     "lead 6 (voice)")
3193 )
3194
3195 subsubsect(MIDI Types and Performers)
3196 cindex(MIDI types and performers)
3197
3198 The types available for  MIDI translators are:
3199
3200 description(
3201   dit(code(Performer_group_performer))indexcode(Performer_group_performer)
3202   dit(code(Score_performer))indexcode(Score_performer)
3203   dit(code(Staff_performer))indexcode(Staff_performer)
3204 )
3205
3206 The performers for MIDI translators are:
3207
3208 description(
3209   dit(code(Key_performer))indexcode(Key_performer)
3210   dit(code(Time_signature_performer))indexcode(Time_signature_performer)
3211   dit(code(Note_performer))indexcode(Note_performer)
3212   dit(code(Lyric_performer))indexcode(Lyric_performer)
3213   dit(code(Swallow_performer))indexcode(Swallow_performer)
3214 )
3215
3216
3217 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3218 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3219
3220 sect(Pre-defined Identifiers)
3221 cindex(pre-defined identifiers)
3222 label(ident)
3223
3224 Various identifiers are defined in the initialization files to
3225 provide shorthands for some settings.  Most of them are in
3226 file(ly/declarations.ly).
3227
3228 description(
3229   dit(code(\break))keyindex(break) nl()
3230     Force a line break in music by using a large argument for the
3231     keyword code(\penalty).
3232
3233   dit(code(\center))keyindex(center) nl()
3234     Used for setting direction  properties.  bind(Equals)0.
3235
3236   dit(code(\down))keyindex(down) nl()
3237     Used for setting direction setting properties.  Is equal
3238     bind(to)-1.
3239
3240   dit(code(\free))keyindex(free) nl()
3241     Used for setting direction setting properties.  Is equal
3242     bind(to)0.
3243
3244   dit(code(\left))keyindex(left) nl()
3245     Used for setting text alignment property.  Is equal bind(to)-1.
3246
3247   dit(code(\nobreak))keyindex(nobreak) nl()
3248     Prevent a line break in music by using a large negative argument
3249     for the keyword code(\penalty).
3250
3251   dit(code(\none))keyindex(none) nl()
3252     Used for setting code(Score.beamslopedamping) and
3253     code(Score.beamquantisation) properties.  Is equal bind(to)0.
3254
3255   dit(code(\normal))keyindex(normal) nl()
3256     Used for setting code(Score.beamslopedamping) and
3257     code(Score.beamquantisation) properties.  Is equal bind(to)1.
3258
3259   dit(code(\normalkey))keyindex(normalkey) nl()
3260     Select normal key signatures where each octave has the same key
3261     signature.  This sets the code(Staff.keyoctaviation) property.
3262
3263   dit(code(\right))keyindex(right) nl()
3264     Used for setting text alignment property.  Is set bind(to)1.
3265
3266   dit(code(\shiftoff))keyindex(shiftoff) nl()
3267     Disable horizontal shifting of note heads that collide.  Sets the
3268     code(Voice.horizontalNoteShift) property.
3269
3270   dit(code(\shifton))keyindex(shifton) nl()
3271     Enable note heads that collide with other note heads to be
3272     shifted horiztonally.  Sets the code(Voice.horizontalNoteShift)
3273     property.
3274
3275   dit(code(\slurboth))keyindex(slurboth) nl()
3276     Allow slurs to be above or below notes.  This sets the
3277     code(Voice.slurVerticalDirection) property.
3278
3279   dit(code(\slurdown))keyindex(slurdown) nl()
3280     Force slurs to be below notes.  This sets the
3281     code(Voice.slurVerticalDirection) property.
3282
3283   dit(code(\slurup))keyindex(slurup) nl()
3284     Force slurs to be above notes.  This sets the
3285     code(Voice.slurVerticalDirection) property.
3286
3287   dit(code(\specialkey))keyindex(specialkey) nl()
3288     Allow key signatures do differ in different octaves.  This sets
3289     the code(Staff.keyoctaviation) property.
3290
3291   dit(code(\stemboth))keyindex(stemboth) nl()
3292     Allow stems, beams, and slurs to point either upwards or
3293     downwards, decided automatically by LilyPond.  This sets the
3294     code(Voice.verticalDirection) property.
3295
3296   dit(code(\stemdown))keyindex(stemdown) nl()
3297     Force stems, beams, and slurs to point down.  This sets the
3298     code(Voice.verticalDirection) property.
3299
3300   dit(code(\stemup))keyindex(stemup) nl()
3301     Force stems, beams and slurs to point up.  This sets the
3302     code(Voice.verticalDirection) property.
3303
3304   dit(code(\traditional))keyindex(traditional) nl()
3305     Used for setting the code(Score.beamquantisation) property.  Is
3306     equal bind(to)2.
3307
3308   dit(code(\up))keyindex(up) nl()
3309     Used for setting various direction properties.  Is equal
3310     bind(to)1.
3311 )
3312
3313
3314 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3315 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3316
3317 sect(Running LilyPond)
3318 cindex(running LilyPond)
3319
3320
3321 When invoked with a filename that has no extension, LilyPond will try
3322 adding `file(.ly)' as an extension first, then `file(.fly)' and
3323 finally `file(.sly)' extension.  If the filename ends with
3324 `file(.fly)', LilyPond processes the file as music using
3325 `file(init.fly)'.  In this case, LilyPond does something like:
3326
3327 quote(
3328 verb(\score {
3329   \notes\relative c {
3330     \input "yourfile.fly"
3331   }
3332   \paper{}
3333   \midi{}
3334 })
3335 )
3336 The result of `file(.sly)' is similar except that a single unjustified
3337 line is produced.
3338
3339 If you invoke LilyPond with a file `file(foo.)var(ext)' that doesn't
3340 have the `file(.ly)' extension, then LilyPond will look for a file
3341 called `file(init.)var(ext)' and process this file.  The file
3342 `file(init.)var(ext)' must contain the code(\maininput) keyword or
3343 LilyPond will not read the user specified file.
3344
3345 When LilyPond processes file(filename.ly) it will produce
3346 file(filename.tex) as output.  If file(filename.ly) contains a second
3347 code(\paper) keyword, then LilyPond will produce file(filename-1.tex)
3348 as well.  Subsequent code(\paper) keywords will produce sequentially
3349 numbered file names.  Several files can be specified; they will each
3350 be processed independently.footnote(Not entirely true: The status of
3351 GUILE is kept.)
3352
3353 whenlatex(latexcommand(\printindex))
3354
3355 COMMENT(End of reference-manual.yo)