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