]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/tex/reference-manual.tely
426b878046f1f2c503127f2c3b5272b571e2b478
[lilypond.git] / Documentation / tex / reference-manual.tely
1 \input texinfo @c -*-texinfo-*-
2 @setfilename reference-manual.info
3 @settitle LilyPond 1-2-0 Reference Manual
4
5 @node Top, , Running LilyPond, (dir)
6 @top
7 @menu
8 * LilyPond 1-2-0 Reference Manual::LilyPond 1-2-0 Reference Manual
9 @end menu
10
11 @macro keyindex {word}
12 @cindex \word\
13
14 @end macro
15
16 @macro indexcode {word}
17 @cindex \word\
18
19 @end macro
20
21
22
23 @node LilyPond 1-2-0 Reference Manual, Overview, , Top
24 @menu
25 * Overview::                      Overview
26 * Top level::                     Top level
27 * notenames::                     notenames
28 * Lexical conventions::           Lexical conventions
29 * notelang::                      notelang
30 * modes::                         modes
31 * Types::                         Types
32 * Music expressions::             Music expressions
33 * Atomic music expressions::      Atomic music expressions
34 * atomicmusic::                   atomicmusic
35 * notedesc::                      notedesc
36 * barlines::                      barlines
37 * manualbeam::                    manualbeam
38 * tremolo::                       tremolo
39 * Compound music expressions::    Compound music expressions
40 * compoundmusic::                 compoundmusic
41 * relative::                      relative
42 * sec-repeats::                   sec-repeats
43 * transpose::                     transpose
44 * Ambiguities::                   Ambiguities
45 * Notation conversion specifics:: Notation conversion specifics
46 * autobeam::                      autobeam
47 * lyricprint::                    lyricprint
48 * Notation Contexts::             Notation Contexts
49 * contextselection::              contextselection
50 * Notation output definitions::   Notation output definitions
51 * output::                        output
52 * paper::                         paper
53 * papervars::                     papervars
54 * contextdefs::                   contextdefs
55 * engravers::                     engravers
56 * Sound output::                  Sound output
57 * midilist::                      midilist
58 * Pre-defined Identifiers::       Pre-defined Identifiers
59 * ident::                         ident
60 * Running LilyPond::              Running LilyPond
61 @end menu
62 @chapter LilyPond 1.2.0 Reference Manual
63
64
65
66 @node Overview, Top level, LilyPond 1-2-0 Reference Manual, LilyPond 1-2-0 Reference Manual
67 @section Overview
68
69 This document@footnote{This document has been revised for
70 LilyPond 1.2.} describes the the GNU LilyPond input format, which is
71 a language for defining music.  We call this language @emph{Music
72 Definition Language} or @emph{Mudela}, for short.@footnote{If anybody
73 comes up with a better name, we'd gladly take this.  Gourlay already
74 uses a ``Musical Description Language,'' ISO standard 10743 defines a
75 ``Standard Music Description Language.''  We're not being original
76 here.}
77
78 @emph{Mudela} is a language that allows you to
79
80 @itemize @bullet
81   @item  create musical expressions by combining pitches, durations 
82   @item  output those musical expressions to various formats
83   @item  give those musical expressions and output definitions names, so
84        you can enter them in manageable chunks.
85 @end itemize
86
87 @emph{Mudela} aims to define a piece of music completely, both from
88 typesetting and from a performance point of view.
89
90
91
92 @node Top level, notenames, Overview, LilyPond 1-2-0 Reference Manual
93 @section Top level
94
95 @cindex top level
96
97 This section describes what you may enter at top level.
98
99
100
101 @cindex score definition
102
103 The output is generated combining a music expression with an output
104 definition.  A score block has the following syntax:
105
106 @quotation
107
108   @code{\score @{} @var{musicexpr} @var{outputdefs} @code{@}}
109 @end quotation
110
111 @var{outputdefs} are zero or more output definitions.  If no output
112 definition is supplied, the default @code{\paper} block will be added.
113
114
115
116 @cindex header
117
118 @keyindex{header}
119
120 The syntax is
121
122 @quotation
123
124   @code{\header} @code{@{} @var{key1} = @var{val1};
125                         @var{key2} = @var{val2}; ... @code{@}}
126 @end quotation
127
128 A header describes the file's contents.  It can also appear in a
129 @code{\score} block.  Tools like @code{ly2dvi}@indexcode{ly2dvi} can use this
130 information for generating titles.  Key values that are used by
131 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
132 metre, arranger, piece and tagline.
133
134 It is customary to put the @code{\header} at the top of the file.
135
136
137 @node notenames, Lexical conventions, Top level, LilyPond 1-2-0 Reference Manual
138
139 Note name tables can be specified using
140
141 @quotation
142
143   @code{\notenames}@keyindex{notenames}
144     @code{@{} @var{assignmentlist} @code{@}}
145 @end quotation
146
147 @var{assignmentlist} is a list of definitions of the form
148
149 @quotation
150
151   @var{name} = @var{pitch}
152 @end quotation
153
154 Chord modifiers can be set analogously, with
155 @code{\chordmodifiers}@keyindex{chordmodifiers}.
156
157
158
159 A @code{\paper} block at top level sets the default paper block.  A
160 @code{\midi} block at top level works similarly.
161
162
163
164 LilyPond contains a Scheme interpreter (the GUILE library) for
165 internal use.  The following commands access the interpreter
166 directly.
167
168 @quotation
169
170   @code{\scm}@keyindex{scm} @var{scheme} @code{;}
171 @end quotation
172
173 Evaluates the specified Scheme code.  The result is discarded.
174
175 @quotation
176
177   @code{\scmfile}@keyindex{scmfile} @var{filename} @code{;}
178 @end quotation
179
180 Reads Scheme code from the specified file.  The result is discarded.
181
182
183
184 Identifier assignments may appear at top level.  Semicolons are
185 forbidden after top level assignments.
186
187
188
189 @node Lexical conventions, notelang, notenames, LilyPond 1-2-0 Reference Manual
190 @section Lexical conventions
191
192 @cindex lexical conventions
193
194
195
196 @cindex comment
197
198 @indexcode{%}
199
200
201 A one line comment is introduced by a `@code{%}' character. 
202 Block comments are started by `@code{%@{}' and ended by `@code{%@}}'. 
203 They cannot be nested.
204
205
206
207 @cindex keyword
208
209 Keywords start with a backslash, followed by a number of lower case
210 alphabetic characters.  These are all the keywords.
211
212 @quotation
213
214   @code{\accepts}
215   @code{\addlyrics}
216   @code{\alternative}
217   @code{\bar}
218   @code{\breathe}
219   @code{\cadenza}
220   @code{\chordmodifiers}
221   @code{\chords}
222   @code{\clef}
223   @code{\cm}
224   @code{\consists}
225   @code{\consistsend}
226   @code{\context}
227   @code{\duration}
228   @code{\font}
229   @code{\grace}
230   @code{\header}
231   @code{\in}
232   @code{\key}
233   @code{\keysignature}
234   @code{\lyrics}
235   @code{\mark}
236   @code{\midi}
237   @code{\mm}
238   @code{\musicalpitch}
239   @code{\name}
240   @code{\notenames}
241   @code{\notes}
242   @code{\paper}
243   @code{\partial}
244   @code{\penalty}
245   @code{\property}
246   @code{\pt}
247   @code{\relative}
248   @code{\remove}
249   @code{\repeat}
250   @code{\repetitions}
251   @code{\scm}
252   @code{\scmfile}
253   @code{\score}
254   @code{\script}
255   @code{\sequential}
256   @code{\shape}
257   @code{\simultaneous}
258   @code{\skip}
259   @code{\spanrequest}
260   @code{\tempo}
261   @code{\textscript}
262   @code{\time}
263   @code{\times}
264   @code{\translator}
265   @code{\transpose}
266   @code{\type}
267 @end quotation
268
269
270
271
272 @cindex integer
273
274 Formed from an optional minus sign followed by digits.  Arithmetic
275 operations cannot be done with integers, and integers cannot be mixed
276 with reals.
277
278
279
280 @cindex real
281  
282
283 Formed from an optional minus sign and a sequence of digits followed
284 by a @emph{required} decimal point and an optional exponent such as
285 @code{-1.2e3}.  Reals can be built up using the usual operations:
286 `@code{+}@indexcode{+}', `@code{-}@indexcode{-}', `@code{*}@indexcode{*}', and
287 `@code{/}@indexcode{/}', with parentheses for grouping.
288
289 A real constant can be followed by one of the dimension
290 keywords:
291 @cindex dimensions
292  @code{\mm}@keyindex{mm},
293 @code{\pt}@keyindex{pt}, @code{\in}@keyindex{in}, or
294 @code{\cm}@keyindex{cm}, for millimeters, points, inches and
295 centimeters, respectively.  This converts the number to a real that
296 is the internal representation of dimensions.
297
298
299
300 @cindex string
301  
302
303 Begins and ends with the `@code{"}' character.  To include a `@code{"}'
304 character in a string write `@code{\"}'.  Various other backslash
305 sequences have special interpretations as in the C language.  A
306 string that contains no spaces can be written without the quotes. 
307 See section @xref{modes} for details on unquoted strings; their
308 interpretation varies depending on the situation.  Strings can be
309 concatenated with the `@code{+}' operator.
310
311
312
313 The tokenizer accepts the following commands.  They can appear
314 anywhere.
315
316 @quotation
317
318   @code{\maininput}@keyindex{maininput}
319 @end quotation
320
321 This command is used in init files to signal that the user file must
322 be read. This command cannot be used in a user file.
323
324 @quotation
325
326   @code{\include}@keyindex{include} @var{file}
327 @end quotation
328
329 Include @var{file}.  The argument @var{file} may be a quoted string (an
330 unquoted string will not work here!) or a string identifier.  The full
331 filename including the @file{.ly} extension must be given,
332
333 @quotation
334
335   @code{\version}@keyindex{version} @var{string} @code{;}
336 @end quotation
337
338 Specify the version of LilyPond that a file was written for.  The
339 argument is a version string in quotes, for example @code{"1.2.0"}. 
340 This is used to detect invalid input, and to aid
341 @code{convert-mudela}, a tool that automatically upgrades input files.
342
343
344
345 @cindex other languages
346
347 @node notelang, modes, Lexical conventions, LilyPond 1-2-0 Reference Manual
348
349 Note name definitions have been provided in various languages. 
350 Simply include the language specific init file.  For example:
351 `@code{\include "english.ly"}'.  The available language files and the
352 names they define are:
353
354 @quotation
355
356 @example 
357                         Note Names               sharp       flat
358
359 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
360 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
361 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
362 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
363 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
364 italiano.ly    do  re  mi  fa  sol la  sid si  -d          -b
365 catalan.ly     do  re  mi  fa  sol la  sid si  -d/-s       -b 
366 @end example 
367
368 @end quotation
369
370 Pitch names can be redefined using the
371 @code{\notenames}@keyindex{notenames} command, see
372 subsection @xref{notenames}.
373
374
375
376 @cindex lexical modes
377
378 @cindex modes
379
380 @node modes, Types, notelang, LilyPond 1-2-0 Reference Manual
381
382 To simplify entering notes, lyrics, and chords, @emph{Mudela} has three
383 special input modes on top of the default mode.  In each mode, words
384 are identified on the input.  If @code{"word"} is encountered, it is
385 treated as a string.  If @code{\word} is encountered, it is treated as
386 a keyword or as an identifier.  The behavior of the modes differs in
387 two ways: Different modes treat unquoted words differently, and
388 different modes have different rules for deciding what is a word.
389
390 @table @samp
391   @item Normal mode.
392 @cindex mode!normal
393  
394     At the start of parsing, @emph{Mudela} is in Normal mode.  In Normal
395     mode, a word is an alphabetic character followed by alphanumeric
396     characters.  If @code{word} is encountered on the input it is
397     treated as a string.
398
399   @item Note mode.
400 @cindex mode!note
401
402     Note mode is introduced by the keyword
403     @code{\notes}@keyindex{notes}.  In Note mode, words can only
404     contain alphabetic characters.  If @code{word} is encountered,
405     LilyPond first checks for a notename of @code{word}.  If no
406     notename is found, then @code{word} is treated as a string.
407
408     Since combinations of numbers and dots are used for indicating
409     durations, it is not possible to enter real numbers in this mode.
410
411   @item Chord mode.
412 @cindex mode!chord
413
414     Chord mode is introduced by the keyword
415     @code{\chords}@keyindex{chords}.  It is similar to Note mode, but
416     words are also looked up in a chord modifier table (containing
417     @code{maj}, @code{dim}, etc).
418
419     Since combinations of numbers and dots are used for indicating
420     durations, you can not enter real numbers in this mode.  Dashes
421     and carets are used to indicate chord additions and subtractions,
422     so scripts can not be entered in Chord mode.
423
424   @item Lyrics mode. 
425 @cindex mode!lyric
426
427     Lyrics mode is introduced by the keyword
428     @code{\lyrics}@keyindex{lyrics}.  This mode has rules that make it
429     easy to include punctuation and diacritical marks in words.  A
430     word in Lyrics mode begins with: an alphabetic character,
431     `@code{_}', `@code{?}', `@code{!}', `@code{:}', `@code{'}', the
432     control characters @code{^A} through @code{^F}, @code{^Q} through
433     @code{^W}, @code{^Y}, @code{^^}, any 8-bit character with ASCII code
434     over 127, or a two-character combination of a backslash followed
435     by one of `@code{`}', `@code{'}', `@code{"}', or
436     `@code{^}'.@footnote{The purpose of Lyrics mode is that you can
437     enter lyrics in TeX format or a standard encoding without
438     needing quotes.  The precise definition of this mode indeed is
439     ludicrous.  This will remain so until the authors of LilyPond
440     acquire a deeper understanding of character encoding, or someone
441     else steps up to fix this.}
442
443     Subsequent characters of a word can be any character that is not
444     a digit and not white space.  One important consequence of this
445     is that a word can end with `@code{@}}', which may be confusing if
446     you thought the closing brace was going to terminate Lyrics
447     mode.@footnote{LilyPond will issue a warning, though.}  Any
448     `@code{_}' characters which appear in an unquoted word are
449     converted to spaces.  This provides a mechanism for introducing
450     spaces into words without using quotes.  Quoted words can also be
451     used in Lyrics mode to specify words that cannot be written with
452     the above rules.  Here are some examples.  Not all of these words
453     are printable by TeX.
454
455
456     @quotation
457
458 @example 
459 Ah!             % a word
460 2B_||_!2B       % not a word because it starts with a digit
461 ``Hello''       % not a word because it starts with `
462 _ _ _ _         % 4 words, each one a space 
463 @end example 
464
465     @end quotation
466
467     Since combinations of numbers and dots are used for indicating
468     durations, you can not enter real numbers in this mode.
469 @end table
470
471 It is possible to create words that break the rules by prefixing them
472 with the dollar sign `@code{$}@indexcode{$}'.  Regardless of the context, a
473 word beginning with `@code{$}' extends until the next white space
474 character.  Such words can contain numbers (even in Note mode), or
475 other forbidden characters.  The dollar sign can be used to create
476 and access identifiers that could not otherwise be used.@footnote{Use
477 of `@code{$}' hampers readability and portability to future LilyPond
478 versions, thus the use of the dollar sign is discouraged.}
479
480
481
482 @node Types, Music expressions, modes, LilyPond 1-2-0 Reference Manual
483 @section Types
484
485 @cindex types and identifiers
486
487 @emph{Mudela} has a limited set of types:
488
489 @itemize @bullet
490   @item  integers
491   @item  reals
492   @item  strings
493   @item  music expressions
494   @item  durations of notes and rests (specified with
495        @code{\notenames}@keyindex{notenames})
496   @item  note name tables
497   @item  context definitions, part of output definitions.  See
498        section @xref{contextdefs} for more information
499   @item  output definitions (like @code{\paper}@keyindex{paper} blocks
500        and @code{\midi}@keyindex{midi} blocks)
501   @item  score definitions (@code{\score}@keyindex{score} blocks)
502 @end itemize
503
504 Type is a syntactical property: @emph{Mudela} has no real type system,
505 so there is no support for generic expressions, functions, or user
506 defined types.  For the same reason, it is not possible to mix reals
507 and integers in arithmetic expressions, and ``type
508 errors''
509 @cindex type error
510  (e.g., using a string identifier to
511 initialize a @code{\paper}@keyindex{paper} block) will yield a ``parse
512 error''.
513
514 Identifiers allow objects to be assigned to names.  To assign an
515 identifier, you use `@var{name}=@var{value}' and to refer to an
516 identifier, you preceed its name with a backslash:
517 `@code{\}@var{name}'.  Identifier assignments must appear at top level
518 in the @emph{Mudela} file.  Semicolons are forbidden after assignments
519 appearing at top level but they are obligatory after assignments
520 appearing in the @code{\paper} block, see Section @xref{paper}.
521
522 @var{value} is any of the types listed above.
523
524 An identifier can be created with any string for its name, but you
525 will only be able to refer to identifiers whose names begin with a
526 letter, being entirely alphanumeric.  It is impossible to refer to an
527 identifier whose name is the same as the name of a keyword.
528
529 The right hand side of an identifier assignment is parsed completely
530 before the assignment is done, so it is allowed to redefine an
531 identifier in terms of its old value, e.g.
532
533 @quotation
534
535   @code{foo = \foo * 2.0}
536 @end quotation
537
538 When an identifier is referenced, the information it points to is
539 copied.  Therefore it only makes sense to put identifiers for
540 translators, output definitions, and @code{\score}@keyindex{score}
541 blocks as the first item in a block.  For this reason, if you
542 reference a @code{\foo} variable in a @code{\foo} block, it must be the
543 first item in the list following @code{\foo}.@footnote{@code{\paper@{\one
544 \two@}} does not make sense, because the information of @code{\two}
545 would overwrite the information of @code{\one}, thereby making the
546 reference to the first identifier useless.}
547
548
549
550 @node Music expressions, Atomic music expressions, Types, LilyPond 1-2-0 Reference Manual
551 @section Music expressions
552
553 @cindex music expressions
554
555 Music in @emph{Mudela} is entered as a music expression.  Notes, rests,
556 lyric syllables are music expressions (the atomic
557 expressions)
558 @cindex atomic music expressions
559 , and you can combine
560 music expressions to form new ones.  This example forms a compound
561 expressions out of the quarter @code{c} note and a @code{d}
562 note:
563
564 @quotation
565
566   @example 
567 \sequential @{ c4 d4 @} 
568 @end example 
569
570 @end quotation
571
572 The meaning of this compound expression is to play the `@code{c}'
573 first, and then the `@code{d}' (as opposed to playing them
574 simultaneously, for instance).
575
576 Atomic music expression are discussed in
577 subsection @xref{atomicmusic}.  Compound music expressions are
578 discussed in subsection @xref{compoundmusic}.
579
580
581
582 @node Atomic music expressions, atomicmusic, Music expressions, LilyPond 1-2-0 Reference Manual
583 @section Atomic music expressions
584 @node atomicmusic, notedesc, Atomic music expressions, LilyPond 1-2-0 Reference Manual
585
586
587
588 @cindex pitch
589
590 @cindex duration
591  
592
593 The syntax for pitch specification is
594
595 @quotation
596
597   @code{\musicalpitch}@keyindex{musicalpitch}
598     @code{@{} @var{octave} @var{note} @var{shift} @code{@}}
599 @end quotation
600
601 @var{octave} is specified by an integer, zero for the octave
602 containing middle C.  @var{note} is a number from 0 to 7, with 0
603 corresponding to C and 7 corresponding to B.  The shift is zero for a
604 natural, negative to add flats, or positive to add sharps.
605
606 In Note and Chord mode, pitches may be designated by names.  See
607 section @xref{notelang} for pitch names in different languages.
608
609 The syntax for duration specification is
610
611 @quotation
612
613   @code{\duration}@keyindex{duration}
614     @code{@{} @var{length} @var{dotcount} @code{@}}
615 @end quotation
616
617 @var{length} is the negative logarithm (base 2) of the duration:
618 1 is a half note, 2 is a quarter note, 3 is an eighth
619 note, etc.  The number of dots after the note is given by
620 @var{dotcount}.
621
622 In Note, Chord, and Lyrics mode, durations may be designated by
623 numbers and dots.  See Section @xref{notelang} for details.
624
625
626 @node notedesc, barlines, atomicmusic, LilyPond 1-2-0 Reference Manual
627
628 @cindex note specification
629
630 @cindex pitches
631
632 @cindex entering notes
633
634 A note specification has the form
635
636 @quotation
637
638   @var{pitch}[@var{octavespec}][@code{!}][@code{?}][@var{duration}]
639 @end quotation
640
641 The pitch of the note is specified by the note's name.
642
643
644 The default names are the Dutch note names.  The notes are specified
645 by the letters `@code{c}' through `@code{b}', where `@code{c}' is an
646 octave below middle C and the letters span the octave above that C. 
647 In Dutchcindex(notenames!Dutch), a sharp is formed by adding
648 `@code{-is}' to the end of a pitch name.  A flat is formed by adding
649 `@code{-es}'. Double sharps and double flats are obtained by adding
650 `@code{-isis}' or `@code{-eses}'.  `@code{aes}' and `@code{ees}' are
651 contracted to `@code{as}' and `@code{es}' in Dutch, but both forms will
652 be accepted.
653
654 LilyPond has predefined sets of notenames for various languages.  See
655 section @xref{notelang} for details.
656
657
658 The optional octave specification takes the form of a series of
659 single quote (`@code{'}@indexcode{'}') characters or a series of comma
660 (`@code{,}@indexcode{,}') characters.  Each @code{'} raises the pitch by one
661 octave; each @code{,} lowers the pitch by an octave.
662
663 @mudela[fragment,verbatim,center]
664   c' d' e' f' g' a' b' c''
665 @end mudela
666
667 @mudela[fragment,verbatim,center]
668   cis' dis' eis' fis' gis' ais' bis'
669 @end mudela
670
671 @mudela[fragment,verbatim,center]
672   ces' des' es' fes' ges' as' bes'
673 @end mudela
674
675 @mudela[fragment,verbatim,center]
676   cisis' eisis' gisis' aisis' beses'
677 @end mudela
678
679 @mudela[fragment,verbatim,center]
680   ceses' eses' geses' ases' beses'
681 @end mudela
682
683 Whenever a C-sharp is desired,  you must specify a C-sharp.  LilyPond
684 will determine what accidentals to typeset depending on the key and
685 context.  A reminder accidental 
686 @cindex reminder accidental
687  can be
688 forced by adding an exclamation mark `@code{!}' after the pitch.  A
689 cautionary accidental, 
690 @cindex cautionary accidental
691  i.e., an
692 accidental within parentheses can be obtained by adding the question
693 mark `@code{?}@indexcode{?}' after the pitch.
694
695 @mudela[fragment,verbatim,center]
696   cis' d' e' cis'  c'? d' e' c'!
697 @end mudela
698
699
700 @cindex duration
701
702 Durations are entered as their reciprocal values.  For notes longer
703 than a whole note, use identifiers.
704
705 @quotation
706
707 @example 
708 c'\longa c'\breve  
709 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64 
710 @end example 
711
712 @end quotation
713
714 @quotation
715
716 @mudela[]
717 \score {
718   \notes \relative c'' {
719     a\longa a\breve  
720     a1 a2 a4 a8 a16 a32 a64 a64 
721   }
722   \paper {
723     loose_column_distance = 2.5 * \interline;
724     linewidth = -1.0;
725     \translator {
726       \type "Score_engraver";
727       \name "Score";
728       \consists "Note_heads_engraver";
729       \consists "Stem_engraver";
730       \consists "Rhythmic_column_engraver";
731     }
732   }
733 }
734 @end mudela
735 @end quotation
736
737 @quotation
738
739 @example 
740 r\longa r\breve  
741 r1 r2 r4 r8 r16 r32 r64 r64 
742 @end example 
743
744 @end quotation
745
746 @quotation
747
748 @mudela[]
749 \score {
750   \notes \relative c'' {
751     r\longa r\breve  
752     r1 r2 r4 r8 r16 r32 r64 r64 
753   }
754   \paper {
755     loose_column_distance = 2.5 * \interline;
756     linewidth = -1.0;
757     \translator {
758       \type "Score_engraver";
759       \name "Score";
760       \consists "Rest_engraver";
761       \consists "Stem_engraver";
762       \consists "Rhythmic_column_engraver";
763     }
764   }
765 }
766 @end mudela
767 @end quotation
768
769 If the duration is omitted then it is set equal to the previous
770 duration.  If there is no previous duration, a quarter note is
771 assumed.  The duration can be followed by a dot (`@code{.}@indexcode{.}')
772 to obtain dotted note lengths.
773
774 @mudela[fragment,verbatim,center]
775   a'4. b'4.
776 @end mudela
777
778 You can alter the length of duration by writing
779 `@code{*}@var{fraction}' after it.  This will not affect the
780 appearance of note heads or rests.
781
782
783 Rests are entered like notes, with note name `@code{r}@indexcode{r}',
784 or `@code{R}@indexcode{R}'.  There is also a note name `@code{s}@indexcode{s}',
785 which produces a space of the specified duration. 
786 `@code{R}' is specifically meant for entering parts: the @code{R} rest
787 can expand to fill a score with rests, or it can be printed as a
788 single multimeasure rest.
789
790
791 @cindex lyrics expressions
792
793 Syllables are entered like notes, with pitches replaced by text.  For
794 example, `@code{Twin-4 kle4 twin-4 kle4}' enters four syllables, each
795 with quarter note duration.  Note that the hyphen has no special
796 meaning for lyrics, and does not introduce special symbols.  See
797 section @xref{modes} for a description of what is interpreted as
798 lyrics.
799
800 Spaces can be introduced into a lyric either by using quotes
801 (`@code{"}') or by using an underscore without quotes: `@code{He_could4
802 not4}'.  All unquoted underscores are converted to spaces.  Printing
803 lyrics is discussed in section @xref{lyricprint}.
804
805
806
807 @cindex properties
808
809 @quotation
810
811   @code{\property}@keyindex{property}
812     @var{contextname}@code{.}@var{propname} @code{=} @var{value}
813 @end quotation
814
815 Sets the @var{propname} property of the context @var{contextname} to
816 the specified @var{value}.  All three arguments are strings. 
817 Depending on the context, it may be necessary to quote the strings or
818 to leave space on both sides of the dot.
819
820
821
822 @cindex translator switches
823
824 @quotation
825
826   @code{\translator}@keyindex{translator}
827     @var{contexttype} = @var{name}
828 @end quotation
829
830 A music expression indicating that the context which is a direct
831 child of the a context of type @var{contexttype} should be shifted to
832 a context of type @var{contexttype} and the specified name.
833
834 Usually this is used to switch staffs in Piano music, e.g.
835
836 @quotation
837
838   @code{\translator Staff = top} @var{Music}
839 @end quotation
840
841
842
843 @cindex commands
844
845 Commands are music expressions that have no duration.   
846
847
848 @quotation
849
850   @code{\key}@keyindex{key} @var{pitch} @var{type} @code{;}
851 @end quotation
852
853 Change the key signature.  @var{type} should be
854 @code{\major}@keyindex{major} or @code{\minor}@keyindex{minor} to get
855 @var{pitch}-major or @var{pitch}-minor, respectively.  The second
856 argument is optional; the default is major keys.  The @var{\context}
857 argument can also be given as an integer, which tells the number of
858 semitones that should be added to the pitch given in the subsequent
859 @code{\key}@keyindex{key} commands to get the corresponding major key,
860 e.g., @code{\minor}@keyindex{minor} is defined as 3.  The standard
861 mode names @code{\ionian}@keyindex{ionian},
862 @code{\locrian}@keyindex{locrian}, @code{\aeolian}@keyindex{aeolian},
863 @code{\mixolydian}@keyindex{mixolydian}, @code{\lydian}@keyindex{lydian},
864 @code{\phrygian}@keyindex{phrygian}, and @code{\dorian}@keyindex{dorian}
865 are also defined.
866
867 @quotation
868
869   @code{\keysignature}@keyindex{keysignature} @var{pitchseq} @code{;}
870 @end quotation
871
872 Specify an arbitrary key signature.  The pitches from @var{pitch} will
873 be printed in the key signature in the order that they appear on the
874 list.
875
876         
877 @quotation
878
879   @code{\mark}@keyindex{mark} @var{unsigned} @code{;} @* 
880   @code{\mark} @var{string} @code{;}
881 @end quotation
882
883 Prints a mark over or under (depending on the
884 @code{markDirection}@indexcode{markDirection} property) the staff.  You must add
885 @code{Mark_engraver}@indexcode{Mark_engraver} to either the Score or Staff context for
886 this to work.
887
888 @node barlines, manualbeam, notedesc, LilyPond 1-2-0 Reference Manual
889
890 @quotation
891
892   @code{\bar}@keyindex{bar} @var{bartype} @code{;}
893 @end quotation
894
895 This is a request to print a special bar symbol. It replaces the 
896 regular bar symbol with a special
897 symbol.  The argument @var{bartype} is a string which specifies the
898 kind of bar to print.  Options are @code{":|"}
899 @cindex "|A@@@code{:|}
900 ,
901 @code{"|:"}
902 @cindex "|B@@@code{|:}
903 , @code{":|:"}
904 @cindex "|C@@@code{:|:}
905 ,
906 @code{"||"}
907 @cindex "|D@@@code{||}
908 , @code{"|."}
909 @cindex "|E@@@code{|.}
910 ,
911 @code{".|"}
912 @cindex "|F@@@code{.|}
913 , and @code{".|."}
914 @cindex "|G@@@code{.|.}
915
916 These produce, respectively, a right repeat, a left repeat, a double
917 repeat, a double bar, a start bar, an end bar, and a thick double
918 bar.  If @var{bartype} is set to @code{"empty"} then nothing is
919 printed, but a line break is allowed at that spot.
920
921 You are encouraged to use @code{\repeat} for repetitions.
922 See section @xref{sec-repeats}.
923
924  
925
926 @quotation
927
928   @code{\cadenza}@keyindex{cadenza} @var{togglevalue} @code{;}
929 @end quotation
930
931 Music expression that toggles the automatic generation of bar lines. 
932 If @var{togglevalue} is 1, bar line generation is turned off.  If
933 @var{togglevalue} is 0, a bar line is immediately printed and 
934 automatic bar generation is turned on.
935
936 @quotation
937
938   @code{\time}@keyindex{time} @var{numerator}@code{/}@var{denominator} @code{;}
939 @end quotation
940
941 Change the time signature.  The default time signature is 4/4. 
942 The time signature is used to generate bar lines.
943
944 @quotation
945
946   @code{\tempo}@keyindex{tempo} @var{duration} = @var{perminute} @code{;}
947 @end quotation
948
949 Used to specify the tempo.  For example, `@code{\tempo 4 = 76;}'
950 requests output with 76 quarter notes per minute.
951
952 @quotation
953
954   @code{\partial}@keyindex{partial} @var{duration} @code{;}
955 @end quotation
956
957 @cindex anacrusis
958
959 @cindex upstep
960
961 This creates an incomplete measure (anacrusis, upbeat) at the start of 
962 the music, e.g., `@code{\partial 8*2;}' creates a starting measure 
963 lasting two eighth notes.
964
965 @quotation
966
967   @code{|}@indexcode{|}
968 @cindex bar check
969
970 @end quotation
971
972 @cindex shorten measures
973
974 @cindex upstep
975
976 `@code{|}' is a barcheck.  Whenever a barcheck is encountered during
977 interpretation, a warning message is issued if it doesn't fall at a
978 measure boundary.  This can help you finding errors in the input. 
979 The beginning of the measure will be relocated, so this can also
980 be used to shorten measures.
981
982
983 @quotation
984
985   @code{\penalty}@keyindex{penalty} @var{int} @code{;}
986 @end quotation
987
988 Discourage or encourage line breaks.  See identifiers
989 @code{\break}@keyindex{break} and @code{\nobreak}@keyindex{nobreak} in
990 section @xref{ident}.
991
992 @quotation
993
994   @code{\clef}@keyindex{clef} @var{clefname} @code{;}
995 @end quotation
996
997 Music expression that sets the current clef.  The argument is a
998 string which specifies the name of the clef.  Several clef names are
999 supported.  If `@code{_8}' or `@code{^8}' is added to the end of a clef
1000 name, then the clef lowered or raised an octave will be generated. 
1001 Here are the supported clef names with middle C shown in each
1002 clef:
1003
1004 @quotation
1005
1006 @mudela[]
1007 \score {
1008   \notes {
1009     \cadenza 1;
1010     %\property Voice.textStyle = typewriter
1011     \clef subbass;     c'4-"\kern -5mm subbass" 
1012     \clef bass;        c'4^"\kern -2mm bass"
1013     \clef baritone;    c'4_"\kern -5mm baritone"
1014     \clef varbaritone; c'4^"\kern -6mm varbaritone"
1015     \clef tenor;       c'4_"\kern -3mm tenor"
1016     \clef "G_8";       c'4^"\kern -2mm G\\_8" 
1017   }  
1018   \paper {
1019     linewidth = 4.5 \in;
1020   }
1021 }
1022 @end mudela
1023 @end quotation
1024
1025 @quotation
1026
1027 @mudela[]
1028 \score {
1029   \notes {
1030     \cadenza 1;
1031     \clef alto;         c'4_"\kern -2mm alto"
1032     \clef mezzosoprano; c'4^"\kern -9mm mezzosoprano"
1033     \clef soprano;      c'4_"\kern -6mm soprano"
1034     \clef treble;       c'4^"\kern -4mm treble"
1035     \clef french;       c'4_"\kern -4mm french"
1036   }
1037   \paper {
1038     linewidth = 4.5 \in;
1039   }
1040 }
1041 @end mudela
1042 @end quotation
1043
1044 The three clef symbols can also be obtained using the names `@code{G}', 
1045 `@code{C}' or `@code{F}', optionally followed by an integer which 
1046 indicates at which note line the clef is located. An as example, the 
1047 @code{mezzosoprano} clef can also be given as `@code{C2}'.
1048
1049 @quotation
1050
1051   @code{\skip}@keyindex{skip} @var{duration} @code{;}
1052 @end quotation
1053
1054 Skips the amount of time specified by @var{duration}.  If no other
1055 music is played, a gap will be left for the skipped time with no
1056 notes printed.  It works in Note Mode or Lyrics Mode.  In Note mode,
1057 this has the same effect as the space rest `@code{s}'.
1058
1059
1060 @cindex beams
1061
1062 @node manualbeam, tremolo, barlines, LilyPond 1-2-0 Reference Manual
1063
1064 A beam is specified by surrounding the beamed notes with brackets
1065 `@code{[}@indexcode{[}' and `@code{]}@indexcode{]}'.  
1066
1067 @mudela[fragment,verbatim,center]
1068   [a'8 a'] [a'16 a' a' a']
1069 @end mudela
1070
1071 Some more elaborate constructions:
1072
1073 @mudela[fragment,verbatim,center]
1074   [a'16 <a' c''> c'' <a' c''>]
1075   \times 2/3 { [e'8 f' g'] }
1076 @end mudela
1077
1078 Beaming can be generated automatically; see section @xref{autobeam}.
1079
1080 To place tremolo marks 
1081 @cindex tremolo beams
1082  between two notes, begin
1083 with `@code{[:}@var{length}' and end with `@code{]}'.  Tremolo marks
1084 will appear instead of beams.  Putting more than two notes in such a
1085 construction will produce odd effects.  To create tremolo beams on a
1086 single note, simply attach `@code{:}@var{length}' to the note itself
1087 (see also section @xref{tremolo}).
1088   
1089 @mudela[fragment,verbatim,center]
1090   [:16 e'1 g'] [:8 e'4 f']
1091 @end mudela
1092   
1093 @mudela[fragment,verbatim,center]
1094   c'4:32 [:16 c'8 d'8]
1095 @end mudela
1096
1097
1098 @cindex --@@@code{-}@code{-}
1099
1100 @indexcode{__}
1101
1102 @cindex extender
1103
1104 @cindex hyphen
1105
1106 The syntax for an extender mark is `@code{__}'.  This syntax can only
1107 be used within lyrics mode.  The syntax for a spanning hyphen (i.e.,
1108 a hyphen that will be printed between two lyric syllables) is
1109 `@code{-}@code{-}'.
1110
1111
1112 @cindex ties
1113
1114 A tie connects two adjacent note heads of the same pitch.  When used
1115 with chords, it connects all of the note heads whose pitches match.
1116 Ties are indicated using the tilde symbol `@code{~}@indexcode{~}'.
1117 If you try to tie together chords which have no common pitches, a
1118 warning message will appear and no ties will be created.
1119
1120 @mudela[fragment,verbatim,center]
1121   e' ~ e' <c' e' g'> ~ <c' e' g'>
1122 @end mudela
1123
1124
1125
1126 [TODO: explain Requests]
1127
1128
1129 @cindex articulations
1130
1131 @cindex scripts
1132
1133 @cindex ornaments
1134
1135 A variety of symbols can appear above and below notes to indicate
1136 different characteristics of the performance.  These symbols can be
1137 added to a note with `@var{note}@code{-\}@var{name}'.  Numerous symbols
1138 are defined in @file{script.ly} and @file{script.scm}.  Symbols can be
1139 forced to appear above or below the note by writing
1140 `@var{note}@code{^\}@var{name}' and `@var{note}@code{_\}@var{name}'
1141 respectively.  Here is a chart showing symbols above notes, with the
1142 name of the corresponding symbol appearing underneath.
1143
1144 @mudela[]
1145
1146   \score {
1147     < \notes {
1148         c''-\accent      c''-\marcato      c''-\staccatissimo c''-\fermata 
1149         c''-\stopped     c''-\staccato     c''-\tenuto        c''-\upbow
1150         c''-\downbow     c''^\lheel        c''-\rheel         c''^\ltoe
1151         c''-\rtoe        c''-\turn         c''-\open          c''-\flageolet
1152         c''-\reverseturn c''-\trill        c''-\prall         c''-\mordent
1153         c''-\prallprall  c''-\prallmordent c''-\upprall       c''-\downprall
1154         c''-\thumb       c''-\segno        c''-\coda
1155       }
1156       \context Lyrics \lyrics {  
1157         accent__      marcato__      staccatissimo__ fermata
1158         stopped__     staccato__     tenuto__        upbow
1159         downbow__     lheel__        rheel__         ltoe
1160         rtoe__        turn__         open__          flageolet
1161         reverseturn__ trill__        prall__         mordent
1162         prallprall__  prallmordent__ uprall__        downprall
1163         thumb__       segno__        coda
1164       }
1165     >
1166     \paper {
1167       linewidth = 5.875\in;          
1168       indent    = 0.0;
1169     }
1170   }
1171
1172 @end mudela
1173
1174 In addition, it is possible to place arbitrary strings of text or
1175 TeX above or below notes by using a string instead of an
1176 identifier: `@code{c^"text"}'.  Fingerings 
1177 @cindex fingering
1178  can be
1179 placed by simply using digits.  All of these note ornaments appear in
1180 the printed output but have no effect on the MIDI rendering of the
1181 music.
1182
1183 To save typing, fingering instructions (digits 0 to 9 are
1184 supported) and single characters shorthands exist for a few
1185 common symbols
1186
1187 @mudela[]
1188
1189   \score {
1190     \notes {
1191       \property Voice.textStyle = typewriter
1192       c''4-._"c-."      s4
1193       c''4--_"c-{}-"    s4
1194       c''4-+_"c-+"      s4
1195       c''4-|_"c-|"      s4
1196       c''4->_"c->"      s4
1197       c''4-^_"c-\\^{ }" s4
1198       c''4-1_"c-1"      s4
1199       c''4-2_"c-2"      s4
1200       c''4-3_"c-3"      s4
1201       c''4-4_"c-4"      s4
1202     }
1203     \paper {
1204       linewidth = 5.875 \in;
1205       indent    = 0.0;
1206     }
1207   }
1208
1209 @end mudela
1210
1211 Dynamic marks are specified by using an identifier after a note:
1212 `@code{c4-\ff}' (the dash is optional for dynamics: `@code{c4 \ff})'.  
1213 The available dynamic marks are:
1214 @code{\ppp}@keyindex{ppp},
1215 @code{\pp}@keyindex{pp}, @code{\p}@keyindex{p}, @code{\mp}@keyindex{mp},
1216 @code{\mf}@keyindex{mf}, @code{\f}@keyindex{f}, @code{\ff}@keyindex{ff},
1217 @code{\fff}@keyindex{fff}, @code{\fff}@keyindex{ffff},
1218 @code{\fp}@keyindex{fp}, @code{\sf}@keyindex{sf},
1219 @code{\sff}@keyindex{sff}, @code{\sp}@keyindex{sp},
1220 @code{\spp}@keyindex{spp}, @code{\sfz}@keyindex{sfz}, and
1221 @code{\rfz}@keyindex{rfz}.
1222
1223
1224 @quotation
1225
1226   @code{\textscript}@keyindex{textscript} @var{text} @var{style}
1227 @end quotation
1228
1229 Defines a text to be printed over or under a note.  @var{style} is a
1230 string that may be one of @code{roman}, @code{italic}, @code{typewriter}, 
1231 @code{bold}, @code{Large}, @code{large}, @code{dynamic} or @code{finger}.
1232
1233 You can attach a general textscript request using this syntax:
1234
1235 @quotation
1236
1237 @example 
1238 c4-\textscript "6" "finger"
1239 c4-\textscript "foo" "normal" 
1240 @end example 
1241
1242 @end quotation
1243
1244 This is equivalent to `@code{c4-6 c4-"foo"}'.  
1245
1246
1247 @cindex scripts
1248
1249 @quotation
1250
1251   @code{\script}@keyindex{script} @var{alias}
1252 @end quotation
1253
1254 Prints a symbol above or below a note.  The argument is a string
1255 which points into the script-alias table defined in @file{script.scm}.
1256 The scheme definitions specify whether the symbol follows notes into
1257 the staff, dependence of symbol placement on staff direction, and a
1258 priority for placing several symbols over one note.  Usually the
1259 @code{\script}@keyindex{script} keyword is not used directly.  Various
1260 helpful identifier definitions appear in @file{script.ly}.
1261
1262
1263 @cindex slur
1264
1265 Slurs connects chords and try to avoid crossing stems.  A slur is
1266 started with `@code{(}' and stopped with `@code{)}'.  The
1267 starting `@code{(}' appears to the right of the first note in
1268 the slur.  The terminal `@code{)}' appears to the left of the
1269 first note in the slur.  This makes it possible to put a note in
1270 slurs from both sides:
1271
1272 @mudela[fragment,verbatim,center]
1273   f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
1274 @end mudela
1275
1276
1277 @cindex crescendo
1278
1279 A crescendo mark is started with @code{\cr}@keyindex{cr} and terminated
1280 with @code{\rc}@keyindex{rc}.  A decrescendo mark is started with
1281 @code{\decr}@keyindex{decr} and terminated with
1282 @code{\rced}@keyindex{rced}.  There are also shorthands for these
1283 marks.  A crescendo can be started with @code{\<}@keyindex{<} and a
1284 decrescendo can be started with @code{\>}@keyindex{>}.  Either one can
1285 be terminated with @code{\!}@keyindex{"!}.  Note that @code{\!}
1286 must go before the last note of the dynamic mark whereas @code{\rc}
1287 and @code{\rced} go after the last note.  Because these marks are
1288 bound to notes, if you want to get several marks during one note, you
1289 must use spacer notes.
1290
1291 @mudela[fragment,verbatim,center]
1292   c'' \< \! c''   d'' \decr e'' \rced 
1293   < f''1 { s4 \< \! s2 \> \! s4 } >
1294 @end mudela
1295
1296
1297 @quotation
1298
1299   @code{\spanrequest}@keyindex{spanrequest} @var{startstop} @var{type}
1300 @end quotation
1301
1302 Define a spanning request. The @var{startstop} parameter is either -1
1303 (@code{\start}@keyindex{start}) or 1 (@code{\stop}@keyindex{stop}) and
1304 @var{type} is a string that describes what should be started.
1305 Supported types are @code{crescendo}, @code{decrescendo},
1306 @code{beam}, @code{slur}.  This is an internal command.  Users should
1307 use the shorthands which are defined in the initialization file
1308 @file{spanners.ly}.
1309
1310 You can attach a (general) span request to a note using
1311
1312 @mudela[fragment,verbatim,center]
1313   c'4-\spanrequest \start "slur"
1314   c'4-\spanrequest \stop "slur"
1315 @end mudela
1316
1317 The slur syntax with parentheses is a shorthand for this.
1318
1319
1320
1321 @cindex tremolo marks
1322
1323 @node tremolo, Compound music expressions, manualbeam, LilyPond 1-2-0 Reference Manual
1324
1325 Tremolo marks can be printed on a single note by adding
1326 `@code{:}[@var{length}]' after the note.  The length must be at
1327 least 8.  A @var{length} value of 8 gives one line across
1328 the note stem.  If the length is omitted, then the last value is
1329 used, or the value of the @code{abbrev}@indexcode{abbrev} property if there was
1330 no last value.
1331
1332 @mudela[verbatim,fragment,center]
1333   c'2:8 c':32
1334 @end mudela
1335
1336
1337
1338 @node Compound music expressions, compoundmusic, tremolo, LilyPond 1-2-0 Reference Manual
1339 @section Compound music expressions
1340
1341 @cindex compound music expressions
1342
1343 @node compoundmusic, relative, Compound music expressions, LilyPond 1-2-0 Reference Manual
1344
1345 Music expressions are compound data structures.  You can nest music
1346 expressions any way you like.  This simple example shows how three
1347 chords can be expressed in two different ways:
1348
1349 @mudela[fragment,verbatim,center]
1350   \notes \context Staff {
1351     \cadenza 1;
1352     <a c'> <b  d' > <c' e' >
1353     <{a b  c'}{c' d' e'}>
1354   }
1355 @end mudela
1356
1357
1358
1359 @cindex context selection
1360
1361 @quotation
1362
1363   @code{\context}@keyindex{context}
1364     @var{contexttype} [@code{=} @var{contextname}] @var{musicexpr}
1365 @end quotation
1366
1367 Interpret @var{musicexpr} within a context of type @var{contexttype}. 
1368 If the context does not exist, it will be created.  The new context
1369 can optionally be given a name.  See
1370 section @xref{contextselection} and @xref{contextdefs} for more
1371 information on interpretation contexts.
1372
1373
1374
1375 @cindex input modes
1376
1377 @cindex mode switch
1378
1379 Mode switching keywords form compound music expressions: @code{\notes}
1380 @keyindex{notes} @var{musicexpr}, @code{\chords} @keyindex{chords}
1381 @var{musicexpr}, and @code{\lyrics} @keyindex{lyrics} @var{musicexpr}. 
1382 These expressions do not add anything to the meaning of their
1383 arguments.  They are just a way to indicate that the arguments should
1384 be parsed in indicated mode.  See section @xref{modes} for more
1385 information on modes.
1386
1387 More information on context selection can be found in
1388 section @xref{contextselection}.
1389
1390
1391
1392 @cindex sequential music
1393
1394
1395
1396 @quotation
1397
1398   @code{\sequential}@keyindex{sequential}
1399     @code{@{} @var{musicexprlist} @code{@}}
1400 @end quotation
1401
1402 This means that list should be played or written in sequence, i.e.,
1403 the second after the first, the third after the second.  The duration
1404 of sequential music is the the sum of the durations of the elements. 
1405 There is a shorthand, which leaves out the keyword:
1406
1407 @quotation
1408
1409   @code{@{} @var{musicexprlist} @code{@}}
1410 @end quotation
1411
1412
1413
1414 @cindex simultaneous music
1415
1416 @indexcode{<}
1417 @indexcode{>}
1418
1419 @quotation
1420
1421   @code{\simultaneous}@keyindex{simultaneous}
1422     @code{@{} @var{musicexprlist} @code{@}}
1423 @end quotation
1424
1425 It constructs a music expression where all of its arguments start at
1426 the same moment.  The duration is the maximum of the durations of the
1427 elements.  The following shorthand is a common idiom:
1428
1429 @quotation
1430
1431   @code{<} @var{musicexprlist} @code{>}
1432 @end quotation
1433
1434 If you try to use a chord as the first thing in your score, you might
1435 get multiple staffs instead of a chord.
1436
1437 @mudela[verbatim,center]
1438   \score {
1439     \notes <c''4 e''>
1440     \paper {
1441       linewidth = -1.;
1442     }
1443   }
1444 @end mudela
1445
1446 This happens because the chord is interpreted by a score context.
1447 Each time a note is encountered a default Voice context (along with a
1448 Staff context) is created.  The solution is to explicitly instantiate
1449 a Voice context:
1450
1451 @mudela[verbatim,center]
1452   \score {
1453     \notes\context Voice <c''4 e''>
1454     \paper {
1455       linewidth = -1.;
1456     }
1457   }
1458 @end mudela
1459
1460
1461
1462 @cindex relative pitch specification
1463
1464 @node relative, sec-repeats, compoundmusic, LilyPond 1-2-0 Reference Manual
1465
1466 It is easy to get confused by octave changing marks and accidentally
1467 putting a pitch in the wrong octave.  A much better way of entering a
1468 note's octave is `the relative octave' mode.
1469
1470 @quotation
1471
1472   @code{\relative}@keyindex{relative} @var{startpitch} @var{musicexpr}
1473 @end quotation
1474
1475 The octave of notes that appear in @var{musicexpr} are calculated as
1476 follows: If no octave changing marks are used, the basic interval
1477 between this and the last note is always taken to be a fourth or
1478 less.@footnote{The interval is determined without regarding
1479 accidentals.  A @code{fisis} following a @code{ceses} will be put above
1480 the @code{ceses}.}  The octave changing marks `@code{'}' and `@code{,}'
1481 can then be added to raise or lower the pitch by an extra octave. 
1482 Upon entering relative mode, an absolute starting pitch must be
1483 specified that will act as the predecessor of the first note of
1484 @var{musicexpr}.
1485
1486 Entering scales is straightforward in relative mode.
1487
1488 @mudela[fragment,verbatim,center]
1489   \relative c' {
1490     c d e f g a b c c,
1491   }
1492 @end mudela
1493
1494 And octave changing marks are used for intervals greater than a fourth.
1495
1496 @mudela[fragment,verbatim,center]
1497   \relative c'' {
1498     c g c f, c' a, e'' }
1499 @end mudela
1500
1501 If the preceding item is a chord, the first note of the chord is used
1502 to determine the first note of the next chord.  But other notes
1503 within the second chord are determined by looking at the immediately
1504 preceding note.
1505
1506 @mudela[fragment,verbatim,center]
1507   \relative c' {
1508     c <c e g> 
1509     <c' e g>
1510     <c, e' g>
1511   }
1512 @end mudela 
1513
1514 The pitch after the @code{\relative} contains a notename.  To parse
1515 the pitch as a notename, you have to be in note mode, so there must
1516 be a surrounding @code{\notes}@keyindex{notes} keyword (which is not
1517 shown here).
1518
1519 The relative conversion will not affect @code{\transpose} or
1520 @code{\relative} sections in its argument.  If you want to use
1521 relative within transposed music, you must place an additional
1522 @code{\relative} inside the @code{\transpose}.
1523
1524 It is strongly recommended to use relative pitch mode: less work,
1525 less error-prone, and more readable.
1526
1527
1528
1529 Chord names are a way to generate simultaneous music expressions that
1530 correspond with traditional chord names.  It can only be used in
1531 Chord mode (see section @xref{modes}).
1532
1533 @quotation
1534
1535   @var{tonic}[@var{duration}][@code{-}@var{modifiers}][@code{^}@var{subtractions}][@code{/}@var{inversion}].
1536 @end quotation
1537
1538 @var{tonic} should be the tonic note of the chord, and @var{duration}
1539 is the chord duration in the usual notation.  There are two kinds of
1540 modifiers.  One type is @emph{chord additions}, which are obtained by
1541 listing intervals separated by dots.  An interval is written by its
1542 number with an optional `@code{+}' or `@code{-}' to indicate raising or
1543 lowering by half a step.  Chord additions has two effects: It adds
1544 the specified interval and all lower odd numbered intervals to the
1545 chord, and it may lower or raise the specified interval.  Intervals
1546 must be separated by a dot (`@code{.}').
1547
1548 @quotation
1549
1550 @mudela[fragment,verbatim]
1551 \transpose c'' {
1552   \chords {
1553     c1  c-3-       c-7     c-8
1554     c-9 c-9-.5+.7+ c-3-.5- c-4.6.8
1555   }
1556 }
1557
1558 @end mudela
1559 @end quotation
1560
1561 The second type of modifier that may appear after the `@code{-}' is a
1562 named modifier.  Named modifiers are listed in the file
1563 @file{chord-modifiers.ly}.  The available modifiers are `@code{m}' and
1564 `@code{min}' which lower the 3rd half a step, `@code{aug}@indexcode{aug}' which
1565 raises the 5th, `@code{dim}@indexcode{dim}' which lowers the 5th,
1566 `@code{maj}@indexcode{maj}' which adds a raised 7th, and `@code{sus}@indexcode{sus}'
1567 which replaces the 5th with a 4th.
1568
1569 @quotation
1570
1571 @mudela[fragment,verbatim]
1572 \transpose c'' {
1573   \chords {
1574     c1-m c-min7 c-maj c-aug c-dim c-sus
1575   }
1576 }
1577
1578 @end mudela
1579 @end quotation
1580  
1581
1582 Chord subtractions are used to eliminate notes from a chord.  The
1583 notes to be subtracted are listed after a `@code{^}' character,
1584 separated by dots.
1585
1586 @mudela[fragment,verbatim,center]
1587   \transpose c'' {
1588     \chords {
1589       c1^3 c-7^5.3 c-8^7
1590     }
1591   }
1592 @end mudela 
1593
1594 Chord inversions can be specified by appending `@code{/}@indexcode{/}' and
1595 the name of a single note to a chord.  This has the effect of
1596 lowering the specified note by an octave so it becomes the lowest
1597 note in the chord.  If the specified note is not in the chord, a
1598 warning will be printed.
1599
1600 @mudela[fragment,verbatim,center]
1601   \transpose c''' {
1602     \chords {
1603       c1 c/e c/g c-7/e
1604     }
1605   }
1606
1607 @end mudela 
1608
1609 Throughout these examples, chords have been shifted around the staff
1610 using @code{\transpose}.
1611
1612 You should not combine @code{\relative} with named chords. 
1613
1614
1615
1616 @cindex tuplets
1617
1618 Tuplets are made out of a music expression by multiplying their
1619 duration with a fraction.
1620
1621 @quotation
1622
1623   @code{\times}@keyindex{times} @var{fraction} @var{musicexpr}
1624 @end quotation
1625
1626 The duration of @var{musicexpr} will be multiplied by the fraction. 
1627 In print, the fraction's denominator will be printed over the notes,
1628 optionally with a bracket.  The most common tuplet is the triplet in
1629 which 3 notes have the length of 2, so the notes are 2/3 of
1630 their written length:
1631
1632 @mudela[fragment,verbatim,center]
1633   g'4 \times 2/3 {c'4 c' c'} d'4 d'4
1634 @end mudela
1635
1636
1637
1638 @cindex grace notes
1639
1640 @quotation
1641
1642   @code{\grace}@keyindex{grace} @var{musicexpr}
1643 @end quotation
1644
1645 A grace note expression has duration 0; the next real note is
1646 assumed to be the main note.
1647
1648 You cannot have the grace note after the main note, in terms of
1649 duration, and main notes, but you can typeset the grace notes to the
1650 right of the main note using the property
1651 @code{graceAlignPosition}@indexcode{graceAlignPosition}.
1652
1653 When grace music is interpreted, a score-within-a-score is set up:
1654 @var{musicexpr} has its own time bookkeeping, and you could (for
1655 example) have a separate time signature within grace notes.  While in
1656 this score-within-a-score, you can create notes, beams, slurs, etc.
1657 Unbeamed eighth notes and shorter by default have a slash through the
1658 stem.  This behavior can be controlled with the
1659 @code{stemStyle}@indexcode{stemStyle} property.
1660
1661 @quotation
1662
1663 @mudela[fragment,verbatim]
1664 \relative c'' {
1665   \grace c8 c4 \grace { [c16 c16] } c4
1666   \grace { \property Grace.stemStyle = "" c16 } c4
1667 }
1668
1669 @end mudela
1670 @end quotation
1671
1672 At present, nesting @code{\grace}@keyindex{grace} notes, e.g.
1673
1674 @quotation
1675
1676   @code{\grace @{ \grace c32 c16 @} c4}
1677 @end quotation
1678
1679 may result in run-time errors of LilyPond.  Since the meaning of such
1680 a construct is unclear, we don't consider this a loss.  Similarly,
1681 juxtaposing two @code{\grace} sections is syntactically valid, but
1682 makes no sense and may cause runtime errors.
1683
1684 Ending a staff or score with grace notes may also generate a run-time
1685 error, since there will be no main note to attach the grace notes to.
1686
1687
1688
1689 @cindex repeats
1690
1691 @node sec-repeats, transpose, relative, LilyPond 1-2-0 Reference Manual
1692
1693 In order to specify repeats, use the @code{\repeat}@keyindex{repeat}
1694 keyword.  Since repeats look and sound differently when played or
1695 printed, there are a few different variants of repeats.
1696
1697 @table @samp
1698   @item unfolded @* 
1699     Repeated music is fully written (played) out.  Useful for MIDI
1700     output.
1701
1702   @item volta @* 
1703     This is the normal notation: Repeats are not written out, but
1704     alternative endings (voltas) are printed, left to right.
1705
1706   @item folded @* 
1707     Alternative endings are written stacked, which is useful for
1708     lyrics.
1709 @end table  
1710
1711 The syntax for repeats is
1712
1713 @quotation
1714
1715   @code{\repeat} @var{variant} @var{repeatcount} @var{repeatbody}
1716 @end quotation
1717
1718 If you have alternative endings, you may add
1719
1720 @quotation
1721
1722   @code{\alternative}@keyindex{alternative}
1723     @code{@{} @var{alternative1}
1724             @var{alternative2}
1725             @var{alternative3} ... @code{@}}
1726 @end quotation
1727
1728 where each @var{alternative} is a Music expression.
1729
1730 Normal notation repeats are used like this:
1731
1732 @quotation
1733
1734 @mudela[fragment,verbatim]
1735   c'1
1736   \repeat volta 2 { c'4 d' e' f' }
1737   \repeat volta 2 { f' e' d' c' }
1738
1739 @end mudela
1740 @end quotation
1741
1742 With alternative endings:
1743
1744 @quotation
1745
1746 @mudela[fragment,verbatim]
1747   c'1
1748   \repeat volta 2 {c'4 d' e' f'} 
1749   \alternative { {d'2 d'} {f' f} }
1750
1751 @end mudela
1752 @end quotation
1753
1754 Folded repeats look like this:@footnote{Folded repeats offer little
1755 more over simultaneous music.  However, it is to be expected that
1756 more functionality -- especially for the MIDI backend -- will be
1757 implemented.}
1758
1759 @quotation
1760
1761 @mudela[fragment,verbatim]
1762   c'1
1763   \repeat fold 2 {c'4 d' e' f'} 
1764   \alternative { {d'2 d'} {f' f} }
1765
1766 @end mudela
1767 @end quotation
1768
1769 @quotation
1770
1771 @mudela[fragment,verbatim]
1772 \context Staff {
1773   \relative c' {
1774     \partial 4;
1775     \repeat volta 2 { e | c2 d2 | e2 f2 | }
1776     \alternative { { g4 g g } { a | a a a a | b1 } }
1777   }
1778 }
1779
1780 @end mudela
1781 @end quotation
1782
1783 If you don't give enough alternatives for all of the repeats, then
1784 the first alternative is assumed to be repeated often enough to equal
1785 the specified number of repeats.
1786
1787 @quotation
1788
1789 @mudela[fragment,verbatim]
1790 \context Staff {
1791   \relative c' {
1792     \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1793     \alternative { { g4 g g }
1794                    {\partial 1; e4 e e } 
1795                    {\partial 1; a a a a | b1 } }
1796   }
1797 }
1798
1799 @end mudela
1800 @end quotation
1801
1802 It is possible to nest @code{\repeat}.  This is not entirely
1803 supported: the notes will come be in the right places, but the repeat
1804 bars will not.
1805
1806
1807
1808 @cindex transposition of pitches
1809
1810 @node transpose, Ambiguities, sec-repeats, LilyPond 1-2-0 Reference Manual
1811
1812 A music expression can be transposed with
1813 @code{\transpose}@keyindex{transpose}.  The syntax is
1814
1815 @quotation
1816
1817   @code{\transpose} @var{pitch} @var{musicexpr}
1818 @end quotation
1819
1820 This means that middle C in @var{musicexpr} is transposed to
1821 @var{pitch}.
1822
1823 @code{\transpose} distinguishes between enharmonic pitches: both
1824 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
1825 a tone.  The first version will print sharps and the second version
1826 will print flats.
1827
1828 @quotation
1829
1830 @mudela[fragment,verbatim]
1831 \context Staff {
1832   \clef "F";
1833   { \key e; c d e f }
1834   \clef "G";
1835   \transpose des'' { \key e; c d e f }
1836   \transpose cis'' { \key e; c d e f }
1837 }
1838
1839 @end mudela
1840 @end quotation
1841
1842 If you want to use both @code{\transpose} and @code{\relative}, then
1843 you must use @code{\transpose} first.  @code{\relative} will have no
1844 effect music that appears inside a @code{\transpose}.
1845
1846
1847
1848 @cindex automatic lyric durations
1849
1850 If you have lyrics that are set to a melody, you can import the
1851 rhythm of that melody into the lyrics using @code{\addlyrics}.
1852 @keyindex{addlyrics} The syntax for this is
1853
1854 @quotation
1855
1856   @code{\addlyrics} @var{musicexpr1 musicexpr2}
1857 @end quotation
1858
1859 This means that both @var{musicexpr1} and @var{musicexpr2} are
1860 interpreted, but that every non-command atomic music expression
1861 (``every syllable'') in @var{musicexpr2} is interpreted using timing
1862 of @var{musicexpr1}.
1863
1864 If the property @code{automaticMelismata}@indexcode{automaticMelismata} is set in the
1865 context of @var{musicexpr1}, no lyrics will be put on slurred or tied
1866 notes.
1867
1868 @quotation
1869
1870 @mudela[verbatim,fragment]
1871 \addlyrics
1872 \transpose c'' {
1873   \property Voice.automaticMelismata = "1"
1874   c8 () cis d8. e16 f2
1875 }
1876 \context Lyrics \lyrics {
1877  do4 re mi fa }
1878
1879 @end mudela
1880 @end quotation
1881
1882 You should use a single rhythm melody, and single rhythm lyrics (a
1883 constant duration is the obvious choice).  If you do not, you will get
1884 undesired effects when using multiple stanzas:
1885
1886 @quotation
1887
1888 @mudela[verbatim,fragment]
1889 \addlyrics
1890 \transpose c'' {
1891   c8 () cis d8. e16 f2
1892 }
1893 \context Lyrics \lyrics
1894 < { do4 re mi fa }
1895   { do8 re mi fa } >
1896
1897 @end mudela
1898 @end quotation
1899
1900 It is valid (but probably not very useful) to use notes instead of
1901 lyrics for @var{musicexpr2}.
1902
1903
1904
1905
1906 @node Ambiguities, Notation conversion specifics, transpose, LilyPond 1-2-0 Reference Manual
1907 @section Ambiguities
1908
1909 @cindex ambiguities
1910
1911 The grammar contains a number of ambiguities.@footnote{The authors
1912 hope to resolve them at a later time.}
1913
1914 @itemize @bullet
1915   @item  The assignment
1916
1917        @quotation
1918
1919          @example 
1920 foo = bar 
1921 @end example 
1922
1923        @end quotation
1924
1925        can be interpreted as making a string identifier @code{\foo}
1926        containing @code{"bar"}, or a music identifier @code{\foo}
1927        containing the syllable `bar'.
1928
1929   @item  The assignment
1930
1931        @quotation
1932
1933          @example 
1934 foo = -6 
1935 @end example 
1936
1937        @end quotation
1938
1939        can be interpreted as making an integer identifier
1940        containing -6, or a Request identifier containing the
1941        fingering `6' (with neutral direction).
1942
1943   @item  If you do a nested repeat like
1944
1945        @quotation
1946
1947 @example 
1948 \repeat ...
1949 \repeat ...
1950 \alternative 
1951 @end example 
1952
1953        @end quotation
1954
1955        then it is ambiguous to which @code{\repeat} the
1956        @code{\alternative} belongs.  This is the classic if-then-else
1957        dilemma.  It may be solved by using braces.
1958
1959   @item  (an as yet unidentified ambiguity :-)
1960 @end itemize
1961
1962
1963
1964 @node Notation conversion specifics, autobeam, Ambiguities, LilyPond 1-2-0 Reference Manual
1965 @section Notation conversion specifics
1966
1967
1968
1969 @cindex automatic beam generation
1970
1971 @node autobeam, lyricprint, Notation conversion specifics, LilyPond 1-2-0 Reference Manual
1972
1973 By default, LilyPond will generate beams automatically.  This feature
1974 can be disabled by setting the @code{Voice.noAutoBeaming}@indexcode{Voice.noAutoBeaming}
1975 property to 1.  It can be overridden for specific cases by
1976 specifying explicit beams as described in
1977 section @xref{manualbeam}.
1978
1979 A large number of Voice properties are used to decide how to generate
1980 beams.  Their default values appear in @file{auto-beam-settings.ly}.
1981 In general, beams can begin anywhere, but their ending location is
1982 significant.  Beams can end on a beat, or at durations specified by
1983 the @code{Voice.beamAutoEnd}@indexcode{Voice.beamAutoEnd} property.  To end beams every
1984 quarter note, for example, you could set
1985 @code{Voice.beamAutoEnd}@indexcode{Voice.beamAutoEnd} equal to `@code{"1/4"}'.  To end beams
1986 at every three eighth notes you would set it to `@code{"3/8"}'.  The
1987 same syntax can be used to specify beam starting points using
1988 @code{Voice.beamAutoBegin}@indexcode{Voice.beamAutoBegin}.
1989
1990 To allow different settings for different time signatures, these
1991 property names can start with `@code{time}@var{N}@code{_}@var{M}' to
1992 restrict the definition to `@var{N}@code{/}@var{M}' time.  For example,
1993 to specify beams ending only for 6/8 time you would use the
1994 property @code{Voice.time6_8beamAutoEnd}.  To allow different endings
1995 for notes of different durations, the duration can be tacked onto the
1996 end of the property.  To specify beam endings for beams that contain
1997 32nd notes, you would use @code{Voice.beamAutoEnd_32}.
1998
1999
2000
2001 @cindex chord names
2002
2003 @cindex chords
2004
2005 @cindex printing!chord names
2006
2007 For displaying printed chord names, use the @code{ChordNames}@indexcode{ChordNames}
2008 and @code{ChordNameVoice}@indexcode{ChordNameVoice} contexts.  The chords may be entered
2009 either using the notation described above, or directly using
2010 simultaneous music.
2011
2012 @quotation
2013
2014 @mudela[fragment,verbatim]
2015 <
2016   \context ChordNames {
2017     \chords{a b c} \notes{<d f g>  <e g b>}
2018   }
2019   \context Staff \notes {
2020     a b c' d' e'
2021   }
2022 >
2023
2024 @end mudela
2025 @end quotation
2026
2027 LilyPond examines chords specified as lists of notes to determine a
2028 name to give the chord.  By default, LilyPond will not try to
2029 identify chord inversions:
2030
2031 @mudela[fragment,verbatim,center]
2032   <
2033     \context ChordNameVoice \notes {
2034       <e'1 g' c''>
2035     }
2036     \context Thread \notes {
2037       <e'1 g' c''>
2038     }
2039   >
2040 @end mudela
2041
2042 If you want inversions to be recognized, you must set the property
2043 @code{ChordNames.chordInversion}@indexcode{ChordNames.chordInversion}:
2044
2045 @mudela[fragment,verbatim,center]
2046   <
2047     \property Score.chordInversion = 1
2048     \context ChordNameVoice \notes {
2049       <e'1 g' c''>
2050     }
2051     \context Thread \notes {
2052       <e'1 g' c''>
2053     }
2054   >
2055 @end mudela
2056
2057
2058
2059 @cindex lyrics
2060
2061 @cindex printing!lyrics
2062
2063 @node lyricprint, Notation Contexts, autobeam, LilyPond 1-2-0 Reference Manual
2064
2065 Lyric syllables must be interpreted within a @code{Lyrics} context
2066
2067 @cindex context!Lyrics
2068  for printing them.
2069
2070 Here is a full example: 
2071
2072 @quotation
2073
2074 @mudela[verbatim]
2075 \score {
2076   <
2077     \notes \transpose c'' {
2078       c d e c | c d e c |
2079       e f g2 | e4 f g2 \bar "|.";
2080     }
2081     \context Lyrics \lyrics { 
2082       Va-4 der Ja- cob Va- der Ja- cob
2083       Slaapt gij nog?2 Slaapt4 gij nog?2
2084     }
2085   >
2086 }
2087
2088 @end mudela
2089 @end quotation
2090
2091 You may want a continuous line after the syllables to show melismata. 
2092 To achieve this effect, add a `@code{__}' lyric as a separate word
2093 after the lyric to be extended.  This will create an extender, a line
2094 that extends over the entire duration of the lyric.  This line will
2095 run all the way to the start of the next lyric, so you may want to
2096 shorten it by using a blank lyric (using `@code{_}').
2097
2098 @quotation
2099
2100 @mudela[verbatim]
2101 \score {
2102   <
2103     \notes \relative c'' {
2104       a4 () b () c () d | c () d () b () a | c () d () b () a
2105     }
2106     \context Lyrics \lyrics {
2107       foo1 __ | bar2. __ _4 | baz1 __
2108     }
2109   >
2110 }
2111
2112 @end mudela
2113 @end quotation
2114
2115      
2116 If you want to have hyphens centered between syllables (rather than
2117 attached to the end of the first syllable) you can use the special
2118 `@code{-}@code{-}' lyric as a separate word between syllables.  This
2119 will result in a hyphen which length varies depending on the space
2120 between syllables, and which will be centered between the syllables. 
2121 For example:
2122
2123 @quotation
2124
2125 @mudela[verbatim]
2126 \score {
2127   <
2128     \notes \transpose c'' {
2129       c d e c | c d e c |
2130       e f g2 | e4 f g2 \bar "|.";
2131     }
2132     \context Lyrics \lyrics {
2133       Va4 -- der Ja -- cob | Va -- der Ja -- cob |
2134       Slaapt gij nog?2 | Slaapt4 gij nog?2
2135     }
2136   >
2137 }
2138
2139 @end mudela
2140 @end quotation
2141
2142
2143
2144 @node Notation Contexts, contextselection, lyricprint, LilyPond 1-2-0 Reference Manual
2145 @section Notation Contexts
2146
2147 @cindex notation contexts
2148
2149 Notation contexts are objects that only exist during a run of
2150 LilyPond.  During the interpretation phase of LilyPond, the Music
2151 expression contained in a @code{\score} block is interpreted in time
2152 order.  This is the order in which humans read, play, and write
2153 music.
2154
2155 A context is an object that holds the reading state of the
2156 expression; it contains information like
2157
2158 @itemize @bullet
2159   @item  What notes are playing at this point?
2160   @item  What symbols will be printed at this point?
2161   @item  In what style will they printed?
2162   @item  What is the current key signature, time signature, point within
2163        the measure, etc.?
2164 @end itemize
2165
2166 Contexts are grouped hierarchically: A @code{Voice} context is
2167 contained in a @code{Staff} context (because a staff can contain
2168 multiple voices at any point), a @code{Staff} context is contained in
2169 a @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context (because
2170 these can all contain multiple staffs).
2171
2172 Contexts associated with sheet music output are called @emph{notation
2173 contexts}, those for sound output are called playing contexts.
2174
2175 Contexts are created either manually or automatically.  Initially,
2176 the top level music expression is interpreted by the top level
2177 context (the @code{Score} context).  When a atomic music expression
2178 (i.e. a note, a rest, @code{\bar}, or @code{\time} commands), a nested
2179 set of contexts is created that can process these atomic expressions,
2180 as in this example:
2181
2182 @quotation
2183
2184   @example 
2185 \score @{ \notes < c4 > @} 
2186 @end example 
2187
2188 @end quotation
2189
2190 The sequential music, `@code{@{ c4 @}}' is interpreted by @code{Score}
2191 context. When the note `@code{c4}' itself is interpreted, a set of
2192 contexts is needed that will accept notes.  The default for this is a
2193 @code{Voice} context, contained in a @code{Staff} context.  Creation of
2194 these contexts results in the staff being printed.
2195
2196
2197 @node contextselection, Notation output definitions, Notation Contexts, LilyPond 1-2-0 Reference Manual
2198
2199 @cindex context
2200
2201 You can also create contexts manually, and you probably have to do so
2202 if you want to typeset complicated multiple part material.  If a
2203 `@code{\context} @var{name} @var{musicexpr}' expression is encountered
2204 during the interpretation phase, the @var{musicexpr} argument will be
2205 interpreted with a context of type @var{name}.  If you specify a name,
2206 the specific context with that name is searched.
2207
2208 If a context of the specified type and name can not be found, a new
2209 one is created.  For example,
2210
2211 @quotation
2212
2213 @mudela[verbatim]
2214 \score {
2215   \notes \relative c'' {
2216     c4 <d4 \context Staff = "another" e4> f
2217   }
2218 }
2219
2220 @end mudela
2221 @end quotation
2222
2223 In this example, the @code{c} and @code{d} are printed on the
2224 default staff.  For the @code{e}, a context Staff called
2225 `@code{another}' is specified; since that does not exist, a new
2226 context is created.  Within @code{another}, a (default) Voice context
2227 is created for the @code{e4}.  When all music referring to a
2228 context is finished, the context is ended as well.  So after the
2229 third quarter, @code{another} is removed.
2230
2231 Almost all music expressions inherit their interpretation context
2232 from their parent.  In other words, suppose that the syntax for a
2233 music expression is
2234
2235 @quotation
2236
2237   @code{\keyword} @var{musicexpr1} @var{musicexpr2} ...
2238 @end quotation
2239
2240 When the interpretation of this music expression starts, the context
2241 for @var{musicexpr1}, @var{musicexpr2}, etc. is that of the total
2242 expression.
2243
2244 Lastly, you may wonder, why this:
2245
2246 @quotation
2247
2248 @example 
2249 \score @{
2250   \notes \relative c'' @{
2251     c4 d4 e4
2252   @}
2253 @} 
2254 @end example 
2255
2256 @end quotation
2257
2258 doesn't result in this:
2259
2260 @mudela[]
2261
2262   \score {
2263     \notes \relative c'' {
2264       <c4> <d4> <e4>
2265     }
2266   }
2267
2268 @end mudela
2269
2270 For the @code{c4}, a default @code{Staff} (with a contained
2271 @code{Voice}) context is created.  After the @code{c4} ends, no
2272 music refers to this default staff, so it would be ended, with the
2273 result shown.  To prevent this inconvenient behavior, the context to
2274 which the sequential music refers is adjusted during the
2275 interpretation.  So after the @code{c4} ends, the context of the
2276 sequential music is also the default @code{Voice} context. 
2277 The @code{d4} gets interpreted in the same context
2278 as @code{c4}.
2279
2280
2281
2282 These are the contexts supplied with the package.  They are defined
2283 in the initialization file @file{ly/engraver.ly}.
2284
2285 @table @samp
2286   @item @code{Grace}@indexcode{Grace} @* 
2287     The context for handling grace notes.  It is instantiated
2288     automatically when you use @code{\grace}.  Basically, it is an
2289     `embedded' miniature of the Score context.  Since this context
2290     needs special interaction with the rest of LilyPond, you should
2291     not explicitly instantiate it.
2292
2293   @item @code{LyricVoice}@indexcode{LyricVoice} @* 
2294     Corresponds to a voice with lyrics.  Handles the printing of a
2295     single line of lyrics.
2296
2297   @item @code{Thread}@indexcode{Thread} @* 
2298     Handles note heads, and is contained in the Voice context.  You
2299     have to instantiate this explicitly if you want to adjust the
2300     style of individual note heads.
2301
2302   @item @code{Voice}@indexcode{Voice} @* 
2303     Corresponds to a voice on a staff.  This context handles the
2304     conversion of dynamic signs, stems, beams, super- and subscripts,
2305     slurs, ties, and rests.
2306
2307     You have to instantiate this explicitly if you want to have
2308     multiple voices on the same staff.
2309
2310   @item @code{ChordNamesVoice}@indexcode{ChordNamesVoice} @* 
2311     A voice with chord names.  Handles printing of a line of chord
2312     names.
2313
2314   @item @code{ChordNames}@indexcode{ChordNames} @* 
2315     Typesets chord names.  Can contain @code{ChordNamesVoice}
2316     contexts.
2317
2318   @item @code{Lyrics}@indexcode{Lyrics} @* 
2319     Typesets lyrics.  It can contain @code{LyricVoice} contexts.
2320
2321   @item @code{Staff}@indexcode{Staff} @* 
2322     Handles clefs, bar lines, keys, accidentals.  It can contain
2323     @code{Voice} contexts.
2324
2325   @item @code{RhythmicStaff}@indexcode{RhythmicStaff} @* 
2326     A context like @code{Staff} but for printing rhythms.  Pitches are
2327     ignored; the notes are printed on one line.  It can contain
2328     @code{Voice} contexts.
2329
2330   @item @code{GrandStaff}@indexcode{GrandStaff} @* 
2331     Contains @code{Staff} or @code{RhythmicStaff} contexts.  It adds a
2332     brace on the left side, grouping the staffs together.  The bar
2333     lines of the contained staffs are connected vertically.  It can
2334     contain @code{Staff} contexts.
2335
2336   @item @code{PianoStaff}@indexcode{PianoStaff} @* 
2337     Just like @code{GrandStaff} but with @code{minVerticalAlign} set
2338     equal to @code{maxVerticalAlign} so that interstaff beaming and
2339     slurring can be used.
2340
2341   @item @code{StaffGroup}@indexcode{StaffGroup} @* 
2342     Contains @code{Staff} or @code{RhythmicStaff} contexts.  Adds a
2343     bracket on the left side, grouping the staffs together.  The bar
2344     lines of the contained staffs are connected vertically.  It can
2345     contain @code{Staff}, @code{RhythmicStaff}, @code{GrandStaff}, or
2346     @code{Lyrics} contexts.
2347
2348   @item @code{ChoirStaff}@indexcode{ChoirStaff} @* 
2349     Identical to @code{StaffGroup} except that the contained staffs
2350     are not connected vertically.
2351
2352   @item @code{Score}@indexcode{Score} @* 
2353     This is the top level notation context.  No other context can
2354     contain a @code{Score} context.  This context handles the
2355     administration of time signatures.  It also makes sure that items
2356     such as clefs, time signatures, and key-signatures are aligned
2357     across staffs.  It can contain @code{Lyrics}, @code{Staff},
2358     @code{RhythmicStaff}, @code{GrandStaff}, @code{StaffGroup}, and
2359     @code{ChoirStaff} contexts.
2360
2361     You cannot explicitly instantiate a Score context (since it is
2362     not contained in any other context).  It is instantiated
2363     automatically when an output definition (a @code{\score} or
2364     @code{\paper} block) is processed.
2365 @end table
2366
2367
2368
2369 Properties that are set in one context are inherited by all of the
2370 contained contexts.  This means that a property valid for the
2371 @code{Voice} context can be set in the @code{Score} context (for
2372 example) and thus take effect in all @code{Voice} contexts.
2373
2374 Properties can be preset within the @code{\translator} block
2375 corresponding to the appropriate context.  In this case, the syntax
2376 is
2377
2378 @quotation
2379
2380   @var{propname} @code{=} @var{value}
2381 @end quotation
2382
2383 This assignment happens before interpretation starts, so a
2384 @code{\property} expression will override any predefined settings.
2385
2386 The @code{\property} expression will create any property you specify.
2387 There is no guarantee that a property will be used.  So if you spell
2388 a property name wrong, there will be no error message.
2389
2390 The property settings are used during the interpretation phase.  They
2391 are read by the LilyPond modules where interpretation contexts are
2392 built of.  These modules are called @emph{translators}.  Translators for
2393 notation are called @emph{engravers}, and translators for sound are
2394 called @emph{performers}.
2395
2396 The precise result of a property is determined by the implementation
2397 of the translator that reads them.  Therefore, the result of a
2398 property can vary, since it is implementation and configuration
2399 dependent.
2400
2401 In order to fully find out what properties are used, you must
2402 currently search the source code for calls to @code{get_property}. 
2403 The rest of the section is devoted to an (incomplete) overview of
2404 available properties.
2405
2406
2407 @cindex properties!Lyrics
2408
2409 @table @samp
2410   @item @code{textStyle}@indexcode{textStyle} @* 
2411     Set the font for lyrics.  The available font choices are
2412     @code{roman}, @code{italic}, @code{bold}, @code{large}, @code{Large},
2413     @code{typewriter}, and @code{finger}.  The @code{finger} font can
2414     only display numbers.  Note also that you must be careful when
2415     using @code{\property} in Lyrics mode, because of the way strings
2416     are parsed.  Either put quotes around the arguments to
2417     @code{\property} or be sure to leave a space on both sides of the
2418     dot.
2419 @end table
2420
2421
2422 @cindex properties!Thread
2423
2424 @table @samp
2425   @item @code{noteheadStyle}@indexcode{noteheadStyle} @* 
2426     Selects type of note head.  Choices are @code{cross},
2427     @code{diamond}, @code{harmonic}, @code{transparent}, and @code{""}. 
2428     They are shown in that order below.
2429
2430     @mudela[center]
2431
2432       \score {
2433         \notes { 
2434           \property Staff.barNonAuto = 1
2435           \property Voice.noteHeadStyle = cross 
2436           a'
2437           \property Voice.noteHeadStyle = diamond
2438           a'
2439           \property Voice.noteHeadStyle = harmonic
2440           a'
2441           \property Voice.noteHeadStyle = transparent
2442           a' 
2443           \property Voice.noteHeadStyle = ""
2444           a'
2445         }
2446         \paper {
2447           linewidth = -1.;
2448         }
2449       }
2450     
2451 @end mudela
2452 @end table
2453
2454 @subsubheading Grace properties
2455
2456 @cindex properties!Grace
2457
2458  
2459 @table @samp  
2460   @item @code{stemStyle}@indexcode{stemStyle} @* 
2461     By default set to @code{"grace"} meaning that all unbeamed 
2462     notes with flags are typeset with a slash through the flag. 
2463     Setting to @code{""} gives standard flags.
2464 @end table
2465
2466
2467 @cindex properties!Voice
2468
2469 @table @samp  
2470   @item @code{abbrev}@indexcode{abbrev} @* 
2471     Set length for tremolo to be used if no length is explicitly
2472     specified. 
2473
2474   @item @code{articulationScriptPadding}@indexcode{articulationScriptPadding}
2475     @* 
2476     Determines the extra space added between articulation marks, such
2477     as staccato, tenuto, trill, up/down bow or fermata, and the
2478     closest staff line or note.
2479
2480   @item @code{articulationScriptVerticalDirection}
2481     @indexcode{articulationScriptVerticalDirection} @* 
2482     Determines the location of articulation marks.  Set to @code{\up}
2483     to print marks above the staff; set to @code{\down} to print marks
2484     below the staff.  This property does not override explicit
2485     directions marked with `@code{^}' or `@code{_}' in the mudela file.
2486     
2487   @item @code{noAutoBeaming}@indexcode{beamAuto} @* 
2488     If set to 1 then beams are not generated automatically.
2489
2490   @item @code{beamAutoEnd}@indexcode{beamAutoEnd} @* 
2491     Specifies when automatically generated beams can end.  See
2492     section @xref{autobeam}.
2493
2494   @item @code{beamAutoBegin}@indexcode{beamAutoBegin} @* 
2495     Specifies when automatically generated beams can start.  See
2496     section @xref{autobeam}.
2497
2498   @item @code{beamquantisation}@indexcode{beamquantisation} @* 
2499     Set to @code{\none} for no quantization.  Set to @code{\normal} to
2500     quantize position and slope.  Set to @code{\traditional} to avoid
2501     wedges.  These three settings are available via
2502     @code{\beamposfree}@keyindex{beamposfree},
2503     @code{\beamposnormal}@keyindex{beamposnormal}, and
2504     @code{\beampostraditional}@keyindex{beampostraditional}.
2505
2506   @item @code{beamslopedamping}@indexcode{beamslopedamping} @* 
2507     Set to @code{\none} for undamped beams.  Set to @code{\normal} for
2508     damped beams.  Set to @code{\infinity} for beams with zero slope. 
2509     The identifiers
2510     @code{\beamslopeproportional}@keyindex{beamslopeproportional},
2511     @code{\beamslopedamped}@keyindex{beamslopedamped}, and
2512     @code{\beamslopezero}@keyindex{beamslopezero} each set the
2513     corresponding value.
2514
2515   @item @code{dynamicDirection}@indexcode{dynamicDirection} @* 
2516     Determines location of dynamic marks.  Set to @code{\up} to print
2517     marks above the staff; set to @code{\down} to print marks below
2518     the staff.
2519
2520   @item @code{dynamicStyle}@indexcode{dynamicStyle} @* 
2521     Set the text style for dynamics.  
2522
2523   @item @code{fontSize}@indexcode{fontSize} @* 
2524     Can be used to select smaller font sizes for music.  The normal
2525     font size is 0, and the two smaller sizes are -1
2526     and -2.
2527
2528    @item @code{forceHorizontalShift}@indexcode{forceHorizontalShift} @* 
2529     Force horizontal shift for collision resolution.  It overrides
2530     automatic collision resolution.  The value is the shift amount
2531     expressed in @code{note_width}, as set in the paper section.
2532
2533 @ignore
2534
2535 TODO: explain this in refman.
2536
2537 horizontalNoteShift does not set shifting itself.
2538
2539 Notes that are likely to collide, are grouped into a Collision
2540 object.  Colliding notes within the collision are then grouped based
2541 on their stem direction and horizontalNoteShift setting, like this:
2542
2543                          |
2544                          | | 
2545                         0u |  |
2546                           1u  |
2547                              2u
2548
2549
2550                 2d
2551                 |  1d
2552                 |  |  0d
2553                    |  |
2554                       |
2555
2556 (0,1,2, ..  = horizontalNoteShift value.  u,d = stem up / stem down)
2557
2558 Only then the seperate groups are shifted horizontally.  When
2559 collision is done with this shifting, any forceHorizontalShift
2560 settings will override the default shifts.
2561
2562
2563 This scheme makes sense, because you only have to set
2564 horizontalNoteShift once in each voice.  (Otherwise you'd have to set
2565 and unset it for each collision in a score.)
2566 @end ignore
2567
2568
2569   @item @code{horizontalNoteShift}@indexcode{horizontalNoteShift} @* 
2570     Enable LilyPond to shift notes horizontally if they collide with
2571     other notes.  This is useful when typesetting many voices on one
2572     staff.  The identifier @code{\shift}@keyindex{shift} is defined to
2573     enable this.  Traditionally, the outer chords (the upmost and
2574     downmost voices), should have no @code{horizontalNoteShift}.
2575
2576   @item @code{markScriptPadding}@indexcode{markScriptPadding} @* 
2577     Determines the extra space added between the mark and the closest
2578     staff line or note.
2579
2580   @item @code{markDirection}@indexcode{markDirection} @* 
2581     Determines if marks should be printed above or below the staff.
2582     Set to @code{\up} to print marks above the staff; set to
2583     @code{\down} to print marks below the staff.
2584
2585   @item @code{midiInstrument}@indexcode{midiInstrument} @* 
2586     Sets the instrument for MIDI output.  If this property is not set
2587     then LilyPond will use the @code{instrument} property.  This must
2588     be set to one of the strings on the list of MIDI instruments that
2589     appears in section @xref{midilist}.  If you use a string which
2590     is not listed, LilyPond will silently substitute piano.
2591
2592   @item @code{oldTieBehavior}@indexcode{oldTieBehavior} @* 
2593     Set to 1 in order to get old tie behavior where ties would
2594     connect unequal pitches.  This property is deprecated, and its
2595     use is not recommended.
2596
2597   @item @code{restStyle}@indexcode{restStyle} @* 
2598     Change the layout of rests shorter than quarter notes. 
2599     Currently, the standard layout @code{""} and mensural notation
2600     @code{"mensural"} are available. Mensural rests of duration
2601     32 or shorter are not available.
2602     
2603   @item @code{scriptHorizontal}@indexcode{scriptHorizontal} @* 
2604     Put scripts left or right of note heads.  Support for this is
2605     limited.  Accidentals will collide with scripts.
2606     
2607   @item @code{slurVerticalDirection}@indexcode{slurVerticalDirection} @* 
2608     Set to @code{\free} for free choice of slur direction, set to
2609     @code{\up} to force slurs up, set to @code{\down} to force slurs
2610     down.  The shorthands @code{\slurup}@keyindex{slurup},
2611     @code{\slurdown}@keyindex{slurdown}, and
2612     @code{\slurboth}@keyindex{slurboth} are available.
2613
2614   @item @code{slurDash}@indexcode{slurDash} @* 
2615     Set to 0 for normal slurs, 1 for dotted slurs, and a
2616     larger value for dashed slurs.  Identifiers
2617     @code{\slurnormal}@keyindex{slurnormal} and
2618     @code{\slurdotted}@keyindex{slurdotted} are predefined to set the
2619     first two settings.
2620
2621 @item @code{stemLength}@indexcode{stemLength} @* 
2622     Set length of stems.  Unit is `@code{interline}/2', so
2623     @code{stemLength} defaults to 7.
2624
2625   @item @code{stemLeftBeamCount}@indexcode{stemLeftBeamCount} @* 
2626     Specify the number of beams to draw on the left side of the next
2627     note.  Overrides automatic beaming.  The value is only used once,
2628     and then it is erased.
2629
2630   @item @code{stemRightBeamCount}@indexcode{stemRightBeamCount} @* 
2631     Specify the number of beams to draw on the right side of the next
2632     note.  Overrides automatic beaming.  The value is only used once,
2633     and then it is erased.
2634   @item @code{tieVerticalDirection}@indexcode{tieVerticalDirection} @* 
2635     Set to @code{\free} for free choice of tie direction, set to
2636     @code{\up} to force ties up, set to @code{\down} to force ties
2637     down.
2638
2639   @item @code{transposing}@indexcode{transposing} @* 
2640     Transpose the MIDI output.  Set this property to the number of
2641     half-steps to transpose by.
2642
2643   
2644   @item @code{textEmptyDimension}@indexcode{textEmptyDimension} @* 
2645     If set to 1 then text placed above or below the staff is
2646     assumed to have zero width.
2647   
2648   @item @code{textStyle}@indexcode{textStyle} @* 
2649     Set the text style for superscripts and subscripts.  See above
2650     for list of text styles.
2651
2652   @item @code{textScriptPadding}@indexcode{textScriptPadding} @* 
2653     Determines the extra space added between superscripted resp.
2654     subscripted text and the closest staff line or note.
2655
2656   @item @code{verticalDirection}@indexcode{verticalDirection} @* 
2657     Determines the direction of stems, subscripts, beams, slurs, and
2658     ties.  Set to @code{\down} to force them down, @code{\up} to force
2659     them up, or @code{\free} to let LilyPond decide.  This can be used
2660     to distinguish between voices on the same staff.  The
2661     @code{\stemdown}@keyindex{stemdown}, @code{\stemup}@keyindex{stemup},
2662     and @code{\stemboth}@keyindex{stemboth} identifiers set this
2663     property.
2664     
2665
2666   @item @code{tupletDirection}@indexcode{tupletDirection} @* 
2667     Determines the direction of triplets and other tuplets.  Set to
2668     @code{\down} to force them below the staff, @code{\up} to force
2669     them above, or @code{\free} to let LilyPond decide.
2670
2671   @item @code{tupletVisibility}@indexcode{tupletVisibility} @* 
2672     Determines whether tuplets of notes are labelled.  Setting
2673     to 0 shows nothing; setting to 1 shows a number;
2674     setting to 2 shows a number and a bracket if there is no
2675     beam; setting to 3 shows a number, and if there is no beam
2676     it adds a bracket; setting to 4 shows both a number and a
2677     bracket unconditionally.
2678
2679 @end table
2680
2681 @subsubheading Staff properties
2682
2683 @cindex properties!Staff
2684
2685 @table @samp
2686  
2687   @item @code{barNonAuto}@indexcode{barNonAuto} @* 
2688     If set to 1 then bar lines will not be printed
2689     automatically; they must be explicitly created with @code{\bar}
2690     keywords.  Unlike with the @code{\cadenza} keyword, measures are
2691     still counted.  Bar generation will resume according to that
2692     count if this property is set to zero.
2693
2694   @item @code{barNumberDirection}@indexcode{barNumberDirection} @* 
2695     Set to @code{\up} or @code{\down} to put bar numbers above or below
2696     the staff.
2697
2698   @item @code{barNumberHangOnClef}@indexcode{barNumberHangOnClef} @* 
2699     Set to 1 to cause bar numbers to appear above or below the
2700     clef instead of on the bar line.  This property is deprecated. 
2701     Do not use.
2702
2703   @item @code{barNumberScriptPadding}@indexcode{barNumberScriptPadding} @* 
2704     Sets extra space between the bar number and the bar it labels.
2705
2706   @item @code{barSize}@indexcode{barSize} @* 
2707     Specify the height of the bar lines if it should be different
2708     than the staff height.
2709
2710   @item @code{barAtLineStart}@indexcode{barAtLineStart} @* 
2711     Set to 1 to produce a bar line after the clef at the start
2712     of each line (but not at the beginning of the music).
2713
2714   @item @code{clefStyle}@indexcode{clefStyle} @* 
2715     Determines how clefs are typeset.  If set to @code{transparent},
2716     the clefs are not printed at all, if set to
2717     @code{fullSizeChanges}, clef changes in the middle of a line are
2718     typeset with a full size clef.  By default, clef changes are
2719     typeset in smaller size.
2720
2721   @item @code{createKeyOnClefChange}@indexcode{createKeyOnClefChange} @* 
2722     Set to a nonempty string if you want key signatures to be printed
2723     when the clef changes.  Set to the empty string if you do not
2724     want key signatures printed.
2725
2726   @item @code{createInitdefaultClef}@indexcode{createInitdefaultClef} @* 
2727     Specify whether clefs are created on default?  (Doesn't seem to
2728     do anything.)
2729
2730   @item @code{defaultClef}@indexcode{defaultClef} @* 
2731     Determines the default clef.  See @code{\clef} keyword.
2732
2733   @item @code{markHangOnClef}@indexcode{markHangOnClef} @* 
2734     Set to 1 to cause marks to appear by clefs instead of by bar
2735     lines.  Deprecated, use is not recommended.
2736
2737   @item @code{marginDirection}@indexcode{marginDirection} @* 
2738     Set to @code{\left} or @code{\right} to specify location of
2739     marginal scripts.
2740
2741   @item @code{marginScriptPadding}@indexcode{marginScriptPadding} @* 
2742     Specify extra space for marginal scripts.
2743
2744   @item @code{forgetAccidentals}@indexcode{forgetAccidentals} @* 
2745     Causes accidentals to be printed at every note instead of
2746     remembered for the duration of a measure.
2747
2748   @item @code{noResetKey}@indexcode{noResetKey} @* 
2749     Do not reset the key at the start of a measure.  Accidentals will
2750     be printed only once and are in effect until overridden, possibly
2751     many measures later.
2752
2753   @item @code{staffLineLeading}@indexcode{staffLineLeading} @* 
2754     Specifies the distance (in points) between lines of the staff.
2755
2756   @item @code{numberOfStaffLines}@indexcode{numberOfStaffLines} @* 
2757     Specifies the number of staff lines.  The default is 5.
2758
2759   @item @code{postBreakPadding}@indexcode{postBreakPadding} @* 
2760     Extra space in points to be added after the clef, time signature
2761     and key signature on the staff.  Deprecated, do not use.
2762
2763   @item @code{noVoltaBraces}@indexcode{noVoltaBraces} @* 
2764     Set to true to suppress the printing of brackets over alternate
2765     endings specified by the command @code{\alternative}.
2766
2767   @item @code{numberOfStaffLines}@indexcode{numberOfStaffLines} @* 
2768     Sets the number of lines that the staff has.
2769  
2770   @item @code{barAlways}@indexcode{barAlways} @* 
2771     If set to 1 a bar line is drawn after each note.
2772
2773   @item @code{defaultBarType}@indexcode{defaultBarType} @* 
2774     Sets the default type of bar line. See Section @xref{barlines} 
2775     for a list of available bar types.
2776
2777   @item @code{instrument}, @code{instr}
2778     @indexcode{instrument}@indexcode{instr} @* 
2779     If @code{Staff_margin_engraver}
2780 @cindex Staff_margin_engraver
2781  is
2782     added to the Staff translator, then the @code{instrument} property
2783     is used to label the first line of the staff and the @code{instr}
2784     property is used to label subsequent lines.  If the
2785     @code{midiInstrument} property is not set, then @code{instrument}
2786     is used to determine the instrument for MIDI output.
2787
2788   @item @code{keyOctaviation}@indexcode{keyOctaviation} @* 
2789     If set to 1, then keys are the same in all octaves.  If set
2790     to 0 then the key signature for different octaves can be
2791     different and is specified independently:
2792
2793     @quotation
2794
2795       @code{\keysignature bes fis'}
2796     @end quotation
2797
2798     The default value is 1.  Can be set to zero with
2799     @code{\specialkey} or reset to 1 with @code{\normalkey}.
2800
2801   @item @code{timeSignatureStyle}@indexcode{timeSignatureStyle} @* 
2802     Changes the default two-digit layout for time signatures.  The
2803     following values are recognized:
2804
2805     @table @samp
2806       @item @code{C}@indexcode{C} @* 
2807         4/4 and 2/2 are typeset as C and struck C, respectively.  All
2808         other time signatures are written with two digits.
2809
2810       @item @code{old}@indexcode{old} @* 
2811         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
2812         typeset with old-style mensuration marks.  All other time
2813         signatures are written with two digits.
2814
2815       @item @code{1}@indexcode{1} @* 
2816         All time signatures are typeset with a single
2817         digit, e.g. 3/2 is written as 3.
2818
2819       @item @indexcode{CM/N}@code{C}@var{M}@code{/}@var{N}, 
2820       @indexcode{oldM/N}@code{old}@var{M}@code{/}@var{N} or
2821       @code{old6/8alt}@indexcode{old6/8alt} @* 
2822         Tells LilyPond to use a specific symbol as time signature.
2823     @end table
2824
2825     The different time signature characters are shown below with its
2826     names:
2827
2828     @mudela[center]
2829
2830       \score {
2831         \notes\relative c'' {
2832           \property Voice.textStyle = typewriter
2833           \property Staff.timeSignatureStyle = "C2/2"
2834           \time 2/2; a2^"C2/2" a2 
2835           \property Staff.timeSignatureStyle = "C4/4"
2836           \time 2/2; a2^"C4/4" a2 
2837           \property Staff.timeSignatureStyle = "old2/2"
2838           \time 2/2; a2^"old2/2" a2 
2839           \property Staff.timeSignatureStyle = "old3/2"
2840           \time 2/2; a2^"old3/2" a2 
2841           \property Staff.timeSignatureStyle = "old2/4"
2842           \time 2/2; a2^"old2/4" a2 
2843           \property Staff.timeSignatureStyle = "old4/4"
2844           \time 2/2; a2^"old4/4" a2 
2845           \property Staff.timeSignatureStyle = "old6/4"
2846           \time 2/2; a2^"old6/4" a2 
2847           \property Staff.timeSignatureStyle = "old9/4"
2848           \time 2/2; a2^"old9/4" a2 
2849           \property Staff.timeSignatureStyle = "old4/8"
2850           \time 2/2; a2^"old4/8" a2 
2851           \property Staff.timeSignatureStyle = "old6/8"
2852           \time 2/2; a2^"old6/8" a2 
2853           \property Staff.timeSignatureStyle = "old6/8alt"
2854           \time 2/2; a2^"old6/8alt" a2 
2855           \property Staff.timeSignatureStyle = "old9/8"
2856           \time 2/2; a2^"old9/8" a2 
2857         }
2858         \paper {
2859           linewidth = 4.5 \in;
2860         }
2861       }
2862     
2863 @end mudela
2864
2865   @item @code{voltaSpannerDuration}@indexcode{voltaSpannerDuration} @* 
2866     Set to an integer to control the size of the brackets printed by
2867     @code{\alternative}.  The integer specifies the number of whole
2868     notes duration to use for the brackets.  It is rounded to the
2869     nearest measure.  This can be used to shrink the length of
2870     brackets in the situation where one alternative is very large. 
2871     It may have odd effects if the specified duration is longer than
2872     the music given in an @code{\alternative}.
2873 @end table
2874    
2875
2876 @cindex properties!GrandStaff
2877
2878 @table @samp 
2879   @item @code{alignmentReference}@indexcode{alignmentReference} @* 
2880     Set to @code{\center} for vertical alignment reference point to be
2881     in the center of the vertical group.  Set to @code{\up} to put the
2882     reference point at the top of the group.
2883
2884   @item @code{maxVerticalAlign}@indexcode{maxVerticalAlign} @* 
2885     Set the maximum vertical distance between staffs.
2886
2887   @item @code{minVerticalAlign}@indexcode{minVerticalAlign} @* 
2888     Set the minimum vertical distance between staffs.  
2889 @end table
2890
2891
2892 @cindex properties!Score
2893
2894 @table @samp
2895   @item @code{skipBars}@indexcode{skipBars} @* 
2896     Set to 1 to skip the empty bars that are produced by
2897     multimeasure notes and rests.  These bars will not appear on the
2898     printed output.  Set to zero (the default) to expand multimeasure
2899     notes and rests into their full length, printing the appropriate
2900     number of empty bars so that synchronization with other voices is
2901     preserved.
2902
2903     @quotation
2904
2905 @mudela[fragment,verbatim,center]
2906 r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
2907
2908 @end mudela
2909     @end quotation
2910
2911 @end table
2912
2913
2914 @cindex properties!ChordNamesVoice
2915
2916 @table @samp
2917   @item @code{chordInversion}@indexcode{chordInversion} @* 
2918     Determines whether LilyPond should look for chord inversions when
2919     translating from notes to chord names.  Set to 1 to find
2920     inversions.  The default is 0 which does not look for
2921     inversions.
2922 @end table
2923
2924
2925
2926 @node Notation output definitions, output, contextselection, LilyPond 1-2-0 Reference Manual
2927 @section Notation output definitions
2928
2929 @cindex output
2930
2931 @cindex notation output
2932
2933 @cindex output definition
2934
2935 @node output, paper, Notation output definitions, LilyPond 1-2-0 Reference Manual
2936
2937 @node paper, papervars, output, LilyPond 1-2-0 Reference Manual
2938
2939 The most important output definition is the @code{\paper} block, for
2940 music notation.  The syntax is
2941
2942 @quotation
2943
2944   @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}}
2945 @end quotation
2946
2947 where each of the items is one of
2948
2949 @itemize @bullet
2950   @item  An assignment.  The assignment must be terminated by a
2951        semicolon.  See section @xref{papervars} for information on
2952        paper variables.
2953
2954   @item  A context definition.  See section @xref{contextdefs} for
2955        more information on context definitions.
2956
2957   @item  A margin shape declaration.  The syntax is
2958
2959        @quotation
2960
2961          @code{\shape} @var{indent1}@code{,} @var{width1}@code{,}
2962                       @var{indent2}@code{,} @var{width2} ... @code{;}
2963        @end quotation
2964
2965        @keyindex{shape}
2966
2967        Each pair of @var{indent} and @var{width} values is a dimension
2968        specifying how far to indent and how wide to make the line. 
2969        The indentation and width of successive lines are specified by
2970        the successive pairs of dimensions.  The last pair of
2971        dimensions will define the characeristics of all lines beyond
2972        those explicitly specified.
2973
2974   @item  A font declaration.  Its syntax is
2975
2976        @quotation
2977
2978          @var{fontsize} @code{=} @code{\font}@keyindex{font} @var{fontname}
2979        @end quotation
2980
2981        @var{fontsize} is an integer describing the font to be used. 
2982        0 is the default font.  @var{fontname} is the basename of
2983        a font (usually a member of the Feta family).
2984 @end itemize
2985
2986
2987
2988 @cindex changing font size and paper size
2989
2990 The Feta font provides musical symbols at six different sizes.  These
2991 fonts are 11 point, 13 point, 16 point, 20 point,
2992 23 point, and 26 point.  The point size of a font is the
2993 height of the five lines in a staff when displayed in the font.
2994
2995 Definitions for these sizes are the files @file{paperSZ.ly}, where
2996 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include
2997 any of these files, the identifiers @code{paper_eleven},
2998 @code{paper_thirteen}, @code{paper_sixteen}, @code{paper_twenty},
2999 @code{paper_twentythree}, and @code{paper_twentysix} are defined
3000 respectively.  The default @code{\paper} block is also set.
3001
3002 To change the paper size, you must first set the
3003 @code{papersize}@indexcode{papersize} variable at top level.  Set it to the strings
3004 @code{a4}, @code{letter}, or @code{legal}.  After this specification,
3005 you must set the font as described above.  If you want the default
3006 font, then use the 20 point font.  The new paper size will not
3007 take effect if the font is not loaded and selected afterwards.  Paper
3008 size selection works by loading a file named after the paper size you
3009 select.
3010
3011
3012
3013 @cindex paper variables
3014
3015 @node papervars, contextdefs, paper, LilyPond 1-2-0 Reference Manual
3016
3017 There is a large number of paper variables that are used to control
3018 details of the layout.  These variables control the defaults for the
3019 entire score.  Usually, they do not have to be changed; they are by
3020 default set to values that depend on the font size in use.  The
3021 values are used by the graphic objects while formatting the score;
3022 they are therefore implementation dependent.  Most variables are
3023 accompanied by documentation in the initalization file
3024 @file{params.ly} or @file{paperSZ.ly}, where @code{SZ} is the staff
3025 height in points.
3026
3027 Nevertheless, here are some variables you may want to use or change:
3028
3029 @table @samp
3030   @item @code{indent}@indexcode{indent} @* 
3031     The indentation of the first line of music.
3032
3033   @item @code{interline}@indexcode{interline} @* 
3034     The distance between two staff lines, calculated from the center
3035     of the lines.  You should use either this or @code{rulethickness}
3036     as a unit for distances you modify.
3037   
3038   @item @code{linewidth}@indexcode{linewidth} @* 
3039     Sets the width of the lines.  If set to -1.0, a single
3040     unjustified line is produced.
3041
3042   @item @code{output}@indexcode{output} @* 
3043     Specifies an alternate name for the the output @file{s}.
3044     A @file{.tex}, @file{.midi} or @file{.ps} extension will be 
3045     added to the string you specify.
3046
3047   @item @code{rulethickness}@indexcode{rulethickness} @* 
3048     Determines the thickness of staff and bar lines. 
3049
3050   @item @code{castingalgorithm}@indexcode{castingalgorithm} @* 
3051     The algorithm to use for breaking lines.  Choices are
3052     @code{\Gourlay}@keyindex{Gourlay} for a TeX-like dynamic
3053     programming algorithm, and @code{\Wordwrap}@keyindex{Wordwrap} for
3054     a simple algorithm.  Gourlay breaking looks much better, but
3055     takes a lot more resources.  Wordwrap leaves loosely spaced lines
3056     at the end.
3057 @end table
3058
3059
3060 @node contextdefs, engravers, papervars, LilyPond 1-2-0 Reference Manual
3061
3062 @cindex context definition
3063
3064 A notation contexts is defined by the following information
3065
3066 @enumerate i
3067   @item  A name.
3068
3069   @item  The LilyPond modules that do the actual conversion of music to
3070        notation.  Each module is a so-called
3071        @emph{engraver}
3072 @cindex engraver
3073 .
3074
3075   @item  How these modules should cooperate, i.e. which ``cooperation
3076        module'' should be used.  This cooperation module is a special
3077        type of engraver.
3078
3079   @item  What other contexts the context can contain,
3080
3081   @item  What properties are defined.
3082 @end enumerate
3083
3084 A context definition has this syntax:
3085
3086 @quotation
3087
3088   @code{\translator} @code{@{}
3089                       @var{translatorinit} @var{translatormodifierlist}
3090                     @code{@}}
3091 @end quotation
3092
3093 @var{translatorinit} can be an identifier or of the form
3094
3095 @quotation
3096
3097   @code{\type} @var{typename} @code{;}
3098 @end quotation
3099
3100 @var{typename} is one of
3101
3102 @table @samp
3103   @item @code{Engraver_group_engraver}@indexcode{Engraver_group_engraver} @* 
3104     The standard cooperation engraver.
3105
3106   @item @code{Score_engraver}@indexcode{Score_engraver} @* 
3107     This is cooperation module that should be in the top level context.
3108
3109   @item @code{Grace_engraver_group}@indexcode{Grace_engraver_group} @* 
3110     This is a special cooperation module (resembling
3111     @code{Score_engraver}) that is used to created an embedded
3112     `miniscore'.
3113 @end table 
3114
3115 @var{translatormodifierlist} is a list of items where each item is
3116 one of
3117
3118 @itemize @bullet
3119   @item  @code{\consists} @var{engravername} @code{;} @* 
3120     Add @var{engravername} to the list of modules in this context. 
3121     Section @xref{engravers} contains an overview of the engravers
3122     available.  The order of engravers added with @code{\consists} is
3123     significant.
3124   
3125   @item  @code{\consistsend} @var{engravername} @code{;} @* 
3126     Analogous to @code{\consists}, but makes sure that
3127     @var{engravername} is always added to the end of the list of
3128     engravers.
3129
3130     Some engraver types need to be at the end of the list; this
3131     insures they are put there, and stay there, if a user adds or
3132     removes engravers.  This command is usually not needed for
3133     end-users.
3134     
3135   @item  @code{\accepts} @var{contextname} @code{;} @* 
3136     Add @var{contextname} to the list of  context this context can
3137     contain.  The first listed context the context to create by
3138     default.
3139   
3140   @item  @code{\remove} @var{engravername} @code{;} @* 
3141     Remove a previously added (with @code{\consists}) engraver.
3142   
3143   @item  @code{\name} @var{contextname} @code{;} @* 
3144     This sets name of the context, e.g. @code{Staff}, @code{Voice}.  If
3145     the name is not specified, the translator won't do anything.
3146
3147   @item  @var{propname} @code{=} @var{value} @code{;} @* 
3148     A property assignment.  It is allowed to use reals for
3149     @var{value}.
3150 @end itemize
3151
3152 In the @code{\paper} block, it is also possible to define translator
3153 identifiers.  Like other block identifiers, the identifier can only
3154 be used as the very first item of a translator.  In order to define
3155 such an identifier outside of @code{\score}, you must do
3156
3157 @quotation
3158
3159 @example 
3160 \paper @{
3161   foo = \translator @{ ... @}
3162 @}
3163 \score @{
3164   \notes @{
3165     ...
3166   @}
3167   \paper @{
3168     \translator @{ \foo ... @}
3169   @}
3170 @} 
3171 @end example 
3172
3173 @end quotation
3174
3175
3176 @cindex paper types, engravers, and pre-defined translators
3177
3178 Some pre-defined identifiers can simplify modification of
3179 translators.  The pre-defined identifiers are:
3180
3181 @table @samp
3182   @item @code{StaffContext}@indexcode{StaffContext} @* 
3183     Default Staff context. 
3184
3185   @item @code{RhythmicStaffContext}@indexcode{RhythmicStaffContext} @* 
3186     Default RhythmicStaff context. 
3187
3188   @item @code{VoiceContext}@indexcode{VoiceContext} @* 
3189     Default Voice context.  
3190
3191   @item @code{ScoreContext}@indexcode{ScoreContext} @* 
3192     Default Score context. 
3193
3194   @item @code{ScoreWithNumbers}@indexcode{ScoreWithNumbers} @* 
3195     Score context with numbering at the Score level.
3196
3197   @item @code{BarNumberingStaffContext}@indexcode{BarNumberingStaffContext} @* 
3198     Staff context with numbering at the Staff level.
3199
3200   @item @code{HaraKiriStaffContext}@indexcode{HaraKiriStaffContext} @* 
3201     Staff context that does not print if it only contains rests. 
3202     Useful for orchestral scores.@footnote{Harakiri, also called
3203     Seppuku, is the ritual suicide of the Samourai.}
3204
3205   @item @code{OrchestralPartStaffContext}@indexcode{OrchestralPartStaffContext}
3206
3207   @item @code{OrchestralScoreContext}@indexcode{OrchestralScoreContext}
3208 @end table
3209
3210 Using these pre-defined values, you can remove or add items to the
3211 translator:
3212
3213 @quotation
3214
3215 @example 
3216 \paper @{
3217   \translator @{
3218     \StaffContext
3219     \remove Some_engraver;
3220     \consists Different_engraver;
3221   @}
3222 @} 
3223 @end example 
3224
3225 @end quotation
3226
3227       
3228
3229 @node engravers, Sound output, contextdefs, LilyPond 1-2-0 Reference Manual
3230
3231 The engravers for paper output are:
3232
3233 [incomplete, FIXME]
3234
3235 @table @samp
3236   @item @code{Bar_engraver}@indexcode{Bar_engraver} @* 
3237     Engraves bar lines.  Normally in @code{Staff} and
3238     @code{RhythmicStaff}.
3239
3240   @item @code{Bar_number_engraver}@indexcode{Bar_number_engraver} @* 
3241     Engrave bar numbers.  These numbers appear at the start of each
3242     line.  Not normally in any translator.  Can be added to
3243     @code{Score} for score-wide numbering or to @code{Staff} for
3244     numbering on each staff.
3245
3246   @item @code{Beam_engraver}@indexcode{Beam_engraver} @* 
3247     Handles beam requests by engraving beams.  Normally appears in
3248     the @code{Voice} translator.  If omitted, then notes will be
3249     printed with flags instead of beams.
3250
3251   @item @code{Beam_req_swallow_translator}
3252     @indexcode{Beam_req_swallow_translator} @* 
3253     Swallows beam requests.  In @code{LyricVoice}.  
3254
3255   @item @code{Chord_name_engraver}@indexcode{Chord_name_engraver} @* 
3256     Engraves chord names.  Normally in @code{ChordNameVoice} .
3257
3258   @item @code{Chord_tremolo_engraver}@indexcode{Chord_tremolo_engraver}
3259
3260   @item @code{Clef_engraver}@indexcode{Clef_engraver} @* 
3261     Engraves the clef symbol.  Normally in @code{Staff}.
3262
3263   @item @code{Collision_engraver}@indexcode{Collision_engraver}
3264
3265   @item @code{Dot_column_engraver}@indexcode{Dot_column_engraver} @* 
3266     Engraves dots on dotted notes shifted to the right of the note. 
3267     Normally in @code{Voice}.  If omitted, then dots appear on top of
3268     the notes.
3269
3270   @item @code{Dynamic_engraver}@indexcode{Dynamic_engraver} @* 
3271     Engraves dynamics symbols.  Normally in @code{Voice}.
3272
3273   @item @code{Font_size_engraver}@indexcode{Font_size_engraver}
3274
3275   @item @code{Key_engraver}@indexcode{Key_engraver} @* 
3276     Engraves the key signature.  Normally in @code{Staff}.
3277
3278   @item @code{Local_key_engraver}@indexcode{Local_key_engraver}
3279
3280   @item @code{Lyric_engraver}@indexcode{Lyric_engraver} @* 
3281     Engraves lyrics.  Normally in @code{LyricVoice}.
3282
3283   @item @code{Multi_measure_rest_engraver}
3284     @indexcode{Multi_measure_rest_engraver} @* 
3285     Engraves multi-measure rests that are produced with @code{R}. 
3286     Normally in @code{Voice}.
3287
3288   @item @code{Piano_bar_engraver}@indexcode{Piano_bar_engraver}
3289
3290   @item @code{Pitch_squash_engraver}@indexcode{Pitch_squash_engraver} @* 
3291     Treat all pitches as middle C.  Used in @code{RhythmicStaff}. 
3292     Note that the notes move, but the locations of accidentals stay
3293     the same.
3294
3295   @item @code{Priority_horizontal_align_engraver}
3296     @indexcode{Priority_horizontal_align_engraver}
3297
3298   @item @code{Repeat_engraver}@indexcode{Repeat_engraver} @* 
3299     Handles repeats?  In @code{Staff} and @code{RhythmicStaff}.
3300
3301   @item @code{Rest_collision_engraver}@indexcode{Rest_collision_engraver} @* 
3302     Handles collisions of rests.  In @code{Staff}.
3303
3304   @item @code{Rest_engraver}@indexcode{Rest_engraver} @* 
3305     Engraves rests.  Normally in @code{Voice}.
3306
3307   @item @code{Rhythmic_column_engraver}@indexcode{Rhythmic_column_engraver}
3308
3309   @item @code{Score_priority_engraver}@indexcode{Score_priority_engraver}
3310
3311   @item @code{Script_engraver}@indexcode{Script_engraver} @* 
3312     Handles note ornaments generated by @code{\script}.  Normally in
3313     @code{Voice}.
3314
3315   @item @code{Separating_line_group_engraver}
3316     @indexcode{Separating_line_group_engraver}
3317
3318   @item @code{Skip_req_swallow_translator}
3319     @indexcode{Skip_req_swallow_translator}
3320
3321   @item @code{Slur_engraver}@indexcode{Slur_engraver} @* 
3322     Engraves slurs.  Normally in @code{Voice}.
3323
3324   @item @code{Span_bar_engraver}@indexcode{Span_bar_engraver} @* 
3325     Engraves lines across multiple staffs.  Normally in
3326     @code{Staffgroup} and @code{GrandStaff}.  Removing this from
3327     @code{StaffGroup} gives the definition of @code{ChoirStaff}.
3328
3329   @item @code{Span_score_bar_engraver}@indexcode{Span_score_bar_engraver}
3330
3331   @item @code{Staff_group_bar_engraver}@indexcode{Staff_group_bar_engraver}
3332
3333   @item @code{Staff_margin_engraver}@indexcode{Staff_margin_engraver} @* 
3334     Prints the name of the instrument (specified by
3335     @code{Staff.instrument} and @code{Staff.instr}) at the left of the
3336     staff.
3337
3338   @item @code{Staff_sym_engraver}@indexcode{Staff_sym_engraver}
3339
3340   @item @code{Stem_engraver}@indexcode{Stem_engraver} @* 
3341     Engraves stems.  Normally in @code{Voice}.
3342
3343   @item @code{Ties_engraver}@indexcode{Ties_engraver} @* 
3344     Engraves ties.  Normally in @code{Voice}.
3345
3346   @item @code{Time_signature_engraver}@indexcode{Time_signature_engraver} @* 
3347     Engraves the time signature.  Normally in @code{Staff} and
3348     @code{RhythmicStaff}.
3349
3350   @item @code{Timing_engraver}@indexcode{Timing_engraver} @* 
3351     Responsible for synchronizing timing information from staffs. 
3352     Normally in @code{Score}.  In order to create polyrhythmic music,
3353     this engraver should be removed from @code{Score} and placed in
3354     @code{Staff}.
3355
3356   @item @code{Tuplet_engraver}@indexcode{Tuplet_engraver} @* 
3357     Engraves tuplet brackets?  In @code{Staff}.
3358
3359   @item @code{Vertical_align_engraver}@indexcode{Vertical_align_engraver} 
3360 @end table
3361
3362
3363
3364 @node Sound output, midilist, engravers, LilyPond 1-2-0 Reference Manual
3365 @section Sound output
3366
3367
3368
3369 The MIDI block is analogous to the paper block, but it is simpler.
3370 The @code{\midi} block can contain:
3371 @cindex MIDI block
3372
3373 @itemize @bullet
3374   @item  a @code{\tempo} definition
3375   @item  context definitions
3376 @end itemize
3377
3378 Assignments in the @code{\midi} block are not allowed.
3379
3380
3381
3382 @cindex context definition
3383
3384 Context definitions follow precisely the same syntax as within the
3385 \paper block.  Translation modules for sound are called performers.
3386 The contexts for MIDI output are defined in @file{ly/performer.ly}.
3387
3388
3389
3390 @cindex MIDI instrument names
3391
3392 @node midilist, Pre-defined Identifiers, Sound output, LilyPond 1-2-0 Reference Manual
3393
3394 The MIDI instrument name is set by the
3395 @code{Staff.midiInstrument}@indexcode{Staff.midiInstrument} property or, if that property is
3396 not set, the @code{Staff.instrument}@indexcode{Staff.instrument} property.  The instrument
3397 name should be chosen from the following list.  If the selected
3398 string does not exactly match, then LilyPond uses the default piano.
3399
3400
3401 @quotation
3402
3403 @example 
3404 "acoustic grand"            "contrabass"           "lead 7 (fifths)"
3405 "bright acoustic"           "tremolo strings"      "lead 8 (bass+lead)"
3406 "electric grand"            "pizzicato strings"    "pad 1 (new age)"
3407 "honky-tonk"                "orchestral strings"   "pad 2 (warm)"
3408 "electric piano 1"          "timpani"              "pad 3 (polysynth)"
3409 "electric piano 2"          "string ensemble 1"    "pad 4 (choir)"
3410 "harpsichord"               "string ensemble 2"    "pad 5 (bowed)"
3411 "clav"                      "synthstrings 1"       "pad 6 (metallic)"
3412 "celesta"                   "synthstrings 2"       "pad 7 (halo)"
3413 "glockenspiel"              "choir aahs"           "pad 8 (sweep)"
3414 "music box"                 "voice oohs"           "fx 1 (rain)"
3415 "vibraphone"                "synth voice"          "fx 2 (soundtrack)"
3416 "marimba"                   "orchestra hit"        "fx 3 (crystal)"
3417 "xylophone"                 "trumpet"              "fx 4 (atmosphere)"
3418 "tubular bells"             "trombone"             "fx 5 (brightness)"
3419 "dulcimer"                  "tuba"                 "fx 6 (goblins)"
3420 "drawbar organ"             "muted trumpet"        "fx 7 (echoes)"
3421 "percussive organ"          "french horn"          "fx 8 (sci-fi)"
3422 "rock organ"                "brass section"        "sitar"
3423 "church organ"              "synthbrass 1"         "banjo"
3424 "reed organ"                "synthbrass 2"         "shamisen"
3425 "accordion"                 "soprano sax"          "koto"
3426 "harmonica"                 "alto sax"             "kalimba"
3427 "concertina"                "tenor sax"            "bagpipe"
3428 "acoustic guitar (nylon)"   "baritone sax"         "fiddle"
3429 "acoustic guitar (steel)"   "oboe"                 "shanai"
3430 "electric guitar (jazz)"    "english horn"         "tinkle bell"
3431 "electric guitar (clean)"   "bassoon"              "agogo"
3432 "electric guitar (muted)"   "clarinet"             "steel drums"
3433 "overdriven guitar"         "piccolo"              "woodblock"
3434 "distorted guitar"          "flute"                "taiko drum"
3435 "guitar harmonics"          "recorder"             "melodic tom"
3436 "acoustic bass"             "pan flute"            "synth drum"
3437 "electric bass (finger)"    "blown bottle"         "reverse cymbal"
3438 "electric bass (pick)"      "skakuhachi"           "guitar fret noise"
3439 "fretless bass"             "whistle"              "breath noise"
3440 "slap bass 1"               "ocarina"              "seashore"
3441 "slap bass 2"               "lead 1 (square)"      "bird tweet"
3442 "synth bass 1"              "lead 2 (sawtooth)"    "telephone ring"
3443 "synth bass 2"              "lead 3 (calliope)"    "helicopter"
3444 "violin"                    "lead 4 (chiff)"       "applause"
3445 "viola"                     "lead 5 (charang)"     "gunshot"
3446 "cello"                     "lead 6 (voice)" 
3447 @end example 
3448
3449 @end quotation
3450
3451
3452 @cindex MIDI types and performers
3453
3454 The types available for  MIDI translators are:
3455
3456 @table @samp
3457   @item @code{Performer_group_performer}@indexcode{Performer_group_performer}
3458   @item @code{Score_performer}@indexcode{Score_performer}
3459   @item @code{Staff_performer}@indexcode{Staff_performer}
3460 @end table
3461
3462 The performers for MIDI translators are:
3463
3464 @table @samp
3465   @item @code{Key_performer}@indexcode{Key_performer}
3466   @item @code{Time_signature_performer}@indexcode{Time_signature_performer}
3467   @item @code{Note_performer}@indexcode{Note_performer}
3468   @item @code{Lyric_performer}@indexcode{Lyric_performer}
3469   @item @code{Swallow_performer}@indexcode{Swallow_performer}
3470 @end table
3471
3472
3473
3474 @node Pre-defined Identifiers, ident, midilist, LilyPond 1-2-0 Reference Manual
3475 @section Pre-defined Identifiers
3476
3477 @cindex pre-defined identifiers
3478
3479 @node ident, Running LilyPond, Pre-defined Identifiers, LilyPond 1-2-0 Reference Manual
3480
3481 Various identifiers are defined in the initialization files to
3482 provide shorthands for some settings.  Most of them are in
3483 @file{ly/declarations.ly}.
3484
3485 @table @samp
3486   @item @code{\break}@keyindex{break} @* 
3487     Force a line break in music by using a large argument for the
3488     keyword @code{\penalty}.
3489
3490   @item @code{\center}@keyindex{center} @* 
3491     Used for setting direction  properties.  Equals 0.
3492
3493   @item @code{\down}@keyindex{down} @* 
3494     Used for setting direction setting properties.  Is equal
3495     to -1.
3496
3497   @item @code{\free}@keyindex{free} @* 
3498     Used for setting direction setting properties.  Is equal
3499     to 0.
3500
3501   @item @code{\left}@keyindex{left} @* 
3502     Used for setting text alignment property.  Is equal to -1.
3503
3504   @item @code{\nobreak}@keyindex{nobreak} @* 
3505     Prevent a line break in music by using a large negative argument
3506     for the keyword @code{\penalty}.
3507
3508   @item @code{\none}@keyindex{none} @* 
3509     Used for setting @code{Score.beamslopedamping} and
3510     @code{Score.beamquantisation} properties.  Is equal to 0.
3511
3512   @item @code{\normal}@keyindex{normal} @* 
3513     Used for setting @code{Score.beamslopedamping} and
3514     @code{Score.beamquantisation} properties.  Is equal to 1.
3515
3516   @item @code{\normalkey}@keyindex{normalkey} @* 
3517     Select normal key signatures where each octave has the same key
3518     signature.  This sets the @code{Staff.keyoctaviation} property.
3519
3520   @item @code{\right}@keyindex{right} @* 
3521     Used for setting text alignment property.  Is set to 1.
3522
3523   @item @code{\shiftoff}@keyindex{shiftoff} @* 
3524     Disable horizontal shifting of note heads that collide.  Sets the
3525     @code{Voice.horizontalNoteShift} property.
3526
3527   @item @code{\shifton}@keyindex{shifton} @* 
3528     Enable note heads that collide with other note heads to be
3529     shifted horiztonally.  Sets the @code{Voice.horizontalNoteShift}
3530     property.
3531
3532   @item @code{\slurboth}@keyindex{slurboth} @* 
3533     Allow slurs to be above or below notes.  This sets the
3534     @code{Voice.slurVerticalDirection} property.
3535
3536   @item @code{\slurdown}@keyindex{slurdown} @* 
3537     Force slurs to be below notes.  This sets the
3538     @code{Voice.slurVerticalDirection} property.
3539
3540   @item @code{\slurup}@keyindex{slurup} @* 
3541     Force slurs to be above notes.  This sets the
3542     @code{Voice.slurVerticalDirection} property.
3543
3544   @item @code{\specialkey}@keyindex{specialkey} @* 
3545     Allow key signatures do differ in different octaves.  This sets
3546     the @code{Staff.keyoctaviation} property.
3547
3548   @item @code{\stemboth}@keyindex{stemboth} @* 
3549     Allow stems, beams, and slurs to point either upwards or
3550     downwards, decided automatically by LilyPond.  This sets the
3551     @code{Voice.verticalDirection} property.
3552
3553   @item @code{\stemdown}@keyindex{stemdown} @* 
3554     Force stems, beams, and slurs to point down.  This sets the
3555     @code{Voice.verticalDirection} property.
3556
3557   @item @code{\stemup}@keyindex{stemup} @* 
3558     Force stems, beams and slurs to point up.  This sets the
3559     @code{Voice.verticalDirection} property.
3560
3561   @item @code{\traditional}@keyindex{traditional} @* 
3562     Used for setting the @code{Score.beamquantisation} property.  Is
3563     equal to 2.
3564
3565   @item @code{\up}@keyindex{up} @* 
3566     Used for setting various direction properties.  Is equal
3567     to 1.
3568 @end table
3569
3570
3571
3572 @node Running LilyPond, Top, ident, LilyPond 1-2-0 Reference Manual
3573 @section Running LilyPond
3574
3575 @cindex running LilyPond
3576
3577
3578 When invoked with a filename that has no extension, LilyPond will try
3579 adding `@file{.ly}' as an extension first, then `@file{.fly}' and
3580 finally `@file{.sly}' extension.  If the filename ends with
3581 `@file{.fly}', LilyPond processes the file as music using
3582 `@file{init.fly}'.  In this case, LilyPond does something like:
3583
3584 @quotation
3585
3586 @example 
3587 \score @{
3588   \notes\relative c @{
3589     \input "yourfile.fly"
3590   @}
3591   \paper@{@}
3592   \midi@{@}
3593 @} 
3594 @end example 
3595
3596 @end quotation
3597
3598 The result of `@file{.sly}' is similar except that a single unjustified
3599 line is produced.
3600
3601 If you invoke LilyPond with a file `@file{foo.}@var{ext}' that doesn't
3602 have the `@file{.ly}' extension, then LilyPond will look for a file
3603 called `@file{init.}@var{ext}' and process this file.  The file
3604 `@file{init.}@var{ext}' must contain the @code{\maininput} keyword or
3605 LilyPond will not read the user specified file.
3606
3607 When LilyPond processes @file{filename.ly} it will produce
3608 @file{filename.tex} as output.  If @file{filename.ly} contains a second
3609 @code{\paper} keyword, then LilyPond will produce @file{filename-1.tex}
3610 as well.  Subsequent @code{\paper} keywords will produce sequentially
3611 numbered file names.  Several files can be specified; they will each
3612 be processed independently.@footnote{Not entirely true: The status of
3613 GUILE is kept.}
3614
3615
3616
3617 @bye