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