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