]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/tex/refman.yo
5331fe1269343f1f613730223f2db51eed6fb697
[lilypond.git] / Documentation / tex / refman.yo
1 COMMENT(-*-text-*-)
2
3 redef(var)(1)(whenlatex(latexcommand({\normalfont\scshape )ARG1+latexcommand(}))\
4     whenhtml(sc(ARG1)))
5
6
7 redef(code)(1)(tt(ARG1))
8
9 COMMENT(
10
11 TODO:
12    the use of semicolons needs to be documented once it settles down
13    \times needs documentation with examples somewhere once it works (?)
14    paper size?
15    the explanation of how lyrics mode parses words seems ridiculous.  
16      Is there a simple way to explain this, or is the behavior
17      too complicated for a reasonable explanation?
18 )
19
20
21 COMMENT( This document contains Mudela fragments.  You need at least
22 Yodl-1.30.18 to convert this to tex or html.
23
24 TODO
25
26 in stead <-> instead
27 )
28
29 htmlbodyopt(bgcolor)(white)
30 htmlcommand(<font color=black>)
31
32 latexlayoutcmds(
33 \setlength{\topmargin}{-0.25in}
34 \setlength{\textheight}{9in}
35 \setlength{\textwidth}{5.875in} 
36 \setlength{\oddsidemargin}{0.25in}   
37 \setlength{\evensidemargin}{0.25in}
38 \input mudela-book
39 )
40
41 whentexinfo(notableofcontents())
42
43 article(Mudela 1.0.7 / LilyPond 1.0.15 Reference Manual)
44       (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen)
45       (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop())
46
47 COMMENT(
48
49 * The [ ] look weird
50
51 * paragraphs have too much space.
52
53 )
54
55
56 latexcommand(\def\interexample{})
57 latexcommand(\def\preexample{\par})
58 latexcommand(\def\postexample{\par\medskip})
59 latexcommand(\def\file#1{{code(#1)}})
60 COMMENT(
61 latexcommand(\def\texttt#1{\tt #1})
62 latexcommand(\def\textbf#1{\bf #1})
63 )
64
65 COMMENT(urg, texinfo include breaks)
66 whenhtml(
67 includefile(html-disclaimer.yo-urg)
68 )
69
70 bf(This document is not up to date).  All rendered examples of course
71 are current, but the rest probably isn't.  Adjusting the tutorial was
72 considered more important than writing the reference manual.  We
73 apologize for the inconvenience.  For a complete and up-to-date
74 definition, see file(lily/parser.yy), file(lily/lexer.ll), and the
75 init files.
76
77 This document describes the the GNU LilyPond input format, which is an
78 effective language for defining music.  We call this language (rather
79 arrogantly) The Musical Definition Language or Mudela, for
80 short.footnote(If anybody comes up with a better name, we'd gladly
81   take this. Gourlay already uses Musical Description Language,
82   G-Sharp Score Definition Language.  ISO standard 10743 defines a
83   Standard Music Description Language.  We're not being original here.)
84
85 The first aim of Mudela is to define a piece of music, being complete
86 from both from a musical typesetting, as from a musical performing
87 point of view.
88
89 The Musical Definition Language (Mudela), has a logical structure,
90 making use of identifiers, that allows for flexible input, and
91 definition reuse. See the documentation file file(MANIFESTO), included
92 with the LilyPond sources for reasons and design considerations.
93
94
95 sect(Running LilyPond)
96
97 When invoked with a filename that has no extension, LilyPond will try adding
98 a file(.fly) extension first, and a file(.ly) extension second.  
99 If the filename ends with 
100 file(.fly),  LilyPond processes  the file as music using
101 file(init.fly).  In this case, LilyPond does something
102 like:
103 verb(\score {
104   \notes\relative c {
105     \input "yourfile.fly"
106   }
107   \paper{}
108   \midi{}
109 })
110 If you invoke LilyPond with a file file(foo.)var(ext) that doesn't
111 have the file(.ly) extension then LilyPond will look for a file called
112 file(init.)var(ext) and process this file.  The file
113 file(init.)var(ext) must contain the code(\maininput) keyword or LilyPond
114 will not read the user specified file.
115
116
117 sect(Syntax)
118
119 subsect(Basic Mudela)
120
121 A Mudela file consists of keywords with arguments and identifier
122 assignments separated by spaces, tabs or newlines.  Semicolons are
123 used by some keywords but are not generally required.  A one line
124 comment is introduced by a code(%) character.  Block comments are
125 started by code(%{) and ended by code(%}).  They cannot be nested.
126
127 Mudela supports several types:
128
129 description(
130
131 dit(integer) 
132 Formed from an optional minus sign followed by digits.  Arithmetic
133 operations cannot be done with integers, and integers cannot be mixed
134 with reals.
135
136 dit(real) 
137 Formed from an optional minus sign and a sequence of digits followed
138 by a emph(required) decimal point and an optional exponent such as
139 code(-1.2e3).  Reals can be built up using the usual operations:
140 code(+), code(-), code(*), and code(/), with parentheses for grouping.
141
142 dit(string) 
143 Begins and ends with the code(") character.  To include a code(")
144 character in a string write code(\").  Various other backslash
145 sequences have special interpretations as in the C language.  A string
146 that contains no spaces can be written without the quotes.  See
147 Section ref(modes) for details on unquoted strings; their
148 interpretation varies depending on the situation.  On the right side
149 of identifier assignments and within the code(\header) keyword,
150 strings can be concatenated using the code(+) character.
151
152 dit(dimension) Consists of a real followed by one of the dimension
153 keywords: code(\mm), code(\pt), code(\in), or code(\cm).  Dimensions
154 are converted immediately to a real which gives the dimension in
155 points, so they can be mixed with reals, but the result is no longer
156 of type dimension.  The keywords that require a dimension
157 (code(\shape) and code(\symboltables)) will not accept this.
158
159 dit(pitch) 
160 A pitch is a string which is the name of a pitch.  Example: code(a).
161 The pitch names can be redefined with the code(\notenames) keyword.
162 See Section(notelang) for pitch names in different languages.  Pitches
163 can only be specified inside note mode which is specified with
164 code(\notes).  Therefore, keywords which require pitch arguments must
165 appear inside code(\notes).  
166
167 dit(music) 
168 Music is a compound type: arbitrarily complicated expressions with a
169 hierarchical structure can be formed from simple building blocks.  The
170 simplest expression of type music is a single note.  A note is formed
171 from a pitch and an optional duration and must be specified within
172 code(\notes).  See Section ref(notedesc) for details.  More
173 complicated expressions of type music are formed by surrounding a
174 sequence of expressions of type music with braces code({) and code(})
175 or with angle brackets code(<) and code(>).  Items appearing in braces
176 will be treated as serial. Items in angle brackets will be
177 simultaneous.  So for example code({ c e g }) represents an arpeggio
178 and code(< c e g >) represents a chord.  These items can be nested any
179 way you like.  This simple example shows how three chords can be
180 expressed in two different ways:
181 mudela(fragment,verbatim,center)(
182 \notes<{a b  c'}{c' d' e'}{e' f' g'}>
183 \notes{<a c' e'><b  d' f'><c' e' g'>}
184 )
185
186 )
187
188
189 COMMENT(
190 Compound types are built up from the simple types.  The compound types
191 are: arglist, assignlist and musiclist.  An arglist is a
192 white space separated list of integers, reals and or strings surrounded
193 by braces code({) and code(}).  An assignlist is a list of 
194 identifier assignments, which have the form var(key)code(=)var(value).
195 A statement in Mudela has one of three forms:
196 verb(\keyword argument
197 \keyword argument1 argument2 ... ;
198 string=value)
199 )
200
201 subsect(Identifiers)
202
203 Identifiers allow names to be assigned to constants, music, or other
204 Mudela structures.  To assign an identifier you use
205 var(name)=var(value) and to refer to an identifier, you preceed its
206 name with a backslash: code(\)var(name).  It is legal to redefine an
207 identifier in terms of its old value: code(foo = \foo * 2.0).
208 Identifier assignments must appear at the top level in the Mudela
209 file.
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(absdynamic   header         musicalpitch   remove         times
217 accepts      in             name           score          translator
218 bar          include        notenames      script         transpose 
219 cadenza      key            notes          shape          type      
220 clef         keysignature   paper          skip           version   
221 cm           lyrics         partial        spandynamic 
222 consists     maininput      penalty        symboltables
223 duration     mark           property       table       
224 font         midi           pt             tempo       
225 grouping     mm             relative       time)
226
227 The right hand side of an identifier assignment is parsed completely
228 when the assignment is made.  It therefore must have any context
229 specified in the definition.  For example, you must write
230 code(foo=\notes{a8 b c}) rather than code(foo={a8 b c}).  Even though
231 the context is specified in the definition, you must refer to the
232 identifier inside the correct context:
233 verb(foo = \paper{ linewidth = 6.0\in; }
234 \score{
235   \notes{ ... }
236   \paper{ \foo }
237 })
238 If code(\foo) is used here without the surrounding code(\paper) then
239 an error will result.  Note however that the following is acceptible
240 verb(foo = \notes { ... }
241 \score{ \foo })  
242 It is not necessary to specify code(\notes).
243
244 Identifiers can be set equal to integers, reals, strings, music,
245 durations (specified with code(\duration)), note ornaments (specified
246 with code(\script), dynamics commands, or code(:)), note name tables
247 (specified with code(\notenames), translator definitions, the
248 code(\paper) block, the code(\midi) block or the code(\score) block.
249 When identifiers are used for translators, the code(\paper),
250 code(\midi), and code(\score) blocks, they may only be referred to as
251 the first item in a block.  So code(\paper{\one \two}) is illegal
252 because the identifier code(\two) is not the first thing in the block.
253 Unlike other identifier definitions, translator identifier definitions
254 can only appear within code(\midi) or code(\paper) blocks.  See
255 Section ref(translators) for more information.
256
257
258 COMMENT(
259 subsect(Hierarchical structures)
260
261 The general structure consists of declarations:
262 verb(IDENTIFIER = \TYPE{
263         <type specific data>
264 })
265 and instantiations:
266
267 verb(\TYPE{ <type specific data> })
268
269 (Currently, code(\score) is the only type that can be instantiated
270 at top level.)
271
272 Most instantiations that use an IDENTIFIER are specified as follows:
273
274 verb(\TYPE{ \IDENTIFIER [...] })
275
276 Some exceptions on this rule have been made to prevent inputting
277 Mudela becoming tedious
278 )
279
280
281 subsect(Modes)
282 label(modes)
283
284 To simplify different aspects of music definition (entering the notes
285 and manipulating them) Mudela has three different input modes which
286 affect how unquoted strings are interpreted.
287 In each mode, words are identified on the input.  If code("word") is
288 encountered, it is treated as a string.  If code(\word) is
289 encountered it is treated as a keyword or as an identifier.  The
290 behavior of the modes differs in two ways: different modes treat
291 unquoted words different, and different modes have different rules for
292 deciding what is a word.  
293
294 description(
295
296 dit(Normal mode)
297 At the start of parsing, Mudela is in normal mode.
298 In normal mode, a word is an alphabetic character followed by
299 alphanumeric characters.  If code(word) is encountered on the input it
300 is treated as a string. 
301
302 dit(Note mode) Note mode is introduced by the keyword
303 code(\notes).  In Note mode, words can only contain alphabetic
304 characters.  If code(word) is encountered, LilyPond first checks for a
305 notename of code(word).  If no notename is found, then code(word) is
306 treated as a string.  If you mistype a notename, the parser will most
307 likely complain that you should be in code(\lyrics) mode to do lyrics. 
308
309 dit(Lyric mode) Lyrics mode is introduced by the keyword
310 code(\lyrics).  This mode is has rules that make it easy to include
311 punctuation and diacritical marks in words.  A word in Lyrics mode
312 begins with: an alphabetic character, code(_),
313 code(?), code(!), code(:), code('), 
314 the control characters code(^A) through code(^F), code(^Q) through
315 code(^W), code(^Y), code(^^), any 8-bit character with ASCII code over
316 127, or a two character combination of a backslash followed by one
317 of code(`), code('), code(") or code(^).  
318 Subsequent characters of a word can be any character that is not a
319 digit and not white space.  One important consequence of this is that
320 a word can end with code(}), which may be confusing if you thought the
321 code(}) was going to terminate lyrics mode.  Any code(_) characters
322 which appear in an unquoted word are converted to spaces, providing a
323 mechanism for introducing spaces into words without using quotes.  
324 Quoted words can also be used in lyrics mode to specify words that
325 cannot be specified with the above rules.  Here are some examples.
326 Not all of these words are printable by TeX().  
327 verb(a&@&@&TSI|{[    % a word
328 \'afoo}         % a word
329 1THtrhortho     % not a word because it starts with a digit
330 ``Hello''       % not a word because it starts with `
331 Leise DOEXPAND(Fl\)DOEXPAND("u\)ss{}teren meine Sapfe       % 4 words
332 _ _ _ _         % 4 words, each one a space
333 ))
334
335
336 COMMENT(
337 These modes are of a lexical nature. Normal and Note mode largely
338 resemble each other, save the possibility of entering Reals, 
339 meaning of code(_) and the resolution of words
340
341 What's this about reals?  When can you enter them or not enter them?)
342
343
344 sect(Note Description)
345 label(notedesc)
346
347 subsect(Basic Note Specification)
348
349 A note specification has the form 
350 var(pitch)[var(octavespec)][code(!)][var(duration)].
351 The pitch of the note is specified by the note's name.  
352
353 LilyPond has predefined note names for various languages.  The default
354 names are the Dutch note names.  The notes are specified by the
355 letters code(c) through code(b), where code(c) is an octave below
356 middle C and the letters span the ocatave above that C.  
357 In Dutch, a sharp is formed by adding
358 code(-is) to the end of a pitch name.  A flat is formed by adding code(-es).
359 Double sharps and double flats are obtained by adding code(-isis) or
360 code(-eses).  
361 Lily has predefined sets of notenames
362 for various nop(languages).  See Section ref(notelang) for details.
363 Rests are specified with the note name code(r) or code(R).  
364 There is also a note name code(s) which produces a nonprinting note of the
365 specified duration.
366
367 The optional octave specification takes the form of a series of single
368 quote 
369 code(') characters or a series of comma code(,) characters.  Each
370 code(') raises the pitch by one octave; each code(,) lowers the pitch
371 by an octave.  
372
373 mudela(fragment,verbatim,center)(
374 c' d' e' f' g' a' b' c''
375 )
376
377 mudela(fragment,verbatim,center)(
378 cis' dis' eis' fis' gis' ais' bis'
379 )
380
381 mudela(fragment,verbatim,center)(
382 ces' des' es' fes' ges' as' bes'
383 )
384
385 mudela(fragment,verbatim,center)(
386 cisis' eisis' gisis' aisis' beses'
387 )
388
389 mudela(fragment,verbatim,center)(
390 ceses' eses' geses' ases' beses'
391 )
392
393 Whenever a C-sharp is desired,  you must specify a C-sharp.  LilyPond
394 will determine what accidentals to  typeset  depending on the  key and
395 context.   
396 A reminder accidental can be forced by
397 using the  optional exclamation mark `code(!)'
398 on a pitch.
399 mudela(fragment,verbatim,center)(
400 cis' d' e' cis'  c'! d' e' c' 
401 )
402
403
404 Durations are entered as their reciprocal values
405 mudela(fragment,verbatim,center)(
406 a'1 a'2 a'4 a a'8 a a'16 a'32 a'64
407 )
408 mudela(fragment,verbatim,center)(
409 r1 r2 r4 r8 r16 r32
410 )
411
412 If the duration is omitted then it is set equal to the previous
413 duration.  If there is no previous duration, then a quarter note is
414 assumed.  
415 The duration can be followed by a dot code(.) to obtain dotted note
416 lengths.  
417 mudela(fragment,verbatim,center)(
418 a'4. b'4.
419 )
420
421 In addition, the duration can be followed by a multiplier which is
422 introduced with the asterisk code(*) and can be an integer or a
423 fraction.  The multiplier changes the duration that LilyPond uses
424 internally for the note, but for notes it 
425 does not change the symbol that is printed.  
426 mudela(fragment,verbatim,center)(
427 c'4*2 c'4*2 d'8*2/3 d'8*2/3
428 )
429 For long rests with durations equal to an integer number of whole notes,
430 LilyPond produces output that indicates the duration of the rest.  If you use
431 code(r) then one rest symbol will be printed and several measures left blank.
432 If you use code(R) then all of the measure will be filled with whole rests.
433 If you set the code(Score.SkipBars) property, then only one measure will be
434 printed; with code(R), a number indicating the length of the rest will be
435 displayed.  
436 mudela(fragment,verbatim,center)(
437 r1*3 R1*3
438 \property Score.SkipBars=1
439 r1*3 R1*3)
440
441 Extra long notes can be obtained using the code(\breve) and
442 code(longa) durations:
443 mudela(fragment,verbatim,center)(
444 c'\breve gis'\longa
445 )
446
447
448 subsect(Note Spanners: Beams, Tuplets, Slurs and Ties)
449
450 A beam is specified by surrounding the beamed notes with brackets
451 code([) and code(]).  
452 mudela(fragment,verbatim,center)(
453 [a'8 a'] [a'16 a' a' a']
454 )
455
456 In order to create triplets, you must use a length multiplier after
457 the brackets.  An open bracket code([) followed by a fraction
458 instructs LilyPond to print a number over the beam, and it also
459 starts multiplying all note lengths by the fraction.  The closing
460 bracket code(]) should be followed by the fraction code(1/1) in order
461 to restore normal note lengths.  To create a triplet without a beam,
462 place a backslace code(\) before the opening and closing brackets. 
463
464 For example, in an ordinary triplet, the notes have duration 2/3 as
465 long as normal. 
466 mudela(fragment,verbatim,center)(
467 [2/3 a'8 a' a' ]1/1 \[2/3 b'4 b' b'\]1/1
468 )
469
470 There is a shorthand that can be used when you 
471 want notes lengths multiplied by 2/n.  
472 The 2 can be omitted after the open bracket
473 and the first 1 can be omitted after the closing bracket.  
474 mudela(fragment,verbatim,center)(
475 [/3 b'8 b' b' ]/1  \[/3 a'4 a'8\]/1
476 )
477
478 COMMENT(This next bit needs to be fixed...or the language needs to be
479 fixed.)
480
481 Here is a combination
482 mudela(fragment,verbatim,center)(
483 [/3 a'8 a'16 a'] a'8 \]
484 )
485
486 Another type of spanner is the slur.  Slurs connects chords and try to
487 avoid crossing stems.  A slur is started with code(CHAR(40)) and stopped with
488 code(CHAR(41)).  The starting code(CHAR(40)) appears to the right of the first note
489 in the slur.  The terminal code(CHAR(41)) apppears to the left of the first
490 note in the slur.  This makes it possible to put a note in slurs from
491 both sides:
492 mudela(fragment,verbatim,center)(
493 f'()g'()a' [a'8 b']( a'4 g' )f'
494 )
495
496 A tie connects two adjacent note heads.  When used with chords, it
497 connects all of the note heads.  Ties are indicated using the tilde symbol
498 code(~) by analogy with TeX()'s tie which connects words.  For ties
499 between chords, the input convention is somewhat peculiar.  You cannot
500 write code(<c g>~<c g>), but rather must put the tilde after
501 a note within the first chord.  
502
503 mudela(fragment,verbatim,center)(
504 e' ~ e' <c'~ e' g'><c' e' g'>
505 )
506
507
508 subsect(Note Ornaments)
509
510 A variety of symbols can appear above and below notes to indicate
511 different characteristics of the performance.  
512 These symbols can be
513 added to a note with `var(note)code(-\)var(name)'.  Numerous different
514 symbols are defined in file(script.ly).  Each symbol is defined using
515 the code(\script) keyword which specifies where symbols appear.
516 Symbols can be forced to appear above the note by writing
517 `var(note)code(^\)var(name)', and they can be forced to appear below
518 by writing `var(note)code(_\)var(name)'.  Here is a chart showing
519 symbols above notes, with the name of the corresponding symbol
520 appearing underneath.  
521
522 mudela()(
523 \score{
524  < \notes{ c''-\accent c''-\marcato c''-\staccatissimo f'-\fermata 
525           c''-\stopped c''-\staccato c''-\tenuto c''-\upbow c''-\downbow
526           c''-\lheel c''-\rheel  c''-\ltoe  c''-\rtoe  c''-\turn
527           c''-\open  c''-\flageolet  c''-\reverseturn 
528           c''-\trill
529           c''-\prall c''-\mordent c''-\prallprall  c''-\prallmordent
530           c''-\upprall c''-\downprall }
531   \type Lyrics \lyrics{  
532         accent      marcato      staccatissimo fermata stopped
533            staccato tenuto upbow downbow lheel rheel ltoe rtoe  turn
534            open  flageolet reverseturn 
535              trill  prall
536            mordent prallprall prallmordent uprall  downprall }>
537   \paper{linewidth  = 5.875\in;
538          indent = 0.0;
539         }
540 }
541 )
542
543 COMMENT( The following are defined in script.ly but do not work:
544
545 portato lbheel rbheel lbtoe rbtoe lfheel rfheel lftoe rftoe )
546
547 In addition, it is possible to place arbitrary strings of text or
548 TeX() above or below notes by using a string instead of an identifier:
549 `code(c^"text")'.  Fingerings can be placed by simply using digits.
550 All of these note ornaments appear in the printed output but have no
551 effect on the MIDI rendering of the music.
552
553 To save typing,  a few common symbols  can  be  abbreviated  with
554 single characters:
555 mudela()(
556 \score{ \notes {
557         \property Voice.textstyle = typewriter
558         c''4-._"c-." s4
559         c''4--_"c-{}-"  s4
560         c''4-+_"c-+" s4
561         c''4-|_"c-|" s4
562         c''4->_"c->"  s4
563         c''4-^_"c-\\^{ }"  s4 }
564         \paper { linewidth = 12.\cm; }})
565
566 Dynamic marks are specified by using an identifier after a note
567 without a dash: code(c4 \ff).  Note that this syntax is inconsistent
568 with the syntax for other types of ornaments.  The available dynamic
569 marks are: code(\ppp), code(\pp), code(\p), code(\mp), code(\mf),
570 code(\f), code(\ff), code(\fff), code(\fp), code(sf), and code(\sfz).
571
572 A crescendo mark is started with code(\cr) and terminated with
573 code(\rc).  A decrescendo mark is started with code(\decr) and
574 terminated with code(\rced).  There are also shorthands for these
575 marks.  A crescendo can be started with code(\<) and a decrescendo can
576 be started with code(\>).  Either one can be terminated with code(\!).
577
578 Tremolo marks can be printed by a note by adding code(:)[var(length)]
579 after the note.  The length must be at least 8.  A var(length) value
580 of 8 gives one line across the note stem.  
581 If the length is omitted,
582 then the last value is used, or the value of the code(Abbrev)
583 property if there was no last value.  To place tremolo marks in
584 between two notes, begin with code([:)var(length) and end with code(]).
585 The tremolo marks will appear instead of beams.  Putting more than two
586 notes in such a construction will produce odd effects. 
587 mudela(fragment,verbatim,center)(
588 c'2:8 c':32 [:16 e'1 g'] [:8 e'4 f']
589 )
590
591 COMMENT(
592 Is the last paragraph correct?  Is it called "tremolo"?  Why is
593 "abbreviation" used?  (What is the unabreviated form?)
594
595
596 mudela(fragment,verbatim,center)(
597 c'4:32 [:16 c'8 d'8]
598 )
599
600 )
601
602
603 sect(Other Ways to Enter Pitches)
604
605 subsect(Pitch Names in Other Languages)
606 label(notelang)
607
608 The pitch names can be easily redefined using the code(\notenames) command.
609 Note name definitions have been provided in various languages.  
610 Simply include the language specific init file.  For example:
611 code(\include "english.ly").  The available language files and the names
612 they define are:
613
614 verb(                        Note Names               sharp       flat
615 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
616 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
617 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
618 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
619 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
620 italiano.ly    do  re  mi  fa  sol la  sid si  -d          -b)
621
622 subsect(Relative Pitch Specification)
623 label(relative)
624
625 One very common error when entering music is to place notes in the wrong
626 octave.  One way to avoid being confused by large numbers of octave changing
627 marks is to use
628 the code(\relative) keyword. 
629 Music which appears within code(\relative) is
630 interpreted differently.  The octave of a note is determined by making it as
631 close to the previous note as possible.  The octave changing marks code(') and
632 code(,) can then be added to raise or lower this note by octaves.  You have to
633 specify a starting pitch because the first note of a list has no predecessor.  
634
635 mudela(fragment,verbatim,center)(
636 \relative c'' { c d b c, d b c' d 
637                 b c,, d b }
638 )
639
640 When the preceeding item is a chord, the first note of the chord is used to
641 determine the first note of the next chord.  But other notes within the second
642 chord are determined by looking at the immediately preceeding note.  
643
644 mudela(fragment,verbatim,center)(
645 \relative c' { <c e g> 
646     <c' e g> <c, e' g> }
647
648
649 The code(\relative) keyword can only appear in music, so there must be a
650 surrounding code(\notes) keyword which does not appear in the fragments shown
651 above.  Also note that if the music passed to a code(\relative) keyword 
652 contains a code(\transpose) keyword, the tranposed music will not be
653 processed in relative mode.  An additional code(\relative) must be placed
654 inside the code(\transpose).  
655
656
657 subsect(Tranposition of Pitches)
658 label(transpose)
659
660 Another way to modify the meaning of the note names is to use the
661 code(\transpose) keyword.  This keyword allows you to transpose music.
662 To use transposition, specify the pitch that middle C should be tranposed to.
663 It is important to distinguish between enharmonic pitches as they can produce
664 different transpositions.  To transpose up half a step, for example, either 
665 code(\transpose cis') or code(\transpose des') will work.  But the first
666 version will print sharps and the second version will print flats.  
667 In this example, a scale in the key of E is transposed to F, or to E-sharp 
668 with odd results.
669 mudela(fragment,verbatim,center)(
670 \relative c' { \key e; 
671   e fis gis a b cis dis e }
672 )
673 mudela(fragment,verbatim,center)(
674 \transpose des' \relative c' { \key e; 
675    e fis gis a b cis dis e }
676 )
677 mudela(fragment,verbatim,center)(
678 \transpose cis' \relative c' { \key e; 
679     e fis gis a b cis dis e }
680 )
681 If you want to use both code(\transpose) and code(\relative), then you must use
682 code(\transpose) first.  Any code(\relative) keywords that are outside the 
683 code(\transpose) have no effect on notes that appear inside the
684 code(\transpose).  
685
686 sect(Lyrics)
687
688 Lyrics are entered like notes, with pitches replaced
689 by text.  For example code(Twin-4 kle4 twin-4 kle4) enters four
690 syllables, each with quarter note duration.  Note that the hyphen has
691 no special meaning for lyrics, and does not introduce special symbols.
692 See Section ref(modes) for a description of what is interpreted as a lyric.
693
694 In order to instruct LilyPond to write lyrics underneath the
695 staff, you must enter the lyrics context with code(\type Lyrics).  
696 Lyrics should be entered in lyrics mode which is entered with code(\lyrics).
697
698 Spaces can be introduced into a lyric either by using quotes (code("))
699 or by using an underscore without quotes: code(He_could4 not4).  All
700 unquoted underscores are converted to spaces.  Here is a full example: 
701 mudela(verbatim)(\score{
702   <  \notes \transpose c'' {c d e c | c d e c | e f g'2 | 
703                               e'4 f g'2 \bar "|."; }
704      \type Lyrics \lyrics { 
705               DOEXPAND(Fr\)`e-4 re Ja- que DOEXPAND(Fr\)`e- re Ja- que
706               Dor- mez vous?2 Dor-4 mez vous?2  }
707   >
708 })
709
710 COMMENT(
711 URG
712                         Fr\`e-4 re Ja- que
713                         Fr\`e- re Ja- que
714 Why does this warrant an URG?
715 )
716
717
718 COMMENT(
719
720 sect(Chords and Voices)
721
722 Here's a simple chord
723 mudela(fragment,verbatim,center)(
724 <c e g>
725 )
726
727 here are a few
728 mudela(fragment,verbatim,center)(
729 <
730         { c'()d'()c' }
731         { e'()f'()e' }
732         { g'()a'()g' }
733 >
734 )
735
736 and similarly voices
737 mudela(fragment,verbatim)(
738 <
739         { \voiceone c'4 g' c' g' }
740         { \voicetwo c2 g2 }
741 >
742 )
743
744 )
745
746 sect(Time)  
747
748 LilyPond aligns all musical objects according to the amount of time
749 they occupy.  All of these objects have a duration.  When music is
750 written sequentially using braces the duration is the sum of the 
751 durations of the elements.  When music is stacked into simultaneous music 
752 using angle
753 brackets, the duration is the maximum of the durations of the
754 elements.  
755
756 Because LilyPond knows the durations of all musical elements, the time
757 signature enables LilyPond to draw bar lines automatically.  The time
758 signature is specified with the code(\time) keyword: code(\time 3/4).
759 If no time signature is given, LilyPond assumes 4/4.  The automatic
760 generation of bar lines can toggled with the code(\cadenza) keyword,
761 and an incomplete measure at the start of the music can be created
762 using the code(\partial) keyword: code(\partial 8*2;) creates a
763 starting measure lasting two eighth notes.
764
765 In order to help with error checking, you can insert bar markers in
766 your music by typing code(|).  Whenever LilyPond encounters a code(|)
767 that doesn't fall at a measure boundary, she prints a warning message.
768
769 Rhythmic grouping is  a concept closely associated with this. 
770 A default grouping is selected for the chosen time signature.  
771 The default consists of combinations of 2 and 3 beats with as many
772 groups of 3 as possible, and the groups of 3 coming first.  For
773 example, 4/4 is divided into 2+2 and 8/8 is divided into 3+3+2.  This
774 default grouping can be changed using the \grouping keyword which
775 takes a list of durations to specify the grouping. 
776
777
778 COMMENT(
779 sect(Composition: forming bigger structures)
780 label(sec:grammar)
781
782 The computer savy user may be interested in a more formal
783 specification.  We can capture what have learned about forming
784 sentences in Mudela in a context-free grammar.
785
786 latexcommand(\smallskip)
787
788 table(2)(lll)(
789         row(cell(em(Music))cell(: em(Note)))
790         row(cell()cell(code(|) em(Rest)))
791         row(cell()cell(code(|) code({) em(MusicList) code(})))
792         row(cell()cell(code(|) code(<) em(MusicList) code(>)))
793         row(cell()cell(code(|) em(Command)))
794         row(cell()cell(code(|) code(\type) em(string) code(=) em(string)  em(Music)))
795         row(cell()cell(;))
796         row(cell(em(MusicList))cell(: em(empty)))
797         row(cell()cell(code(|)  em(MusicList)  em(Music)))
798         row(cell()cell(;))
799 )
800
801 latexcommand(\smallskip)
802
803 In mathematics you can form expressions by combining expressions,
804 which are ultimately some kind of atom or terminal symbol.  The same
805 goes for Mudela: there are some basic building blocks, and by
806 combining those you create complex music.
807
808 You can combine music in three ways:
809 itemize(
810 it()If you enclose a sequence of music-elements in braces ( code({)
811     and code(}) ), then you form another kind of music called
812 sequential music
813     with those pieces.
814   The duration of sequential composition is the sum of the durations of its elements
815   verb(
816       { c c g g a a g2 }      % twinkle twinkle
817       { { c c g g} { a a g2 } }
818   )
819 it()You can stack music by enclosing a sequence of music elements
820     with code(<) and code(>). This is called simultaneous music.  
821     The duration of a simultaneous composition is the maximum of the durations 
822     of its elements Example:
823     verb(
824         <a4 {cis8 cis8} e'4>      % a-major chord
825     )
826 it()You can form music by transposing music:
827     verb(
828     \transpose  
829         d       % from c to the d that's almost one octave down
830                 { e4 f4 }       % the horizontal music
831 )
832 it()verb(\type)
833 it()verb(\property)
834 it()verb(\translator)
835 it()verb(\relative)
836 )
837
838 Of course you can also combine these three mechanisms.
839 verb(
840 { c <c e> <c e g> <c e g \transpose d' dis > }  % 4 increasing chords
841 )
842
843 )
844
845
846 sect(Keywords)
847
848 Keywords sometimes appear alone, but usually they require arguments.
849 A keyword may have a single argument, a sequence of arguments in
850 braces, or a sequence of arguments separated by spaces and terminated
851 by a semicolon.  The precise syntax of each keyword is shown below.
852 Keywords must appear in the right context.  If you use a keyword in
853 the wrong place, even if the usage is syntactically correct, you will
854 get the message ``parse error'' from LilyPond.
855
856
857 description(
858
859 dit(code(\absdynamic) code({) var(code) code(})) Internal keyword for
860 printing dynamic marks such as $f$ under music.  The parameter
861 var(code) is unsigned and specifies the dynamic mark to print.
862 Normally you should use the more user friendly abbreviations defined
863 in the init file file(dynamic.ly).
864
865 dit(code(\accepts) var(string)code(;)) This keyword can appear only within a
866 code(\translator) block.  It specifies what contexts are allowed with the
867 context that is being defined.  See Section ref(translators).  
868
869 dit(code(\bar) var(bartype)code(;)) Prints a special bar symbol, or at
870 measure boundaries, replaces the regular bar symbol with a special
871 symbol.  The argument var(bartype) is a string which specifies the
872 kind of bar to print.  Options are code(":|"), code("|:"),
873 code(":|:"), code("||"), code("|."), code(".|"), or code(".|.").
874 These produce respectively a right repeat, a left repeat, a double
875 repeat, a double bar, a start bar, an end bar, or a thick double bar.
876 If var(bartype) is set to code("empty") then nothing is printed, but a
877 line break is allowed at that spot.  Note that the printing of special bars
878 has no effect on the MIDI output.
879
880 dit(code(\cadenza) var(togglevalue)code(;)) Toggles the automatic generation
881 of bar lines.  If var(togglevalue) is 0 then bar line generation is
882 turne off.   If var(togglevalue) is  1  then a bar is  immediately
883 printed and bar generation is turned  on.
884
885 dit(code(\clef) var(clefname)code(;)) Allowed only in music.  
886 Sets the current clef.  The argument is
887 a string which specifies the name of the clef.  Several clef names are
888 supported.  If code(_8) or code(^8) is added to the end of a clef
889 name then the clef lowered or raised an octave will be generated.  
890 Here are the supported clef names with middle C shown in each clef:
891 mudela(center)(
892 \score{
893   \notes{ \cadenza 1;
894    %\property Voice.textstyle = typewriter
895    \clef subbass; c'4-"\kern-10mm subbass" 
896            \clef bass;    c'4^"\kern -8mm bass"
897            \clef baritone; c'4_"\kern -10mm baritone"
898            \clef varbaritone; c'4^"\kern -10mm varbaritone"
899            \clef tenor;     c'4_"\kern -10mm tenor"
900            \clef "G_8";   c'4^"\kern -6mm G\_8"  }  
901    \paper{ linewidth= 4.5 \in; }
902 }
903 )
904 mudela(center)(
905 \score{
906   \notes{\cadenza 1; \clef alto;    c'4_"\kern -10mm alto"
907            \clef mezzosoprano; c'4^"\kern -10mm mezzosoprano"
908            \clef soprano;  c'4_"\kern -10mm soprano"
909            \clef treble;  c'4^"\kern -6mm treble"
910            \clef french;  c'4_"\kern -10mm french" }  
911   \paper{ linewidth= 4.5 \in; }
912 }
913 )
914 The treble  clef  can also  be obtained using  the  names code(G) or
915 code(violin).  The bass clef is also available by code(\clef  F). 
916
917 dit(code(\cm)) Specify a dimension in centimeters. 
918
919 dit(code(\consists) var(string)code(;)) This keyword can appear only within a
920 code(\translator) block.  It specifies that an engraver or performer named
921 var(string) should be added to the translator.  See Section
922 ref(translators).
923
924 dit(code(\duration) code({) var(length) var(dotcount) code(})) Specify note
925 duration.  The parameter var(length) is the negative logarithm (base
926 2) of duration: 1 is a half note, 2 is a quarter note, 3 is an eighth
927 note, etc.  The number of dots  after  the  note is given by
928 var(dotcount). 
929
930 dit(code(\font) var(string)) Internal keyword.  Used within
931 code(\symboltables) to specify the font.
932
933 dit(code(\grouping) var(durationseq)code(;))  Sets  the  metric structure of
934 the measure.  Each argument specifies the duration of one metric unit.
935 For example, code(\duration 16*5;) specifies a grouping of five beats
936 together in 5/16 time.  The default grouping is to have as many groups
937 of 3 as possible followed by groups of two.  
938
939 dit(code(\header) code({) var(key1) = var(val1); var(key2) = var(val2); ... code(}))
940 Specifies information about the music.  A header should appear at the
941 top of the file describing the file's contents.  If a file has
942 multiple code(\score) blocks, then a header should appear in
943 each score block describing its contents.  Tools like code(ly2dvi) can
944 use this information for generating titles.   Some possible key values
945 are: title, opus, description, composer, enteredby, and copyright.
946
947 dit(code(\in)) Specify a dimension in inches.  
948
949 dit(code(\include) var(file)) Include the specified file.  The
950 argument var(file) is a string.  The full filename including the
951 file(.ly) extension must be given, and the filename must be quoted.
952 (An unquoted string will not work here.)
953
954 dit(code(\key) var(pitch)code(;)) Change key signature to that of
955 var(pitch)-major. The predefined identifiers code(\major) and
956 code(\minor) decide if all subsequent code(\key) commands are given in
957 major or minor, respectively.
958   
959
960 dit(code(\keysignature) var(pitchseq)code(;))
961 Specify an arbitrary key signature.  The pitches from var(pitch) will
962 be printed in the key signature in the order that they appear on the list.
963
964 dit(code(\lyrics) var(lyriclist)) Parse var(lyriclist) in lyrics mode.
965
966 dit(code(\maininput)) Internal command.  This command is used for creating init
967 files like file(init.fly) that read the user file into the middle of another
968 file.  Using it in a user file will lead to an infinite loop.
969         
970 dit(code(\mark) var(unsigned)code(;) or code(\mark) var(string)code(;)) 
971 Allowed in music only.  Prints a mark over or under (?) the staff.
972 You must add code(Mark_engraver) to the Score context and it only
973 seems to work if the mark appears at the beginning of a line.
974
975 dit(code(\midi) var(statementlist)) Appears in a score block to
976 indicate that musical output should be produced and to set output
977 parameters.  Can also appear at the top level to set default output
978 parameters.  See code(\tempo).
979
980 dit(code(\mm)) Specify a dimension in millimeters. 
981
982 dit(code(\musicalpitch) code({) var(octave) var(note) var(shift) code(})) 
983 Specify note pitch.  The octave is specified by an integer,
984 zero for the octave containing middle C.  The note is a number from 0
985 to 7, with 0 corresponding to C and 7 corresponding to B.  The shift
986 is zero for a natural, negative to add flats, or positive to add
987 sharps.
988
989 dit(code(\name) var(context)code(;)) Appears within code(\translator) to
990 specify the name of the context that the translator handles. See Section
991 ref(translators).   
992
993 dit(code(\notenames) var(assignmentlist)) Define new note names.  This
994 keyword can appear only at the top level. 
995 The argument is a list of definitions of  the form
996 var(name) = var(pitch),  where var(pitch) is specified with the
997 code(\musicalpitch) keyword.  
998
999 dit(code(\notes) var(music)) Enter note mode and process the
1000 specified music. 
1001
1002 dit(code(\)code(output) var(string)code(;)) Generate a parse error.
1003
1004 dit(code(\paper) var(statmentlist)) 
1005 Appears in a score block to indicate that the music should be printed
1006 or to set output parameters.  Can also appear at the top level to set
1007 default output parameters for all of the score blocks.  
1008 The var(statmentlist) contains statements that change features of the
1009 output.  See Section ref(paper).  
1010
1011 dit(code(\partial) var(duration)code(;)) Specify that the first measure of
1012 the music lasts only for the specified duration.
1013
1014 dit(code(\penalty) code(=) var(int)code(;)) Allowed only in music.
1015 Discourage or encourage line breaks.  See identifiers code(\break) and
1016 code(\nobreak) in Section ref(ident). 
1017
1018 dit(code(\property) var(contextname)code(.)var(propname) code(=) var(value))
1019 Sets the var(propname) property of the context var(contextname) to the
1020 specified var(value).  All three arguments are strings.  Depending on
1021 the context it may be necessary to quote the strings or to leave space
1022 on both sides of the dot. 
1023
1024 dit(code(\pt)) Specify a dimension in points. 
1025
1026 dit(code(\relative) var(pitch) var(music)) Processes the specified
1027 var(music) in relative pitch
1028 mode.  In this mode, the octave of a pitch is chosen so that the
1029 pitch is closest to the preceeding pitch.  
1030 The argument var(pitch) is
1031 the starting pitch for this comparision.  In the case of chords, the
1032 first note of a chord is used as the base for the first pitches in the next
1033 chord.  See Section ref(relative).
1034
1035 dit(code(\remove) var(string)code(;)) Can appear only in a
1036 code(\translator) block.  Specifies that a performer or engraver named
1037 var(string) should be removed.  See Section ref(translators).  
1038
1039 dit(code(\score) var(statementlist)) Create a Score context.  This
1040 is the top level notation context.  
1041 COMMENT(this still needs work)
1042
1043 dit(code(\script) code({) var(name) var(instaff) var(withstem)
1044 var(location) var(invertible) var(priority) code(})) This keyword is
1045 used the initialization file(script.ly) to define the various symbols
1046 that can appear above and below notes.  The first argument is the name
1047 of the symbol.  The second argument var(instaff) is 1 if the symbol
1048 follows the notehead into the staff and 0 if the symbol stays above or
1049 below the staff lines.  The third parameter var(withstem) is 0 if the
1050 symbol's placement does not depend on the stem direction; it is 1 if
1051 the symbol should be at the stem end of the note and it is -1 if the
1052 symbol should be at the note head end of the note.  The argument
1053 var(location) is set to 1 for symbols that always appear above the
1054 staff; it is -1 for symbols that appear below the staff.  If
1055 var(invertible) is set to 1 then the symbol can be inverted; otherwise
1056 it cannot.  The last argument var(priority) sets a priority for the
1057 order of placement of several symbols on a single note.
1058
1059 dit(code(\shape) code(=) var(indent1) var(width1) var(indent2)
1060 var(width2) ... code(;)) Allowed only within code(\paper).  Each pair
1061 of var(indent) and var(width) values is a dimension specifying how far
1062 to indent and how wide to make the line.  The indentation and width of
1063 successive lines are specified by the successive pairs of dimensions.
1064 The last pair of dimensions will define the characeristics of all
1065 lines beyond those explicitly specified.
1066
1067 COMMENT(First pair of dimensions seems to be skipped.  At least it is
1068 in the example file denneboom.ly.)
1069
1070 dit(code(\skip) var(duration)code(;)) Skips the amount of time specified by
1071 var(duration).  A gap will be left for the skipped time with no notes
1072 printed.  It works in Note Mode or Lyrics Mode (but generates a
1073 mysterious error in lyrics).
1074
1075 dit(code(\spandynamic) code({) var(kind) var(toggle) code(})) Internal
1076 keyword for crescendo and decrescendo symbols.  The first parameter
1077 var(kind) is set to 1 for a crescendo and -1 for a decrescendo.  The
1078 second parameter is set to 1 to start the mark and 2 to stop it.
1079 Users should use the abbreviations which are defined in the
1080 initialization file file(dynamic.ly).
1081
1082 dit(code(\symboltables)) Internal keyword.  Used to create symbol
1083 tables.  See initialization files file(paper*.ly), file(feta*.ly), and
1084 file(table*.ly).  
1085
1086 dit(code(\table)) Internal keyword.  Used within code(\symboltables)
1087 to specify the tables.  See initialization files. 
1088
1089 dit(code(\tempo) var(duration) = var(perminute)code(;)) Used within
1090 code(\midi) or within music to specify the tempo.  For example, 
1091 `code(\midi { \tempo 4 = 76;})' requests output with 76 quarter notes
1092 per minute.  Note that if the music contains several tempo commands,
1093 only the last one is used to set the tempo for the entire MIDI output. 
1094 COMMENT(Is this true?)
1095
1096 dit(code(\time) var(numerator)code(/)var(denominator)code(;)) Change the time
1097 signature.  The default time signature is 4/4.  
1098
1099 dit(code(\times) var(numerator)code(/)var(denominator) var(music))
1100 Multiply the duration of var(music) by the specified fraction.
1101
1102 dit(code(\translator) var(statements) or code(\translator)
1103 var(context) = var(name)) The first variant appears only within
1104 code(\paper) and specifies a translator for
1105 converting music to notation.  The translator is specified with a
1106 single code(\type) statement and a series of code(\accepts), and
1107 code(\consists) statements.  See Section ref(translators). 
1108 The second variant appears in 
1109 music.  It specifies that the current the contexts
1110 contained within the specified context should be shifted to the
1111 context with the specified name.  
1112
1113 COMMENT( \translator seems like a strange name for the second
1114 operation, and is the overloading desireable? )
1115
1116 dit(code(\transpose) var(pitch) var(music)) Transposes the specified
1117 music.  Middle C is tranposed to var(pitch).  This is allowed in music only,
1118 and if it appears inside code(\relative), then any notes specified for
1119 transposition should be specified inside another code(\relative).  See Section
1120 ref(transpose).  
1121
1122 dit(code(\type) var(contexttype) [code(=) var(contextname)]
1123 var(music) or code(\type) var(translatortype)code(;)) The first
1124 variant is used only within music to create an instance of a
1125 context.  The new context can optionally be given a name.  The
1126 specified var(music) is processed in the new context. The second
1127 variant appears within a code(\translator) block and specifies the
1128 type of translator being created.
1129
1130 dit(code(\version) var(string)) Specify the version of Mudela that a
1131 file was written for.  The argument is the version number, for example
1132 code("1.0.1").  Note that the Mudela version is different from the
1133 LilyPond version.
1134
1135 )  
1136
1137
1138 sect(Notation Contexts)
1139
1140 Notation contexts provide information that appears in printed music
1141 but not in the music itself.  A new musical context is created using
1142 the code(\type) keyword: `code(\type) var(contexttype) [code(=)
1143 var(contextname)] var(music)'.  The following context types are
1144 allowed.
1145
1146 description(
1147
1148 dit(code(LyricVoice)) Corresponds to a voice with lyrics.  Handles the printing
1149 of a single line of lyrics.  
1150
1151 dit(code(Voice)) Corresponds to a voice on a staff.
1152   This context handles the conversion of noteheads,
1153   dynamic signs, stems, beams, super- and subscripts, slurs, ties and rests.
1154
1155 dit(code(Lyrics)) Typesets lyrics.  It can contain code(LyricVoice) contexts.
1156
1157 dit(code(Staff)) Handles clefs, bar lines, keys,
1158   accidentals.  It can contain code(Voice) contexts.
1159
1160 dit(code(RhythmicStaff)) A context like code(Staff) but for printing
1161 rhythms.  Pitches are ignored; the notes are printed on one line.  
1162 It can contain code(Voice) contexts. 
1163
1164 dit(code(GrandStaff)) Contains code(Staff) or code(RhythmicStaff)
1165 contexts.  It adds a brace on the left side grouping the staffs
1166 together. The bar lines of the contained staffs are connected vertically.
1167 It can contain code(Staff) contexts.
1168
1169 dit(code(StaffGroup)) Contains code(Staff) or code(RhythmicStaff)
1170 contexsts.  Adds a bracket on the left side, grouping the staffs
1171 together.  The bar lines of the contained staffs are connected vertically.
1172 It can contain code(Staff), code(RhythmicStaff), code(GrandStaff) or code(Lyrics) contexts.  
1173
1174 dit(code(ChoirStaff)) Identical to code(StaffGroup) except that the
1175 contained staffs are not connected vertically.  
1176
1177 dit(code(Score)) This is the top level notation context.  It is specified with
1178 the code(\score) keyword rather than the code(\type) command.  No
1179 other context can contain a code(Score) context.  This context handles
1180 the administration of time signatures.  It also makes sure that items
1181 such as clefs, time signatures, and key-signatures are aligned across
1182 staffs.  It can contain code(Lyrics), code(Staff),
1183 code(RhythmicStaff), code(GrandStaff), code(StaffGroup), and
1184 code(ChoirStaff) contexts.
1185
1186 )
1187
1188 The various contexts have properties associated with them.  These
1189 properties can be changed using the code(\property) command:
1190 `code(\property) var(context)code(.)var(propname) code(=) var(value)'.
1191 Properties can also be set within the code(\translator) block
1192 corresponding to the appropriate context.  In this case, they are
1193 assigned by `var(propname) code(=) var(value)'.  The settings made with
1194 code(\property) are processed after settings made in the code(\translator)
1195 block, so the code(\property) settings will override code(\translator)
1196 settings.  
1197
1198 The code(\property) keyword will create any property you specify.
1199 There is no guarantee that a property will actually be used.  If you
1200 spell a property name wrong, there will be no error message.  In order to find
1201 out what properties are used, you must search the source code 
1202 for code(get_property).  
1203 Properties that are set in one context are inherited by all of the
1204 contained contexts.  This means that a property valid for the Voice
1205 context can be set in the Score context (for example) and thus take
1206 effect in all Voice contexts.  
1207
1208 subsubsubsect(Lyrics properties)
1209
1210 description(
1211
1212 dit(code(textstyle)) Set the font for lyrics.  The available font
1213 choices are code(roman), code(italic), code(bold), code(large),
1214 code(Large), code(typewriter), and code(finger).  The code(finger)
1215 font can only display numbers.  Note also that you must be careful
1216 when using code(\property) in Lyrics mode.  Because of the way strings
1217 are parsed, either put quotes around the arguments to code(\property)
1218 or be sure to leave a space on both sides of the dot.
1219
1220 dit(code(textalignment)) Controls alignment of lyrics.  Set to code(\left)
1221 to align the left end of the lyric with the note; set to code(\right) to
1222 align the right end of the lyric with the note.  Set to code(\center) to
1223 align the center of the lyric with the note.  
1224
1225 )
1226
1227 subsubsubsect(Voice properties)
1228
1229 description(  
1230
1231 dit(code("midi_instrument")) Sets the instrument for MIDI output.  This
1232 property name must be quoted because of the embedded underscore.  If
1233 this property is not set then LilyPond will use the code(instrument)
1234 property.  This must be set to one of the strings on the list of MIDI
1235 instruments that appears in Section ref(midilist).  If you use a
1236 string which is not listed, LilyPond will silently substitute piano. 
1237
1238 dit(code(transposing)) Tranpose the MIDI output.  Set this property to
1239 the number of half-steps to transpose by.
1240
1241 dit(code(ydirection)) Determines the direction of stems, subscripts,
1242 beams, slurs, and ties.  Set to code(\down) to force them down,
1243 code(\up) to force them up, or code(\free) to let LilyPond decide.
1244 This can be used to distinguish between voices on the same staff.  The
1245 code(\stemdown), code(\stemup), and code(\stemboth) identifiers set
1246 this property.  See also the identifiers code(\voiceone),
1247 code(\voicetwo), code(\voicethree) and code(\voicefour).
1248
1249 dit(code(slurydirection)) Set to code(\free) for free choice of slur
1250 direction, set to code(\up) to force slurs up, set to code(\down) to
1251 force slurs down.  The shorthands code(\slurup), code(\slurdown), and
1252 code(\slurboth) are available.
1253
1254 dit(code(slurdash)) Set to 0 for normal slurs, 1 for dotted slurs, and
1255 a larger value for dashed slurs.  Identifiers code(\slurnormal) and
1256 code(\slurdotted) are predefined to set the first two settings.
1257
1258 dit(code(hshift)) Set to 1 to enable LilyPond to shift notes
1259 horizontally if they collide with other notes.  This is useful when
1260 typesetting many voices on one staff.  The identifier code(\shift) is
1261 defined to enable this.
1262
1263 dit(code(dynamicdir)) Determines location of dynamic marks.  Set to
1264 code(\up) to print marks above the staff; set to code(\down) to print
1265 marks below the staff.
1266
1267 dit(code(textalignment)) Controls alignment of superscripted and
1268 subscripted text.  Set to \left to align the left end of the text with
1269 the note; set to \right to align the right end of the text with the
1270 note.  Set to \center to align the center of the text with the note.
1271
1272 dit(code(textstyle)) Set the text style for superscripts and
1273 subscripts.  See above for list of text styles.
1274
1275 dit(code(fontsize)) Can be used to select smaller font sizes for
1276 music.  The normal font size is 0, and the two smaller sizes are -1
1277 and -2.
1278
1279 dit(code(pletvisibility)) Determines whether tuplets of notes are
1280 labelled.  Setting to 0 shows nothing; setting to 1 shows a number;
1281 setting to 2 shows a number and a bracket if there is no beam; setting
1282 to 3 shows a number, and if there is no beam it adds a bracket;
1283 setting to 4 shows both a number and a bracket unconditionally.  
1284
1285 )
1286
1287 subsubsubsect(Staff properties)
1288
1289 description(
1290  
1291 dit(code(defaultClef)) Determines the default clef.  See code(\clef)
1292 keyword.
1293
1294 dit(code(nolines)) Sets the number of lines that the staff has.
1295  
1296 dit(code(barAlways)) If set to 1 a bar line is drawn after each note.
1297
1298 dit(code(defaultBarType)) Sets the default type of bar line.  See
1299 code(\bar) keyword.
1300
1301
1302 dit(code(keymodality)) The number of semitones that should be added to
1303 the pitch given in the subsequent code(\key) commands to get the
1304 corresponding major key, e.g. minor keys are specified by
1305 code(keymodality=3). Is set by code(\major) and code(\minor).
1306
1307 dit(code(keyoctaviation)) If set to 1, then keys are the same in all
1308 octaves.  If set to 0 then the key signature for different octaves can
1309 be different and is specified independently: code(\keysignature bes
1310 fis').  The default value is 1.  Can be set to zero with
1311 code(\specialkey) or reset to 1 with code(\normalkey).
1312
1313 dit(code(instrument) and code(instr)) If code(Staff_margin_engraver)
1314 is added to the Staff translator, then the code(instrument) property
1315 is used to label the first line of the staff and the code(instr)
1316 property is used to label subsequent lines.  If the
1317 code(midi_instrument) property is not set then code(instrument) is
1318 used to determine the instrument for MIDI output.
1319 COMMENT(This prints the instrument name on top of the staff lines.)
1320
1321 dit(code(abbrev)) Set length for tremolo to be used if no length is
1322 explicitly specified.
1323
1324 dit(code(createKeyOnClefChange)) Set to a nonempty string if you want key
1325 signatures to be printed when the clef changes.  Set to the empty string (the
1326 default) if you do not want key signatures printed.
1327
1328
1329 dit(code(timeSignatureStyle)) Changes the default two-digit layout
1330    for time signatures. The following values are recognized:
1331    description(
1332       dit(code(C)) 4/4 and 2/2 are typeset as C and struck C,
1333       respectively. All other time signatures are written with two digits.
1334       dit(code(old)) 2/2, 3/2, 3/4, 4/4, 6/4 and 9/4 are typeset with
1335       old-style mensuration marks. All other time signatures are 
1336       written with two digits.
1337       dit(code(1)) All time signatures are typeset with a single
1338       digit, e.g. 3/2 is written as 3.
1339       dit(code(C2/2), code(C4/4), code(old2/2), code(old3/2),
1340       code(old3/4), code(old4/4), code(old6/4) or
1341       code(old9/4)) Tells Lilypond to use a specific symbol as time
1342       signature.
1343    )
1344 The different time signature characters are shown below with
1345 their names:
1346 mudela(fragment,center)(
1347 \relative c'' {
1348 \property Voice.textstyle = typewriter
1349 \property Staff.timeSignatureStyle = "C2/2"
1350 \time 2/2; a2^"C2/2" a2 
1351 \property Staff.timeSignatureStyle = "C4/4"
1352 \time 2/2; a2^"C4/4" a2 
1353 \property Staff.timeSignatureStyle = "old2/2"
1354 \time 2/2; a2^"old2/2" a2 
1355 \property Staff.timeSignatureStyle = "old3/2"
1356 \time 2/2; a2^"old3/2" a2 
1357 \property Staff.timeSignatureStyle = "old4/4"
1358 \time 2/2; a2^"old4/4" a2 
1359 \property Staff.timeSignatureStyle = "old6/4"
1360 \time 2/2; a2^"old6/4" a2 
1361 \property Staff.timeSignatureStyle = "old9/4"
1362 \time 2/2; a2^"old9/4" a2 
1363 }
1364 )
1365
1366
1367 )
1368    
1369
1370
1371 subsubsubsect(GrandStaff properties)
1372
1373 description( 
1374
1375 dit(code(maxVerticalAlign)) Set the maximum vertical distance between
1376 staffs.
1377
1378 dit(code(minVerticalAlign)) Set the minimum vertical distance between
1379 staffs.  
1380
1381 )
1382
1383 subsubsubsect(Score properties)
1384
1385 description(
1386
1387 dit(code(SkipBars)) Set to 1 to skip the empty bars that are produced
1388 by multimeasure notes and rests.  These bars will not appear on the
1389 printed output.  Set to zero (the default) to expand multimeasure
1390 notes and rests into their full length, printing the appropriate
1391 number of empty bars so that synrchonization with other voices is
1392 preserved.  COMMENT(meaning of "skip" here seems to be different from
1393 the meaning used for the keyword \skip.)
1394
1395 dit(code(beamquantisation)) Set to code(\none) for no quantization.
1396 Set to code(\normal) to quantize position and slope.  Set to
1397 code(\traditional) to avoid wedges.  These three settings are
1398 available via code(\beamposfree), code(\beamposnormal), and
1399 code(\beampostraditional).
1400
1401 dit(code(beamslopedamping)) Set to code(\none) for undamped beams.
1402 Set to code(\normal) for damped beams.  Set to code(\infinity) for
1403 beams with zero slope.  The identifiers code(\beamslopeproportional),
1404 code(\beamslopedamped), and code(\beamslopezero) each set the
1405 corresponding value.
1406
1407 )
1408        
1409
1410 COMMENT(
1411
1412 Mystery properties:
1413
1414 bar-number-engraver.cc:  "barScriptPadding"  vertical space for numbers
1415 mark-engraver.cc:        "markScriptPadding" vertical space for marks
1416 span-bar-engraver.cc:    "singleStaffBracket" do single staffs get a bracket?
1417 bar-column-engraver.cc:  "barColumnPriority"        
1418 bar-number-engraver.cc:  "barNumberBreakPriority"   Control horizontal ordering
1419 mark-engraver.cc:        "markBreakPriority"      of bars, clefs, keysig
1420 staff-margin-engraver.cc:"marginBreakPriority"    etc.  Slated for revision
1421 )
1422
1423 sect(Pre-defined Identifiers)
1424 label(ident)
1425
1426 Various identifiers are defined in the initialization files to
1427 provide shorthands for some settings.  
1428
1429 description(
1430 dit(code(\break)) Force a line break in music by using a large
1431 argument for the keyword code(\penalty). 
1432 dit(code(\center)) Used for setting textalignment property.  Is set to 0.
1433 dit(code(\cr)) Start a crescendo.
1434 dit(code(\decr)) Start a decrescendo.
1435 dit(code(\down)) Used for setting direction setting properties.  Is
1436 equal to -1.  
1437 dit(code(\f)) Print forte symbol on the preceeding note.
1438 dit(code(\ff)) Print fortissimo symbol on the preceeding note. 
1439 dit(code(\fff)) Print fortississimo symbol on preceeding note. 
1440 dit(code(\fp)) Print fortepiano symbol on preceeding note. 
1441 dit(code(\free)) Used for setting direction setting properties.  Is
1442 equal to 0.  
1443 dit(code(\Gourlay)) Used for setting the paper variable
1444 code(castingalgorithm).  Is equal to 1.0.  
1445 dit(code(\infinity)) Used for setting the Score.beamslopedamping
1446 property.  Is actually equal to 10000.  
1447 dit(code(\left)) Used for setting textalignment property.  Is equal to -1.
1448 dit(code(\major)) All subsequent code(\key) commands are interpreted
1449 as major keys.
1450 dit(code(\minor)) All subsequent code(\key) commands are interpreted
1451 as minor keys.
1452 dit(code(\mf)) Print mezzoforte symbol on preceeding note. 
1453 dit(code(\mp)) Print mezzopiano symbol on preceeding note. 
1454 dit(code(\nobreak)) Prevent a line break in music by using a large
1455 negative argument for the keyword code(\penalty). 
1456 dit(code(\none)) Used for setting Score.beamslopedamping and
1457 Score.beamquantisation properties.  Is equal to 0.
1458 dit(code(\normal)) Used for setting Score.beamslopedamping and
1459 Score.beamquantisation properties.  Is equal to 1.
1460 dit(code(\normalkey)) Select normal key signatures where each octave
1461 has the same key signature.  This sets the Staff.keyoctaviation property.
1462 dit(code(\p)) Print a piano symbol on preceeding note. 
1463 dit(code(\pp)) Print pianissimo symbol on preceeding note. 
1464 dit(code(\ppp)) Print pianississimo symbol on preceeding note. 
1465 dit(code(\rc)) Terminate a crescendo. 
1466 dit(code(\rced)) Terminate a decrescendo
1467 dit(code(\right)) Used for setting textalignment property.  Is set to 1.
1468 dit(code(\sf)) Print a ?? symbol on preceeding note. 
1469 dit(code(\sfz)) Print a ?? symbol on preceeding note. 
1470 dit(code(\shiftoff)) Disable horizontal shifting of note heads that collide.  
1471 Sets the Voice.hshift property.
1472 dit(code(\shifton)) Enable note heads that collide with other note heads
1473 to be shifted horiztonally.  Sets the Voice.hshift property.
1474 dit(code(\slurboth)) Allow slurs to be above or below notes.  This
1475 sets the Voice.slurydirection property. 
1476 dit(code(\slurdown)) Force slurs to be below notes. This sets the
1477 Voice.slurydirection property. 
1478 dit(code(\slurup)) Force slurs to be above notes.  This sets the
1479 Voice.slurydirection property.  
1480 dit(code(\specialkey)) Allow keys signatures do differ in different
1481 octaves.  This sets the Staff.keyoctaviation property.  
1482 dit(code(\stemboth)) Allow stems, beams, and slurs to point either
1483 direction.  This sets the Voice.ydirection property. 
1484 dit(code(\stemdown)) Force stems, beams, and slurs to point down.
1485 This sets the Voice.ydirection property. 
1486 dit(code(\stemup)) Force stems, beams and slurs to point up.  This
1487 sets the Voice.ydirection property. 
1488 dit(code(\traditional)) Used for setting the 
1489 Score.beamquantisation property.  Is equal to 2.  
1490 dit(code(\up)) Used for setting various direction properties.  Is
1491 equal to 1. 
1492 dit(code(\voiceone)) Enter Voice context called code(one) and force stems down.
1493 (See code(\stemdown).)
1494 dit(code(\voicetwo)) Enter Voice context called code(two) and force stems
1495 up. (See code(\stemup).)
1496 dit(code(\voicethree)) Enter Voice context called code(three) and force stems
1497 up.  
1498 dit(code(\voicefour)) Enter Voice context called code(four), force stems down
1499 and turn on horizontal shifting.  (See code(\stemdown) and code(\shifton).)
1500 dit(code(\Wordwrap)) Used for setting the paper variable
1501 code(castingalgorithm).  Equal to 0.0.  
1502 )
1503
1504
1505 sect(Output)
1506 label(output)
1507 label(paper)
1508
1509 The output produced by LilyPond is controlled by the code(\paper) and
1510 code(\midi) keywords.  These keywords appear in the code(\score) block
1511 to indicate that printed or musical output should be produced.  If
1512 neither keyword appears in a code(\score) block, then paper output is
1513 produced but MIDI output is not produced.  
1514
1515 The contents of the code(\paper) and code(\midi) blocks can change the
1516 output in various ways.  These blocks can appear at the top level of a
1517 Mudela file to set default parameters for each type of output.  It is
1518 still necessary to explicitly specify the output type in the
1519 code(\score) blocks if you don't want the default behavior of
1520 producing only paper output.  
1521
1522 The code(\paper) and code(\midi) blocks 
1523 may begin with an optional identifier reference.  No
1524 identifier references are allowed anywhere else in the block.  
1525 The code(\paper) block can contain the code(\shape) keyword; the
1526 code(\midi) block can contain the code(\tempo) keyword.  Both of them
1527 can contain code(\translator) keywords.  The code(\paper) block can
1528 also contain identifier assignments and parameter assignments.  Unlike
1529 at the top level, these assignments must be terminated by a semicolon.
1530
1531
1532 subsect(Paper variables)
1533
1534 There are a large number of paper variables that are used to control
1535 details of the layout.  Usually you will not want to change these
1536 variables; they are set by default to vaules that depend on the font
1537 size in use.  The only way to find out what variables are supported is
1538 to search the source code for code(get_var).  Two variables that you
1539 may want to change are code(linewidth) and code(indent).
1540
1541 In order to change the font size used for the output, many variables
1542 need to be changed.  Some identifiers and initialization files can
1543 simplify this process.  The default size is 20pt.  In order to select
1544 a different size, you must do two things.  At the top level, do
1545 code(\include "paper)var(SZ)code(.ly") where var(SZ) is the height of
1546 the staff in points.  Values presently allowed are 11, 13, 16, 20, and
1547 26.  This loads some definitions, but does not cause them to take
1548 effect.  In order to actually change the size, you must use one of the
1549 identifiers: code(\paper_eleven), code(\paper_thirteen),
1550 code(\paper_sixteen), code(\paper_twenty) or code(\paper_twentysix)
1551 inside a code(\paper) block.
1552
1553
1554 description(
1555   dit(var(integer)) If an integer appears on the left side of an
1556 assignment then a code(\symboltables) keyword must appear on the right
1557 side.  This defines a music font at a particular size.  See Voice
1558 property code(\fontsize).
1559
1560 dit(code(arithmetic_basicspace) and code(arithmetic_multiplier))
1561 The space taken by a note is determined by the formula 
1562 verb(arithmetic_multiplier * ( c + time ))
1563 where code(time) is the amount of time a note occupies.  The value of
1564 code(c) is affected by code(arithmetic_basicspace).  Increasing
1565 code(arithmetic_basicspace) will increase code(c).
1566 dit(code(barsize)) Specify height of bars.  This value may need to be
1567 adjusted if you change the number of lines in the staff.
1568 dit(code(beam_dir_algorithm)) Specify algorithm for determining
1569 whether beams go up or down.  It is real valued.  If set to 2.0 then
1570 majority selection is used.  If set to 3.0, then mean selection is
1571 used based on the mean center distance.  If set to 4.0 then median
1572 selection is used, based on the median center distance.  
1573 dit(code(beam_ideal_stem1))
1574 dit(code(beam_ideal_stem2))
1575 dit(code(beam_minimum_stem1))
1576 dit(code(beam_minimum_stem2))
1577 dit(code(beam_multiple_break))
1578 dit(code(beam_slope_damp_correct_factor))
1579 dit(code(beam_thickness)) Specify the thickness of beams.
1580 dit(code(castingalgorithm)) 
1581 dit(code(forced_stem_shorten)) Stems that have been forced to go the
1582 unnatural direction are shortened by this amount.  Equal to
1583 code(\interline) by default.  
1584 dit(code(gourlay_energybound))
1585 dit(code(gourlay_maxmeasures)) Maximum number of measures per line
1586 when using Gourlay method.
1587 Decreasing this greatly reduces computation time.  Default value: 10.  
1588 dit(code(indent)) Sets the indentation of the first line of music.  
1589 dit(code(interbeam))
1590 dit(code(interbeam4))
1591 dit(code(interline))  The distance between two staff
1592 lines, calculated from the center of the lines.  
1593 dit(code(linewidth))  Sets the width of the lines.  If it is set to
1594 -1.0, then a single unjustified line is produced.  
1595 dit(code(notewidth)) Width of an average note head.  
1596 dit(code(output)) Specifies an alternate
1597 name for the TeX() output.  A file(.tex) extension will be added to
1598 the string you specify.
1599 dit(code(rulethickness)) Determines thickness of staff lines and bars. 
1600 dit(code(slur_clip_angle))
1601 dit(code(slur_clip_height))
1602 dit(code(slur_clip_ratio))
1603 dit(code(slur_height_limit)) Specifies the maximum height of slurs.
1604 Normally equal to staff_height.
1605 dit(code(slur_ratio)) Specifes the ratio of slur hight to slur width
1606 to aim for.  Default value is 0.3.  
1607 dit(code(slur_rc_factor))
1608 dit(code(slur_slope_damping)) Allows slurs to start and end at
1609 different heights ????  Default value is 0.5.
1610 dit(code(slur_thickness)) Specify slur thickness.  Equal to code(1.4 *
1611 \staffline) by default.  
1612 dit(code(slur_x_gap)) Horizontal space between note and slur.  Set to
1613 code(\interline / 5) by default.  
1614 dit(code(slur_x_minimum))
1615 dit(code(staffheight)) The height of the staff from the center of the
1616 bottom line to the center of the top line.  Equal to to code(4 * \interline).
1617 dit(code(stem_length)) Specify length of stems for notes in the staff
1618 that don't have beams.  
1619 dit(code(stemthickness)) Specifies the thickness of the stem lines.  
1620 dit(code(tie_slope_damping))
1621 dit(code(tie_x_minimum))
1622 )
1623
1624
1625 subsect(MIDI Instrument Names)
1626 label(midilist)
1627
1628 The MIDI instrument name is set by the code(Staff."midi_instrument")
1629 property or, if that property is not set, the code(Staff.instrument)
1630 property.  The instrument name should be chosen from this list.  If
1631 string does not exactly match one from this list then LilyPond uses
1632 the default piano.
1633
1634 COMMENT( acordina = accordion, tango accordian = concertina
1635          distortion guitar = distorted guitar
1636          orchestral strings = harp 
1637          pan flute = wood flute? )
1638
1639 verb("acoustic grand"               "contrabass"             "lead 7 (fifths)"
1640 "bright acoustic"              "tremolo strings"        "lead 8 (bass+lead)"
1641 "electric grand"               "pizzicato strings"      "pad 1 (new age)"
1642 "honky-tonk"                   "orchestral strings"     "pad 2 (warm)"
1643 "electric piano 1"             "timpani"                "pad 3 (polysynth)"
1644 "electric piano 2"             "string ensemble 1"      "pad 4 (choir)"
1645 "harpsichord"                  "string ensemble 2"      "pad 5 (bowed)"
1646 "clav"                         "synthstrings 1"         "pad 6 (metallic)"
1647 "celesta"                      "synthstrings 2"         "pad 7 (halo)"
1648 "glockenspiel"                 "choir aahs"             "pad 8 (sweep)"
1649 "music box"                    "voice oohs"             "fx 1 (rain)"
1650 "vibraphone"                   "synth voice"            "fx 2 (soundtrack)"
1651 "marimba"                      "orchestra hit"          "fx 3 (crystal)"
1652 "xylophone"                    "trumpet"                "fx 4 (atmosphere)"
1653 "tubular bells"                "trombone"               "fx 5 (brightness)"
1654 "dulcimer"                     "tuba"                   "fx 6 (goblins)"
1655 "drawbar organ"                "muted trumpet"          "fx 7 (echoes)"
1656 "percussive organ"             "french horn"            "fx 8 (sci-fi)"
1657 "rock organ"                   "brass section"          "sitar"
1658 "church organ"                 "synthbrass 1"           "banjo"
1659 "reed organ"                   "synthbrass 2"           "shamisen"
1660 "accordion"                    "soprano sax"            "koto"
1661 "harmonica"                    "alto sax"               "kalimba"
1662 "concertina"                   "tenor sax"              "bagpipe"
1663 "acoustic guitar (nylon)"      "baritone sax"           "fiddle"
1664 "acoustic guitar (steel)"      "oboe"                   "shanai"
1665 "electric guitar (jazz)"       "english horn"           "tinkle bell"
1666 "electric guitar (clean)"      "bassoon"                "agogo"
1667 "electric guitar (muted)"      "clarinet"               "steel drums"
1668 "overdriven guitar"            "piccolo"                "woodblock"
1669 "distorted guitar"             "flute"                  "taiko drum"
1670 "guitar harmonics"             "recorder"               "melodic tom"
1671 "acoustic bass"                "pan flute"              "synth drum"
1672 "electric bass (finger)"       "blown bottle"           "reverse cymbal"
1673 "electric bass (pick)"         "skakuhachi"             "guitar fret noise"
1674 "fretless bass"                "whistle"                "breath noise"
1675 "slap bass 1"                  "ocarina"                "seashore"
1676 "slap bass 2"                  "lead 1 (square)"        "bird tweet"
1677 "synth bass 1"                 "lead 2 (sawtooth)"      "telephone ring"
1678 "synth bass 2"                 "lead 3 (calliope)"      "helicopter"
1679 "violin"                       "lead 4 (chiff)"         "applause"
1680 "viola"                        "lead 5 (charang)"       "gunshot"
1681 "cello"                        "lead 6 (voice)")
1682
1683
1684
1685 subsect(Translators)
1686 label(translators)
1687
1688 The behavior of notation contexts is defined by the translators for
1689 those contexts.  The translator for a context specifies what notations
1690 are handled by the context, it specifies what other contexts the
1691 context can contain, and it sets property values for the context.  
1692 There are different translators for each type of output.  The
1693 translators for paper output are defined in file(engraver.ly).  The
1694 translators for MIDI output are defined in file(performer.ly).  
1695
1696 The first thing that appears inside a code(\translator) definition is
1697 the type of the context being created.  This is specified with the
1698 code(\type) keyword: code(\type) var(typename)code(;).  After the type
1699 of the context is specified, property assignments, the code(\name)
1700 keyword and code(\consists), code(\accepts), and code(\remove)
1701 keywords can appear in any order.  The code(\name) keyword specifies
1702 the name of the context that is handled by the translator.  If the
1703 name is not specified, the translator won't do anything.  Each
1704 code(\accepts) keyword specifies what contexts can be contained inside
1705 this one.  The code(\consists) keywords specify which notations are
1706 handled by the context.  Each code(\consists) keyword specifies the
1707 name of an engraver (for paper ouput) or performer (for MIDI output)
1708 which handles a certain notation.  The code(\remove) keyword can be
1709 used to remove a performer or engraver from the translator.
1710
1711 In the code(\paper) block, it is also possible to define translator
1712 identifiers.  Like other block identifiers, the identifier can only
1713 be used as the very first item of a translator.  In order to define
1714 such an identifier outside of code(\score), you must do
1715 verb(\paper{ foo=\translator{ ... }
1716 \score{
1717   \notes{ ... }
1718   \paper{ \translator{ \foo ... } }
1719 })
1720
1721 Some All of the standard translators have predefined identifiers,  making
1722 it easy to redefine these contexts by adding or removing items. 
1723 The predefined identifiers are:  code(StaffContext),
1724 code(RhythmicStaffContext),  code(VoiceContext),  code(ScoreContext), code(ScoreWithNumbers)
1725
1726
1727 subsubsect(Paper Types and Engravers and Pre-defined Translators)
1728
1729 Some pre-defined identifiers can simplify modification of translators.
1730 The pre-defined identifiers are:  
1731 description(
1732 dit(code(StaffContext)) Default Staff  context. 
1733 dit(code(RhythmicStaffContext)) Default RhythmicStaff  context. 
1734 dit(code(VoiceContext)) Default Voice  context.  
1735 dit(code(ScoreContext))  Default  Score context. 
1736 dit(code(ScoreWithNumbers)) Score  context with numbering at  the
1737 Score level.   
1738 dit(code(BarNumberingStaffContext)) Staff context with numbering  at
1739 the Staff level.  
1740 dit(code(HaraKiriStaffContext))  
1741 dit(code(OrchestralPartStaffContext))
1742 dit(code(OrchestralScoreContext))
1743 )
1744 Using these pre-defined values, you can remove  or add items to the
1745 translator verb(\paper{ \translator{ \StaffContext
1746                      \remove Some_engraver;
1747                      \consists Different_engraver;  }})
1748       
1749
1750
1751 There are four types for paper translators:
1752 description(
1753   dit(code(Engraver_group_engraver))
1754   dit(code(Hara_kiri_line_group_engraver))
1755   dit(code(Line_group_engraver_group))
1756   dit(code(Score_engraver))  
1757 )
1758 COMMENT( The names of these types seem somewhat confusing. )
1759
1760 The engravers for paper output are:
1761
1762 description(
1763 dit(code(Abbreviation_beam_engraver))
1764 dit(code(Bar_column_engraver)) 
1765 dit(code(Bar_engraver)) Engraves bar lines.  Normally in code(Staff) and
1766 code(RhythmicStaff).  
1767 dit(code(Bar_number_engraver)) Engrave bar numbers.  These numbers
1768 appear at the start of each line.  Not normally in any translator.  Can
1769 be added to code(Score) for Score-wide numbering or to code(Staff) for
1770 numbering on each staff.  
1771
1772 dit(code(Beam_engraver)) Handles beam requests by engraving beams.  Normally
1773 appears in the code(Voice) translator.  If omitted, then notes will be printed
1774 with flags instead of beams.
1775
1776 dit(code(Beam_req_swallow_translator)) Swallows beam requests.  In
1777 code(LyricVoice).  
1778 dit(code(Clef_engraver)) Engraves the clef symbol.  Normally in code(Staff).
1779 dit(code(Collision_engraver))
1780 dit(code(Dot_column_engraver)) Engraves dots on dotted notes shifted to the
1781 right of the note.  Normally in code(Voice).  If omitted, then dots appear on
1782 top of the notes.  
1783 dit(code(Dynamic_engraver)) Engraves dynamics symbols.  Normally in code(Voice).
1784 dit(code(Font_size_engraver))
1785 dit(code(Key_engraver)) Engraves the key signature.  Normally in code(Staff).
1786 dit(code(Local_key_engraver))
1787 dit(code(Lyric_engraver)) Engraves lyrics.  Normally in code(LyricVoice).
1788 dit(code(Multi_measure_rest_engraver)) Engraves multi-measure rests that are
1789 produced with code(R).  Normally in code(Voice).
1790 dit(code(Note_heads_engraver)) Engraves note heads.  Normally in code(Voice).
1791 Removing this gives a fatal error.  
1792 COMMENT(Perhaps should be Note_head_engraver)
1793 dit(code(Piano_bar_engraver))
1794 dit(code(Pitch_squash_engraver)) Treat all pitches as middle C.  Used in
1795 code(RhythmicStaff).  Note that the notes move, but the locations of
1796 accidentals stay the same. 
1797 dit(code(Plet_engraver)) Engraves brackets and the number over tuplets.  In
1798 code(Voice).  
1799 dit(code(Plet_swallow_engraver)) Swallows tuplet requests without any output.
1800 In code(LyricVoice).  
1801 COMMENT( Should this be named Plet_req_swallow_translator? )
1802 dit(code(Priority_horizontal_align_engraver))
1803 dit(code(Rest_collision_engraver)) Handles collisions of rests. In code(Staff).
1804 dit(code(Rest_engraver)) Engraves rests.  Normally in code(Voice).
1805 dit(code(Rhythmic_column_engraver))
1806 dit(code(Score_priority_engraver))
1807 dit(code(Script_engraver)) Handles note ornaments generated by code(\script).
1808 Normally in code(Voice).  
1809 dit(code(Separating_line_group_engraver))
1810 dit(code(Skip_req_swallow_translator))
1811 dit(code(Slur_engraver)) Engraves slurs.  Normally in code(Voice).
1812 dit(code(Span_bar_engraver)) Engraves lines across multiple staffs.  Normally
1813 in code(Staffgroup) and code(GrandStaff).  Removing this from code(StaffGroup)
1814 gives the definition of code(ChoirStaff).  
1815 dit(code(Span_score_bar_engraver))
1816 dit(code(Staff_group_bar_engraver))
1817 dit(code(Staff_margin_engraver)) Prints the name of the instrument
1818 (specified by code(Staff.instrument) and code(Staff.instr)) at the
1819 left of the staff.  
1820 dit(code(Staff_sym_engraver))
1821 dit(code(Stem_engraver)) Engraves stems.  Normally in code(Voice).
1822 dit(code(Ties_engraver)) Engraves ties.  Normally in code(Voice).
1823 dit(code(Time_signature_engraver)) Engraves the time signature.  Normally in
1824 code(Staff) and code(RhythmicStaff).
1825 dit(code(Timing_engraver)) Responsible for synchronizing timing information
1826 from staffs.  Normally in code(Score).  In order to create polyrhythmic music,
1827 this engraver should be removed from code(Score) and placed in code(Staff).
1828 dit(code(Vertical_align_engraver)) 
1829 )
1830
1831
1832 subsubsect(MIDI Types and Performers)
1833
1834 The types available for  MIDI translators are:
1835 description(
1836 dit(code(Performer_group_performer))
1837 dit(code(Score_performer))
1838 dit(code(Staff_performer))
1839 )
1840
1841 The performers for MIDI translators are:
1842 description(
1843 dit(code(Key_performer))
1844 dit(code(Time_signature_performer))
1845 dit(code(Note_performer))
1846 dit(code(Lyric_performer))
1847 dit(code(Swallow_performer))
1848 )
1849