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