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