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