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