]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/tex/reference-manual.yo
release: 1.1.65
[lilypond.git] / Documentation / tex / reference-manual.yo
1 mailto(gnu-music-discuss@gnu.org)
2 COMMENT(-*-text-*-)
3
4 redef(var)(1)(whenlatex(latexcommand({\normalfont\scshape )ARG1+latexcommand(}))\
5     whenhtml(sc(ARG1)))
6
7
8 redef(code)(1)(tt(ARG1))
9
10
11 COMMENT(
12
13   BUGS:
14
15    restStyle=mensural doesn't seem to work (lots of characters not found
16      for rests.fly)
17
18 TODO:
19    the explanation of how lyrics mode parses words seems ridiculous.  
20       Is there a simple way to explain this, or is the behavior
21       too complicated for a reasonable explanation?
22    accordion symbols
23 )
24
25
26 COMMENT( 
27 This document contains Mudela fragments.  You need at least
28 Yodl-1.30.18 to convert this to tex or html.
29 )
30
31 htmlbodyopt(bgcolor)(white)
32 htmlcommand(<font color=black>)
33
34 latexlayoutcmds(
35 \setlength{\topmargin}{-0.25in}
36 \setlength{\textheight}{9in}
37 \setlength{\textwidth}{5.875in} 
38 \setlength{\oddsidemargin}{0.25in}   
39 \setlength{\evensidemargin}{0.25in}
40 \input mudela-book
41 )
42
43 whentexinfo(notableofcontents())
44
45 article(Mudela 1.0.21 / LilyPond 1.1.49 Reference Manual)
46       (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen)
47       (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop())
48
49
50 latexcommand(\def\interexample{})
51 latexcommand(\def\preexample{\par})
52 latexcommand(\def\postexample{\par\medskip})
53 latexcommand(\def\file#1{{code(#1)}})
54 COMMENT(
55 latexcommand(\def\texttt#1{\tt #1})
56 latexcommand(\def\textbf#1{\bf #1})
57 )
58
59 COMMENT(urg, texinfo include breaks)
60 whenhtml(
61 includefile(html-disclaimer.yo-urg)
62 )
63
64
65 This document describes the the GNU LilyPond input format, which is a
66 language for defining music.  We call this language (rather
67 arrogantly) The Musical Definition Language or Mudela, for
68 short.footnote(If anybody comes up with a better name, we'd gladly
69 take this. Gourlay already uses Musical Description Language, G-Sharp
70 Score Definition Language.  ISO standard 10743 defines a Standard
71 Music Description Language.  We're not being original here.)
72
73 This document was revised for LilyPond 1.2. 
74
75 The first aim of Mudela is to define a piece of music, being complete
76 from both from a musical typesetting, as from a musical performing
77 point of view.
78
79 The Musical Definition Language (Mudela), has a logical structure,
80 making use of identifiers, that allows for flexible input, and
81 definition reuse. See the documentation file file(MANIFESTO), included
82 with the LilyPond sources for reasons and design considerations.
83
84
85 sect(Running LilyPond)
86
87
88 When invoked with a filename that has no extension, LilyPond will try
89 adding a file(.ly) extension first, then a file(.sly) and then a
90 file(.ly) extension second.  If the filename ends with file(.fly),
91 LilyPond processes the file as music using file(init.fly).  In this
92 case, LilyPond does something like: COMMENT(
93
94 )verb(\score {
95   \notes\relative c {
96     \input "yourfile.fly"
97   }
98   \paper{}
99   \midi{}
100 })
101 If you invoke LilyPond with a file file(foo.)var(ext) that doesn't
102 have the file(.ly) extension then LilyPond will look for a file called
103 file(init.)var(ext) and process this file.  The file
104 file(init.)var(ext) must contain the code(\maininput) keyword or LilyPond
105 will not read the user specified file.
106
107 When LilyPond processes file(filename.ly) it will produce
108 file(filename.tex) as output.  If file(filename.ly) contains a second
109 code(\paper) keyword, then LilyPond will produce file(filename-1.tex)
110 as well.  Subsequent code(\paper) keywords will produces sequentially
111 numbered file names.  Several files can be specified; they will each
112 be processed independently.footnote(Not entirely true: the status of
113 GUILE is kept).
114
115
116
117 sect(Syntax)
118
119
120
121 subsect(Basic Mudela)
122
123 Mudela is a declarative input format: in a file you can declare items
124 with identifiers, and instruct LilyPond to typeset music 
125
126
127 A Mudela file consists of keywords with arguments and identifier
128 assignments separated by spaces, tabs or newlines.  Semicolons are
129 used by some keywords and are inconsistently required in other
130 circumstances.  A one line comment is introduced by a code(%)
131 character.  Block comments are started by code(%{) and ended by
132 code(%}).  They cannot be nested.
133
134 Mudela supports several types:
135
136 description(
137
138 dit(integer) 
139 Formed from an optional minus sign followed by digits.  Arithmetic
140 operations cannot be done with integers, and integers cannot be mixed
141 with reals.
142
143 dit(real) 
144 Formed from an optional minus sign and a sequence of digits followed
145 by a emph(required) decimal point and an optional exponent such as
146 code(-1.2e3).  Reals can be built up using the usual operations:
147 code(+), code(-), code(*), and code(/), with parentheses for grouping.
148
149 dit(string) 
150 Begins and ends with the code(") character.  To include a code(")
151 character in a string write code(\").  Various other backslash
152 sequences have special interpretations as in the C language.  A string
153 that contains no spaces can be written without the quotes.  See
154 Section ref(modes) for details on unquoted strings; their
155 interpretation varies depending on the situation.  On the right side
156 of identifier assignments and within the code(\header) keyword,
157 strings can be concatenated using the code(+) character.
158
159 dit(dimension) Consists of a real followed by one of the dimension
160 keywords: code(\mm), code(\pt), code(\in), or code(\cm).  Dimensions
161 are converted immediately to a real which gives the dimension in
162 points, so they can be mixed with reals, but the result is no longer
163 of type dimension.  The keywords that require a dimension
164 (code(\shape)).
165
166 dit(pitch) 
167 A pitch is a string which is the name of a pitch.  Example: code(a).
168 The pitch names can be redefined with the code(\notenames) keyword.
169 See Section(notelang) for pitch names in different languages.  Pitches
170 can only be specified inside note mode which is specified with
171 code(\notes).  Therefore, keywords which require pitch arguments must
172 appear inside code(\notes).  
173
174 dit(music) 
175 Music is a compound type: arbitrarily complicated expressions with a
176 hierarchical structure can be formed from simple building blocks.  The
177 simplest expression of type music is a single note.  A note is formed
178 from a pitch and an optional duration and must be specified within
179 code(\notes).  See Section ref(notedesc) for details.  More
180 complicated expressions of type music are formed by surrounding a
181 sequence of expressions of type music with braces code({) and code(})
182 or with angle brackets code(<) and code(>).  Items appearing in braces
183 will be treated as serial. Items in angle brackets will be
184 simultaneous.  So for example code({ c e g }) represents an arpeggio
185 and code(< c e g >) represents a chord.  These items can be nested any
186 way you like.  This simple example shows how three chords can be
187 expressed in two different ways:
188 mudela(fragment,verbatim,center)(
189 \notes{
190   c
191   <a c' e'> <b  d' f'> <c' e' g'>
192   <{a b  c'}{c' d' e'}{e' f' g'}>
193 })
194
195 )
196
197
198
199 subsect(Identifiers)
200
201 Identifiers allow names to be assigned to constants, music, or other
202 Mudela structures.  To assign an identifier you use
203 var(name)=var(value) and to refer to an identifier, you preceed its
204 name with a backslash: code(\)var(name).  It is legal to redefine an
205 identifier in terms of its old value: code(foo = \foo * 2.0).
206 Identifier assignments must appear at the top level in the Mudela
207 file.  Note that semicolons are forbidden after assignments appearing
208 at the top level but they are obligatory after assignments appearing
209 elsewhere.  (Semicolons are also forbidden after code(\property) assignments.)
210
211 An identifier can be created with any string for its name, but you
212 will only be able to refer to identifiers whose names begin with a
213 letter and are entirely alphanumeric.  It is also impossible to refer
214 to an identifier whose name is the same as the name of a keyword.  The
215 following words are keywords:
216 verb(accepts         duration      midi          relative      textscript 
217 alternative     font          mm            remove        time       
218 bar                   musicalpitch  repeat        times      
219 cadenza         header        name          scm           translator 
220 chordmodifiers  in            notenames     scmfile       transpose  
221 chords          include       notes         score         type       
222 clef            key           paper         script        version
223 cm              keysignature  partial       shape      
224 consists        lyrics        penalty       skip       
225 consistsend     maininput     property      spanrequest
226 context         mark          pt            tempo)
227
228 The right hand side of an identifier assignment is parsed completely
229 when the assignment is made.  It therefore must have any context
230 specified in the definition.  For example, you must write
231 code(foo=\notes{a8 b c}) rather than code(foo={a8 b c}).  Even though
232 the context is specified in the definition, you must refer to the
233 identifier inside the correct context:
234 verb(foo = \paper{ linewidth = 6.0\in; }
235 \score{
236   \notes{ ... }
237   \paper{ \foo }
238 })
239 If code(\foo) is used here without the surrounding code(\paper) then
240 an error will result.  Note however that the following is acceptible
241 verb(foo = \notes { ... }
242 \score{ \foo })  
243 It is not necessary to specify code(\notes).
244
245 Identifiers can be set equal to integers, reals, strings, music,
246 durations (specified with code(\duration)), note ornaments (specified
247 with code(\script), dynamics commands, or code(:)), note name tables
248 (specified with code(\notenames), translator definitions, the
249 code(\paper) block, the code(\midi) block or the code(\score) block.
250 When identifiers are used for translators, the code(\paper),
251 code(\midi), and code(\score) blocks, they may only be referred to as
252 the first item in a block.  So code(\paper{\one \two}) is illegal
253 because the identifier code(\two) is not the first thing in the block.
254 Unlike other identifier definitions, translator identifier definitions
255 can only appear within code(\midi) or code(\paper) blocks.  See
256 Section ref(translators) for more information.
257
258
259
260 subsect(Modes)
261 label(modes)
262
263 To simplify different aspects of music definition (entering the notes
264 and manipulating them) Mudela has three different input modes which
265 affect how unquoted strings are interpreted.
266 In each mode, words are identified on the input.  If code("word") is
267 encountered, it is treated as a string.  If code(\word) is
268 encountered it is treated as a keyword or as an identifier.  The
269 behavior of the modes differs in two ways: different modes treat
270 unquoted words different, and different modes have different rules for
271 deciding what is a word.  
272
273 description(
274
275 dit(Normal mode)
276 At the start of parsing, Mudela is in normal mode.
277 In normal mode, a word is an alphabetic character followed by
278 alphanumeric characters.  If code(word) is encountered on the input it
279 is treated as a string. 
280
281 dit(Note mode) Note mode is introduced by the keyword
282 code(\notes).  In Note mode, words can only contain alphabetic
283 characters.  If code(word) is encountered, LilyPond first checks for a
284 notename of code(word).  If no notename is found, then code(word) is
285 treated as a string.  If you mistype a notename, the parser will most
286 likely complain that you should be in code(\lyrics) mode to do lyrics. 
287
288 Since the dot has special meaning in  Note  mode, it is not possible
289 to enter real numbers in this mode.
290
291 dit(Chord mode) Chord mode is introduced by the keyword code(\chords).
292 Very similar to Note mode.  
293 COMMENT(I'm not sure how it differs)
294
295 dit(Lyric mode) Lyrics mode is introduced by the keyword
296 code(\lyrics).  This mode is has rules that make it easy to include
297 punctuation and diacritical marks in words.  A word in Lyrics mode
298 begins with: an alphabetic character, code(_),
299 code(?), code(!), code(:), code('), 
300 the control characters code(^A) through code(^F), code(^Q) through
301 code(^W), code(^Y), code(^^), any 8-bit character with ASCII code over
302 127, or a two character combination of a backslash followed by one
303 of code(`), code('), code(") or code(^).  
304 Subsequent characters of a word can be any character that is not a
305 digit and not white space.  One important consequence of this is that
306 a word can end with code(}), which may be confusing if you thought the
307 code(}) was going to terminate lyrics mode.  Any code(_) characters
308 which appear in an unquoted word are converted to spaces, providing a
309 mechanism for introducing spaces into words without using quotes.  
310 Quoted words can also be used in lyrics mode to specify words that
311 cannot be specified with the above rules.  Here are some examples.
312 Not all of these words are printable by TeX().  
313 verb(a&@&@&TSI|{[    % a word
314 \'afoo}         % a word
315 1THtrhortho     % not a word because it starts with a digit
316 ``Hello''       % not a word because it starts with `
317 Leise DOEXPAND(Fl\)DOEXPAND("u\)ss{}teren meine Sapfe       % 4 words
318 _ _ _ _         % 4 words, each one a space
319 ))
320
321 It is possible to create words that break the rules by prefixing them with the
322 dollar sign code($).  Regardless of the context, a word beginning with code($)
323 extends until the next white space character.  Such words can contain numbers
324 (even in Note mode), or other forbidden characters.  The dollar sign can be
325 used to create and access identifiers that could not otherwise be used.  
326
327 These modes are of a lexical nature. Normal and Note mode largely
328 resemble each other, save the possibility of entering Reals, 
329 the meaning of code(_) and the resolution of words.  
330
331 What's this about reals?  When can you enter them or not enter them?)
332
333
334 sect(Note Description)
335 label(notedesc)
336
337 subsect(Basic Note Specification)
338
339 A note specification has the form 
340 var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)].
341 The pitch of the note is specified by the note's name.  
342
343 LilyPond has predefined note names for various languages.  The default
344 names are the Dutch note names.  The notes are specified by the
345 letters code(c) through code(b), where code(c) is an octave below
346 middle C and the letters span the ocatave above that C.  
347 In Dutch, a sharp is formed by adding
348 code(-is) to the end of a pitch name.  A flat is formed by adding code(-es).
349 Double sharps and double flats are obtained by adding code(-isis) or
350 code(-eses).  
351 Lily has predefined sets of notenames
352 for various nop(languages).  See Section ref(notelang) for details.
353 Rests are specified with the note name code(r) or code(R).  
354 There is also a note name code(s) which produces a nonprinting note of the
355 specified duration.
356
357 The optional octave specification takes the form of a series of single
358 quote 
359 code(') characters or a series of comma code(,) characters.  Each
360 code(') raises the pitch by one octave; each code(,) lowers the pitch
361 by an octave.  
362
363 mudela(fragment,verbatim,center)(
364 c' d' e' f' g' a' b' c''
365 )
366
367 mudela(fragment,verbatim,center)(
368 cis' dis' eis' fis' gis' ais' bis'
369 )
370
371 mudela(fragment,verbatim,center)(
372 ces' des' es' fes' ges' as' bes'
373 )
374
375 mudela(fragment,verbatim,center)(
376 cisis' eisis' gisis' aisis' beses'
377 )
378
379 mudela(fragment,verbatim,center)(
380 ceses' eses' geses' ases' beses'
381 )
382
383 Whenever a C-sharp is desired,  you must specify a C-sharp.  LilyPond
384 will determine what accidentals to  typeset  depending on the  key and
385 context.   
386 A reminder accidental can be forced by
387 using the  optional exclamation mark `code(!)'
388 on the pitch.
389 A cautionary accidental, i.e., an accidental within paranthesis
390 can be obtained using the optional question mark `code(?)' on the pitch.
391 mudela(fragment,verbatim,center)(
392 cis' d' e' cis'  c'? d' e' c'!  
393 )
394
395
396 Durations are entered as their reciprocal values
397 mudela(fragment,verbatim,center)(
398 a'1 a'2 a'4 a a'8 a a'16 a'32 a'64
399 )
400 mudela(fragment,verbatim,center)(
401 r1 r2 r4 r8 r16 r32
402 )
403
404 If the duration is omitted then it is set equal to the previous
405 duration.  If there is no previous duration, then a quarter note is
406 assumed.  
407 The duration can be followed by a dot code(.) to obtain dotted note
408 lengths.  
409 mudela(fragment,verbatim,center)(
410 a'4. b'4.
411 )
412
413 Extra long notes can be obtained using the code(\breve) and
414 code(longa) durations:
415 mudela(fragment,verbatim,center)(
416 c'\breve gis'\longa
417 )
418
419 You can alter the length of duration by writing code(*)var(fraction) after a
420 it.  This shorthand is convenient for long rests.   The shape of notes
421 and normal restse will be unchanged.  When used in this whole-measure
422 rest code(R) will fill measures with rest symbols.  
423 COMMENT(
424
425 )mudela(fragment,verbatim,center)(
426 r1 r1*3 R1*3
427 )
428 If you set the code(Score.skipBars) property, then only one measure will be
429 printed; with code(R), a number indicating the length of the rest will be
430 displayed.  
431 mudela(fragment,verbatim,center)(
432 \property Score.skipBars=1
433 r1 r1*3 R1*3
434 )
435
436
437 In order to get triplets and other tuplets, you must use the
438 code(\times) keyword which multiplies the duration by a fraction.  The
439 syntax is code(\times) var(fraction) var(music).  The length of all of
440 the specified music will be multiplied by the fraction and the
441 fraction's denominator will be printed over the notes.  The most
442 common tuplet is the triplet in which 3 notes have the length of 2, so
443 the notes are 2/3 their written length:
444 mudela(fragment,verbatim,center)( b'4 \times 2/3 {c'4 c' c'} d'4 d'4 )
445 If you try to use code(\times) as the first thing in your music, you
446 may encounter the warning ``No one to print a tuplet start bracket''.
447 This happens because the Tuplet-engraver is in Voice and no Voice has
448 been created yet.  You must explicitly specify the Voice context in
449 this situation 
450 mudela(fragment,verbatim,center)( 
451 \context Voice { \times 2/3 {c'4 d' e'}
452          % [..]
453 }
454 )
455
456
457 subsect(Automatic Beam Generation)
458 label(autobeam)
459
460 By default, Lilypond will generate beams automatically.  This feature can be
461 disabled by setting the code(Voice.beamAuto) property to 0.  It can be
462 overridden for specific cases by specifying explicit beams as
463 described in Section ref(manualbeam).  
464
465 In order to decide how to generate beams, Lilypond uses a large number
466 of Voice properties, whose default values appear in
467 file(auto-beam-settings.ly).  In general, beams can begin anywhere,
468 but their ending location is significant.  Beams can end on a beat, or
469 at durations specified by the code(Voice.beamAutoEnd) property.  To
470 end beams every quarter note, for example, you could use set
471 code(Voice.beamAutoEnd) equal to code("1/4").  To end beams every
472 three eighth notes you would set it to code("3/8").  The same syntax
473 can be used to specify beam starting points using code(Voice.beamAutoBegin).
474
475 To allow different settings for different time signatures, these
476 property names can start with code(time)var(N)code(_)var(M) to
477 restrict the definition to var(N)code(/)code(M) time.  So for example,
478 to specify beams ending only for 6/8 time you would use the property
479 code(Voice.time6_8beamAutoEnd).  To allow different endings for notes
480 of different durations, the duration can be tacked onto the end of the
481 property.  To specify beam endings for beams that contain 32nd notes,
482 you would use code(Voice.beamAutoEnd_32).
483
484
485 subsect(Note Spanners: Beams, Slurs and Ties)
486 label(manualbeam)
487
488 A beam is specified by surrounding the beamed notes with brackets
489 code([) and code(]).  
490 mudela(fragment,verbatim,center)(
491 [a'8 a'] [a'16 a' a' a'] 
492 )
493 Some more elaborate constructions:
494 mudela(fragment,verbatim,center)(
495 [a'16 <a' c''> c'' <a' c''>]
496 \times 2/3 { [e'8 f' g'] }
497 )
498
499 Another type of spanner is the slur.  Slurs connects chords and try to
500 avoid crossing stems.  A slur is started with code(CHAR(40)) and stopped with
501 code(CHAR(41)).  The starting code(CHAR(40)) appears to the right of the first note
502 in the slur.  The terminal code(CHAR(41)) apppears to the left of the first
503 note in the slur.  This makes it possible to put a note in slurs from
504 both sides:
505 mudela(fragment,verbatim,center)(
506 f'()g'()a' [a'8 b'(] a'4 g' )f'
507 )
508
509 A tie connects two adjacent note heads of the same pitch.  
510 When used with chords, it
511 connects all of the note heads whose pitches match.  
512 Ties are indicated using the tilde symbol
513 code(~) by analogy with TeX()'s tie which connects words.  
514 Note that if you try to tie together chords which have no common
515 pitches, then a warning message will appear and no tie will be created.
516
517
518 mudela(fragment,verbatim,center)(
519 e' ~ e' <c' e' g'> ~ <c' e' g'>
520 )
521
522 It is possible to create beams and slurs that cross staffs by switching the
523 context:
524 mudela(fragment,verbatim,center)(
525 \context PianoStaff <
526 \context Staff=one \notes\relative c'{
527   \stemup
528   [c8 c \translator Staff=two \stemup c c]
529   \translator Staff=one
530   d4( \translator Staff=two )a4
531   }
532 \context Staff=two \notes{ \clef bass; s1}
533 >
534 )
535
536
537
538 subsect(Note Ornaments)
539
540 A variety of symbols can appear above and below notes to indicate
541 different characteristics of the performance.  These symbols can be
542 added to a note with `var(note)code(-\)var(name)'.  Numerous symbols
543 are defined in file(script.ly) and file(script.scm).  Symbols can be
544 forced to appear above the note by writing
545 `var(note)code(^\)var(name)', and they can be forced to appear below
546 by writing `var(note)code(_\)var(name)'.  Here is a chart showing
547 symbols above notes, with the name of the corresponding symbol
548 appearing underneath.
549
550 mudela()(
551 \score{
552  < \notes{ c''-\accent c''-\marcato c''-\staccatissimo f'-\fermata 
553           c''-\stopped c''-\staccato c''-\tenuto c''-\upbow c''-\downbow
554           c''-\lheel c''-\rheel  c''-\ltoe  c''-\rtoe  c''-\turn
555           c''-\open  c''-\flageolet  c''-\reverseturn 
556           c''-\trill
557           c''-\prall c''-\mordent c''-\prallprall  c''-\prallmordent
558           c''-\upprall c''-\downprall c''-\thumb c''-\segno c''-\coda}
559   \context Lyrics \lyrics{  
560         accent__ marcato__ staccatissimo__ fermata stopped__
561         staccato__ tenuto__ upbow downbow__ lheel__ rheel__ ltoe
562         rtoe__ turn__ open__ flageolet reverseturn__ trill__ prall__
563         mordent prallprall__ prallmordent__ uprall__ downprall thumb 
564         segno coda }
565   >
566   \paper{ linewidth = 5.875\in;          
567           indent = 0.0;        }
568  }
569 )
570
571 In addition, it is possible to place arbitrary strings of text or
572 TeX() above or below notes by using a string instead of an identifier:
573 `code(c^"text")'.  Fingerings can be placed by simply using digits.
574 All of these note ornaments appear in the printed output but have no
575 effect on the MIDI rendering of the music.
576
577 To save typing, fingering instructions (digits 0 to 9 are supported)
578 and a few common symbols can be abbreviated with single characters:
579 COMMENT(
580
581 )mudela()(
582 \score{ \notes {
583         \property Voice.textStyle = typewriter
584         c''4-._"c-." s4
585         c''4--_"c-{}-"  s4
586         c''4-+_"c-+" s4
587         c''4-|_"c-|" s4
588         c''4->_"c->"  s4
589         c''4-^_"c-\\^{ }"  s4
590         c''4-1
591         c''4-2  
592         c''4-3
593         c''4-4  
594         }
595 %        \paper { linewidth = 12.\cm; }
596 })
597
598 Dynamic marks are specified by using an identifier after a note without a dash:
599 code(c4 \ff).  Note that this syntax is inconsistent with the syntax for other
600 types of ornaments.  The available dynamic marks are: code(\pppppp),
601 code(\ppppp), code(\pppp), code(\ppp), code(\pp), code(\p), code(\mp),
602 code(\mf), code(\f), code(\ff), code(\fff), code(\ffff), code(\fffff),
603 code(\ffffff), code(\fp), code(\sf), code(\sff), code(\sp), code(\spp),
604 code(\sfz) and code(\rfz).
605
606 A crescendo mark is started with code(\cr) and terminated with
607 code(\rc).  A decrescendo mark is started with code(\decr) and
608 terminated with code(\rced).  There are also shorthands for these
609 marks.  A crescendo can be started with code(\<) and a decrescendo can
610 be started with code(\>).  Either one can be terminated with code(\!).
611 Note that code(\!) must go before the last note of the dynamic mark whereas
612 code(\rc) and code(\rced) go after the last note.  Because these marks are
613 bound to notes, if you want to get several marks during one note, you must use
614 spacer notes. 
615 COMMENT(Broken
616 m udela(fragment,verbatim,center)(
617 c'' \< \! c''   d'' \decr e'' \rced 
618 < f''1 {s4 \< \! s4 \> \! s2 } >)
619 )
620
621 Tremolo marks can be printed by a note by adding code(:)[var(length)]
622 after the note.  The length must be at least 8.  A var(length) value
623 of 8 gives one line across the note stem.  
624 If the length is omitted,
625 then the last value is used, or the value of the code(Abbrev)
626 property if there was no last value.  
627
628 mudela(fragment,verbatim,center)(
629 c'2:8 c':32 c'
630 ))
631
632
633 sect(Other Ways to Enter Pitches)
634
635 subsect(Pitch Names in Other Languages)
636 label(notelang)
637
638 The pitch names can be easily redefined using the code(\notenames) command.
639 Note name definitions have been provided in various languages.  
640 Simply include the language specific init file.  For example:
641 code(\include "english.ly").  The available language files and the names
642 they define are:
643
644 verb(                        Note Names               sharp       flat
645 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
646 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
647 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
648 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
649 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
650 italiano.ly    do  re  mi  fa  sol la  sid si  -d          -b
651 catalan.ly     do  re  mi  fa  sol la  sid si  -d/-s       -b)
652
653 subsect(Relative Pitch Specification)
654 label(relative)
655
656 One very common error when entering music is to place notes in the wrong
657 octave.  One way to avoid being confused by large numbers of octave changing
658 marks is to use
659 the code(\relative) keyword. 
660 Music which appears within code(\relative) is
661 interpreted differently.  The octave of a note is determined by making it as
662 close to the previous note as possible.  The octave changing marks code(') and
663 code(,) can then be added to raise or lower this note by octaves.  You have to
664 specify a starting pitch because the first note of a list has no predecessor.  
665
666 mudela(fragment,verbatim,center)(
667 \relative c'' { c d b c, d b c' d 
668                 b c,, d b }
669 )
670
671 When the preceding item is a chord, the first note of the chord is used to
672 determine the first note of the next chord.  But other notes within the second
673 chord are determined by looking at the immediately preceding note.  
674
675 mudela(fragment,verbatim,center)(
676 \relative c' { c <c e g> 
677     <c' e g> <c, e' g> }
678
679
680 The pitch after the code(\relative) is a notename. To parse the pitch
681 as a notename, you have to be in note mode, so there must be a
682 surrounding code(\notes) keyword (which is not shown here).  Also
683 note that if the music passed to a code(\relative) keyword contains a
684 code(\transpose) keyword, the tranposed music will not be processed in
685 relative mode.  An additional code(\relative) must be placed inside
686 the code(\transpose).  If code(\relative) will be used several times,
687 or if it will be used in the same music with code(\transpose), then
688 you may get bizarre effects.  This can be fixed by using an explicit
689 code(Staff) context.
690
691
692 subsect(Tranposition of Pitches)
693 label(transpose)
694
695 Another way to modify the meaning of the note names is to use the
696 code(\transpose) keyword.  This keyword allows you to transpose music.
697 To use transposition, specify the pitch that middle C should be tranposed to.
698 It is important to distinguish between enharmonic pitches as they can produce
699 different transpositions.  To transpose up half a step, for example, either 
700 code(\transpose cis') or code(\transpose des') will work.  But the first
701 version will print sharps and the second version will print flats.  
702 In this example, a scale in the key of E is transposed to F, or to E-sharp 
703 with odd results.
704 mudela(fragment,verbatim,center)(
705 \relative c' { \key e; 
706   e fis gis a b cis dis e }
707 )
708 mudela(fragment,verbatim,center)(
709 \transpose des' \relative c' { \key e; 
710    e fis gis a b cis dis e }
711 )
712 mudela(fragment,verbatim,center)(
713 \transpose cis' \relative c' { \key e; 
714     e fis gis a b cis dis e }
715 )
716 If you want to use both code(\transpose) and code(\relative), then you must use
717 code(\transpose) first.  Any code(\relative) keywords that are outside the 
718 code(\transpose) have no effect on notes that appear inside the
719 code(\transpose).  As with code(\relative), using code(\transpose)
720 repeatedly can cause bizarre effects.  An explicit code(Staff) context
721 will eliminate the problems.  
722
723 sect(Chords)
724
725 Chords can be entered either by name or by listing the notes in angle brackets.
726 Chords can be displayed either as notes or by name.  To enter chords by name,
727 place them inside the code(\chords) keyword.
728 Chord names have the form
729 var(tonic)[var(duration)][code(-)var(modifier)][code(^)var(subtractions)][code(/)var(inversion)]
730 The var(tonic) should be the tonic note of the chord, and the var(duration) is
731 the chord duration in the usual notation.  There are two kinds of modifiers.
732 One type is chord additions, which are obtained by listing intervals separated
733 by dots.  An interval is written by its number with an optional code(+) or
734 code(-) to indicate raising or lowering by half a step.  A chord additions has
735 two effects:  it adds the specified interval and all lower odd numbered
736 intervals to the chord, and it may lower or raise the specified interval.
737 Intervals must be separated by a dot (code(.)).
738 Repeating a code(-) character will remove a half step from the preceding
739 interval.  
740 mudela(fragment,verbatim,center)(
741 \transpose c''{ 
742 \chords{
743   c1 c-3- c-7 c-8 c-9  
744   c-9-.5+.7+ c-3-.5- c-4.6.8
745 }}) 
746 The second type of modifier that may appear after the code(-) is 
747 a named modifier. 
748 Named modifiers are listed in the file file(chord-modifiers.ly).  The
749 available modifiers are code(m) and code(min) which lower
750 the 3rd half a step, code(aug) which raises the 5th, code(dim) which lowers
751 the 5th, code(maj) which adds a raised 7th, and code(sus) which replaces the
752 5th with a 4th.  
753 mudela(fragment,verbatim,center)(
754 \transpose c''{ 
755 \chords{
756   c1-m c-min c-maj c-aug c-dim c-sus
757 }}) 
758
759 Chord subtractions are used to eliminate notes from a chord.  The notes to be
760 subtracted are listed after a code(^) character, separated by dots.  
761 mudela(fragment,verbatim,center)(
762 \transpose c''{ 
763 \chords{
764   c1^3 c-7^5.3 c-8^7
765 }}) 
766
767 Chord inversions can be specified by appending code(/) and the name of a
768 single note to a chord.  This has the effect of lowering the specified note by
769 an octave so it becomes the lowest note in the chord.  If the
770 specified note is not in the chord then a warning will be printed.  
771 mudela(fragment,verbatim,center)(
772 \transpose c'''{ 
773   \chords { c1 c/e c/g c-7/e }
774 }) 
775 Throughout these examples, chords have been shifted around the staff
776 using code(\transpose).  The code(\relative) keyword has odd effects
777 when combined with named chords.  
778
779 For displaying printed chord names, use the code(ChordNames) context.  
780 The chords may be entered either using the notation described above,
781 or directly using angle brackets. 
782 mudela(fragment,verbatim)(
783 <
784   \context ChordNames { \chords{ a b c} \notes{ < d f g >  < e g b > } }
785   \context Staff \notes{ a b c' d' e' }
786 >
787 )
788 Lilypond examines chords specified as lists of notes to determine a
789 name to give the chord.  By default, LilyPond will not try to identify
790 chord inversions:
791 mudela(fragment,verbatim,center)(
792 <
793   \context ChordNames { 
794      \notes{ < e' g' c'' > } }
795   \context Staff \notes{ c' } 
796 >)
797 If you want inversions to be recognized, you must set the property
798 code(Score.chordInversion): 
799 mudela(fragment,verbatim,center)(
800 <
801   \property Score.chordInversion = 1
802   \context ChordNames { 
803        \notes{ < e' g' c'' > } }
804   \context Staff \notes{ c' } 
805 >)
806
807
808
809 sect(Lyrics)
810
811 Lyrics are entered like notes, with pitches replaced
812 by text.  For example code(Twin-4 kle4 twin-4 kle4) enters four
813 syllables, each with quarter note duration.  Note that the hyphen has
814 no special meaning for lyrics, and does not introduce special symbols.
815 See Section ref(modes) for a description of what is interpreted as a lyric.
816
817 In order to instruct LilyPond to write lyrics underneath the
818 staff, you must enter the lyrics context with code(\context Lyrics).  
819 Lyrics should be entered in lyrics mode which is entered with code(\lyrics).
820
821 Spaces can be introduced into a lyric either by using quotes (code("))
822 or by using an underscore without quotes: code(He_could4 not4).  All
823 unquoted underscores are converted to spaces.  Here is a full example: 
824 mudela(verbatim)(\score{
825   <  \notes \transpose c'' {c d e c | c d e c | e f g'2 | 
826                               e'4 f g'2 \bar "|."; }
827      \context Lyrics \lyrics { 
828               Fre-4 re Ja- que Frere- re Ja- que
829               Dor- mez vous?2 Dor-4 mez vous?2  }
830   >
831 })
832
833
834 When one word is attached to many notes, you may 
835 want a  continuous line after the lyric to show  this.   To achieve
836 this effect, add a code(__) lyric as a separate word 
837 after the lyric to be extended.  
838 This will create
839 an extender, a line  that extends over the entire duration of 
840 the lyric.  This line will run all the way to the start of the next
841 lyric, so you may want to shorten it by using a blank lyric.  
842 mudela(verbatim)(\score{
843 < \notes \relative c''{ 
844      a4()b()c()d c()d()b()a c()d()b()a }
845    \context Lyrics \lyrics {
846      foo1 __  bar2. __ _4 baz1 __ }
847 > })
848      
849 If you want to have hyphens centered between syllables (rather than attached
850 to the end of the first syllable) you can use the special code(--) lyric as
851 separate word between syllables. This will result in a hyphen whose length
852 varies depending on the space between syllables, and centered between the
853 syllables. For example: 
854 mudela(verbatim)(\score{
855   <  \notes \transpose c'' {c d e c | c d e c | e f g'2 | 
856                               e'4 f g'2 \bar "|."; }
857      \context Lyrics \lyrics { 
858               Fre4 -- re Ja -- que Fre -- re Ja -- que
859               Dor -- mez vous?2 Dor4 -- mez vous?2  }
860   >
861 })
862 COMMENT(should use dutch lyrics.  No accent hassles.)
863  
864 sect(Automatic lyric durations)
865
866 Often, lyrics are accompanied by a melody, and the rhythm of the
867 melody is the same as the rhythm of the text.  In this case, you can
868 overlay the durations of the notes on the text, using code(\addlyrics)
869 COMMENT(
870
871 )mudela(verbatim,fragment)(
872         \addlyrics
873                 \transpose c'' { c4 d8. e16 f2 }
874                 \context Lyrics \lyrics { do4 re mi fa }
875 )
876
877 You should use a single rhythm melody, and single rhythm lyrics (a
878 constant duration is the obvious choice).  If you do not, you will get
879 undesired effects when using multiple stanzas: COMMENT(
880
881 )mudela(verbatim,fragment)(
882         \addlyrics
883                 \transpose c'' { c4 d8. e16 f2 }
884                 \context Lyrics \lyrics < { do4 re mi fa }
885                                           { do8 re mi fa } >
886 )
887
888
889
890 sect(Time)  
891
892 LilyPond aligns all musical objects according to the amount of time
893 they occupy.  All musical objects have a duration.  When music is
894 written sequentially using braces the duration is the sum of the 
895 durations of the elements.  When music is stacked into simultaneous music 
896 using angle
897 brackets, the duration is the maximum of the durations of the
898 elements.  
899
900 Because LilyPond knows the durations of all musical elements, the time
901 signature enables LilyPond to draw bar lines automatically.  The time
902 signature is specified with the code(\time) keyword: code(\time 3/4).
903 If no time signature is given, LilyPond assumes 4/4.  The automatic
904 generation of bar lines can toggled with the code(\cadenza) keyword or the
905 code(Staff.barNonAuto) property,
906 and an incomplete measure at the start of the music can be created
907 using the code(\partial) keyword: code(\partial 8*2;) creates a
908 starting measure lasting two eighth notes.
909
910 In order to help with error checking, you can insert bar markers in
911 your music by typing code(|).  Whenever LilyPond encounters a code(|)
912 that doesn't fall at a measure boundary, she prints a warning message.
913 The beginning of the measure will also be relocated, so you can also
914 use this to shorten measures. 
915
916 COMMENT(
917 sect(Composition: forming bigger structures)
918 label(sec:grammar)
919
920 The computer savy user may be interested in a more formal
921 specification.  We can capture what have learned about forming
922 sentences in Mudela in a context-free grammar.
923
924 latexcommand(\smallskip)
925
926 table(2)(lll)(
927         row(cell(em(Music))cell(: em(Note)))
928         row(cell()cell(code(|) em(Rest)))
929         row(cell()cell(code(|) code({) em(MusicList) code(})))
930         row(cell()cell(code(|) code(<) em(MusicList) code(>)))
931         row(cell()cell(code(|) em(Command)))
932         row(cell()cell(code(|) code(\context) em(string) code(=) em(string)  em(Music)))
933         row(cell()cell(;))
934         row(cell(em(MusicList))cell(: em(empty)))
935         row(cell()cell(code(|)  em(MusicList)  em(Music)))
936         row(cell()cell(;))
937 )
938
939 latexcommand(\smallskip)
940
941 In mathematics you can form expressions by combining expressions,
942 which are ultimately some kind of atom or terminal symbol.  The same
943 goes for Mudela: there are some basic building blocks, and by
944 combining those you create complex music.
945
946 You can combine music in three ways:
947 itemize(
948 it()If you enclose a sequence of music-elements in braces ( code({)
949     and code(}) ), then you form another kind of music called
950 sequential music
951     with those pieces.
952   The duration of sequential composition is the sum of the durations of its elements
953   verb(
954       { c c g g a a g2 }      % twinkle twinkle
955       { { c c g g} { a a g2 } }
956   )
957 it()You can stack music by enclosing a sequence of music elements
958     with code(<) and code(>). This is called simultaneous music.  
959     The duration of a simultaneous composition is the maximum of the durations 
960     of its elements Example:
961     verb(
962         <a4 {cis8 cis8} e'4>      % a-major chord
963     )
964 it()You can form music by transposing music:
965     verb(
966     \transpose  
967         d       % from c to the d that's almost one octave down
968                 { e4 f4 }       % the horizontal music
969 )
970 it()verb(\context)
971 it()verb(\property)
972 it()verb(\translator)
973 it()verb(\relative)
974 )
975
976 Of course you can also combine these three mechanisms.
977 verb(
978 { c <c e> <c e g> <c e g \transpose d' dis > }  % 4 increasing chords
979 )
980
981 END OF COMMENT  )
982
983 sect(Repeats)
984
985 In order to specify repeats, use the code(\repeat) keyword.  Since
986 repeats look differently when played and when printed, there are a few
987 different variants of repeats.
988
989 description(
990 dit(unfolded) repeated music is fully written (played) out.  Useful
991 for  MIDI output.
992 dit(semi)  "semifolded". This is the normal notation: repeats are not
993 written out, but alternative endings (voltas), are printed, one after
994 the other.
995 dit(folded) alternative endings are written stacked, which is useful
996 for lyrics.
997 )  
998
999 The syntax for repeats is code(\repeat )var(variant)var(
1000 repeatcount)\var(repeatbody).  If you have alternative endings, you
1001 may add code(\alternative {)var(alternative1) var(alternative2)
1002 var(alternative3) .. code(}), where each var(alternative) is of type Music.
1003
1004 Notation semifolded repeats are used like this:
1005 mudela(fragment,verbatim,center)(
1006 c'1
1007 \repeat semi 2 { c'4 d' e' f' }
1008 \repeat semi 2 { f' e' d' c' })
1009
1010 With alternative endings:
1011 mudela(fragment,verbatim,center)(
1012 c'1
1013 \repeat semi 2 {c'4 d' e' f'} 
1014 \alternative { {d'2 d'} {f' f} })
1015
1016 Folded repeats look like this:footnote(Folded repeats offer little
1017 more over simultaneous music.  However, it is to be expected that more
1018 functionality --especially for the MIDI backend-- will be implemented) 
1019
1020
1021 mudela(fragment,verbatim,center)(
1022 c'1
1023 \repeat fold 2 {c'4 d' e' f'} 
1024 \alternative { {d'2 d'} {f' f} })
1025
1026 mudela(fragment,verbatim)(
1027 \context Staff { \relative c'{
1028   \partial 4; \repeat semi 2 {  e | c2 d2 | e2 f2 | }
1029   \alternative { { g4 g g } {  \partial 4; a a a a  b1 } }
1030 }})
1031 Repeats can be unfolded by setting the property code(Staff.unfoldRepeats).
1032
1033 If you don't give enough alternatives for all of the repeats, then the
1034 first alternative is assumed to be repeated enough to equal to
1035 specified number of repeats.  
1036 mudela(fragment,verbatim)(
1037 \context Staff { \relative c'{
1038   \repeat semi 3 { \partial 4; e | c2 d2 | e2 f2 | }
1039   \alternative { { g4 g g } {\partial 1; e4 e e } 
1040                  {\partial 1; a a a a | b1 } }
1041 }})
1042
1043 note: The syntax of repeats is not entirely crystallised. You can expect
1044 more variants,  better MIDI integration, better time handling.
1045
1046
1047
1048
1049 sect(Ambiguities)
1050
1051 The grammar contains a number of ambiguities.  We hope to resolve most
1052 of them at a later time. 
1053
1054 itemize(
1055 it()
1056 The assignment
1057 verb(
1058 foo = bar)
1059 COMMENT(
1060
1061 )Can be interpreted as making a string identifier code(\foo) containing
1062 code("foo"), or a music identifier containing the lyric lyric `foo'.
1063
1064 Since this assignment is possible at top-level and within paper, these
1065 are two conflicts.
1066 it()The assignment
1067 verb( foo = -6
1068 )Can be interpreted as making a int identifier containing -6, or a
1069 request identifier containing the fingering `6' (with neutral direction).
1070
1071 Since this assignment is possible at top-level and within paper, these
1072 are two conflicts.
1073 it() A chord followed by
1074 code(-3)
1075 can be interpreted as a chord substraction, or as the fingering  `2' (with
1076 neutral direction)
1077 it() Similarly code(^2) is a conflict.
1078  chord_addition '^' ->? 
1079 it()
1080 If you do a nested repeat,
1081 verb (
1082 \repeat ...
1083   \repeat ..
1084   \alternative
1085   ) then it ambiguous to which code(\repeat) the code(\alternative)
1086   belongs. This is the classic if-then-else dillema.  It may be solved
1087   by using braces. 
1088 )
1089
1090 sect(Keywords)
1091
1092 Keywords sometimes appear alone, but usually they require arguments.
1093 A keyword may have a single argument, a sequence of arguments in
1094 braces, or a sequence of arguments separated by spaces and terminated
1095 by a semicolon.  The precise syntax of each keyword is shown below.
1096 Keywords must appear in the right context.  If you use a keyword in
1097 the wrong place, even if the usage is syntactically correct, you will
1098 get the message ``parse error'' from LilyPond.
1099
1100
1101 description(
1102
1103 dit(code(\accepts) var(string)code(;)) This keyword can appear only within a
1104 code(\translator) block.  It specifies what contexts are allowed with the
1105 context that is being defined.  See Section ref(translators).  
1106
1107 dit(code(\alternative) code({) var(music1) var(music2) ... code(}))
1108 Specifies alternative endings.  Must come after a code(\repeat) keyword.  
1109
1110 dit(code(\bar) var(bartype)code(;)) Music expression that requests
1111 LilyPond to prints a special bar symbol, or at
1112 measure boundaries, replaces the regular bar symbol with a special
1113 symbol.  The argument var(bartype) is a string which specifies the
1114 kind of bar to print.  Options are code(":|"), code("|:"),
1115 code(":|:"), code("||"), code("|."), code(".|"), or code(".|.").
1116 These produce respectively a right repeat, a left repeat, a double
1117 repeat, a double bar, a start bar, an end bar, or a thick double bar.
1118 If var(bartype) is set to code("empty") then nothing is printed, but a
1119 line break is allowed at that spot.  Note that the printing of special bars
1120 has no effect on the MIDI output.
1121
1122 Note that you are encouraged to use code(\repeat) for repetitions
1123
1124
1125 dit(code(\cadenza) var(togglevalue)code(;)) Music expression that
1126 toggles the automatic generation of bar lines.  If var(togglevalue) is
1127 0 then bar line generation is turned off.  If var(togglevalue) is 1
1128 then a bar is immediately printed and bar generation is turned on.
1129
1130 dit(code(\clef) var(clefname)code(;)) Music expression that
1131 sets the current clef.  The argument is
1132 a string which specifies the name of the clef.  Several clef names are
1133 supported.  If code(_8) or code(^8) is added to the end of a clef
1134 name then the clef lowered or raised an octave will be generated.  
1135 Here are the supported clef names with middle C shown in each clef:
1136 mudela(center)(
1137 \score{
1138   \notes{ \cadenza 1;
1139    %\property Voice.textStyle = typewriter
1140    \clef subbass; c'4-"\kern-10mm subbass" 
1141            \clef bass;    c'4^"\kern -8mm bass"
1142            \clef baritone; c'4_"\kern -10mm baritone"
1143            \clef varbaritone; c'4^"\kern -10mm varbaritone"
1144            \clef tenor;     c'4_"\kern -10mm tenor"
1145            \clef "G_8";   c'4^"\kern -6mm G\_8" 
1146    }  
1147    \paper{ linewidth= 4.5 \in; }
1148 }
1149 )
1150 mudela(center)(
1151 \score{
1152   \notes{\cadenza 1; \clef alto;    c'4_"\kern -10mm alto"
1153       %     \clef scarlatti;    c'4_"\kern -4mm scarlatti"
1154            \clef mezzosoprano; c'4^"\kern -10mm mezzosoprano"
1155            \clef soprano;  c'4_"\kern -10mm soprano"
1156            \clef treble;  c'4^"\kern -6mm treble"
1157            \clef french;  c'4_"\kern -10mm french" }  
1158   \paper{ linewidth= 4.5 \in; }
1159 }
1160 )
1161 The treble  clef  can also  be obtained using  the  names code(G) or
1162 code(violin).  The bass clef is also available by code(\clef  F). 
1163
1164 dit(code(\chord) var(musicexpr)) Music expression that switches to
1165 chord mode for parsing var(chordmusic).
1166
1167 dit(code(\chordmodifiers) var(modifierlist)) Specify the text chord
1168 modifiers that may appear after chord names.  These are specified in
1169 the file file(chord-modifiers.ly).  
1170
1171 dit(code(\cm)) Specify a dimension in centimeters.  Should come after
1172 a floating point constant.
1173
1174 dit(code(\consists) var(string)code(;)) This keyword can appear only within a
1175 code(\translator) block.  It specifies that an engraver or performer named
1176 var(string) should be added to the translator.  See Section
1177 ref(translators).
1178
1179 dit(code(\consistsend) var(string)code(;)) This keyword can appear
1180 only within a code(\translator) block. Add an engraver to the context
1181 being specified.  Some engraver types need to be at the end of the
1182 list; this insures they are put there.  Usually not needed for end-users.
1183
1184 dit(code(\context) var(contexttype) [code(=) var(contextname)]
1185 var(musicexpr)) Interpret var(musicexpr) within a context of type
1186 var(contexttype).  If the context does not exist, it will be created.
1187 context.  The new context can optionally be given a name.
1188 This is a Music expression itself.
1189
1190 dit(code(\duration) code({) var(length) var(dotcount) code(})) Specify note
1191 duration.  The parameter var(length) is the negative logarithm (base
1192 2) of duration: 1 is a half note, 2 is a quarter note, 3 is an eighth
1193 note, etc.  The number of dots  after  the  note is given by
1194 var(dotcount). 
1195
1196 dit(code(\font) var(string)) Internal keyword.  Used within
1197 code(\paper) to specify the font.
1198
1199 dit(code(\grace) var(musicexpr)) A musicexpression that indicates that
1200 var(musicexpr) consists of grace notes.
1201
1202 dit(code(\header) code({) var(key1) = var(val1); var(key2) = var(val2); ... code(}))
1203 Specifies information about the music.  A header should appear at the
1204 top of the file describing the file's contents.  If a file has
1205 multiple code(\score) blocks, then a header should appear in
1206 each score block describing its contents.  Tools like code(ly2dvi) can
1207 use this information for generating titles.   Key values that are used
1208 by ly2dvi are: title, subtitle, composer, opus, poet, instrument,
1209 metre, arranger, piece and tagline.  
1210
1211 dit(code(\in)) Specify a dimension in inches.  
1212
1213 dit(code(\include) var(file)) Include the specified file.  The
1214 argument var(file) is a string.  The full filename including the
1215 file(.ly) extension must be given, and the filename must be quoted.
1216 (An unquoted string will not work here.)
1217
1218 dit(code(\key) var(pitch) var(type) code(;)) Change the key signature. 
1219 var(type) should be code(\major) or code(\minor) to get
1220 var(pitch)-major or var(pitch)-minor, respectively. The second
1221 argument is optional, the default is major keys. 
1222 The var(\context) argument can also be given as an integer, which tells
1223 the number of semitones that should be added to the pitch given in the
1224 subsequent code(\key) commands to get the corresponding major key,
1225 e.g. code(\minor) is defined as 3.  The standard mode names 
1226 code(\ionian), code(\locrian), code(\aeolian), code(\mixolydian),
1227 code(\lydian), code(\phrygian), and code(\dorian) are also defined. 
1228
1229 dit(code(\keysignature) var(pitchseq)code(;))
1230 Specify an arbitrary key signature.  The pitches from var(pitch) will
1231 be printed in the key signature in the order that they appear on the list.
1232
1233 dit(code(\lyrics) var(music)) Parse var(music) in lyrics mode.
1234
1235 dit(code(\maininput)) Internal command.  This command is used for creating init
1236 files like file(init.fly) that read the user file into the middle of another
1237 file.  It is illegal to use this command in a user file.  
1238         
1239 dit(code(\mark) var(unsigned)code(;) or code(\mark)
1240 var(string)code(;)) A music expression.  Prints a mark over or under
1241 (depending on the code(markDirection) property) the staff.  You must
1242 add code(Mark_engraver) to the either Score or Staff context for this
1243 to work.
1244
1245
1246 dit(code(\midi) var(statementlist)) An output definition (appears in a
1247  code(\score) block) to indicate that musical output should be
1248  produced and to set output parameters.  Can also appear at the top
1249  level to set default output parameters.  See code(\tempo).
1250
1251 dit(code(\mm)) Specify a dimension in millimeters. 
1252
1253 dit(code(\musicalpitch) code({) var(octave) var(note) var(shift) code(})) 
1254 Specify note pitch.  The octave is specified by an integer,
1255 zero for the octave containing middle C.  The note is a number from 0
1256 to 7, with 0 corresponding to C and 7 corresponding to B.  The shift
1257 is zero for a natural, negative to add flats, or positive to add
1258 sharps.
1259
1260 dit(code(\name) var(context)code(;)) Appears within code(\translator) to
1261 specify the name of the context that the translator handles. See Section
1262 ref(translators).   
1263
1264 dit(code(\notenames) var(assignmentlist)) Define new note names.  This
1265 keyword can appear only at the top level. 
1266 The argument is a list of definitions of  the form
1267 var(name) = var(pitch),  where var(pitch) is specified with the
1268 code(\musicalpitch) keyword.  
1269
1270 dit(code(\notes) var(musicexp)) Enter note mode and process the
1271 specified musicexp.  This is a music expression.
1272
1273 dit(code(\paper) var(statmentlist)) An output definition, (appears in
1274 a code(\score) block) to indicate that the music should be printed or
1275 to set output parameters.  Can also appear at the top level to set
1276 default output parameters for all of the score blocks.  The
1277 var(statmentlist) contains statements that change features of the
1278 output.  See Section ref(paper).
1279
1280 dit(code(\partial) var(duration)code(;)) Music expression that makes
1281 the first measure of the music last for the specified duration.  
1282
1283 dit(code(\penalty) var(int)code(;)) Allowed only in music.
1284 Discourage or encourage line breaks.  See identifiers code(\break) and
1285 code(\nobreak) in Section ref(ident). 
1286
1287 dit(code(\property) var(contextname)code(.)var(propname) code(=) var(value))
1288 Sets the var(propname) property of the context var(contextname) to the
1289 specified var(value).  All three arguments are strings.  Depending on
1290 the context it may be necessary to quote the strings or to leave space
1291 on both sides of the dot. 
1292
1293 dit(code(\pt)) Specify a dimension in points. 
1294
1295 dit(code(\relative) var(pitch) var(music)) Add octave indications such
1296 that so that the pitch is closest to the preceding pitch.  The
1297 argument var(pitch) is the starting pitch for this comparison.  In the
1298 case of chords, the first note of a chord is used as the base for the
1299 first pitches in the next chord.  See Section ref(relative).
1300
1301 dit(code(\remove) var(string)code(;)) Can appear only in a
1302 code(\translator) block.  Specifies that a performer or engraver named
1303 var(string) should be removed.  See Section ref(translators).  
1304
1305 dit(code(\repeat) var(style) var(count) code({) var(music) code(}))
1306 Repeats the specified music var(count) times.  Alternative endings can
1307 be specified by adding a code(\alternative) keyword after the
1308 code(\repeat).  The var(style) parameter should be either code(semi),
1309 for regular repeats, or code(fold) for repeats displayed vertically,
1310 or code(unfold) for repeats fully written out.
1311
1312 dit(code(\scm) var(scheme)code(;)) Evaluates the specified Scheme
1313 code.  The result is discarded.
1314
1315 dit(code(\scmfile) var(filename)code(;)) Reads Scheme code from the
1316 specified file.  The result is discarded.
1317
1318 dit(code(\score) var(statementlist))  Combine one music expression and
1319 multiple output definitions
1320
1321 dit(code(\script) var(alias)) Prints a symbol above or below a note.
1322 The argument is a string which points into the script-alias table
1323 defined in file(script.scm).  The scheme definitions specify whether
1324 the symbol follows notes into the staff, dependence of symbol
1325 placement on staff direction, and a priority for placing several
1326 symbols over one note.  Usually the code(\script) keyword is not used
1327 directly.  Various helpful identifier definitions appear in
1328 file(script.ly).
1329
1330 dit(code(\shape) var(indent1)code(,) var(width1)code(,) var(indent2)code(,)
1331 var(width2) ... code(;)) Allowed only within code(\paper).  Each pair
1332 of var(indent) and var(width) values is a dimension specifying how far
1333 to indent and how wide to make the line.  The indentation and width of
1334 successive lines are specified by the successive pairs of dimensions.
1335 The last pair of dimensions will define the characeristics of all
1336 lines beyond those explicitly specified.
1337
1338 dit(code(\skip) var(duration)code(;)) Skips the amount of time
1339 specified by var(duration).  If no other music is played, a gap will
1340 be left for the skipped time with no notes printed.  It works in Note
1341 Mode or Lyrics Mode.
1342
1343 dit(code(\spanrequest) var(startstop) var(type)).  Define a spanning request
1344 var(startstop) is either -1 (code(\start)) or 1 (code(\stop)). The var(type)
1345 parameter is a string that describes what should be started.  Supported types
1346 are "crescendo", "decrescendo", "beam", "slur".  This is an internal command.
1347 Users should use the abbreviations  which are defined in the
1348 initialization file file(spanners.ly).
1349
1350 dit(code(\tempo) var(duration) = var(perminute)code(;)) Used within
1351 code(\midi) or within music to specify the tempo.  For example, 
1352 `code(\midi { \tempo 4 = 76;})' requests output with 76 quarter notes
1353 per minute.
1354
1355 dit(code(\textscript)) var(text) var(style).  Defines a text to be
1356 printed over or under a note.  var(style) may be one offinger, roman,
1357 italic, dynamic, large.  Normally you should use the stable and more
1358 user friendly abbreviations defined in the init file file(textscript.ly).
1359
1360 dit(code(\time) var(numerator)code(/)var(denominator)code(;)) Change the time
1361 signature.  The default time signature is 4/4.  
1362
1363 dit(code(\times) var(numerator)code(/)var(denominator) var(music))
1364 Music expression that results from multiplying the duration of
1365 var(music) by the specified fraction.  In the output a brace is
1366 printed over the music.
1367
1368 dit(code(\translator) var(statements))
1369  This keyword is overloaded, it means something different within
1370 music expressions.
1371
1372 This variant appears only within code(\paper) and specifies a
1373 translator for converting music to notation.  The translator is
1374 specified with a single code(\context) statement and a series of
1375 code(\accepts), and code(\consists) statements.  See Section
1376 ref(translators).
1377
1378 dit(code(\translator) var(contexttype) = var(name))
1379 A music expression that the context which is a direct child of the 
1380 a  context of type var(contexttype) should be shifted to a context of
1381 type var(contexttype) and  the specified name.  
1382
1383 dit(code(\transpose) var(pitch) var(musicexpr))
1384 Music expression
1385 obtained by transposing var(musicexpr).  Middle C is tranposed to
1386 var(pitch).   If it appears inside
1387 code(\relative), then any notes specified for transposition should be
1388 specified inside another code(\relative).  See Section ref(transpose).
1389
1390 dit(code(\type) var(string)code(;)) Use inside code(\translator) to
1391 specify the type of the translator.  
1392
1393 dit(code(\version) var(string)) Specify the version of LilyPond that a
1394 file was written for.  The argument is the version number, for qexample
1395 code("1.0.1").  This is used to detect invalid input, and to aid
1396 code(convert-mudela), a tool that automatically upgrades input files.
1397
1398 )  
1399
1400
1401 sect(Notation Contexts)
1402
1403 Notation contexts are objects that only exist during a run of
1404 LilyPond.  During the interpretation phase of LilyPond, the Music
1405 expression contained in a code(\score) block is interpreted in time
1406 order.  This is the order in which humans read, play and write music.
1407
1408 A  context is an object that holds the reading state of the expression:
1409 it contains information like
1410 itemize(
1411 it() What notes are playing at this point?
1412 it() What symbols will be printed at this point?
1413 it() In what style will they printed?
1414 it() What is the current key signature, time signature, point within
1415 the measure, etc.
1416 )
1417
1418 Contexts are grouped hierarchically: a Voice context is contained in a
1419 Staff context (because a staff can contain multiple voices at any
1420 point), a Staff context is contained in a Score, StaffGroup,
1421 ChoirStaff context (because these can all contain multiple Staffs.)
1422
1423 The Contexts associated with sheet music output are called notation
1424 contexts, those with associated with sound output are called playing
1425 contexts.
1426
1427 Context are created either automatically, or manually.
1428 Initially, the top level music expression is reported to the top level
1429 context (the Score context). 
1430 When a atomic music expression (a note, a rest, a code(\bar),
1431 code(\time) command), a nested set of context is created that can process these
1432 atomic expressions, so in this example,COMMENT(
1433
1434 )verb(\score { \notes < c4 > })COMMENT(
1435
1436 )the sequential music, code({ c4 }) is interpreted by Score context.
1437 When the note code(c4) itself is interpreted, a set of contexts is needed
1438 that will accept notes. The default for this is a Voice context,
1439 contained in a Staff context.
1440
1441
1442
1443 You can also create contexts manually, and you probably have to do so
1444 if you want to typeset complicated multiple voice/multiple staff
1445 material.  If a code(\context )var(name musicexpr) expression is
1446 encountered during the interpretation phase, the var(musicexpr)
1447 argument will be interpreted with a context of type var(name).  If you
1448 specify a name, the specific context with that name is searched.
1449
1450 If a context of the specified type and name can not be found, a new
1451 one is created.  For example,
1452 COMMENT(
1453
1454 )verb(\score { \notes \relative c'' { c4 <d4 \context Staff = "another" e4> f} })COMMENT(
1455
1456 ) in this example, the code(c) and code(d) are
1457 printed on the default staff.  For the code(e), a context Staff called
1458 code(another) is specified; since that does not exist, a new context is
1459 created.  Within code(another) a (default) Voice context is created
1460 for the code(e4).   When all music referring to a context is finished, the
1461 context is ended as well.  So after the third quarter, the
1462 code(another) is removed.
1463
1464 Almost all music expressions inherit their interpretation context from
1465 their parent. In other words, suppose that  the syntax for a music expression is
1466 code(code(\keyword) var(musicexpr1) var(musicexpr2) dots()).
1467 When the interpretation of this music expression starts, 
1468 the context for var(musicexpr1), var(musicexpr2), etc. that of
1469 the total expression.
1470
1471 Lastly, you may wonder, why doesn't this:
1472 verb(\score { \notes \relative c'' { c4 d4 e4 }})
1473 result in this?
1474 mudela()(\score { \notes \relative c'' { <c4> <d4> <e4> }})
1475
1476 For code(c4) a default Staff (with contained Voice) context is
1477 created.  After the code(c4), ends no music refers to this default
1478 staff, so it would be ended, with the result shown.  To prevent this
1479 inconvenient behavior, the context to which the sequential music
1480 refers is adjusted during the interpretation.  So after the code(c4)
1481 ends, the context of the sequential music is also the default Voice
1482 context.  The code(d4) gets interpreted in the same context as code(c4)
1483
1484 These are the contexts that come presupplied with LilyPond.
1485 description(
1486
1487 dit(code(Grace)) The context for handling grace notes, it is
1488   instantiated automatically when you use code(\grace).  It is a
1489   "embedded" miniature of the Score context.  Since this context needs
1490   special interaction with the rest of LilyPond, you should not
1491   explicitly instantiate it.
1492
1493 dit(code(LyricVoice)) Corresponds to a voice with lyrics.  Handles the printing
1494 of a single line of lyrics.  
1495
1496 dit(code(Thread)) Handles note heads, and is contained in the Voice
1497   context.  You have to instantiate these explicitly if you want to
1498   adjust the style of individual noteheads.
1499
1500 dit(code(Voice)) Corresponds to a voice on a staff.  This context
1501   handles the conversion of dynamic signs, stems, beams, super- and
1502   subscripts, slurs, ties and rests.
1503
1504   You have to instantiate these explicitly if you want to have
1505   multiple voices on the same staff.
1506
1507 dit(code(ChordNamesVoice)) A voice with chord names.  Handles printing
1508 of a line of chord names.  
1509
1510 dit(code(ChordNames))  Typesets chord names.  Can contain
1511 code(ChordNamesVoice) contexts.  
1512
1513 dit(code(Lyrics)) Typesets lyrics.  It can contain code(LyricVoice) contexts.
1514
1515 dit(code(Staff)) Handles clefs, bar lines, keys,
1516   accidentals.  It can contain code(Voice) contexts.
1517
1518 dit(code(RhythmicStaff)) A context like code(Staff) but for printing
1519 rhythms.  Pitches are ignored; the notes are printed on one line.  
1520 It can contain code(Voice) contexts. 
1521
1522 dit(code(GrandStaff)) Contains code(Staff) or code(RhythmicStaff)
1523 contexts.  It adds a brace on the left side grouping the staffs
1524 together. The bar lines of the contained staffs are connected vertically.
1525 It can contain code(Staff) contexts.
1526
1527 dit(code(PianoStaff)) Just like code(GrandStaff) but with
1528 code(minVerticalAlign) set equal to code(maxVerticalAlign) so that
1529 interstaff beaming and slurring can be used.  
1530
1531 dit(code(StaffGroup)) Contains code(Staff) or code(RhythmicStaff)
1532 contexsts.  Adds a bracket on the left side, grouping the staffs
1533 together.  The bar lines of the contained staffs are connected vertically.
1534 It can contain code(Staff), code(RhythmicStaff), code(GrandStaff) or code(Lyrics) contexts.  
1535
1536 dit(code(ChoirStaff)) Identical to code(StaffGroup) except that the
1537 contained staffs are not connected vertically.  
1538
1539 dit(code(Score)) This is the top level notation context.    No
1540 other context can contain a code(Score) context.  This context handles
1541 the administration of time signatures.  It also makes sure that items
1542 such as clefs, time signatures, and key-signatures are aligned across
1543 staffs.  It can contain code(Lyrics), code(Staff),
1544 code(RhythmicStaff), code(GrandStaff), code(StaffGroup), and
1545 code(ChoirStaff) contexts.
1546
1547 You can not explicitly instantiate a Score context (since it is not
1548 contained in any other context.).  It is instantiated automatically
1549 when an output definition (a code(\score) or code(\paper) block) is
1550 processed.
1551 )
1552
1553 The various contexts have properties associated with them.  These
1554 properties can be changed using the code(\property) command:
1555 `code(\property) var(context)code(.)var(propname) code(=) var(value)'.
1556
1557
1558 Properties that are set in one context are inherited by all of the
1559 contained contexts.  This means that a property valid for the Voice
1560 context can be set in the Score context (for example) and thus take
1561 effect in all Voice contexts.
1562
1563 Properties can be preset within the code(\translator) block
1564 corresponding to the appropriate context.  In this case, the syntax is
1565 `var(propname) code(=) var(value)'.  This assignment happens before
1566 interpretation starts, so a code(\property) expression will override
1567 any pre defined settings.
1568
1569 The code(\property) expression will create any property you specify.
1570 There is no guarantee that a property will be used.  So if you spell a
1571 property name wrong, there will be no error message.
1572
1573 The property settings are used during the interpretation phase. They
1574 are read by the LilyPond modules where interpretation contexts are
1575 built of.  These modules are called em(translators). Translators for
1576 notation are called em(engravers) and translators for sound are called
1577 em(performers).
1578
1579 The precise result of a property is determined by the implementation
1580 of the translator that reads them.  Therefore, the result of a
1581 property can vary, since it is implementation and configuration
1582 dependent.
1583
1584 In order to fully find out what properties are used, you must search
1585 the source code for calls to code(get_property).  The rest of the
1586 section is devoted to an (incomplete) overview of available properties.
1587
1588 subsubsubsect(Lyrics properties)
1589
1590 description(
1591
1592 dit(code(textStyle)) Set the font for lyrics.  The available font
1593 choices are code(roman), code(italic), code(bold), code(large),
1594 code(Large), code(typewriter), and code(finger).  The code(finger)
1595 font can only display numbers.  Note also that you must be careful
1596 when using code(\property) in Lyrics mode.  Because of the way strings
1597 are parsed, either put quotes around the arguments to code(\property)
1598 or be sure to leave a space on both sides of the dot.
1599
1600
1601 )
1602
1603 subsubsubsect(Thread properties)
1604
1605 description(
1606 dit(code(noteheadStyle)) Selects type of note head.  Choices are
1607 code(cross), code(diamond), code(harmonic), code(transparent), and
1608 code("").  They are shown in that order below.  
1609 mudela(center)(
1610 \score{
1611   \notes{ 
1612      \property Staff.barNonAuto = 1
1613      \property Voice.noteHeadStyle = cross 
1614      a'
1615      \property Voice.noteHeadStyle = diamond
1616      a'
1617      \property Voice.noteHeadStyle = harmonic
1618      a'
1619      \property Voice.noteHeadStyle = transparent
1620      a' 
1621      \property Voice.noteHeadStyle = ""
1622      a'
1623   }
1624  \paper{ linewidth = -1.;}
1625 }
1626 )
1627 )
1628
1629
1630 subsubsubsect(Voice properties)
1631
1632 description(  
1633
1634 dit(code(stemLeftBeamCount)) Specify the number of beams to draw on
1635 the left side of the next note.   Overrides automatic beaming.  The
1636 value is only used once, and then it is erased.
1637
1638 dit(code(stemRightBeamCount)) Specify the number of beams to draw on
1639 the right side of the next note.   Overrides automatic beaming.  The
1640 value is only used once, and then it is erased.
1641
1642 dit(code(beamAuto)) If set to 1 then beams are generated
1643 automatically.  If set to zero then no beams will be automatically
1644 generated.  The default value is 1.  
1645
1646 dit(code(beamAutoEnd)) Specifies when automatically generated beams
1647 can end.  See Section ref(autobeam).
1648
1649 dit(code(beamAutoBegin)) Specifies when automatically generated beams
1650 can start.  See Section ref(autobeam). 
1651
1652 dit(code(textEmptyDimension)) If set to 1 then text placed above or
1653 below the staff is assumed to have zero width.  
1654
1655 dit(code(beamquantisation)) Set to code(\none) for no quantization.
1656 Set to code(\normal) to quantize position and slope.  Set to
1657 code(\traditional) to avoid wedges.  These three settings are
1658 available via code(\beamposfree), code(\beamposnormal), and
1659 code(\beampostraditional).
1660
1661 dit(code(beamslopedamping)) Set to code(\none) for undamped beams.
1662 Set to code(\normal) for damped beams.  Set to code(\infinity) for
1663 beams with zero slope.  The identifiers code(\beamslopeproportional),
1664 code(\beamslopedamped), and code(\beamslopezero) each set the
1665 corresponding value.
1666
1667 dit(code(restStyle)) Change the layout of rests shorter than quarter notes. 
1668 Currently, the standard layout code(restStyle="") and mensural notation
1669 code(restStyle="mensural") are available.
1670
1671 dit(code(midiInstrument)) Sets the instrument for MIDI output.  This
1672 property name must be quoted because of the embedded underscore.  If
1673 this property is not set then LilyPond will use the code(instrument)
1674 property.  This must be set to one of the strings on the list of MIDI
1675 instruments that appears in Section ref(midilist).  If you use a
1676 string which is not listed, LilyPond will silently substitute piano. 
1677
1678 dit(code(transposing)) Tranpose the MIDI output.  Set this property to
1679 the number of half-steps to transpose by.
1680
1681 dit(code(oldTieBehavior)) Set to 1 in order to get old tie behavior
1682 where ties would connect unequal pitches.  This property is
1683 deprecated, and use is not recommended.
1684
1685 dit(code(verticalDirection)) Determines the direction of stems, subscripts,
1686 beams, slurs, and ties.  Set to code(\down) to force them down,
1687 code(\up) to force them up, or code(\free) to let LilyPond decide.
1688 This can be used to distinguish between voices on the same staff.  The
1689 code(\stemdown), code(\stemup), and code(\stemboth) identifiers set
1690 this property.  See also the identifiers code(\voiceone),
1691 code(\voicetwo), code(\voicethree) and code(\voicefour).
1692
1693 dit(code(slurVerticalDirection)) Set to code(\free) for free choice of slur
1694 direction, set to code(\up) to force slurs up, set to code(\down) to
1695 force slurs down.  The shorthands code(\slurup), code(\slurdown), and
1696 code(\slurboth) are available.
1697
1698 dit(code(tieVerticalDirection)) Set to code(\free) for free choice of tie
1699 direction, set to code(\up) to force ties up, set to code(\down) to
1700 force ties down.  
1701
1702 dit(code(slurDash)) Set to 0 for normal slurs, 1 for dotted slurs, and
1703 a larger value for dashed slurs.  Identifiers code(\slurnormal) and
1704 code(\slurdotted) are predefined to set the first two settings.
1705
1706 dit(code(horizontalNoteShift)) Set to 1 to enable LilyPond to shift notes
1707 horizontally if they collide with other notes.  This is useful when
1708 typesetting many voices on one staff.  The identifier code(\shift) is
1709 defined to enable this.  If there are several voices, every voice must
1710 have a distinct value of this property or no shifting will occur.
1711
1712 dit(code(forceHorizontalShift)) Force horizontal shift for collision
1713 resolution.  It overrides automatic collision resolution.
1714 This will only work if the context also has its stem direction and
1715 horizontalNoteShift property set. The value is the shift amount
1716 expressed in code(note_width), as set in the paper section.
1717
1718 dit(code(dynamicDir)) Determines location of dynamic marks.  Set to
1719 code(\up) to print marks above the staff; set to code(\down) to print
1720 marks below the staff.
1721
1722 dit(code(dynamicStyle)) Set the text style for dynamics.  
1723
1724 dit(code(textStyle)) Set the text style for superscripts and
1725 subscripts.  See above for list of text styles.
1726
1727 dit(code(textScriptPadding)) Determines the extra space added between
1728 super-/subscripted text and the closest staff line or note.
1729
1730 dit(code(fontSize)) Can be used to select smaller font sizes for
1731 music.  The normal font size is 0, and the two smaller sizes are -1
1732 and -2.
1733
1734 dit(code(abbrev)) Set length for tremolo to be used if no length is
1735 explicitly specified.
1736
1737 dit(code(tupletDirection)) Determines the direction of triplets and 
1738 other tuplets.  Set to code(\down) to force them below the staff,
1739 code(\up) to force them above, or code(\free) to let LilyPond decide.
1740
1741 dit(code(tupletVisibility)) Determines whether tuplets of notes are
1742 labelled.  Setting to 0 shows nothing; setting to 1 shows a number;
1743 setting to 2 shows a number and a bracket if there is no beam; setting
1744 to 3 shows a number, and if there is no beam it adds a bracket;
1745 setting to 4 shows both a number and a bracket unconditionally. The 
1746 code(pletoff) and code(pleton) identifiers set the property to 0 and 3, 
1747 respectively. 
1748
1749 dit(code(markScriptPadding)) Determines the extra space added between
1750 the mark and the closest staff line or note.
1751
1752 dit(code(markDirection)) Determines if marks should be printed above
1753 or below the staff. Set to code(\up) to print marks above the staff;
1754 set to code(\down) to print marks below the staff.
1755
1756 dit(code(articulationScriptPadding)) Determines the extra space added 
1757 between articulation marks, such as staccato, tenuto, trill, up/down 
1758 bow or fermata, and the closest staff line or note.
1759
1760
1761 dit(code(articulationScriptVerticalDirection)) Determines the location
1762 of articulation marks. Set to code(\up) to print marks above the
1763 staff; set to code(\down) to print marks below the staff. This
1764 property does not override explicit directions marked with code(^) or
1765 code(_) in the mudela file.
1766 )
1767
1768 subsubsubsect(Staff properties)
1769
1770 description(
1771
1772 dit(code(createInitdefaultClef)) Specify whether clefs are created on
1773 default?  (Doesn't seem to do anything.)
1774
1775 dit(code(barNumberDirection)) Set to code(\up) or code(\down) to put
1776 bar numbers above or below the staff.  
1777
1778 dit(code(barNumberHangOnClef)) Set to 1 to cause bar numbers to appear
1779 above or below the clef instead of on the bar line.
1780
1781 dit(code(barNumberScriptPadding)) Sets extra space between the bar
1782 number and the bar it labels.
1783
1784 dit(code(barSize)) Specify the height of the bar lines if it should be
1785 different than the staff height.
1786
1787 dit(code(markHangOnClef)) Set to 1 to cause marks to appear by clefs
1788 instead of by bar lines.  Deprecated, use is not recommended.
1789
1790 dit(code(marginDirection)) Set to code(\left) or code(\right) to
1791 specify location of marginal scripts.  
1792
1793 dit(code(marginScriptPadding)) Specify extra space for marginal scripts.
1794
1795 dit(code(forgetAccidentals)) Causes accidentals to be printed at every
1796 note instead of remembered for the duration of a measure.  
1797
1798 dit(code(noResetKey)) Do not reset the key at the start of a measure.
1799 Accidentals will be printed only once and are in effect until
1800 overridden, possibly many measures later. 
1801
1802 dit(code(staffLineLeading)) Specifies the distance (in points) between lines
1803 of the staff.  
1804
1805 dit(code(numberOfStaffLines)) Specifies the number of staff lines. The
1806 default is 5. 
1807
1808 dit(code(postBreakPadding)) Extra space in points to be added after
1809 the clef, time signature and key signature on the staff.
1810
1811 dit(code(barAtLineStart)) Set to 1 to produce a bar line after the
1812 clef at the start of each line (but not at the beginning of the
1813 music).  
1814
1815 dit(code(noVoltaBraces)) Set to true to suppress the printing
1816 of brackets over alternate endings specified by code(\alternative).
1817
1818 dit(code(voltaSpannerDuration)) Set to an integer to control the size
1819 of the brackets printed by code(\alternative).  The integer specifies
1820 the number of whole notes duration to use for the brackets.  It seems
1821 to be rounded to the nearest measure.  This can be used to shrink the
1822 length of brackets in the situation where one alternative is very
1823 large.  It may have odd effects if the specified duration is longer
1824 than the music given in an code(\alternative).   [FIXME: This was
1825 broken in 1.1.53]
1826
1827 dit(code(barNonAuto)) If set to 1 then bar lines will not be printed
1828 automatically; they must be explicitly created with code(\bar) keywords.
1829 Unlike with the code(\cadenza) keyword, measures are still counted.  Bar
1830 generation will resume according to that count if this property is set to
1831 zero.  
1832
1833 dit(code(defaultClef)) Determines the default clef.  See code(\clef)
1834 keyword.
1835
1836 dit(code(numberOfStaffLines)) Sets the number of lines that the staff has.
1837  
1838 dit(code(barAlways)) If set to 1 a bar line is drawn after each note.
1839
1840 dit(code(defaultBarType)) Sets the default type of bar line.  See
1841 code(\bar) keyword.
1842
1843 dit(code(keyOctaviation)) If set to 1, then keys are the same in all
1844 octaves.  If set to 0 then the key signature for different octaves can
1845 be different and is specified independently: code(\keysignature bes
1846 fis').  The default value is 1.  Can be set to zero with
1847 code(\specialkey) or reset to 1 with code(\normalkey).
1848
1849 dit(code(instrument) and code(instr)) If code(Staff_margin_engraver)
1850 is added to the Staff translator, then the code(instrument) property
1851 is used to label the first line of the staff and the code(instr)
1852 property is used to label subsequent lines.  If the
1853 code(midiInstrument) property is not set then code(instrument) is
1854 used to determine the instrument for MIDI output.
1855
1856 dit(code(createKeyOnClefChange)) Set to a nonempty string if you want key
1857 signatures to be printed when the clef changes.  Set to the empty string (the
1858 default) if you do not want key signatures printed.
1859
1860 dit(code(timeSignatureStyle)) Changes the default two-digit layout
1861    for time signatures. The following values are recognized:
1862    description(
1863       dit(code(C)) 4/4 and 2/2 are typeset as C and struck C,
1864       respectively. All other time signatures are written with two digits.
1865       dit(code(old)) 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and
1866       9/8 are typeset with old-style mensuration marks. All other time
1867       signatures are written with two digits.
1868       dit(code(1)) All time signatures are typeset with a single
1869       digit, e.g. 3/2 is written as 3.
1870       dit(code(C2/2), code(C4/4), code(old2/2), code(old3/2),
1871       code(old2/4), code(old3/4), code(old4/4), code(old6/4), 
1872       code(old9/4), code(old4/8), code(old6/8), code(old6/8alt)
1873       or code(old9/8))Tells Lilypond to use a specific symbol as 
1874       time signature.
1875    )
1876 The different time signature characters are shown below with
1877 their names:
1878 mudela(center)(
1879 \score{
1880   \notes\relative c'' {
1881 \property Voice.textStyle = typewriter
1882 \property Staff.timeSignatureStyle = "C2/2"
1883 \time 2/2; a2^"C2/2" a2 
1884 \property Staff.timeSignatureStyle = "C4/4"
1885 \time 2/2; a2^"C4/4" a2 
1886 \property Staff.timeSignatureStyle = "old2/2"
1887 \time 2/2; a2^"old2/2" a2 
1888 \property Staff.timeSignatureStyle = "old3/2"
1889 \time 2/2; a2^"old3/2" a2 
1890 \property Staff.timeSignatureStyle = "old2/4"
1891 \time 2/2; a2^"old2/4" a2 
1892 \property Staff.timeSignatureStyle = "old4/4"
1893 \time 2/2; a2^"old4/4" a2 
1894 \property Staff.timeSignatureStyle = "old6/4"
1895 \time 2/2; a2^"old6/4" a2 
1896 \property Staff.timeSignatureStyle = "old9/4"
1897 \time 2/2; a2^"old9/4" a2 
1898 \property Staff.timeSignatureStyle = "old4/8"
1899 \time 2/2; a2^"old4/8" a2 
1900 \property Staff.timeSignatureStyle = "old6/8"
1901 \time 2/2; a2^"old6/8" a2 
1902 \property Staff.timeSignatureStyle = "old6/8alt"
1903 \time 2/2; a2^"old6/8alt" a2 
1904 \property Staff.timeSignatureStyle = "old9/8"
1905 \time 2/2; a2^"old9/8" a2 
1906 }
1907    \paper{ linewidth= 4.5 \in; }
1908 }
1909 )
1910
1911 dit(code(clefStyle)) Determines how clefs are typeset. When set to
1912 code(transparent), the clefs are not printed at all, when set to
1913 code(fullSizeChanges), clef changes in the middle of a line are
1914 typeset with a full size clef. By default, clef changes are typeset in
1915 smaller size.
1916
1917 )
1918    
1919 subsubsubsect(GrandStaff properties)
1920
1921 description( 
1922
1923 dit(code(alignmentReference)) Set to code(\center) for vertical
1924 alignment reference point to be in the center of the vertical group.
1925 Set to code(\up) to put the reference point at the top of the group. 
1926
1927 dit(code(maxVerticalAlign)) Set the maximum vertical distance between
1928 staffs.
1929
1930 dit(code(minVerticalAlign)) Set the minimum vertical distance between
1931 staffs.  
1932
1933 )
1934
1935 subsubsubsect(Score properties)
1936
1937 description(
1938
1939 dit(code(skipBars)) Set to 1 to skip the empty bars that are produced
1940 by multimeasure notes and rests.  These bars will not appear on the
1941 printed output.  Set to zero (the default) to expand multimeasure
1942 notes and rests into their full length, printing the appropriate
1943 number of empty bars so that synrchonization with other voices is
1944 preserved.  COMMENT(meaning of "skip" here seems to be different from
1945 the meaning used for the keyword \skip.)
1946 )
1947
1948 subsubsubsect(ChordNamesVoice properties)
1949
1950 description(
1951 dit(code(chordInversion)) Determines whether LilyPond should look for
1952 chord inversions when translating from notes to chord names.  Set to 1
1953 to find inversions.  The default is 0 which does not look for inversions.
1954 )
1955
1956
1957
1958 sect(Pre-defined Identifiers)
1959 label(ident)
1960
1961 Various identifiers are defined in the initialization files to
1962 provide shorthands for some settings.  
1963
1964 description(
1965 dit(code(\aeolian)) Used as the second argument of the code(\key)
1966 keyword to get an aeolian mode. 
1967 dit(code(\break)) Force a line break in music by using a large
1968 argument for the keyword code(\penalty). 
1969 dit(code(\center)) Used for setting textalignment property.  Is set to 0.
1970 dit(code(\cr)) Start a crescendo.
1971 dit(code(\decr)) Start a decrescendo.
1972 dit(code(\dorian)) Used as the second argument of the code(\key)
1973 keyword to get a dorian mode.
1974 dit(code(\down)) Used for setting direction setting properties.  Is
1975 equal to -1.  
1976 dit(code(\f)) Print forte symbol on the preceding note.
1977 dit(code(\ff)) Print fortissimo symbol on the preceding note. 
1978 dit(code(\fff)) Print fortississimo symbol on preceding note. 
1979 dit(code(\ffff)) Print fortissississimo symbol on preceding note.
1980 dit(code(\fffff)) Print fffff symbol on preceding note.
1981 dit(code(\ffffff)) Print ffffff symbol on preceding note.
1982 dit(code(\fp)) Print fortepiano symbol on preceding note. 
1983 dit(code(\free)) Used for setting direction setting properties.  Is
1984 equal to 0.  
1985 dit(code(\Gourlay)) Used for setting the paper variable
1986 code(castingalgorithm).  Is equal to 1.0.  
1987 dit(code(\infinity)) Used for setting the Score.beamslopedamping
1988 property.  Is actually equal to 10000.  
1989 dit(code(\ionian)) Used as the second argument of the code(\key)
1990 keyword to get an ionian mode. 
1991 dit(code(\left)) Used for setting textalignment property.  Is equal to -1.
1992 dit(code(\locrian)) Used as the second argument of the code(\key)
1993 keyword to get a locrian mode. 
1994 dit(code(\lydian)) Used as the second argument of the code(\key)
1995 keyword to get a lydian mode. 
1996 dit(code(\major)) Used as the second argument of the code(\key)
1997 keyword to get a major key.
1998 dit(code(\minor)) Used as the second argument of the code(\key)
1999 keyword to get a minor key.
2000 dit(code(\mixolydian)) Used as the second argument of the code(\key)
2001 keyword to get a mixolydian mode.
2002 dit(code(\mf)) Print mezzoforte symbol on preceding note. 
2003 dit(code(\mp)) Print mezzopiano symbol on preceding note. 
2004 dit(code(\nobreak)) Prevent a line break in music by using a large
2005 negative argument for the keyword code(\penalty). 
2006 dit(code(\none)) Used for setting Score.beamslopedamping and
2007 Score.beamquantisation properties.  Is equal to 0.
2008 dit(code(\normal)) Used for setting Score.beamslopedamping and
2009 Score.beamquantisation properties.  Is equal to 1.
2010 dit(code(\normalkey)) Select normal key signatures where each octave
2011 has the same key signature.  This sets the Staff.keyoctaviation property.
2012 dit(code(\p)) Print a piano symbol on preceding note. 
2013 dit(code(\phrygian)) Used as the second argument of the code(\key)
2014 keyword to get a phrygian mode.
2015 dit(code(\pp)) Print pianissimo symbol on preceding note. 
2016 dit(code(\ppp)) Print pianississimo symbol on preceding note. 
2017 dit(code(\pppp)) Print pianissississimo symbol on preceding note.
2018 dit(code(\ppppp)) Print ppppp symbol on preceding note.
2019 dir(code(\pppppp)) Print pppppp symbol on preceding note.
2020 dit(code(\rc)) Terminate a crescendo. 
2021 dit(code(\rced)) Terminate a decrescendo
2022 dit(code(\rfz)) Print a rinforzato symbol on preceding note.
2023 dit(code(\right)) Used for setting textalignment property.  Is set to 1.
2024 dit(code(\sf)) Print a subito-forte symbol on preceding note. 
2025 dit(code(\sff)) Print a subito-fortissimo symbol on preceding note.
2026 dit(code(\sfz)) Print a sforzato symbol on preceding note. 
2027 dit(code(\shiftoff)) Disable horizontal shifting of note heads that collide.  
2028 Sets the Voice.horizontalNoteShift property.
2029 dit(code(\shifton)) Enable note heads that collide with other note heads
2030 to be shifted horiztonally.  Sets the Voice.horizontalNoteShift property.
2031 dit(code(\slurboth)) Allow slurs to be above or below notes.  This
2032 sets the Voice.slurVerticalDirection property. 
2033 dit(code(\slurdown)) Force slurs to be below notes. This sets the
2034 Voice.slurVerticalDirection property. 
2035 dit(code(\slurup)) Force slurs to be above notes.  This sets the
2036 Voice.slurVerticalDirection property.  
2037 dit(code(\sp)) Print a subito-piano symbol on preceding note.
2038 dit(code(\spp)) Print a subito-forte symbol on preceding note.
2039 dit(code(\specialkey)) Allow keys signatures do differ in different
2040 octaves.  This sets the Staff.keyoctaviation property.  
2041 dit(code(\stemboth)) Allow stems, beams, and slurs to point either
2042 direction.  This sets the Voice.verticalDirection property. 
2043 dit(code(\stemdown)) Force stems, beams, and slurs to point down.
2044 This sets the Voice.verticalDirection property. 
2045 dit(code(\stemup)) Force stems, beams and slurs to point up.  This
2046 sets the Voice.verticalDirection property. 
2047 dit(code(\traditional)) Used for setting the 
2048 Score.beamquantisation property.  Is equal to 2.  
2049 dit(code(\up)) Used for setting various direction properties.  Is
2050 equal to 1. 
2051 dit(code(\voiceone)) Enter Voice context called code(one) and force stems down.
2052 (See code(\stemdown).)
2053 dit(code(\voicetwo)) Enter Voice context called code(two) and force stems
2054 up. (See code(\stemup).)
2055 dit(code(\voicethree)) Enter Voice context called code(three) and force stems
2056 up.  
2057 dit(code(\voicefour)) Enter Voice context called code(four), force stems down
2058 and turn on horizontal shifting.  (See code(\stemdown) and code(\shifton).)
2059 dit(code(\Wordwrap)) Used for setting the paper variable
2060 code(castingalgorithm).  Equal to 0.0.  
2061 )
2062
2063
2064 sect(Output)
2065 label(output)
2066 label(paper)
2067
2068 The output produced by LilyPond is controlled by the code(\paper) and
2069 code(\midi) keywords.  These keywords appear in the code(\score) block
2070 to indicate that printed or musical output should be produced.  If
2071 neither keyword appears in a code(\score) block, then paper output is
2072 produced but MIDI output is not produced.  
2073
2074 The contents of the code(\paper) and code(\midi) blocks can change the
2075 output in various ways.  These blocks can appear at the top level of a
2076 Mudela file to set default parameters for each type of output.  It is
2077 still necessary to explicitly specify the output type in the
2078 code(\score) blocks if you don't want the default behavior of
2079 producing only paper output.  
2080
2081 The code(\paper) and code(\midi) blocks 
2082 may begin with an optional identifier reference.  No
2083 identifier references are allowed anywhere else in the block.  
2084 The code(\paper) block can contain the code(\shape) keyword; the
2085 code(\midi) block can contain the code(\tempo) keyword.  Both of them
2086 can contain code(\translator) keywords.  The code(\paper) block can
2087 also contain identifier assignments and parameter assignments.  Unlike
2088 at the top level, these assignments must be terminated by a semicolon.
2089
2090 subsect(Changing Font Size and Paper Size)
2091
2092 The Feta font provides musical symbols at six different sizes.  These
2093 fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and 26
2094 point.  The point size of a font is the height of the five line staff
2095 when displayed in the font.  The default font is 20 points.  To select
2096 a different font size you must load the desired size with an
2097 code(\include) keyword at the top level and then you must select the
2098 desired size with an identifier in the code(\paper) block.  To load a
2099 font use the command code(\include "paper)var(N)code(.ly") where
2100 var(N) is the desired font size.  For example, using code(\include
2101 "paper26.ly") will produce very large music.  This statement should
2102 appear at the top level at the top of your Mudela file.  To select the
2103 font for printing, this you must include code(\paper_twentysix) in the
2104 code(\paper) block of your file.  The identifiers that are used to
2105 select different font sizes are code(paper_eleven),
2106 code(paper_thirteen), code(paper_sixteen), code(paper_twenty),
2107 code(paper_twentythree), and code(paper_twentysix).
2108
2109 To change the paper size, you must first set the code(papersize)
2110 variable at the top level.  Set it to code(a4), code(letter), or
2111 code(legal).  After this specification, you must set the font as
2112 described above.  If you want the default font, then use the 20 point
2113 font.  The new paper size will not take effect if the font is not
2114 loaded and selected afterwords.  Paper size selection works by loading
2115 a file named after the paper size you select.
2116
2117
2118
2119 subsect(Paper variables)
2120
2121 Warning: this section is outdated and inaccurate.  
2122
2123 There are a large number of paper variables that are used to control
2124 details of the layout.  Usually you will not want to change these
2125 variables; they are set by default to vaules that depend on the font
2126 size in use.   The values are used by the graphic objects while
2127 formatting the score; they are therefore implementation dependent.
2128 Most variables are accompanied by documentation in the
2129 initalization file file(params.ly) or file(paperSZ.ly), where code(SZ)
2130 is the staff height in points.
2131
2132
2133 Nevertheless, here are some variables  you may want to use or change:
2134
2135 description(
2136 dit(code(indent)) Sets the indentation of the first line of music.
2137
2138 dit(code(interline)) The distance between two staff lines, calculated
2139 from the center of the lines.  You should use either this or
2140 code(rulethickness) as a unit for distances you modify.
2141   
2142 dit(code(linewidth))  Sets the width of the lines.  If it is set to
2143 -1.0, then a single unjustified line is produced.  
2144
2145 dit(code(output)) Specifies an alternate
2146 name for the TeX() output.  A file(.tex) extension will be added to
2147 the string you specify.
2148
2149 dit(code(rulethickness)) Determines thickness of staff lines and bars. 
2150 )
2151
2152 In order to change the font size used for the output, many variables
2153 need to be changed.  Some identifiers and initialization files can
2154 simplify this process.  The default size is 20pt.  In order to select
2155 a different size, you must do two things.  At the top level, do
2156 code(\include "paper)var(SZ)code(.ly") where var(SZ) is the height of
2157 the staff in points.  Values presently allowed are 11, 13, 16, 20, and
2158 26.  This loads some definitions, but does not cause them to take
2159 effect.  In order to actually change the size, you must use one of the
2160 identifiers: code(\paper_eleven), code(\paper_thirteen),
2161 code(\paper_sixteen), code(\paper_twenty) or code(\paper_twentysix)
2162 inside a code(\paper) block.
2163
2164
2165
2166 subsect(MIDI Instrument Names)
2167 label(midilist)
2168
2169 The MIDI instrument name is set by the code(Staff.midiInstrument)
2170 property or, if that property is not set, the code(Staff.instrument)
2171 property.  The instrument name should be chosen from this list.  If
2172 string does not exactly match one from this list then LilyPond uses
2173 the default piano.
2174
2175 COMMENT( acordina = accordion, tango accordian = concertina
2176          distortion guitar = distorted guitar
2177          orchestral strings = harp 
2178          pan flute = wood flute? )
2179
2180 verb("acoustic grand"               "contrabass"             "lead 7 (fifths)"
2181 "bright acoustic"              "tremolo strings"        "lead 8 (bass+lead)"
2182 "electric grand"               "pizzicato strings"      "pad 1 (new age)"
2183 "honky-tonk"                   "orchestral strings"     "pad 2 (warm)"
2184 "electric piano 1"             "timpani"                "pad 3 (polysynth)"
2185 "electric piano 2"             "string ensemble 1"      "pad 4 (choir)"
2186 "harpsichord"                  "string ensemble 2"      "pad 5 (bowed)"
2187 "clav"                         "synthstrings 1"         "pad 6 (metallic)"
2188 "celesta"                      "synthstrings 2"         "pad 7 (halo)"
2189 "glockenspiel"                 "choir aahs"             "pad 8 (sweep)"
2190 "music box"                    "voice oohs"             "fx 1 (rain)"
2191 "vibraphone"                   "synth voice"            "fx 2 (soundtrack)"
2192 "marimba"                      "orchestra hit"          "fx 3 (crystal)"
2193 "xylophone"                    "trumpet"                "fx 4 (atmosphere)"
2194 "tubular bells"                "trombone"               "fx 5 (brightness)"
2195 "dulcimer"                     "tuba"                   "fx 6 (goblins)"
2196 "drawbar organ"                "muted trumpet"          "fx 7 (echoes)"
2197 "percussive organ"             "french horn"            "fx 8 (sci-fi)"
2198 "rock organ"                   "brass section"          "sitar"
2199 "church organ"                 "synthbrass 1"           "banjo"
2200 "reed organ"                   "synthbrass 2"           "shamisen"
2201 "accordion"                    "soprano sax"            "koto"
2202 "harmonica"                    "alto sax"               "kalimba"
2203 "concertina"                   "tenor sax"              "bagpipe"
2204 "acoustic guitar (nylon)"      "baritone sax"           "fiddle"
2205 "acoustic guitar (steel)"      "oboe"                   "shanai"
2206 "electric guitar (jazz)"       "english horn"           "tinkle bell"
2207 "electric guitar (clean)"      "bassoon"                "agogo"
2208 "electric guitar (muted)"      "clarinet"               "steel drums"
2209 "overdriven guitar"            "piccolo"                "woodblock"
2210 "distorted guitar"             "flute"                  "taiko drum"
2211 "guitar harmonics"             "recorder"               "melodic tom"
2212 "acoustic bass"                "pan flute"              "synth drum"
2213 "electric bass (finger)"       "blown bottle"           "reverse cymbal"
2214 "electric bass (pick)"         "skakuhachi"             "guitar fret noise"
2215 "fretless bass"                "whistle"                "breath noise"
2216 "slap bass 1"                  "ocarina"                "seashore"
2217 "slap bass 2"                  "lead 1 (square)"        "bird tweet"
2218 "synth bass 1"                 "lead 2 (sawtooth)"      "telephone ring"
2219 "synth bass 2"                 "lead 3 (calliope)"      "helicopter"
2220 "violin"                       "lead 4 (chiff)"         "applause"
2221 "viola"                        "lead 5 (charang)"       "gunshot"
2222 "cello"                        "lead 6 (voice)")
2223
2224
2225
2226 subsect(Translators)
2227 label(translators)
2228
2229 The behavior of notation contexts is defined by the translators for
2230 those contexts.  The translator for a context specifies what notations
2231 are handled by the context, it specifies what other contexts the
2232 context can contain, and it sets property values for the context.  
2233 There are different translators for each type of output.  The
2234 translators for paper output are defined in file(engraver.ly).  The
2235 translators for MIDI output are defined in file(performer.ly).  
2236
2237 The first thing that appears inside a code(\translator) definition is
2238 the type of the context being created.  This is specified with the
2239 code(\type) keyword: code(\type) var(typename)code(;).  After the type
2240 of the context is specified, property assignments, the code(\name)
2241 keyword and code(\consists), code(\accepts), and code(\remove)
2242 keywords can appear in any order.  The code(\name) keyword specifies
2243 the name of the context that is handled by the translator.  If the
2244 name is not specified, the translator won't do anything.  Each
2245 code(\accepts) keyword specifies what contexts can be contained inside
2246 this one.  The code(\consists) keywords specify which notations are
2247 handled by the context.  Each code(\consists) keyword specifies the
2248 name of an engraver (for paper ouput) or performer (for MIDI output)
2249 which handles a certain notation.  The code(\remove) keyword can be
2250 used to remove a performer or engraver from the translator.
2251
2252 In the code(\paper) block, it is also possible to define translator
2253 identifiers.  Like other block identifiers, the identifier can only
2254 be used as the very first item of a translator.  In order to define
2255 such an identifier outside of code(\score), you must do
2256 verb(
2257 \paper{ foo=\translator{ ... } }
2258 \score{
2259   \notes{ ... }
2260   \paper{ \translator{ \foo ... } }
2261 })
2262
2263 Some of the standard translators have predefined identifiers, making
2264 it easy to redefine these contexts by adding or removing items.  The
2265 predefined identifiers are: code(StaffContext),
2266 code(RhythmicStaffContext), code(VoiceContext), code(ScoreContext),
2267 code(ScoreWithNumbers)
2268
2269
2270 subsubsect(Paper Types and Engravers and Pre-defined Translators)
2271
2272 Notation contexts are built from LilyPond modules called Engravers and
2273 Performers. 
2274
2275 Some pre-defined identifiers can simplify modification of translators.
2276 The pre-defined identifiers are:  
2277 description(
2278 dit(code(StaffContext)) Default Staff  context. 
2279 dit(code(RhythmicStaffContext)) Default RhythmicStaff  context. 
2280 dit(code(VoiceContext)) Default Voice  context.  
2281 dit(code(ScoreContext))  Default  Score context. 
2282 dit(code(ScoreWithNumbers)) Score  context with numbering at  the
2283 Score level.   
2284 dit(code(BarNumberingStaffContext)) Staff context with numbering  at
2285 the Staff level.  
2286 dit(code(HaraKiriStaffContext))
2287   Staff context that does not print if it only contains rests.  Useful for
2288   orchestral scores.footnote(Hara kiri is the ritual suicide of the Samourai)
2289 dit(code(OrchestralPartStaffContext))
2290 dit(code(OrchestralScoreContext))
2291 )
2292 Using these pre-defined values, you can remove  or add items to the
2293 translator verb(\paper{ \translator{ \StaffContext
2294                      \remove Some_engraver;
2295                      \consists Different_engraver;  }})
2296       
2297
2298
2299 There are four types for paper translators:
2300 description(
2301   dit(code(Engraver_group_engraver))
2302   dit(code(Hara_kiri_line_group_engraver))
2303   dit(code(Line_group_engraver_group))
2304   dit(code(Score_engraver))
2305   dit(code(Grace_group_engraver_group))
2306 )
2307 COMMENT( The names of these types seem somewhat confusing. )
2308
2309 The engravers for paper output are:
2310
2311 description(
2312 dit(code(Abbreviation_beam_engraver)) [FIXME. Broken as of 1.0.?]
2313 dit(code(Bar_engraver)) Engraves bar lines.  Normally in code(Staff) and
2314 code(RhythmicStaff).  
2315 dit(code(Bar_number_engraver)) Engrave bar numbers.  These numbers
2316 appear at the start of each line.  Not normally in any translator.  Can
2317 be added to code(Score) for Score-wide numbering or to code(Staff) for
2318 numbering on each staff.  
2319
2320 dit(code(Beam_engraver)) Handles beam requests by engraving beams.  Normally
2321 appears in the code(Voice) translator.  If omitted, then notes will be printed
2322 with flags instead of beams.
2323
2324 dit(code(Beam_req_swallow_translator)) Swallows beam requests.  In
2325 code(LyricVoice).  
2326 dit(code(Chord_name_engraver)) Engraves chord names.  Normally in
2327 code(ChordNameVoice) 
2328 dit(code(Clef_engraver)) Engraves the clef symbol.  Normally in code(Staff).
2329 dit(code(Collision_engraver))
2330 dit(code(Dot_column_engraver)) Engraves dots on dotted notes shifted to the
2331 right of the note.  Normally in code(Voice).  If omitted, then dots appear on
2332 top of the notes.  
2333 dit(code(Dynamic_engraver)) Engraves dynamics symbols.  Normally in code(Voice).
2334 dit(code(Font_size_engraver))
2335 dit(code(Key_engraver)) Engraves the key signature.  Normally in code(Staff).
2336 dit(code(Local_key_engraver))
2337 dit(code(Lyric_engraver)) Engraves lyrics.  Normally in code(LyricVoice).
2338 dit(code(Multi_measure_rest_engraver)) Engraves multi-measure rests that are
2339 produced with code(R).  Normally in code(Voice).
2340 dit(code(Piano_bar_engraver))
2341 dit(code(Pitch_squash_engraver)) Treat all pitches as middle C.  Used in
2342 code(RhythmicStaff).  Note that the notes move, but the locations of
2343 accidentals stay the same. 
2344 dit(code(Priority_horizontal_align_engraver))
2345 dit(code(Repeat_engraver)) Handles repeats? In code(Staff) and 
2346    code(RhythmicStaff).
2347 dit(code(Rest_collision_engraver)) Handles collisions of rests. In code(Staff).
2348 dit(code(Rest_engraver)) Engraves rests.  Normally in code(Voice).
2349 dit(code(Rhythmic_column_engraver))
2350 dit(code(Score_priority_engraver))
2351 dit(code(Script_engraver)) Handles note ornaments generated by code(\script).
2352 Normally in code(Voice).  
2353 dit(code(Separating_line_group_engraver))
2354 dit(code(Skip_req_swallow_translator))
2355 dit(code(Slur_engraver)) Engraves slurs.  Normally in code(Voice).
2356 dit(code(Span_bar_engraver)) Engraves lines across multiple staffs.  Normally
2357 in code(Staffgroup) and code(GrandStaff).  Removing this from code(StaffGroup)
2358 gives the definition of code(ChoirStaff).  
2359 dit(code(Span_score_bar_engraver))
2360 dit(code(Staff_group_bar_engraver))
2361 dit(code(Staff_margin_engraver)) Prints the name of the instrument
2362 (specified by code(Staff.instrument) and code(Staff.instr)) at the
2363 left of the staff.  
2364 dit(code(Staff_sym_engraver))
2365 dit(code(Stem_engraver)) Engraves stems.  Normally in code(Voice).
2366 dit(code(Ties_engraver)) Engraves ties.  Normally in code(Voice).
2367 dit(code(Time_signature_engraver)) Engraves the time signature.  Normally in
2368 code(Staff) and code(RhythmicStaff).
2369 dit(code(Timing_engraver)) Responsible for synchronizing timing information
2370 from staffs.  Normally in code(Score).  In order to create polyrhythmic music,
2371 this engraver should be removed from code(Score) and placed in code(Staff).
2372 dit(code(Tuplet_engraver)) Engraves tuplet brackets?  In code(Staff).
2373 dit(code(Vertical_align_engraver)) 
2374 )
2375
2376
2377 subsubsect(MIDI Types and Performers)
2378
2379 The types available for  MIDI translators are:
2380 description(
2381 dit(code(Performer_group_performer))
2382 dit(code(Score_performer))
2383 dit(code(Staff_performer))
2384 )
2385
2386 The performers for MIDI translators are:
2387 description(
2388 dit(code(Key_performer))
2389 dit(code(Time_signature_performer))
2390 dit(code(Note_performer))
2391 dit(code(Lyric_performer))
2392 dit(code(Swallow_performer))
2393 )
2394
2395 )