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