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