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