]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/refman.itely
8cf1e2450fc1389c363fb63822a73715e0a267c9
[lilypond.git] / Documentation / user / refman.itely
1
2 @node Reference Manual
3 @chapter Reference Manual
4
5
6 @menu
7 * Overview::                    Overview
8 * Top level::                   Top level
9 * notenames::                   
10 * Lexical conventions::         Lexical conventions
11 * Other languages::             
12 * modes::                       
13 * Types::                       Types
14 * Music expressions::           Music expressions
15 * Atomic music expressions::    Atomic music expressions
16 * Note specification::          
17 * barlines::                    
18 * Manual beams::                
19 * stem tremolo::                
20 * Compound music expressions::  Compound music expressions
21 * relative::                    
22 * Repeats::                     
23 * transpose::                   
24 * Ambiguities::                 Ambiguities
25 * Notation conversion specifics::  
26 * autobeam::                    
27 * lyricprint::                  
28 * Notation Contexts::           Notation Contexts
29 * Properties::                  
30 * Notation output definitions::  Notation output definitions
31 * paper::                       
32 * Paper variables::             
33 * contextdefs::                 
34 * engravers::                   
35 * Sound output::                Sound output
36 * midilist::                    
37 @end menu
38
39
40
41 @node Overview
42 @section Overview
43
44 This document@footnote{This document has been revised for
45 LilyPond 1.2.} describes the the GNU LilyPond input format, which is
46 a language for defining music.  We call this language @emph{Music
47 Definition Language} or @emph{Mudela}, for short.@footnote{If anybody
48 comes up with a better name, we'd gladly take this.  Gourlay already
49 uses a ``Musical Description Language,'' ISO standard 10743 defines a
50 ``Standard Music Description Language.''  We're not being original
51 here.}
52
53 @emph{Mudela} is a language that allows you to
54
55 @itemize @bullet
56   @item  create musical expressions by combining pitches, durations 
57   @item  output those musical expressions to various formats
58   @item  give those musical expressions and output definitions names, so
59        you can enter them in manageable chunks.
60 @end itemize
61
62 @emph{Mudela} aims to define a piece of music completely, both from
63 typesetting and from a performance point of view.
64
65
66
67 @node Top level
68 @section Top level
69
70 @cindex top level
71
72 This section describes what you may enter at top level.
73
74
75
76 @cindex score definition
77
78 The output is generated combining a music expression with an output
79 definition.  A score block has the following syntax:
80
81 @example
82   \score @{ @var{musicexpr} @var{outputdefs} @}
83 @end example
84
85 @var{outputdefs} are zero or more output definitions.  If no output
86 definition is supplied, the default @code{\paper} block will be added.
87
88
89
90 @cindex header
91
92 @keyindex{header}
93
94 The syntax is
95
96 @example
97   \header @{ @var{key1} = @var{val1};
98                         @var{key2} = @var{val2}; @dots{} @}
99 @end example
100
101 A header describes the file's contents.  It can also appear in a
102 @code{\score} block.  Tools like @code{ly2dvi}@indexcode{ly2dvi} can use this
103 information for generating titles.  Key values that are used by
104 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
105 metre, arranger, piece and tagline.
106
107 It is customary to put the @code{\header} at the top of the file.
108
109
110 @node notenames
111 @section notenames
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
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
309 @section Other languages
310
311 Note name definitions have been provided in various languages. 
312 Simply include the language specific init file.  For example:
313 `@code{\include "english.ly"}'.  The available language files and the
314 names they define are:
315
316 @example 
317                         Note Names               sharp       flat
318 nederlands.ly  c   d   e   f   g   a   bes b   -is         -es
319 english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat
320 deutsch.ly     c   d   e   f   g   a   b   h   -is         -es
321 norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es
322 svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess
323 italiano.ly    do  re  mi  fa  sol la  sid si  -d          -b
324 catalan.ly     do  re  mi  fa  sol la  sid si  -d/-s       -b 
325 @end example 
326
327 Pitch names can be redefined using the
328 @code{\notenames}@keyindex{notenames} command, see
329 subsection XREF-notenames [FIXME].
330
331
332
333 @cindex lexical modes
334
335 @cindex modes
336
337 @node modes
338 @section modes
339
340 To simplify entering notes, lyrics, and chords, @emph{Mudela} has three
341 special input modes on top of the default mode.  In each mode, words
342 are identified on the input.  If @code{"word"} is encountered, it is
343 treated as a string.  If @code{\word} is encountered, it is treated as
344 a keyword or as an identifier.  The behavior of the modes differs in
345 two ways: Different modes treat unquoted words differently, and
346 different modes have different rules for deciding what is a word.
347
348 @table @code
349   @item Normal mode.
350 @cindex mode!normal
351  
352     At the start of parsing, @emph{Mudela} is in Normal mode.  In Normal
353     mode, a word is an alphabetic character followed by alphanumeric
354     characters.  If @code{word} is encountered on the input it is
355     treated as a string.
356
357   @item Note mode.
358 @cindex mode!note
359
360     Note mode is introduced by the keyword
361     @code{\notes}@keyindex{notes}.  In Note mode, words can only
362     contain alphabetic characters.  If @code{word} is encountered,
363     LilyPond first checks for a notename of @code{word}.  If no
364     notename is found, then @code{word} is treated as a string.
365
366     Since combinations of numbers and dots are used for indicating
367     durations, it is not possible to enter real numbers in this mode.
368
369   @item Chord mode.
370 @cindex mode!chord
371
372     Chord mode is introduced by the keyword
373     @code{\chords}@keyindex{chords}.  It is similar to Note mode, but
374     words are also looked up in a chord modifier table (containing
375     @code{maj}, @code{dim}, etc).
376
377     Since combinations of numbers and dots are used for indicating
378     durations, you can not enter real numbers in this mode.  Dashes
379     and carets are used to indicate chord additions and subtractions,
380     so scripts can not be entered in Chord mode.
381
382   @item Lyrics mode. 
383 @cindex mode!lyric
384
385     Lyrics mode is introduced by the keyword
386     @code{\lyrics}@keyindex{lyrics}.  This mode has rules that make it
387     easy to include punctuation and diacritical marks in words.  A
388     word in Lyrics mode begins with: an alphabetic character,
389     `@code{_}', `@code{?}', `@code{!}', `@code{:}', `@code{'}', the
390     control characters @code{^A} through @code{^F}, @code{^Q} through
391     @code{^W}, @code{^Y}, @code{^^}, any 8-bit character with ASCII code
392     over 127, or a two-character combination of a backslash followed
393     by one of `@code{`}', `@code{'}', `@code{"}', or
394     `@code{^}'.@footnote{The purpose of Lyrics mode is that you can
395     enter lyrics in @TeX{} format or a standard encoding without
396     needing quotes.  The precise definition of this mode indeed is
397     ludicrous.  This will remain so until the authors of LilyPond
398     acquire a deeper understanding of character encoding, or someone
399     else steps up to fix this.}
400
401     Subsequent characters of a word can be any character that is not
402     a digit and not white space.  One important consequence of this
403     is that a word can end with `@code{@}}', which may be confusing if
404     you thought the closing brace was going to terminate Lyrics
405     mode.@footnote{LilyPond will issue a warning, though.}  Any
406     `@code{_}' characters which appear in an unquoted word are
407     converted to spaces.  This provides a mechanism for introducing
408     spaces into words without using quotes.  Quoted words can also be
409     used in Lyrics mode to specify words that cannot be written with
410     the above rules.  Here are some examples.  Not all of these words
411     are printable by @TeX{}.
412
413 @example 
414 Ah!             % a word
415 2B_||_!2B       % not a word because it starts with a digit
416 ``Hello''       % not a word because it starts with `
417 _ _ _ _         % 4 words, each one a space 
418 @end example 
419
420     Since combinations of numbers and dots are used for indicating
421     durations, you can not enter real numbers in this mode.
422 @end table
423
424 It is possible to create words that break the rules by prefixing them
425 with the dollar sign `@code{$}@indexcode{$}'.  Regardless of the context, a
426 word beginning with `@code{$}' extends until the next white space
427 character.  Such words can contain numbers (even in Note mode), or
428 other forbidden characters.  The dollar sign can be used to create
429 and access identifiers that could not otherwise be used.@footnote{Use
430 of `@code{$}' hampers readability and portability to future LilyPond
431 versions, thus the use of the dollar sign is discouraged.}
432
433
434
435 @node Types
436 @section Types
437
438 @cindex types and identifiers
439
440 @emph{Mudela} has a limited set of types:
441
442 @itemize @bullet
443   @item  integers
444   @item  reals
445   @item  strings
446   @item  music expressions
447   @item  durations of notes and rests (specified with
448        @code{\notenames}@keyindex{notenames})
449   @item  note name tables
450   @item  context definitions, part of output definitions.  See
451        section XREF-contextdefs [FIXME] for more information
452   @item  output definitions (like @code{\paper}@keyindex{paper} blocks
453        and @code{\midi}@keyindex{midi} blocks)
454   @item  score definitions (@code{\score}@keyindex{score} blocks)
455 @end itemize
456
457 Type is a syntactical property: @emph{Mudela} has no real type system,
458 so there is no support for generic expressions, functions, or user
459 defined types.  For the same reason, it is not possible to mix reals
460 and integers in arithmetic expressions, and ``type
461 errors''
462 @cindex type error
463  (e.g., using a string identifier to
464 initialize a @code{\paper}@keyindex{paper} block) will yield a ``parse
465 error''.
466
467 Identifiers allow objects to be assigned to names.  To assign an
468 identifier, you use `@var{name}=@var{value}' and to refer to an
469 identifier, you preceed its name with a backslash:
470 `@code{\}@var{name}'.  Identifier assignments must appear at top level
471 in the @emph{Mudela} file.  Semicolons are forbidden after assignments
472 appearing at top level but they are obligatory after assignments
473 appearing in the @code{\paper} block, see Section XREF-paper [FIXME].
474
475 @var{value} is any of the types listed above.
476
477 An identifier can be created with any string for its name, but you
478 will only be able to refer to identifiers whose names begin with a
479 letter, being entirely alphanumeric.  It is impossible to refer to an
480 identifier whose name is the same as the name of a keyword.
481
482 The right hand side of an identifier assignment is parsed completely
483 before the assignment is done, so it is allowed to redefine an
484 identifier in terms of its old value, e.g.
485
486 @example
487   foo = \foo * 2.0
488 @end example
489
490 When an identifier is referenced, the information it points to is
491 copied.  Therefore it only makes sense to put identifiers for
492 translators, output definitions, and @code{\score}@keyindex{score}
493 blocks as the first item in a block.  For this reason, if you
494 reference a @code{\foo} variable in a @code{\foo} block, it must be the
495 first item in the list following @code{\foo}.@footnote{@code{\paper@{\one
496 \two@}} does not make sense, because the information of @code{\two}
497 would overwrite the information of @code{\one}, thereby making the
498 reference to the first identifier useless.}
499
500
501
502 @node Music expressions
503 @section Music expressions
504
505 @cindex music expressions
506
507 Music in @emph{Mudela} is entered as a music expression.  Notes, rests,
508 lyric syllables are music expressions (the atomic
509 expressions)
510 @cindex atomic music expressions
511 , and you can combine
512 music expressions to form new ones.  This example forms a compound
513 expressions out of the quarter @code{c} note and a @code{d}
514 note:
515
516 @example 
517 \sequential @{ c4 d4 @} 
518 @end example 
519
520 The meaning of this compound expression is to play the `@code{c}'
521 first, and then the `@code{d}' (as opposed to playing them
522 simultaneously, for instance).
523
524 Atomic music expression are discussed in
525 subsection XREF-atomicmusic [FIXME].  Compound music expressions are
526 discussed in subsection XREF-compoundmusic [FIXME].
527
528
529
530 @node Atomic music expressions
531 @section Atomic music expressions
532
533
534
535
536 @cindex pitch
537
538 @cindex duration
539  
540
541 The syntax for pitch specification is
542
543
544 @example
545   \musicalpitch@keyindex{musicalpitch} @{ @var{octave} @var{note} @var{shift} @}
546 @end example
547
548 @var{octave} is specified by an integer, zero for the octave
549 containing middle C.  @var{note} is a number from 0 to 7, with 0
550 corresponding to C and 7 corresponding to B.  The shift is zero for a
551 natural, negative to add flats, or positive to add sharps.
552
553 In Note and Chord mode, pitches may be designated by names.  See
554 section XREF-notelang [FIXME] for pitch names in different languages.
555
556 The syntax for duration specification is
557
558 @example
559  \duration@keyindex{duration}
560    @{ @var{length} @var{dotcount} @}
561 @end example
562
563 @var{length} is the negative logarithm (base 2) of the duration:
564 1 is a half note, 2 is a quarter note, 3 is an eighth
565 note, etc.  The number of dots after the note is given by
566 @var{dotcount}.
567
568 In Note, Chord, and Lyrics mode, durations may be designated by
569 numbers and dots.  See Section XREF-notelang [FIXME] for details.
570
571
572 @node Note specification
573 @section Note specification
574
575 @cindex note specification
576
577 @cindex pitches
578
579 @cindex entering notes
580
581 A note specification has the form
582
583 @example
584   @var{pitch}[@var{octavespec}][!][?][@var{duration}]
585 @end example
586
587 The pitch of the note is specified by the note's name.
588
589
590 The default names are the Dutch note names.  The notes are specified
591 by the letters `@code{c}' through `@code{b}', where `@code{c}' is an
592 octave below middle C and the letters span the octave above that C. 
593 In Dutchcindex(notenames!Dutch), a sharp is formed by adding
594 `@code{-is}' to the end of a pitch name.  A flat is formed by adding
595 `@code{-es}'. Double sharps and double flats are obtained by adding
596 `@code{-isis}' or `@code{-eses}'.  `@code{aes}' and `@code{ees}' are
597 contracted to `@code{as}' and `@code{es}' in Dutch, but both forms will
598 be accepted.
599
600 LilyPond has predefined sets of notenames for various languages.  See
601 section XREF-notelang [FIXME] for details.
602
603
604 The optional octave specification takes the form of a series of
605 single quote (`@code{'}@indexcode{'}') characters or a series of comma
606 (`@code{,}@indexcode{,}') characters.  Each @code{'} raises the pitch by one
607 octave; each @code{,} lowers the pitch by an octave.
608
609 @mudela[fragment,verbatim,center]
610   c' d' e' f' g' a' b' c''
611 @end mudela
612
613 @mudela[fragment,verbatim,center]
614   cis' dis' eis' fis' gis' ais' bis'
615 @end mudela
616
617 @mudela[fragment,verbatim,center]
618   ces' des' es' fes' ges' as' bes'
619 @end mudela
620
621 @mudela[fragment,verbatim,center]
622   cisis' eisis' gisis' aisis' beses'
623 @end mudela
624
625 @mudela[fragment,verbatim,center]
626   ceses' eses' geses' ases' beses'
627 @end mudela
628
629 Whenever a C-sharp is desired,  you must specify a C-sharp.  LilyPond
630 will determine what accidentals to typeset depending on the key and
631 context.  A reminder accidental 
632 @cindex reminder accidental
633  can be
634 forced by adding an exclamation mark `@code{!}' after the pitch.  A
635 cautionary accidental, 
636 @cindex cautionary accidental
637  i.e., an
638 accidental within parentheses can be obtained by adding the question
639 mark `@code{?}@indexcode{?}' after the pitch.
640
641 @mudela[fragment,verbatim,center]
642   cis' d' e' cis'  c'? d' e' c'!
643 @end mudela
644
645
646 @cindex duration
647
648 Durations are entered as their reciprocal values.  For notes longer
649 than a whole note, use identifiers.
650
651 @quotation
652
653 @example 
654 c'\longa c'\breve  
655 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64 
656 @end example 
657
658 @end quotation
659
660 @quotation
661
662 @mudela[]
663 \score {
664   \notes \relative c'' {
665     a\longa a\breve  
666     a1 a2 a4 a8 a16 a32 a64 a64 
667   }
668   \paper {
669 %{    \translator {
670       \StaffContext
671         \remove "Clef_engraver";
672         \remove "Staff_symbol_engraver";
673     } %}
674   }
675 }
676 @end mudela
677 @end quotation
678
679 @quotation
680
681 @example 
682 r\longa r\breve  
683 r1 r2 r4 r8 r16 r32 r64 r64 
684 @end example 
685
686 @end quotation
687
688 @quotation
689
690 @mudela[]
691 \score {
692   \notes \relative c'' {
693     r\longa r\breve  
694     r1 r2 r4 r8 r16 r32 r64 r64 
695   }
696   \paper {
697     loose_column_distance = 2.5 * \interline;
698     linewidth = -1.0;
699     \translator {
700       \type "Score_engraver";
701       \name "Score";
702       \consists "Rest_engraver";
703       \consists "Stem_engraver";
704       \consists "Rhythmic_column_engraver";
705     }
706   }
707 }
708 @end mudela
709 @end quotation
710
711 If the duration is omitted then it is set equal to the previous
712 duration.  If there is no previous duration, a quarter note is
713 assumed.  The duration can be followed by a dot (`@code{.}@indexcode{.}')
714 to obtain dotted note lengths.
715
716 @mudela[fragment,verbatim,center]
717   a'4. b'4.
718 @end mudela
719
720 You can alter the length of duration by writing
721 `@code{*}@var{fraction}' after it.  This will not affect the
722 appearance of note heads or rests.
723
724
725 Rests are entered like notes, with note name `@code{r}@indexcode{r}',
726 or `@code{R}@indexcode{R}'.  There is also a note name `@code{s}@indexcode{s}',
727 which produces a space of the specified duration. 
728 `@code{R}' is specifically meant for entering parts: the @code{R} rest
729 can expand to fill a score with rests, or it can be printed as a
730 single multimeasure rest.
731
732
733 @cindex lyrics expressions
734
735 Syllables are entered like notes, with pitches replaced by text.  For
736 example, `@code{Twin-4 kle4 twin-4 kle4}' enters four syllables, each
737 with quarter note duration.  Note that the hyphen has no special
738 meaning for lyrics, and does not introduce special symbols.  See
739 section XREF-modes [FIXME] for a description of what is interpreted as
740 lyrics.
741
742 Spaces can be introduced into a lyric either by using quotes
743 (`@code{"}') or by using an underscore without quotes: `@code{He_could4
744 not4}'.  All unquoted underscores are converted to spaces.  Printing
745 lyrics is discussed in section XREF-lyricprint [FIXME].
746
747
748
749 @cindex properties
750
751 @example
752   \property@keyindex{property}
753     @var{contextname}.@var{propname} =  @var{value}
754 @end example
755
756 Sets the @var{propname} property of the context @var{contextname} to
757 the specified @var{value}.  All three arguments are strings. 
758 Depending on the context, it may be necessary to quote the strings or
759 to leave space on both sides of the dot.
760
761
762
763 @cindex translator switches
764
765 @example
766   \translator@keyindex{translator}
767     @var{contexttype} = @var{name}
768 @end example
769
770 A music expression indicating that the context which is a direct
771 child of the a context of type @var{contexttype} should be shifted to
772 a context of type @var{contexttype} and the specified name.
773
774 Usually this is used to switch staffs in Piano music, e.g.
775
776 @example
777   \translator Staff = top @var{Music}
778 @end example
779
780
781 @cindex output properties
782
783
784 These allow you to tweak what is happening in the back-end
785 directly. If you want to control every detail of the output
786 formatting, this is the feature to use. The downside to this is that
787 you need to know exactly how the backend works. Example:
788
789
790 @mudela[fragment,verbatim]
791 \relative c'' { c4
792         \context Staff \outputproperty
793                 #(make-type-checker 'Note_head)
794                 #'extra-offset = #'(5.0 . 7.5)
795 <c8 e g> }
796 @end mudela
797
798 This selects all note heads occurring at current staff level, and sets
799 the extra-offset of those heads to (5,7.5), shifting them up and
800 right.
801
802 Use of this feature is entirely on your own risk: if you use this, the
803 result will depend very heavily on the implentation of the backend,
804 which we change unscrupulously.
805
806
807
808
809 @cindex commands
810
811 Commands are music expressions that have no duration.   
812
813
814 @example
815
816   @code{\key}@keyindex{key} @var{pitch} @var{type} @code{;}
817 @end example
818
819 Change the key signature.  @var{type} should be
820 @code{\major}@keyindex{major} or @code{\minor}@keyindex{minor} to get
821 @var{pitch}-major or @var{pitch}-minor, respectively.  The second
822 argument is optional; the default is major keys.  The @var{\context}
823 argument can also be given as an integer, which tells the number of
824 semitones that should be added to the pitch given in the subsequent
825 @code{\key}@keyindex{key} commands to get the corresponding major key,
826 e.g., @code{\minor}@keyindex{minor} is defined as 3.  The standard
827 mode names @code{\ionian}@keyindex{ionian},
828 @code{\locrian}@keyindex{locrian}, @code{\aeolian}@keyindex{aeolian},
829 @code{\mixolydian}@keyindex{mixolydian}, @code{\lydian}@keyindex{lydian},
830 @code{\phrygian}@keyindex{phrygian}, and @code{\dorian}@keyindex{dorian}
831 are also defined.
832
833 @example
834
835   @code{\keysignature}@keyindex{keysignature} @var{pitchseq} @code{;}
836 @end example
837
838 Specify an arbitrary key signature.  The pitches from @var{pitch} will
839 be printed in the key signature in the order that they appear on the
840 list.
841
842         
843 @example
844   \mark@keyindex{mark} @var{unsigned};
845   \mark @var{string};
846 @end example
847
848 Prints a mark over or under (depending on the
849 @code{markDirection}@indexcode{markDirection} property) the staff.  You must add
850 @code{Mark_engraver}@indexcode{Mark_engraver} to either the Score or Staff context for
851 this to work.
852
853 @node barlines
854 @section barlines
855
856 @example
857   \bar@keyindex{bar} @var{bartype};
858 @end example
859
860 This is a request to print a special bar symbol. It replaces the 
861 regular bar symbol with a special
862 symbol.  The argument @var{bartype} is a string which specifies the
863 kind of bar to print.  Options are @code{":|"}
864 @cindex "|A@@@code{:|}
865 ,
866 @code{"|:"}
867 @cindex "|B@@@code{|:}
868 , @code{":|:"}
869 @cindex "|C@@@code{:|:}
870 ,
871 @code{"||"}
872 @cindex "|D@@@code{||}
873 , @code{"|."}
874 @cindex "|E@@@code{|.}
875 ,
876 @code{".|"}
877 @cindex "|F@@@code{.|}
878 , and @code{".|."}
879 @cindex "|G@@@code{.|.}
880
881 These produce, respectively, a right repeat, a left repeat, a double
882 repeat, a double bar, a start bar, an end bar, and a thick double
883 bar.  If @var{bartype} is set to @code{"empty"} then nothing is
884 printed, but a line break is allowed at that spot.
885
886 You are encouraged to use @code{\repeat} for repetitions.
887 See section XREF-sec-repeats [FIXME].
888
889  
890
891
892 @example
893
894   \time@keyindex{time} @var{numerator}@code{/}@var{denominator} @code{;}
895 @end example
896
897 Change the time signature.  The default time signature is 4/4. 
898 The time signature is used to generate bar lines.
899
900 @example
901
902   \tempo@keyindex{tempo} @var{duration} = @var{perminute} @code{;}
903 @end example
904
905 Used to specify the tempo.  For example, `@code{\tempo 4 = 76;}'
906 requests output with 76 quarter notes per minute.
907
908 @example
909
910   \partial@keyindex{partial} @var{duration} @code{;}
911 @end example
912
913 @cindex anacrusis
914
915 @cindex upstep
916
917 This creates an incomplete measure (anacrusis, upbeat) at the start of 
918 the music, e.g., `@code{\partial 8*2;}' creates a starting measure 
919 lasting two eighth notes.
920
921 @example
922
923   @code{|}@indexcode{|}
924 @cindex bar check
925
926 @end example
927
928 @cindex shorten measures
929
930 @cindex upstep
931
932 `@code{|}' is a barcheck.  Whenever a barcheck is encountered during
933 interpretation, a warning message is issued if it doesn't fall at a
934 measure boundary.  This can help you finding errors in the input. 
935 The beginning of the measure will be relocated, so this can also
936 be used to shorten measures.
937
938
939 @example
940
941   \penalty@keyindex{penalty} @var{int} @code{;}
942 @end example
943
944 Discourage or encourage line breaks.  See identifiers
945 @code{\break}@keyindex{break} and @code{\nobreak}@keyindex{nobreak} in
946 section [on identifiers] [FIXME].
947
948 @example
949
950   \clef@keyindex{clef} @var{clefname} @code{;}
951 @end example
952
953 Music expression that sets the current clef.  The argument is a
954 string which specifies the name of the clef.  Several clef names are
955 supported.  If `@code{_8}' or `@code{^8}' is added to the end of a clef
956 name, then the clef lowered or raised an octave will be generated. 
957 Here are the supported clef names with middle C shown in each
958 clef:
959
960 @quotation
961
962 @mudela[]
963 \score {
964   \notes {
965     \cadenzaOn
966     %\property Voice.textStyle = typewriter
967     \clef subbass;     c'4-"\kern -5mm subbass" 
968     \clef bass;        c'4^"\kern -2mm bass"
969     \clef baritone;    c'4_"\kern -5mm baritone"
970     \clef varbaritone; c'4^"\kern -6mm varbaritone"
971     \clef tenor;       c'4_"\kern -3mm tenor"
972     \clef "G_8";       c'4^"\kern -2mm G\\_8" 
973   }  
974   \paper {
975     linewidth = -1.0;
976   }
977 }
978 @end mudela
979 @end quotation
980
981 @quotation
982
983 @mudela[]
984 \score {
985   \notes {
986         \cadenzaOn
987     \clef alto;         c'4_"\kern -2mm alto"
988     \clef mezzosoprano; c'4^"\kern -9mm mezzosoprano"
989     \clef soprano;      c'4_"\kern -6mm soprano"
990     \clef treble;       c'4^"\kern -4mm treble"
991     \clef french;       c'4_"\kern -4mm french"
992   }
993   \paper {
994     linewidth = 4.5 \in;
995   }
996 }
997 @end mudela
998 @end quotation
999
1000 The three clef symbols can also be obtained using the names `@code{G}', 
1001 `@code{C}' or `@code{F}', optionally followed by an integer which 
1002 indicates at which note line the clef is located. An as example, the 
1003 @code{mezzosoprano} clef can also be given as `@code{C2}'.
1004
1005 @example
1006
1007   \skip@keyindex{skip} @var{duration} @code{;}
1008 @end example
1009
1010 Skips the amount of time specified by @var{duration}.  If no other
1011 music is played, a gap will be left for the skipped time with no
1012 notes printed.  It works in Note Mode or Lyrics Mode.  In Note mode,
1013 this has the same effect as the space rest `@code{s}'.
1014
1015
1016 @cindex beams
1017
1018 @node Manual beams
1019 @section Manual beams
1020
1021 A beam is specified by surrounding the beamed notes with brackets
1022 `@code{[}@indexcode{[}' and `@code{]}@indexcode{]}'.  
1023
1024 @mudela[fragment,verbatim,center]
1025   [a'8 a'] [a'16 a' a' a']
1026 @end mudela
1027
1028 Some more elaborate constructions:
1029
1030 @mudela[fragment,verbatim,center]
1031   [a'16 <a' c''> c'' <a' c''>]
1032   \times 2/3 { [e'8 f' g'] }
1033 @end mudela
1034
1035 Beaming can be generated automatically; see section XREF-autobeam [FIXME].
1036
1037 [OUTDATED, FIXME]
1038
1039 To place tremolo marks 
1040 @cindex tremolo beams
1041  between two notes, begin
1042 with `@code{[:}@var{length}' and end with `@code{]}'.  Tremolo marks
1043 will appear instead of beams.  Putting more than two notes in such a
1044 construction will produce odd effects.  To create tremolo beams on a
1045 single note, simply attach `@code{:}@var{length}' to the note itself
1046 (see also section XREF-tremolo [FIXME]).
1047   
1048 @ignore
1049 @mu dela[fragment,verbatim,center]
1050   [:16 e'1 g'] [:8 e'4 f']
1051 @end mudela
1052   
1053 @mud ela[fragment,verbatim,center]
1054   c'4:32 [:16 c'8 d'8]
1055 @end mudela
1056 @end ignore
1057
1058 @cindex --@@@code{-}@code{-}
1059
1060 @indexcode{__}
1061
1062 @cindex extender
1063
1064 @cindex hyphen
1065
1066 The syntax for an extender mark is `@code{__}'.  This syntax can only
1067 be used within lyrics mode.  The syntax for a spanning hyphen (i.e.,
1068 a hyphen that will be printed between two lyric syllables) is
1069 `@code{-}@code{-}'.
1070
1071
1072 @cindex ties
1073
1074 A tie connects two adjacent note heads of the same pitch.  When used
1075 with chords, it connects all of the note heads whose pitches match.
1076 Ties are indicated using the tilde symbol `@code{~}@indexcode{~}'.
1077 If you try to tie together chords which have no common pitches, a
1078 warning message will appear and no ties will be created.
1079
1080 @mudela[fragment,verbatim,center]
1081   e' ~ e' <c' e' g'> ~ <c' e' g'>
1082 @end mudela
1083
1084
1085
1086 [TODO: explain Requests]
1087
1088
1089 @cindex articulations
1090
1091 @cindex scripts
1092
1093 @cindex ornaments
1094
1095 A variety of symbols can appear above and below notes to indicate
1096 different characteristics of the performance.  These symbols can be
1097 added to a note with `@var{note}@code{-\}@var{name}'.  Numerous symbols
1098 are defined in @file{script.ly} and @file{script.scm}.  Symbols can be
1099 forced to appear above or below the note by writing
1100 `@var{note}@code{^\}@var{name}' and `@var{note}@code{_\}@var{name}'
1101 respectively.  Here is a chart showing symbols above notes, with the
1102 name of the corresponding symbol appearing underneath.
1103
1104 @mudela[]
1105
1106   \score {
1107     < \notes {
1108         c''-\accent      c''-\marcato      c''-\staccatissimo c''-\fermata 
1109         c''-\stopped     c''-\staccato     c''-\tenuto        c''-\upbow
1110         c''-\downbow     c''^\lheel        c''-\rheel         c''^\ltoe
1111         c''-\rtoe        c''-\turn         c''-\open          c''-\flageolet
1112         c''-\reverseturn c''-\trill        c''-\prall         c''-\mordent
1113         c''-\prallprall  c''-\prallmordent c''-\upprall       c''-\downprall
1114         c''-\thumb       c''-\segno        c''-\coda
1115       }
1116       \context Lyrics \lyrics {  
1117         accent__      marcato__      staccatissimo__ fermata
1118         stopped__     staccato__     tenuto__        upbow
1119         downbow__     lheel__        rheel__         ltoe
1120         rtoe__        turn__         open__          flageolet
1121         reverseturn__ trill__        prall__         mordent
1122         prallprall__  prallmordent__ uprall__        downprall
1123         thumb__       segno__        coda
1124       }
1125     >
1126     \paper {
1127       linewidth = 5.875\in;          
1128       indent    = 0.0;
1129     }
1130   }
1131
1132 @end mudela
1133
1134 In addition, it is possible to place arbitrary strings of text or
1135 @TeX{} above or below notes by using a string instead of an
1136 identifier: `@code{c^"text"}'.  Fingerings 
1137 @cindex fingering
1138  can be
1139 placed by simply using digits.  All of these note ornaments appear in
1140 the printed output but have no effect on the MIDI rendering of the
1141 music.
1142
1143 To save typing, fingering instructions (digits 0 to 9 are
1144 supported) and single characters shorthands exist for a few
1145 common symbols
1146
1147 @mudela[]
1148
1149   \score {
1150     \notes {
1151       \property Voice.textStyle = typewriter
1152       c''4-._"c-."      s4
1153       c''4--_"c-{}-"    s4
1154       c''4-+_"c-+"      s4
1155       c''4-|_"c-|"      s4
1156       c''4->_"c->"      s4
1157       c''4-^_"c-\\^{ }" s4
1158       c''4-1_"c-1"      s4
1159       c''4-2_"c-2"      s4
1160       c''4-3_"c-3"      s4
1161       c''4-4_"c-4"      s4
1162     }
1163     \paper {
1164       linewidth = 5.875 \in;
1165       indent    = 0.0;
1166     }
1167   }
1168
1169 @end mudela
1170
1171 Dynamic marks are specified by using an identifier after a note:
1172 `@code{c4-\ff}' (the dash is optional for dynamics: `@code{c4 \ff})'.  
1173 The available dynamic marks are:
1174 @code{\ppp}@keyindex{ppp},
1175 @code{\pp}@keyindex{pp}, @code{\p}@keyindex{p}, @code{\mp}@keyindex{mp},
1176 @code{\mf}@keyindex{mf}, @code{\f}@keyindex{f}, @code{\ff}@keyindex{ff},
1177 @code{\fff}@keyindex{fff}, @code{\fff}@keyindex{ffff},
1178 @code{\fp}@keyindex{fp}, @code{\sf}@keyindex{sf},
1179 @code{\sff}@keyindex{sff}, @code{\sp}@keyindex{sp},
1180 @code{\spp}@keyindex{spp}, @code{\sfz}@keyindex{sfz}, and
1181 @code{\rfz}@keyindex{rfz}.
1182
1183
1184 @example
1185
1186   \textscript@keyindex{textscript} @var{text} @var{style}
1187 @end example
1188
1189 Defines a text to be printed over or under a note.  @var{style} is a
1190 string that may be one of @code{roman}, @code{italic}, @code{typewriter}, 
1191 @code{bold}, @code{Large}, @code{large}, @code{dynamic} or @code{finger}.
1192
1193 You can attach a general textscript request using this syntax:
1194
1195 @quotation
1196
1197 @example 
1198 c4-\textscript "6" "finger"
1199 c4-\textscript "foo" "normal" 
1200 @end example 
1201
1202 @end quotation
1203
1204 This is equivalent to `@code{c4-6 c4-"foo"}'.  
1205
1206
1207 @cindex scripts
1208
1209 @example
1210
1211   \script@keyindex{script} @var{alias}
1212 @end example
1213
1214 Prints a symbol above or below a note.  The argument is a string
1215 which points into the script-alias table defined in @file{script.scm}.
1216 The scheme definitions specify whether the symbol follows notes into
1217 the staff, dependence of symbol placement on staff direction, and a
1218 priority for placing several symbols over one note.  Usually the
1219 @code{\script}@keyindex{script} keyword is not used directly.  Various
1220 helpful identifier definitions appear in @file{script.ly}.
1221
1222
1223 @cindex slur
1224
1225 Slurs connects chords and try to avoid crossing stems.  A slur is
1226 started with `@code{(}' and stopped with `@code{)}'.  The
1227 starting `@code{(}' appears to the right of the first note in
1228 the slur.  The terminal `@code{)}' appears to the left of the
1229 first note in the slur.  This makes it possible to put a note in
1230 slurs from both sides:
1231
1232 @mudela[fragment,verbatim,center]
1233   f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
1234 @end mudela
1235
1236
1237 @cindex crescendo
1238
1239 A crescendo mark is started with @code{\cr}@keyindex{cr} and terminated
1240 with @code{\rc}@keyindex{rc}.  A decrescendo mark is started with
1241 @code{\decr}@keyindex{decr} and terminated with
1242 @code{\rced}@keyindex{rced}.  There are also shorthands for these
1243 marks.  A crescendo can be started with @code{\<}@keyindex{<} and a
1244 decrescendo can be started with @code{\>}@keyindex{>}.  Either one can
1245 be terminated with @code{\!}@keyindex{"!}.  Note that @code{\!}
1246 must go before the last note of the dynamic mark whereas @code{\rc}
1247 and @code{\rced} go after the last note.  Because these marks are
1248 bound to notes, if you want to get several marks during one note, you
1249 must use spacer notes.
1250
1251 @mudela[fragment,verbatim,center]
1252   c'' \< \! c''   d'' \decr e'' \rced 
1253   < f''1 { s4 \< \! s2 \> \! s4 } >
1254 @end mudela
1255
1256
1257 @example
1258
1259   \spanrequest@keyindex{spanrequest} @var{startstop} @var{type}
1260 @end example
1261
1262 Define a spanning request. The @var{startstop} parameter is either -1
1263 (@code{\start}@keyindex{start}) or 1 (@code{\stop}@keyindex{stop}) and
1264 @var{type} is a string that describes what should be started.
1265 Supported types are @code{crescendo}, @code{decrescendo},
1266 @code{beam}, @code{slur}.  This is an internal command.  Users should
1267 use the shorthands which are defined in the initialization file
1268 @file{spanners.ly}.
1269
1270 You can attach a (general) span request to a note using
1271
1272 @mudela[fragment,verbatim,center]
1273   c'4-\spanrequest \start "slur"
1274   c'4-\spanrequest \stop "slur"
1275 @end mudela
1276
1277 The slur syntax with parentheses is a shorthand for this.
1278
1279
1280
1281 @cindex tremolo marks
1282
1283 @node stem tremolo
1284 @section stem tremolo
1285
1286 Tremolo marks can be printed on a single note by adding
1287 `@code{:}[@var{length}]' after the note.  The length must be at
1288 least 8.  A @var{length} value of 8 gives one line across
1289 the note stem.  If the length is omitted, then the last value is
1290 used, or the value of the @code{tremoloFlags}@indexcode{tremoloFlags} property if there was
1291 no last value.
1292
1293 @mudela[verbatim,fragment,center]
1294   c'2:8 c':32
1295 @end mudela
1296
1297
1298
1299 @node Compound music expressions
1300 @section Compound music expressions
1301
1302 @cindex compound music expressions
1303
1304 Music expressions are compound data structures.  You can nest music
1305 expressions any way you like.  This simple example shows how three
1306 chords can be expressed in two different ways:
1307
1308 @mudela[fragment,verbatim,center]
1309   \notes \context Staff {
1310     \cadenzaOn
1311     <a c'> <b  d' > <c' e'>
1312     < { a b  c' } { c' d' e' } >
1313   }
1314 @end mudela
1315
1316 @cindex context selection
1317 @c @keyindex{context}
1318
1319 @example
1320   \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
1321 @end example
1322
1323 Interpret @var{musicexpr} within a context of type @var{contexttype}. 
1324 If the context does not exist, it will be created.  The new context
1325 can optionally be given a name.  See
1326 section XREF-contextselection [FIXME] and XREF-contextdefs [FIXME] for more
1327 information on interpretation contexts.
1328
1329
1330
1331 @cindex input modes
1332
1333 @cindex mode switch
1334
1335 Mode switching keywords form compound music expressions: @code{\notes}
1336 @keyindex{notes} @var{musicexpr}, @code{\chords} @keyindex{chords}
1337 @var{musicexpr}, and @code{\lyrics} @keyindex{lyrics} @var{musicexpr}. 
1338 These expressions do not add anything to the meaning of their
1339 arguments.  They are just a way to indicate that the arguments should
1340 be parsed in indicated mode.  See section XREF-modes [FIXME] for more
1341 information on modes.
1342
1343 More information on context selection can be found in
1344 section XREF-contextselection [FIXME].
1345
1346
1347
1348 @cindex sequential music
1349
1350
1351
1352 @example
1353
1354   \sequential@keyindex{sequential}
1355     @code{@{} @var{musicexprlist} @code{@}}
1356 @end example
1357
1358 This means that list should be played or written in sequence, i.e.,
1359 the second after the first, the third after the second.  The duration
1360 of sequential music is the the sum of the durations of the elements. 
1361 There is a shorthand, which leaves out the keyword:
1362
1363 @example
1364
1365   @code{@{} @var{musicexprlist} @code{@}}
1366 @end example
1367
1368
1369
1370 @cindex simultaneous music
1371
1372 @indexcode{<}
1373 @indexcode{>}
1374
1375 @example
1376
1377   \simultaneous@keyindex{simultaneous}
1378     @code{@{} @var{musicexprlist} @code{@}}
1379 @end example
1380
1381 It constructs a music expression where all of its arguments start at
1382 the same moment.  The duration is the maximum of the durations of the
1383 elements.  The following shorthand is a common idiom:
1384
1385 @example
1386
1387   @code{<} @var{musicexprlist} @code{>}
1388 @end example
1389
1390 If you try to use a chord as the first thing in your score, you might
1391 get multiple staffs instead of a chord.
1392
1393 @mudela[verbatim,center]
1394   \score {
1395     \notes <c''4 e''>
1396     \paper {
1397       linewidth = -1.;
1398     }
1399   }
1400 @end mudela
1401
1402 This happens because the chord is interpreted by a score context.
1403 Each time a note is encountered a default Voice context (along with a
1404 Staff context) is created.  The solution is to explicitly instantiate
1405 a Voice context:
1406
1407 @mudela[verbatim,center]
1408   \score {
1409     \notes\context Voice <c''4 e''>
1410     \paper {
1411       linewidth = -1.;
1412     }
1413   }
1414 @end mudela
1415
1416
1417
1418 @cindex relative pitch specification
1419
1420 @node relative
1421 @section relative
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
1663 @section Repeats
1664
1665 In order to specify repeats, use the @code{\repeat}@keyindex{repeat}
1666 keyword.  Since repeats look and sound differently when played or
1667 printed, there are a few different variants of repeats.
1668
1669 @table @code
1670   @item unfolded  
1671     Repeated music is fully written (played) out.  Useful for MIDI
1672     output.
1673
1674   @item volta  
1675     This is the normal notation: Repeats are not written out, but
1676     alternative endings (voltas) are printed, left to right.
1677
1678   @item folded  
1679     Alternative endings are written stacked, which is useful for
1680     lyrics.
1681 @end table  
1682
1683 The syntax for repeats is
1684
1685 @example
1686
1687   \repeat @var{variant} @var{repeatcount} @var{repeatbody}
1688 @end example
1689
1690 If you have alternative endings, you may add
1691
1692 @example
1693
1694   \alternative@keyindex{alternative}
1695     @code{@{} @var{alternative1}
1696             @var{alternative2}
1697             @var{alternative3} @dots{} @code{@}}
1698 @end example
1699
1700 where each @var{alternative} is a Music expression.
1701
1702 Normal notation repeats are used like this:
1703
1704 @quotation
1705
1706 @mudela[fragment,verbatim]
1707   c'1
1708   \repeat volta 2 { c'4 d' e' f' }
1709   \repeat volta 2 { f' e' d' c' }
1710
1711 @end mudela
1712 @end quotation
1713
1714 With alternative endings:
1715
1716 @quotation
1717
1718 @mudela[fragment,verbatim]
1719   c'1
1720   \repeat volta 2 {c'4 d' e' f'} 
1721   \alternative { {d'2 d'} {f' f} }
1722
1723 @end mudela
1724 @end quotation
1725
1726 Folded repeats look like this:@footnote{Folded repeats offer little
1727 more over simultaneous music.  However, it is to be expected that
1728 more functionality -- especially for the MIDI backend -- will be
1729 implemented.}
1730
1731 @quotation
1732
1733 @mudela[fragment,verbatim]
1734   c'1
1735   \repeat fold 2 {c'4 d' e' f'} 
1736   \alternative { {d'2 d'} {f' f} }
1737
1738 @end mudela
1739 @end quotation
1740
1741 @quotation
1742
1743 @mudela[fragment,verbatim]
1744 \context Staff {
1745   \relative c' {
1746     \partial 4;
1747     \repeat volta 2 { e | c2 d2 | e2 f2 | }
1748     \alternative { { g4 g g } { a | a a a a | b1 } }
1749   }
1750 }
1751
1752 @end mudela
1753 @end quotation
1754
1755 If you don't give enough alternatives for all of the repeats, then
1756 the first alternative is assumed to be repeated often enough to equal
1757 the specified number of repeats.
1758
1759 @quotation
1760
1761 @mudela[fragment,verbatim]
1762 \context Staff {
1763   \relative c' {
1764     \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1765     \alternative { { g4 g g }
1766                    {\partial 1; e4 e e } 
1767                    {\partial 1; a a a a | b1 } }
1768   }
1769 }
1770
1771 @end mudela
1772 @end quotation
1773
1774 It is possible to nest @code{\repeat}.  This is not entirely
1775 supported: the notes will come be in the right places, but the repeat
1776 bars will not.
1777
1778
1779
1780 @cindex transposition of pitches
1781
1782 @node transpose
1783 @section transpose
1784
1785 A music expression can be transposed with
1786 @code{\transpose}@keyindex{transpose}.  The syntax is
1787
1788 @example
1789
1790   \transpose @var{pitch} @var{musicexpr}
1791 @end example
1792
1793 This means that middle C in @var{musicexpr} is transposed to
1794 @var{pitch}.
1795
1796 @code{\transpose} distinguishes between enharmonic pitches: both
1797 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
1798 a tone.  The first version will print sharps and the second version
1799 will print flats.
1800
1801 @quotation
1802
1803 @mudela[fragment,verbatim]
1804 \context Staff {
1805   \clef "F";
1806   { \key e; c d e f }
1807   \clef "G";
1808   \transpose des'' { \key e; c d e f }
1809   \transpose cis'' { \key e; c d e f }
1810 }
1811
1812 @end mudela
1813 @end quotation
1814
1815 If you want to use both @code{\transpose} and @code{\relative}, then
1816 you must use @code{\transpose} first.  @code{\relative} will have no
1817 effect music that appears inside a @code{\transpose}.
1818
1819
1820
1821 @cindex automatic lyric durations
1822
1823 If you have lyrics that are set to a melody, you can import the
1824 rhythm of that melody into the lyrics using @code{\addlyrics}.
1825 @keyindex{addlyrics} The syntax for this is
1826
1827 @example
1828
1829   \addlyrics @var{musicexpr1 musicexpr2}
1830 @end example
1831
1832 This means that both @var{musicexpr1} and @var{musicexpr2} are
1833 interpreted, but that every non-command atomic music expression
1834 (``every syllable'') in @var{musicexpr2} is interpreted using timing
1835 of @var{musicexpr1}.
1836
1837 If the property @code{automaticMelismata}@indexcode{automaticMelismata} is set in the
1838 context of @var{musicexpr1}, no lyrics will be put on slurred or tied
1839 notes.
1840
1841 @quotation
1842
1843 @mudela[verbatim,fragment]
1844 \addlyrics
1845 \transpose c'' {
1846   \property Voice.automaticMelismata = "1"
1847   c8 () cis d8. e16 f2
1848 }
1849 \context Lyrics \lyrics {
1850  do4 re mi fa }
1851
1852 @end mudela
1853 @end quotation
1854
1855 You should use a single rhythm melody, and single rhythm lyrics (a
1856 constant duration is the obvious choice).  If you do not, you will get
1857 undesired effects when using multiple stanzas:
1858
1859 @quotation
1860
1861 @mudela[verbatim,fragment]
1862 \addlyrics
1863 \transpose c'' {
1864   c8 () cis d8. e16 f2
1865 }
1866 \context Lyrics \lyrics
1867 < { do4 re mi fa }
1868   { do8 re mi fa } >
1869
1870 @end mudela
1871 @end quotation
1872
1873 It is valid (but probably not very useful) to use notes instead of
1874 lyrics for @var{musicexpr2}.
1875
1876
1877
1878
1879 @node Ambiguities
1880 @section Ambiguities
1881
1882 @cindex ambiguities
1883
1884 The grammar contains a number of ambiguities.@footnote{The authors
1885 hope to resolve them at a later time.}
1886
1887 @itemize @bullet
1888   @item  The assignment
1889
1890          @example 
1891 foo = bar 
1892 @end example 
1893
1894        can be interpreted as making a string identifier @code{\foo}
1895        containing @code{"bar"}, or a music identifier @code{\foo}
1896        containing the syllable `bar'.
1897
1898   @item  The assignment
1899
1900          @example 
1901 foo = -6 
1902 @end example 
1903
1904        can be interpreted as making an integer identifier
1905        containing -6, or a Request identifier containing the
1906        fingering `6' (with neutral direction).
1907
1908   @item  If you do a nested repeat like
1909
1910        @quotation
1911
1912 @example 
1913 \repeat @dots{}
1914 \repeat @dots{}
1915 \alternative 
1916 @end example 
1917
1918        @end quotation
1919
1920        then it is ambiguous to which @code{\repeat} the
1921        @code{\alternative} belongs.  This is the classic if-then-else
1922        dilemma.  It may be solved by using braces.
1923
1924   @item  (an as yet unidentified ambiguity :-)
1925 @end itemize
1926
1927
1928
1929 @node Notation conversion specifics
1930 @section Notation conversion specifics
1931
1932 [todo]
1933
1934 @cindex automatic beam generation
1935
1936 @node autobeam
1937 @section autobeam
1938
1939 By default, LilyPond will generate beams automatically.  This feature
1940 can be disabled by setting the @code{Voice.noAutoBeaming}@indexcode{Voice.noAutoBeaming}
1941 property to 1.  It can be overridden for specific cases by
1942 specifying explicit beams as described in
1943 section XREF-manualbeam [FIXME].
1944
1945 A large number of Voice properties are used to decide how to generate
1946 beams.  Their default values appear in @file{auto-beam-settings.ly}.
1947 In general, beams can begin anywhere, but their ending location is
1948 significant.  Beams can end on a beat, or at durations specified by
1949 the @code{Voice.beamAutoEnd}@indexcode{Voice.beamAutoEnd} property.  To end beams every
1950 quarter note, for example, you could set
1951 @code{Voice.beamAutoEnd}@indexcode{Voice.beamAutoEnd} equal to `@code{"1/4"}'.  To end beams
1952 at every three eighth notes you would set it to `@code{"3/8"}'.  The
1953 same syntax can be used to specify beam starting points using
1954 @code{Voice.beamAutoBegin}@indexcode{Voice.beamAutoBegin}.
1955
1956 To allow different settings for different time signatures, these
1957 property names can start with `@code{time}@var{N}@code{_}@var{M}' to
1958 restrict the definition to `@var{N}@code{/}@var{M}' time.  For example,
1959 to specify beams ending only for 6/8 time you would use the
1960 property @code{Voice.time6_8beamAutoEnd}.  To allow different endings
1961 for notes of different durations, the duration can be tacked onto the
1962 end of the property.  To specify beam endings for beams that contain
1963 32nd notes, you would use @code{Voice.beamAutoEnd_32}.
1964
1965
1966
1967 @cindex chord names
1968
1969 @cindex chords
1970
1971 @cindex printing!chord names
1972
1973 For displaying printed chord names, use the @code{ChordNames}@indexcode{ChordNames}
1974 and @code{ChordNameVoice}@indexcode{ChordNameVoice} contexts.  The chords may be entered
1975 either using the notation described above, or directly using
1976 simultaneous music.
1977
1978 @quotation
1979
1980 @mudela[fragment,verbatim]
1981 <
1982   \context ChordNames {
1983     \chords{a b c} \notes{<d f g>  <e g b>}
1984   }
1985   \context Staff \notes {
1986     a b c' d' e'
1987   }
1988 >
1989
1990 @end mudela
1991 @end quotation
1992
1993 LilyPond examines chords specified as lists of notes to determine a
1994 name to give the chord.  By default, LilyPond will not try to
1995 identify chord inversions:
1996
1997 @mudela[fragment,verbatim,center]
1998   <
1999     \context ChordNameVoice \notes {
2000       <e'1 g' c''>
2001     }
2002     \context Thread \notes {
2003       <e'1 g' c''>
2004     }
2005   >
2006 @end mudela
2007
2008 If you want inversions to be recognized, you must set the property
2009 @code{ChordNames.chordInversion}@indexcode{ChordNames.chordInversion}:
2010
2011 @mudela[fragment,verbatim,center]
2012   <
2013     \property Score.chordInversion = 1
2014     \context ChordNameVoice \notes {
2015       <e'1 g' c''>
2016     }
2017     \context Thread \notes {
2018       <e'1 g' c''>
2019     }
2020   >
2021 @end mudela
2022
2023
2024
2025 @cindex lyrics
2026
2027 @cindex printing!lyrics
2028
2029 @node lyricprint
2030 @section lyricprint
2031
2032 Lyric syllables must be interpreted within a @code{Lyrics} context
2033
2034 @cindex context!Lyrics
2035  for printing them.
2036
2037 Here is a full example: 
2038
2039 @quotation
2040
2041 @mudela[verbatim]
2042 \score {
2043   <
2044     \notes \transpose c'' {
2045       c d e c | c d e c |
2046       e f g2 | e4 f g2 \bar "|.";
2047     }
2048     \context Lyrics \lyrics { 
2049       Va-4 der Ja- cob Va- der Ja- cob
2050       Slaapt gij nog?2 Slaapt4 gij nog?2
2051     }
2052   >
2053 }
2054
2055 @end mudela
2056 @end quotation
2057
2058 You may want a continuous line after the syllables to show melismata. 
2059 To achieve this effect, add a `@code{__}' lyric as a separate word
2060 after the lyric to be extended.  This will create an extender, a line
2061 that extends over the entire duration of the lyric.  This line will
2062 run all the way to the start of the next lyric, so you may want to
2063 shorten it by using a blank lyric (using `@code{_}').
2064
2065 @quotation
2066
2067 @mudela[verbatim]
2068 \score {
2069   <
2070     \notes \relative c'' {
2071       a4 () b () c () d | c () d () b () a | c () d () b () a
2072     }
2073     \context Lyrics \lyrics {
2074       foo1 __ | bar2. __ _4 | baz1 __
2075     }
2076   >
2077 }
2078
2079 @end mudela
2080 @end quotation
2081
2082      
2083 If you want to have hyphens centered between syllables (rather than
2084 attached to the end of the first syllable) you can use the special
2085 `@code{-}@code{-}' lyric as a separate word between syllables.  This
2086 will result in a hyphen which length varies depending on the space
2087 between syllables, and which will be centered between the syllables. 
2088 For example:
2089
2090 @quotation
2091
2092 @mudela[verbatim]
2093 \score {
2094   <
2095     \notes \transpose c'' {
2096       c d e c | c d e c |
2097       e f g2 | e4 f g2 \bar "|.";
2098     }
2099     \context Lyrics \lyrics {
2100       Va4 -- der Ja -- cob | Va -- der Ja -- cob |
2101       Slaapt gij nog?2 | Slaapt4 gij nog?2
2102     }
2103   >
2104 }
2105
2106 @end mudela
2107 @end quotation
2108
2109
2110
2111 @node Notation Contexts
2112 @section Notation Contexts
2113
2114 @cindex notation contexts
2115
2116 Notation contexts are objects that only exist during a run of
2117 LilyPond.  During the interpretation phase of LilyPond, the Music
2118 expression contained in a @code{\score} block is interpreted in time
2119 order.  This is the order in which humans read, play, and write
2120 music.
2121
2122 A context is an object that holds the reading state of the
2123 expression; it contains information like
2124
2125 @itemize @bullet
2126   @item  What notes are playing at this point?
2127   @item  What symbols will be printed at this point?
2128   @item  In what style will they printed?
2129   @item  What is the current key signature, time signature, point within
2130        the measure, etc.?
2131 @end itemize
2132
2133 Contexts are grouped hierarchically: A @code{Voice} context is
2134 contained in a @code{Staff} context (because a staff can contain
2135 multiple voices at any point), a @code{Staff} context is contained in
2136 a @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context (because
2137 these can all contain multiple staffs).
2138
2139 Contexts associated with sheet music output are called @emph{notation
2140 contexts}, those for sound output are called playing contexts.
2141
2142 Contexts are created either manually or automatically.  Initially,
2143 the top level music expression is interpreted by the top level
2144 context (the @code{Score} context).  When a atomic music expression
2145 (i.e. a note, a rest, @code{\bar}, or @code{\time} commands), a nested
2146 set of contexts is created that can process these atomic expressions,
2147 as in this example:
2148
2149 @example
2150
2151   @example 
2152 \score @{ \notes < c4 > @} 
2153 @end example 
2154
2155 @end example
2156
2157 The sequential music, `@code{@{ c4 @}}' is interpreted by @code{Score}
2158 context. When the note `@code{c4}' itself is interpreted, a set of
2159 contexts is needed that will accept notes.  The default for this is a
2160 @code{Voice} context, contained in a @code{Staff} context.  Creation of
2161 these contexts results in the staff being printed.
2162
2163
2164 @cindex context
2165
2166 You can also create contexts manually, and you probably have to do so
2167 if you want to typeset complicated multiple part material.  If a
2168 `@code{\context} @var{name} @var{musicexpr}' expression is encountered
2169 during the interpretation phase, the @var{musicexpr} argument will be
2170 interpreted with a context of type @var{name}.  If you specify a name,
2171 the specific context with that name is searched.
2172
2173 If a context of the specified type and name can not be found, a new
2174 one is created.  For example,
2175
2176 @quotation
2177
2178 @mudela[verbatim]
2179 \score {
2180   \notes \relative c'' {
2181     c4 <d4 \context Staff = "another" e4> f
2182   }
2183 }
2184
2185 @end mudela
2186 @end quotation
2187
2188 In this example, the @code{c} and @code{d} are printed on the
2189 default staff.  For the @code{e}, a context Staff called
2190 `@code{another}' is specified; since that does not exist, a new
2191 context is created.  Within @code{another}, a (default) Voice context
2192 is created for the @code{e4}.  When all music referring to a
2193 context is finished, the context is ended as well.  So after the
2194 third quarter, @code{another} is removed.
2195
2196 Almost all music expressions inherit their interpretation context
2197 from their parent.  In other words, suppose that the syntax for a
2198 music expression is
2199
2200 @example
2201
2202   \keyword @var{musicexpr1} @var{musicexpr2} @dots{}
2203 @end example
2204
2205 When the interpretation of this music expression starts, the context
2206 for @var{musicexpr1}, @var{musicexpr2}, etc. is that of the total
2207 expression.
2208
2209 Lastly, you may wonder, why this:
2210
2211 @quotation
2212
2213 @example 
2214 \score @{
2215   \notes \relative c'' @{
2216     c4 d4 e4
2217   @}
2218 @} 
2219 @end example 
2220
2221 @end quotation
2222
2223 doesn't result in this:
2224
2225 @mudela[]
2226
2227   \score {
2228     \notes \relative c'' {
2229       <c4> <d4> <e4>
2230     }
2231   }
2232
2233 @end mudela
2234
2235 For the @code{c4}, a default @code{Staff} (with a contained
2236 @code{Voice}) context is created.  After the @code{c4} ends, no
2237 music refers to this default staff, so it would be ended, with the
2238 result shown.  To prevent this inconvenient behavior, the context to
2239 which the sequential music refers is adjusted during the
2240 interpretation.  So after the @code{c4} ends, the context of the
2241 sequential music is also the default @code{Voice} context. 
2242 The @code{d4} gets interpreted in the same context
2243 as @code{c4}.
2244
2245
2246
2247 These are the contexts supplied with the package.  They are defined
2248 in the initialization file @file{ly/engraver.ly}.
2249
2250 @table @code
2251   @item @code{Grace}@indexcode{Grace} 
2252     The context for handling grace notes.  It is instantiated
2253     automatically when you use @code{\grace}.  Basically, it is an
2254     `embedded' miniature of the Score context.  Since this context
2255     needs special interaction with the rest of LilyPond, you should
2256     not explicitly instantiate it.
2257
2258   @item @code{LyricVoice}@indexcode{LyricVoice}  
2259     Corresponds to a voice with lyrics.  Handles the printing of a
2260     single line of lyrics.
2261
2262   @item @code{Thread}@indexcode{Thread}  
2263     Handles note heads, and is contained in the Voice context.  You
2264     have to instantiate this explicitly if you want to adjust the
2265     style of individual note heads.
2266
2267   @item @code{Voice}@indexcode{Voice}  
2268     Corresponds to a voice on a staff.  This context handles the
2269     conversion of dynamic signs, stems, beams, super- and subscripts,
2270     slurs, ties, and rests.
2271
2272     You have to instantiate this explicitly if you want to have
2273     multiple voices on the same staff.
2274
2275   @item @code{ChordNamesVoice}@indexcode{ChordNamesVoice}  
2276     A voice with chord names.  Handles printing of a line of chord
2277     names.
2278
2279   @item @code{ChordNames}@indexcode{ChordNames}  
2280     Typesets chord names.  Can contain @code{ChordNamesVoice}
2281     contexts.
2282
2283   @item @code{Lyrics}@indexcode{Lyrics}  
2284     Typesets lyrics.  It can contain @code{LyricVoice} contexts.
2285
2286   @item @code{Staff}@indexcode{Staff}  
2287     Handles clefs, bar lines, keys, accidentals.  It can contain
2288     @code{Voice} contexts.
2289
2290   @item @code{RhythmicStaff}@indexcode{RhythmicStaff}  
2291     A context like @code{Staff} but for printing rhythms.  Pitches are
2292     ignored; the notes are printed on one line.  It can contain
2293     @code{Voice} contexts.
2294
2295   @item @code{GrandStaff}@indexcode{GrandStaff}  
2296     Contains @code{Staff} or @code{RhythmicStaff} contexts.  It adds a
2297     brace on the left side, grouping the staffs together.  The bar
2298     lines of the contained staffs are connected vertically.  It can
2299     contain @code{Staff} contexts.
2300
2301   @item @code{PianoStaff}@indexcode{PianoStaff}  
2302     Just like @code{GrandStaff} but with @code{minVerticalAlign} set
2303     equal to @code{maxVerticalAlign} so that interstaff beaming and
2304     slurring can be used.
2305
2306   @item @code{StaffGroup}@indexcode{StaffGroup}  
2307     Contains @code{Staff} or @code{RhythmicStaff} contexts.  Adds a
2308     bracket on the left side, grouping the staffs together.  The bar
2309     lines of the contained staffs are connected vertically.  It can
2310     contain @code{Staff}, @code{RhythmicStaff}, @code{GrandStaff}, or
2311     @code{Lyrics} contexts.
2312
2313   @item @code{ChoirStaff}@indexcode{ChoirStaff}  
2314     Identical to @code{StaffGroup} except that the contained staffs
2315     are not connected vertically.
2316
2317   @item @code{Score}@indexcode{Score}  
2318     This is the top level notation context.  No other context can
2319     contain a @code{Score} context.  This context handles the
2320     administration of time signatures.  It also makes sure that items
2321     such as clefs, time signatures, and key-signatures are aligned
2322     across staffs.  It can contain @code{Lyrics}, @code{Staff},
2323     @code{RhythmicStaff}, @code{GrandStaff}, @code{StaffGroup}, and
2324     @code{ChoirStaff} contexts.
2325
2326     You cannot explicitly instantiate a Score context (since it is
2327     not contained in any other context).  It is instantiated
2328     automatically when an output definition (a @code{\score} or
2329     @code{\paper} block) is processed.
2330 @end table
2331
2332
2333
2334 Properties that are set in one context are inherited by all of the
2335 contained contexts.  This means that a property valid for the
2336 @code{Voice} context can be set in the @code{Score} context (for
2337 example) and thus take effect in all @code{Voice} contexts.
2338
2339 Properties can be preset within the @code{\translator} block
2340 corresponding to the appropriate context.  In this case, the syntax
2341 is
2342
2343 @example
2344
2345   @var{propname} @code{=} @var{value}
2346 @end example
2347
2348 This assignment happens before interpretation starts, so a
2349 @code{\property} expression will override any predefined settings.
2350
2351 The @code{\property} expression will create any property you specify.
2352 There is no guarantee that a property will be used.  So if you spell
2353 a property name wrong, there will be no error message.
2354
2355 The property settings are used during the interpretation phase.  They
2356 are read by the LilyPond modules where interpretation contexts are
2357 built of.  These modules are called @emph{translators}.  Translators for
2358 notation are called @emph{engravers}, and translators for sound are
2359 called @emph{performers}.
2360
2361 The precise result of a property is determined by the implementation
2362 of the translator that reads them.  Therefore, the result of a
2363 property can vary, since it is implementation and configuration
2364 dependent.
2365
2366 In order to fully find out what properties are used, you must
2367 currently search the source code for calls to @code{get_property}. 
2368 The rest of the section is devoted to an (incomplete) overview of
2369 available properties.
2370
2371
2372 @node Properties
2373 @section Properties
2374
2375 Properties are Scheme values, so they have a type.  The type of a
2376 property is listed in parentheses after the property name.
2377
2378 @macro propertytype{t}
2379  (\t\)
2380 @end macro
2381
2382
2383 TODO:
2384
2385
2386 @table @code
2387   @item @code{Generic_property_list}
2388     Defines names and types for generic properties. These are properties
2389     than can be plugged into the backend directly. See the init file
2390     @file{generic-property.scm} for details.  For internal use only.
2391
2392   @item @code{XXXVerticalExtent}@indexcode{groupVerticalExtent} @propertytype{Interval: a cons of numbers}
2393     Hard code the size of the vertical group in context XXX, example
2394 @example
2395 \property Staff.StaffVerticalExtent = #(-5.0 . 5.0)
2396 @end example
2397     The value is a cons of real numbers, that measure the extent in
2398     staff spaces.
2399 @end table   
2400
2401 @subsubheading Lyrics properties
2402
2403 @cindex properties!Lyrics
2404
2405 @table @code
2406   @item @code{textStyle}@indexcode{textStyle} @propertytype{string}
2407     Set the font for lyrics.  The available font choices are
2408     @code{roman}, @code{italic}, @code{bold}, @code{large}, @code{Large},
2409     @code{typewriter}, and @code{finger}.  The @code{finger} font can
2410     only display numbers.  Note also that you must be careful when
2411     using @code{\property} in Lyrics mode, because of the way strings
2412     are parsed.  Either put quotes around the arguments to
2413     @code{\property} or be sure to leave a space on both sides of the
2414     dot.
2415 @end table
2416
2417 @subsubheading Thread properties
2418
2419 @cindex properties!Thread
2420
2421 @table @code
2422   @item @code{noteheadStyle}@indexcode{noteheadStyle} @propertytype{string}
2423     Selects type of note head.  Choices are @code{cross},
2424     @code{diamond}, @code{harmonic}, @code{transparent}, and @code{""}. 
2425     They are shown in that order below.
2426
2427     @mudela[center,verbatim]
2428       \score {
2429         \notes { 
2430           \property Staff.barNonAuto = 1
2431           \property Voice.noteHeadStyle = cross 
2432           a'
2433           \property Voice.noteHeadStyle = diamond
2434           a'
2435           \property Voice.noteHeadStyle = harmonic
2436           a'
2437           \property Voice.noteHeadStyle = transparent
2438           a' 
2439           \property Voice.noteHeadStyle = ""
2440           a'
2441         }
2442         \paper {
2443           linewidth = -1.;
2444         }
2445       }
2446     
2447 @end mudela
2448 @end table
2449
2450 @subsubheading Grace properties
2451
2452 @cindex properties!Grace
2453
2454  
2455 @table @code  
2456   @item @code{stemStyle}@indexcode{flagStyle} @propertytype{string}
2457     By default set to @code{"grace"} meaning that all unbeamed 
2458     notes with flags are typeset with a slash through the flag. 
2459     Setting to @code{""} gives standard flags.
2460
2461 @mudela[verbatim]
2462 c'8 \property Voice.flagStyle = "grace" c'8
2463 @end mudela
2464 @end table
2465
2466
2467 @subsubheading Voice properties
2468
2469 @cindex properties!Voice
2470
2471 @table @code  
2472   @item @code{abbrev}@indexcode{abbrev} @propertytype{integer}
2473     Set length for tremolo to be used if no length is explicitly
2474     specified. 
2475
2476   @item @code{articulationScriptPadding}@indexcode{articulationScriptPadding}
2477     Determines the extra space added between articulation marks, such
2478     as staccato, tenuto, trill, up/down bow or fermata, and the
2479     closest staff line or note.
2480
2481   @item @code{articulationScriptVerticalDirection} @propertytype{direction}
2482     @indexcode{articulationScriptVerticalDirection}  
2483     Determines the location of articulation marks.  Set to @code{\up}
2484     to print marks above the staff; set to @code{\down} to print marks
2485     below the staff.  This property does not override explicit
2486     directions marked with `@code{^}' or `@code{_}' in the mudela file.
2487     
2488   @item @code{noAutoBeaming}@indexcode{beamAuto}  @propertytype{boolean}
2489     If set to 1 then beams are not generated automatically.
2490
2491   @item @code{beamAutoEnd}@indexcode{beamAutoEnd}  @propertytype{?}
2492     Specifies when automatically generated beams can end.  See
2493     section XREF-autobeam [FIXME].
2494
2495   @item @code{beamAutoBegin}@indexcode{beamAutoBegin}  @propertytype{?}
2496     Specifies when automatically generated beams can start.  See
2497     section XREF-autobeam [FIXME].
2498
2499
2500 [outdated FIXME]
2501   @item @code{beamQuantisation}@indexcode{beamQuantisation} @propertytype{symbol}
2502     Set to @code{\none} for no quantization.  Set to @code{\normal} to
2503     quantize position and slope.  Set to @code{\traditional} to avoid
2504     wedges.  These three settings are available via
2505     @code{\beamposfree}@keyindex{beamposfree},
2506     @code{\beamposnormal}@keyindex{beamposnormal}, and
2507     @code{\beampostraditional}@keyindex{beampostraditional}.
2508
2509   @item @code{beamSlopeDamping}@indexcode{beamSlopeDamping} @propertytype{number}
2510     Set to @code{\none} for undamped beams.  Set to @code{\normal} for
2511     damped beams.  Set to @code{\infinity} for beams with zero slope. 
2512     The identifiers
2513     @code{\beamslopeproportional}@keyindex{beamslopeproportional},
2514     @code{\beamslopedamped}@keyindex{beamslopedamped}, and
2515     @code{\beamslopezero}@keyindex{beamslopezero} each set the
2516     corresponding value.
2517
2518   @item @code{dynamicDirection}@indexcode{dynamicDirection} @propertytype{direction}
2519     Determines location of dynamic marks.  Set to @code{\up} to print
2520     marks above the staff; set to @code{\down} to print marks below
2521     the staff.
2522
2523   @item @code{dynamicStyle}@indexcode{dynamicStyle} @propertytype{string}
2524     Set the text style for dynamics.
2525
2526   @item @code{fontSize}@indexcode{fontSize} @propertytype{number}
2527     Can be used to select smaller font sizes for music.  The normal
2528     font size is 0, and the two smaller sizes are -1
2529     and -2.
2530
2531 @mudela[verbatim]
2532 c''16 \property Staff.fontSize = -2 c''16
2533 @end mudela
2534
2535    @item @code{forceHorizontalShift}@indexcode{forceHorizontalShift}  
2536     Force horizontal shift for collision resolution.  It overrides
2537     automatic collision resolution.  The value is the shift amount
2538     expressed in @code{note_width}, as set in the paper section.
2539
2540 @item @code{collisionMergeDotted}@indexcode{collisionMergeDotted} @propertytype{boolean}
2541
2542 Merge noteheads in collisions, even if they have a different number of
2543 dots. This normal notation for polyphonic guitar music.
2544
2545 @mudelafile[verbatim]{force-hshift.ly}
2546
2547
2548 [FIXME: this should be moved]
2549
2550 Lilypond always arranges note heads on alternate sides of a stem (that
2551 is, within a single voice) as necessary to prevent collisions (note head
2552 overlaps).  For up stems, the upper note of a colliding pair is placed
2553 on the right side of the stem, the lower on the left. For down stems,
2554 the algorithm works in reverse.
2555   
2556 Lily also attempts to prevent collisions of note heads in different
2557 voices. A situation where chords of two or more voices are played
2558 simultaneously within one staff.
2559
2560 By default, if only two voices (and both have opposite stem directions)
2561 are in this 'collision group', the notes both are shifted by @code{0.5
2562 \quartwidth} if there are unisons or seconds between the voices.
2563
2564 If there are more than two voices in a collision group, shifting is
2565 inactive by default, since in this case, there are multiple chords with
2566 the same stem direction. By  distinguish between those chords, LilyPond
2567 can do collision resolution in these cases as well.  
2568
2569 Distinguishing between voices with the same stem direction, is done by
2570 setting the property @code{Voice.horizontalNoteShift}.  It must be set
2571 to a different integer for each voice. Then, all note heads in collision
2572 groups (not just unisons and seconds) will be offset, one voice relative
2573 another.  The following fragment of sheet music shows how shifting is
2574 done, with values of @code{horizontalNoteShift} printed over and under
2575 the notes. In this case the chords are just simple notes.
2576
2577 @c URG : mudela book bug.
2578 @mudela[singleline,verbatim]
2579 \score {
2580         \notes \context Staff <
2581                 \context Voice  = VA { \stemup f''4^"0" }
2582                 \context Voice  = VB {\stemup
2583                 \property Voice.horizontalNoteShift = 1 d''4^" 1" }
2584                 \context Voice  = VC { \stemup \property
2585 Voice.horizontalNoteShift = 2 b'4^"  2" }
2586                 \context Voice  = VD { \stemdown \property
2587 Voice.horizontalNoteShift = 1 g'4_"1 " }
2588                 \context Voice  = VE { \stemdown e'4_"0" }
2589         >
2590 }
2591 @end mudela
2592
2593 If you are not satisfied with the collision resolution of LilyPond, you
2594 can override the horizontal shift value of the chord of one Voice, by
2595 setting @code{forceHorizontalShift}.  This sets the amount shift,
2596 measured in black note head widths.
2597
2598 To take complete control of note position shifts in complex passages,
2599 you have set things up for normal collisions and override all shifts by
2600 setting @code{forceHorizontalShift} to zero everywhere
2601 @example
2602 \property Voice.horizontalNoteShift = <n>
2603 \property Voice.forceHorizontalShift = "0.0"
2604 @end example
2605
2606 Then you can set the force property to a suitable value before each note
2607 that really needs it (unisons and seconds), and reset it to 0.0 after
2608 the note.  
2609
2610   @item @code{horizontalNoteShift}@indexcode{horizontalNoteShift}  @propertytype{integer}
2611     Enable LilyPond to shift notes horizontally if they collide with
2612     other notes.  This is useful when typesetting many voices on one
2613     staff.  The identifier @code{\shift}@keyindex{shift} is defined to
2614     enable this.  Traditionally, the outer chords (the upmost and
2615     downmost voices), should have no @code{horizontalNoteShift}.
2616
2617   @item @code{markScriptPadding}@indexcode{markScriptPadding}  @propertytype{number}
2618     Determines the extra space added between the mark and the closest
2619     staff line or note.
2620
2621   @item @code{markDirection}@indexcode{markDirection} @propertytype{direction}
2622     Determines if marks should be printed above or below the staff.
2623     Set to @code{\up} to print marks above the staff; set to
2624     @code{\down} to print marks below the staff.
2625
2626   @item @code{midiInstrument}@indexcode{midiInstrument} @propertytype{string}
2627     Sets the instrument for MIDI output.  If this property is not set
2628     then LilyPond will use the @code{instrument} property.  This must
2629     be set to one of the strings on the list of MIDI instruments that
2630     appears in section XREF-midilist [FIXME].  If you use a string which
2631     is not listed, LilyPond will silently substitute piano.
2632
2633   @item @code{restStyle}@indexcode{restStyle} @propertytype{string}
2634     Change the layout of rests shorter than quarter notes. 
2635     Currently, the standard layout @code{""} and mensural notation
2636     @code{"mensural"} are available. Mensural rests of duration
2637     32 or shorter are not available.
2638 @mudela[verbatim]
2639 r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 
2640 \property Staff.restStyle = "mensural"
2641 r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 
2642 @end mudela
2643
2644   @item @code{scriptHorizontal}@indexcode{scriptHorizontal} @propertytype{boolean}
2645     Put scripts left or right of note heads.  Support for this is
2646     limited.  Accidentals will collide with scripts.
2647     
2648   @item @code{slurVerticalDirection}@indexcode{slurVerticalDirection} @propertytype{direction}
2649     Set to @code{\free} for free choice of slur direction, set to
2650     @code{\up} to force slurs up, set to @code{\down} to force slurs
2651     down.  The shorthands @code{\slurup}@keyindex{slurup},
2652     @code{\slurdown}@keyindex{slurdown}, and
2653     @code{\slurboth}@keyindex{slurboth} are available.
2654
2655   @item @code{slurDash}@indexcode{slurDash} @propertytype{number}
2656     Set to NIL for normal slurs, 1 for dotted slurs, and a
2657     larger value for dashed slurs.  Identifiers
2658     @code{\slurnormal}@keyindex{slurnormal} and
2659     @code{\slurdotted}@keyindex{slurdotted} are predefined to set the
2660     first two settings.
2661
2662 @mudela[verbatim]
2663                 c4( )d
2664                 \property Voice.slurDash = 3
2665                 c ( )e
2666 @end mudela             
2667
2668 @item @code{stemLength}@indexcode{stemLength}  
2669     Set length of stems.  Unit is `@code{interline}/2', so
2670     @code{stemLength} defaults to 7.
2671 @mudela[verbatim]
2672 g''4 \property Voice.stemLength = #14  g4 \property Voice.stemLength = #3 g4  g,,4  
2673 @end mudela
2674
2675   @item @code{stemLeftBeamCount}@indexcode{stemLeftBeamCount} @propertytype{integer}
2676     Specify the number of beams to draw on the left side of the next
2677     note.  Overrides automatic beaming.  The value is only used once,
2678     and then it is erased.
2679
2680   @item @code{stemRightBeamCount}@indexcode{stemRightBeamCount} @propertytype{integer}
2681     Specify the number of beams to draw on the right side of the next
2682     note.  Overrides automatic beaming.  The value is only used once,
2683     and then it is erased.
2684
2685   @item @code{tieDash}@indexcode{tieDash} @propertytype{integer}
2686     Set dashing of ties. See also @code{slurDash}
2687
2688   @item @code{tieVerticalDirection}@indexcode{tieVerticalDirection} @propertytype{direction}
2689     Set to @code{\free} for free choice of tie direction, set to
2690     @code{\up} to force ties up, set to @code{\down} to force ties
2691     down.
2692
2693   @item @code{transposing}@indexcode{transposing} @propertytype{integer}
2694     Transpose the MIDI output.  Set this property to the number of
2695     half-steps to transpose by.
2696
2697   @item @code{textEmptyDimension}@indexcode{textEmptyDimension} @propertytype{boolean}
2698     If set to true then text placed above or below the staff is
2699     assumed to have zero width.  @code{fatText} and @code{emptyText}
2700 are predefined settings.
2701
2702 @mudela[verbatim]
2703 c4^"foo"  \emptyText c4^"foo" c4
2704 @end mudela
2705
2706   @item @code{textStyle}@indexcode{textStyle} @propertytype{string}
2707     Set the text style for superscripts and subscripts.  See above
2708     for list of text styles.
2709
2710   @item @code{textScriptPadding}@indexcode{textScriptPadding}  @propertytype{number}
2711     Determines the extra space added between superscripted resp.
2712     subscripted text and the closest staff line or note.
2713
2714   @item @code{verticalDirection}@indexcode{verticalDirection} @propertytype{direction}
2715     Determines the direction of stems, subscripts, beams, slurs, and
2716     ties.  Set to @code{\down} to force them down, @code{\up} to force
2717     them up, or @code{\free} to let LilyPond decide.  This can be used
2718     to distinguish between voices on the same staff.  The
2719     @code{\stemdown}@keyindex{stemdown}, @code{\stemup}@keyindex{stemup},
2720     and @code{\stemboth}@keyindex{stemboth} identifiers set this
2721     property.
2722     
2723
2724   @item @code{tupletDirection}@indexcode{tupletDirection} @propertytype{direction}
2725     Determines the direction of triplets and other tuplets.  Set to
2726     @code{\down} to force them below the staff, @code{\up} to force
2727     them above, or @code{\free} to let LilyPond decide.
2728
2729   @item  @code{tupletBracketVisibility}@indexcode{tupletBracketVisibility} @propertytype{boolean} or @propertytype{symbol}
2730   @item @code{tupletNumberVisibility}@indexcode{tupletNumberVisibility} @propertytype{boolean} or @propertytype{symbol}
2731
2732         These properties the visibility of the tuplet bracket and its
2733 number respectively. Setting it to false will prevent printing of the
2734 associated element. Setting the property to 'if-no-beam will make it
2735 print only if there is no beam associated with this tuplet bracket.
2736
2737 [fixme examples]
2738
2739   @item @code{tupletInvisible}@indexcode{tupletInvisible} @propertytype{boolean}
2740
2741     If set to true, tuplet bracket creation is switched off
2742 entirely. This has the same effect as setting both
2743 @code{tupletNumberVisibility} and @code{tupletBracketVisibility} to
2744 @code{#f}, but as this does not even create elements, this setting
2745 uses less memory and time.
2746
2747
2748 @item @code{tupletSpannerDuration} @indexcode{tupletSpannerDuration}
2749 @propertytype{moment}
2750
2751 Normally a tuplet bracket is as wide as the
2752 @code{\times} expression that gave rise to it. By setting this
2753 property, you can make brackets last shorter. Example
2754
2755 @mudela[verbatim,fragment]
2756 \context Voice \times 2/3 {
2757   \property Voice.tupletSpannerDuration = #(make-moment 1 4)
2758   [c8 c c] [c c c]
2759 }
2760 @end mudela
2761
2762 @end table
2763
2764 @subsubheading Staff properties
2765
2766 @cindex properties!Staff
2767
2768 @table @code
2769  
2770   @item @code{barNonAuto}@indexcode{barNonAuto} @propertytype{boolean}
2771     If set to true then bar lines will not be printed
2772     automatically; they must be explicitly created with @code{\bar}
2773     keywords.  Unlike with the @code{\cadenza} keyword, measures are
2774     still counted.  Bar generation will resume according to that
2775     count if this property is set to zero.
2776
2777   @item @code{barNumberDirection}@indexcode{barNumberDirection} @propertytype{direction}
2778     Set to @code{\up} or @code{\down} to put bar numbers above or below
2779     the staff.
2780
2781   @item @code{barNumberScriptPadding}@indexcode{barNumberScriptPadding}  
2782     Sets extra space between the bar number and the bar it labels.
2783
2784   @item @code{barSize}@indexcode{barSize}  
2785     Specify the height of the bar lines if it should be different
2786     than the staff height.
2787 @mudela[verbatim]
2788 c1 c1 \property Staff.barSize = 20 c1 c1 
2789 @end mudela
2790
2791   @item @code{barAtLineStart}@indexcode{barAtLineStart} @propertytype{boolean}
2792     Set to true to produce a bar line after the clef at the start
2793     of each line (but not at the beginning of the music).
2794
2795         [BROKEN]
2796
2797   @item @code{clefStyle}@indexcode{clefStyle} @propertytype{string}
2798     Determines how clefs are typeset.  If set to @code{transparent},
2799     the clefs are not printed at all, if set to
2800     @code{fullSizeChanges}, clef changes in the middle of a line are
2801     typeset with a full size clef.  By default, clef changes are
2802     typeset in smaller size.
2803
2804   @item @code{supportedClefTypes}@indexcode{supportedClefTypes} @propertytype{alist}
2805
2806         Clef settings supported. The value is an association list clef
2807 descriptions indexed by clef name (alto, baritone, etc.).  A clef
2808 description is a list with the glyph name, and the staff position
2809 where it should go. For internal use.
2810
2811   @item @code{clefPitches}@indexcode{clefPitches} @propertytype{alist}
2812     Settings for the position of the central C, relative to this clef
2813     symbol.  For internal use.
2814    
2815   @item @code{defaultClef}@indexcode{defaultClef} @propertytype{string}
2816         Clef setting to use when this context is created.  If unset,
2817 no clef is printed upon creation.
2818
2819   @item @code{marginDirection}@indexcode{marginDirection} @propertytype{direction}
2820     Set to @code{\left} or @code{\right} to specify location of
2821     marginal scripts.
2822
2823   @item @code{marginScriptPadding}@indexcode{marginScriptPadding}  
2824     Specify extra space for marginal scripts.
2825
2826   @item @code{forgetAccidentals}@indexcode{forgetAccidentals} @propertytype{boolean}
2827     Causes accidentals to be printed at every note instead of
2828     remembered for the duration of a measure.
2829
2830   @item @code{noResetKey}@indexcode{noResetKey} @propertytype{boolean}
2831     Do not reset the key at the start of a measure.  Accidentals will
2832     be printed only once and are in effect until overridden, possibly
2833     many measures later.
2834
2835   @item @code{staffSpace}@indexcode{staffLineLeading}   @propertytype{number}   
2836     Specifies the distance (in points) between lines of the staff.
2837
2838   @item @code{numberOfStaffLines}@indexcode{numberOfStaffLines} @propertytype{integer}
2839     Specifies the number of staff lines.  The default is 5.
2840
2841   @item @code{postBreakPadding}@indexcode{postBreakPadding}   @propertytype{number}
2842     Extra space in points to be added after the clef, time signature
2843     and key signature on the staff.  Deprecated, do not use.
2844
2845   @item @code{noVoltaBraces}@indexcode{noVoltaBraces} @propertytype{boolean}
2846     Set to true to suppress the printing of brackets over alternate
2847     endings specified by the command @code{\alternative}.
2848
2849  
2850   @item @code{barAlways}@indexcode{barAlways} @propertytype{boolean}
2851     If set to true a bar line is drawn after each note.
2852
2853   @item @code{defaultBarType}@indexcode{defaultBarType} @propertytype{string}
2854     Sets the default type of bar line. See Section XREF-barlines [FIXME] 
2855     for a list of available bar types.
2856
2857   @item @code{instrument}, @code{instr} @propertytype{string}
2858     @indexcode{instrument}@indexcode{instr}  
2859     If @code{Instrument_name_engraver}
2860 @cindex Instrument_name_engraver
2861  is
2862     added to the Staff translator, then the @code{instrument} property
2863     is used to label the first line of the staff and the @code{instr}
2864     property is used to label subsequent lines.  If the
2865     @code{midiInstrument} property is not set, then @code{instrument}
2866     is used to determine the instrument for MIDI output.
2867
2868   @item @code{keyOctaviation}@indexcode{keyOctaviation} @propertytype{boolean}
2869     If set to false, then keys are the same in all octaves.  If set
2870     to true then the key signature for different octaves can be
2871     different and is specified independently:
2872
2873     @example
2874       \keysignature bes fis'
2875     @end example
2876
2877     The default value is @code{#f}.  Can be set to @code{#t} with
2878     @code{\specialkey} or reset with @code{\normalkey}.
2879
2880   @item @code{timeSignatureStyle}@indexcode{timeSignatureStyle} @propertytype{string}
2881     Changes the default two-digit layout for time signatures.  The
2882     following values are recognized:
2883
2884     @table @code
2885       @item @code{C}@indexcode{C}  
2886         4/4 and 2/2 are typeset as C and struck C, respectively.  All
2887         other time signatures are written with two digits.
2888
2889       @item @code{old}@indexcode{old}  
2890         2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
2891         typeset with old-style mensuration marks.  All other time
2892         signatures are written with two digits.
2893
2894       @item @code{1}@indexcode{1}  
2895         All time signatures are typeset with a single
2896         digit, e.g. 3/2 is written as 3.
2897
2898       @item @indexcode{CM/N}@code{C}@var{M}@code{/}@var{N}, 
2899       @indexcode{oldM/N}@code{old}@var{M}@code{/}@var{N} or
2900       @code{old6/8alt}@indexcode{old6/8alt}  
2901         Tells LilyPond to use a specific symbol as time signature.
2902     @end table
2903
2904     The different time signature characters are shown below with its
2905     names:
2906
2907     @mudela[center,verbatim]
2908
2909       \score {
2910         \notes\relative c'' {
2911           \property Voice.textStyle = typewriter
2912           \property Staff.timeSignatureStyle = "C2/2"
2913           \time 2/2; a2^"C2/2" a2 
2914           \property Staff.timeSignatureStyle = "C4/4"
2915           \time 2/2; a2^"C4/4" a2 
2916           \property Staff.timeSignatureStyle = "old2/2"
2917           \time 2/2; a2^"old2/2" a2 
2918           \property Staff.timeSignatureStyle = "old3/2"
2919           \time 2/2; a2^"old3/2" a2 
2920           \property Staff.timeSignatureStyle = "old2/4"
2921           \time 2/2; a2^"old2/4" a2 
2922           \property Staff.timeSignatureStyle = "old4/4"
2923           \time 2/2; a2^"old4/4" a2 
2924           \property Staff.timeSignatureStyle = "old6/4"
2925           \time 2/2; a2^"old6/4" a2 
2926           \property Staff.timeSignatureStyle = "old9/4"
2927           \time 2/2; a2^"old9/4" a2 
2928           \property Staff.timeSignatureStyle = "old4/8"
2929           \time 2/2; a2^"old4/8" a2 
2930           \property Staff.timeSignatureStyle = "old6/8"
2931           \time 2/2; a2^"old6/8" a2 
2932           \property Staff.timeSignatureStyle = "old6/8alt"
2933           \time 2/2; a2^"old6/8alt" a2 
2934           \property Staff.timeSignatureStyle = "old9/8"
2935           \time 2/2; a2^"old9/8" a2 
2936         }
2937         \paper {
2938           linewidth = 4.5 \in;
2939         }
2940       }
2941     
2942 @end mudela
2943
2944   @item @code{voltaSpannerDuration}@indexcode{voltaSpannerDuration} @propertytype{moment}
2945     Set to an integer to control the size of the brackets printed by
2946     @code{\alternative}.  The integer specifies the number of whole
2947     notes duration to use for the brackets.  It is rounded to the
2948     nearest measure.  This can be used to shrink the length of
2949     brackets in the situation where one alternative is very large. 
2950     It may have odd effects if the specified duration is longer than
2951     the music given in an @code{\alternative}.
2952 @end table
2953    
2954 @subsubheading GrandStaff properties
2955
2956 @cindex properties!GrandStaff
2957
2958 @table @code 
2959   @item @code{maxVerticalAlign}@indexcode{maxVerticalAlign}  @propertytype{number}
2960     Set the maximum vertical distance between staffs.
2961
2962   @item @code{minVerticalAlign}@indexcode{minVerticalAlign}  @propertytype{number}
2963     Set the minimum vertical distance between staffs.  
2964 @end table
2965
2966 @subsubheading Score properties
2967
2968 @cindex properties!Score
2969
2970
2971
2972
2973 @table @code
2974   @item @code{skipBars}@indexcode{skipBars} @propertytype{boolean}
2975     Set to 1 to skip the empty bars that are produced by
2976     multimeasure notes and rests.  These bars will not appear on the
2977     printed output.  Set to zero (the default) to expand multimeasure
2978     notes and rests into their full length, printing the appropriate
2979     number of empty bars so that synchronization with other voices is
2980     preserved.
2981
2982     @quotation
2983
2984 @mudela[fragment,verbatim,center]
2985 r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
2986
2987 @end mudela
2988     @end quotation
2989
2990 @item @code{breakAlignOrder}@indexcode{breakAlignOrder} @propertytype{list of string}
2991
2992    Defines the order in which prefatory matter (clefs, key signatures) appears, eg. this puts the key signatures after the bar lines:
2993 @example
2994         \property Score.breakAlignOrder = #'(
2995           "Span_bar"
2996           "Breathing_sign"
2997           "Clef_item"
2998           "Staff_bar"
2999           "Key_item"
3000           "Time_signature"
3001         )
3002 @end example
3003
3004
3005 @item @code{timing}@indexcode{timing} @propertytype{boolean}
3006   Keep administration of measure length, position, bar number, etc?
3007 Switch off for cadenzas.
3008
3009 @item @code{currentBarNumber}@indexcode{currentBarNumber} @propertytype{integer}
3010   Contains the current barnumber. This property is incremented at
3011 every barline.
3012
3013 @item @code{measurePosition}@indexcode{measurePosition} @propertytype{Moment}
3014
3015   How much of the current measure (measured in whole notes) have we had?
3016
3017 @item @code{oneBeat}@indexcode{oneBeat} @propertytype{Moment}
3018
3019   How long does one beat in the current time signature last?
3020
3021 @item @code{measureLength}@indexcode{measureLength} @propertytype{Moment}
3022
3023   How long does one measure in the current time signature last?
3024
3025 @end table
3026
3027 @subsubheading ChordNamesVoice properties
3028
3029 @cindex properties!ChordNamesVoice
3030
3031 @table @code
3032   @item @code{chordInversion}@indexcode{chordInversion} @propertytype{boolean}
3033     Determines whether LilyPond should look for chord inversions when
3034     translating from notes to chord names.  Set to 1 to find
3035     inversions.  The default is 0 which does not look for
3036     inversions.
3037 @end table
3038
3039
3040
3041 @node Notation output definitions
3042 @section Notation output definitions
3043
3044 @cindex output
3045
3046 @cindex notation output
3047
3048 @cindex output definition
3049
3050 @node paper
3051 @section paper
3052
3053 The most important output definition is the @code{\paper} block, for
3054 music notation.  The syntax is
3055
3056 @example
3057
3058   @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}}
3059 @end example
3060
3061 where each of the items is one of
3062
3063 @itemize @bullet
3064   @item  An assignment.  The assignment must be terminated by a
3065        semicolon.  See section XREF-papervars [FIXME] for information on
3066        paper variables.
3067
3068   @item  A context definition.  See section XREF-contextdefs [FIXME] for
3069        more information on context definitions.
3070
3071   @item
3072         FIXME now in SCM
3073
3074         A margin shape declaration.  The syntax is
3075
3076        @example
3077
3078          \shape @var{indent1}@code{,} @var{width1}@code{,}
3079                       @var{indent2}@code{,} @var{width2} @dots{} @code{;}
3080        @end example
3081
3082        @keyindex{shape}
3083
3084        Each pair of @var{indent} and @var{width} values is a dimension
3085        specifying how far to indent and how wide to make the line. 
3086        The indentation and width of successive lines are specified by
3087        the successive pairs of dimensions.  The last pair of
3088        dimensions will define the characeristics of all lines beyond
3089        those explicitly specified.
3090
3091   @item  A font declaration.  Its syntax is
3092
3093        @example
3094
3095          @var{fontsize} @code{=} \font@keyindex{font} @var{fontname}
3096        @end example
3097
3098        @var{fontsize} is an integer describing the font to be used. 
3099        0 is the default font.  @var{fontname} is the basename of
3100        a font (usually a member of the Feta family).
3101 @end itemize
3102
3103
3104
3105 @cindex changing font size and paper size
3106
3107 The Feta font provides musical symbols at six different sizes.  These
3108 fonts are 11 point, 13 point, 16 point, 20 point,
3109 23 point, and 26 point.  The point size of a font is the
3110 height of the five lines in a staff when displayed in the font.
3111
3112 Definitions for these sizes are the files @file{paperSZ.ly}, where
3113 @code{SZ} is one of 11, 13, 16, 20, 23 and 26.  If you include
3114 any of these files, the identifiers @code{paper_eleven},
3115 @code{paper_thirteen}, @code{paper_sixteen}, @code{paper_twenty},
3116 @code{paper_twentythree}, and @code{paper_twentysix} are defined
3117 respectively.  The default @code{\paper} block is also set.
3118
3119 To change the paper size, you must first set the
3120 @code{papersize}@indexcode{papersize} variable at top level.  Set it to the strings
3121 @code{a4}, @code{letter}, or @code{legal}.  After this specification,
3122 you must set the font as described above.  If you want the default
3123 font, then use the 20 point font.  The new paper size will not
3124 take effect if the font is not loaded and selected afterwards.  Paper
3125 size selection works by loading a file named after the paper size you
3126 select.
3127
3128
3129
3130 @cindex paper variables
3131
3132 @node Paper variables
3133 @section Paper variables
3134
3135 There is a large number of paper variables that are used to control
3136 details of the layout.  These variables control the defaults for the
3137 entire score.  Usually, they do not have to be changed; they are by
3138 default set to values that depend on the font size in use.  The
3139 values are used by the graphic objects while formatting the score;
3140 they are therefore implementation dependent.  Most variables are
3141 accompanied by documentation in the initalization file
3142 @file{params.ly} or @file{paperSZ.ly}, where @code{SZ} is the staff
3143 height in points.
3144
3145 Nevertheless, here are some variables you may want to use or change:
3146
3147 @table @code
3148   @item @code{indent}@indexcode{indent}  
3149     The indentation of the first line of music.
3150
3151   @item @code{interline}@indexcode{interline}  
3152     The distance between two staff lines, calculated from the center
3153     of the lines.  You should use either this or @code{rulethickness}
3154     as a unit for distances you modify.
3155   
3156   @item @code{linewidth}@indexcode{linewidth}  
3157     Sets the width of the lines.  If set to -1.0, a single
3158     unjustified line is produced.
3159
3160   @item @code{output}@indexcode{output}  
3161     Specifies an alternate name for the the output @file{s}.
3162     A @file{.tex}, @file{.midi} or @file{.ps} extension will be 
3163     added to the string you specify.
3164
3165   @item @code{rulethickness}@indexcode{rulethickness}  
3166     Determines the thickness of staff and bar lines. 
3167 @end table
3168
3169
3170 @node contextdefs
3171 @section contextdefs
3172
3173 @cindex context definition
3174
3175 A notation contexts is defined by the following information
3176
3177 @enumerate i
3178   @item  A name.
3179
3180   @item  The LilyPond modules that do the actual conversion of music to
3181        notation.  Each module is a so-called
3182        @emph{engraver}
3183 @cindex engraver
3184 .
3185
3186   @item  How these modules should cooperate, i.e. which ``cooperation
3187        module'' should be used.  This cooperation module is a special
3188        type of engraver.
3189
3190   @item  What other contexts the context can contain,
3191
3192   @item  What properties are defined.
3193 @end enumerate
3194
3195 A context definition has this syntax:
3196
3197 @example
3198
3199   \translator @code{@{}
3200                       @var{translatorinit} @var{translatormodifierlist}
3201                     @code{@}}
3202 @end example
3203
3204 @var{translatorinit} can be an identifier or of the form
3205
3206 @example
3207
3208   \type @var{typename} @code{;}
3209 @end example
3210
3211 @var{typename} is one of
3212
3213 @table @code
3214   @item @code{Engraver_group_engraver}@indexcode{Engraver_group_engraver}  
3215     The standard cooperation engraver.
3216
3217   @item @code{Score_engraver}@indexcode{Score_engraver}  
3218     This is cooperation module that should be in the top level context.
3219
3220   @item @code{Grace_engraver_group}@indexcode{Grace_engraver_group}  
3221     This is a special cooperation module (resembling
3222     @code{Score_engraver}) that is used to created an embedded
3223     `miniscore'.
3224 @end table 
3225
3226 @var{translatormodifierlist} is a list of items where each item is
3227 one of
3228
3229 @itemize @bullet
3230   @item  @code{\consists} @var{engravername} @code{;}  
3231     Add @var{engravername} to the list of modules in this context. 
3232     Section XREF-engravers [FIXME] contains an overview of the engravers
3233     available.  The order of engravers added with @code{\consists} is
3234     significant.
3235   
3236   @item  @code{\consistsend} @var{engravername} @code{;}  
3237     Analogous to @code{\consists}, but makes sure that
3238     @var{engravername} is always added to the end of the list of
3239     engravers.
3240
3241     Some engraver types need to be at the end of the list; this
3242     insures they are put there, and stay there, if a user adds or
3243     removes engravers.  This command is usually not needed for
3244     end-users.
3245     
3246   @item  @code{\accepts} @var{contextname} @code{;}  
3247     Add @var{contextname} to the list of  context this context can
3248     contain.  The first listed context the context to create by
3249     default.
3250   
3251   @item  @code{\remove} @var{engravername} @code{;}  
3252     Remove a previously added (with @code{\consists}) engraver.
3253   
3254   @item  @code{\name} @var{contextname} @code{;}  
3255     This sets name of the context, e.g. @code{Staff}, @code{Voice}.  If
3256     the name is not specified, the translator won't do anything.
3257
3258   @item  @var{propname} @code{=} @var{value} @code{;}  
3259     A property assignment.  It is allowed to use reals for
3260     @var{value}.
3261 @end itemize
3262
3263 In the @code{\paper} block, it is also possible to define translator
3264 identifiers.  Like other block identifiers, the identifier can only
3265 be used as the very first item of a translator.  In order to define
3266 such an identifier outside of @code{\score}, you must do
3267
3268 @quotation
3269
3270 @example 
3271 \paper @{
3272   foo = \translator @{ @dots{} @}
3273 @}
3274 \score @{
3275   \notes @{
3276     @dots{}
3277   @}
3278   \paper @{
3279     \translator @{ \foo @dots{} @}
3280   @}
3281 @} 
3282 @end example 
3283
3284 @end quotation
3285
3286
3287 @cindex paper types, engravers, and pre-defined translators
3288
3289 Some pre-defined identifiers can simplify modification of
3290 translators.  The pre-defined identifiers are:
3291
3292 @table @code
3293   @item @code{StaffContext}@indexcode{StaffContext}  
3294     Default Staff context. 
3295
3296   @item @code{RhythmicStaffContext}@indexcode{RhythmicStaffContext}  
3297     Default RhythmicStaff context. 
3298
3299   @item @code{VoiceContext}@indexcode{VoiceContext}  
3300     Default Voice context.  
3301
3302   @item @code{ScoreContext}@indexcode{ScoreContext}  
3303     Default Score context. 
3304
3305   @item @code{ScoreWithNumbers}@indexcode{ScoreWithNumbers}  
3306     Score context with numbering at the Score level.
3307
3308   @item @code{BarNumberingStaffContext}@indexcode{BarNumberingStaffContext}  
3309     Staff context with numbering at the Staff level.
3310
3311   @item @code{HaraKiriStaffContext}@indexcode{HaraKiriStaffContext}  
3312     Staff context that does not print if it only contains rests. 
3313     Useful for orchestral scores.@footnote{Harakiri, also called
3314     Seppuku, is the ritual suicide of the Samourai.}
3315
3316   @item @code{OrchestralPartStaffContext}@indexcode{OrchestralPartStaffContext}
3317
3318   @item @code{OrchestralScoreContext}@indexcode{OrchestralScoreContext}
3319 @end table
3320
3321 Using these pre-defined values, you can remove or add items to the
3322 translator:
3323
3324 @quotation
3325
3326 @example 
3327 \paper @{
3328   \translator @{
3329     \StaffContext
3330     \remove Some_engraver;
3331     \consists Different_engraver;
3332   @}
3333 @} 
3334 @end example 
3335
3336 @end quotation
3337
3338       
3339
3340 @node engravers
3341 @section engravers
3342
3343 The engravers for paper output are:
3344
3345 [incomplete, FIXME]
3346
3347 @table @code
3348   @item @code{Bar_engraver}@indexcode{Bar_engraver}  
3349     Engraves bar lines.  Normally in @code{Staff} and
3350     @code{RhythmicStaff}.
3351
3352   @item @code{Bar_number_engraver}@indexcode{Bar_number_engraver}  
3353     Engrave bar numbers.  These numbers appear at the start of each
3354     line.  Not normally in any translator.  Can be added to
3355     @code{Score} for score-wide numbering or to @code{Staff} for
3356     numbering on each staff.
3357
3358   @item @code{Beam_engraver}@indexcode{Beam_engraver}  
3359     Handles beam requests by engraving beams.  Normally appears in
3360     the @code{Voice} translator.  If omitted, then notes will be
3361     printed with flags instead of beams.
3362
3363   @item @code{Beam_req_swallow_translator}
3364     @indexcode{Beam_req_swallow_translator}  
3365     Swallows beam requests.  In @code{LyricVoice}.  
3366
3367   @item @code{Chord_name_engraver}@indexcode{Chord_name_engraver}  
3368     Engraves chord names.  Normally in @code{ChordNameVoice} .
3369
3370   @item @code{Chord_tremolo_engraver}@indexcode{Chord_tremolo_engraver}
3371
3372   @item @code{Clef_engraver}@indexcode{Clef_engraver}  
3373     Engraves the clef symbol.  Normally in @code{Staff}.
3374
3375   @item @code{Collision_engraver}@indexcode{Collision_engraver}
3376
3377   @item @code{Dot_column_engraver}@indexcode{Dot_column_engraver}  
3378     Engraves dots on dotted notes shifted to the right of the note. 
3379     Normally in @code{Voice}.  If omitted, then dots appear on top of
3380     the notes.
3381
3382   @item @code{Dynamic_engraver}@indexcode{Dynamic_engraver}  
3383     Engraves dynamics symbols.  Normally in @code{Voice}.
3384
3385   @item @code{Font_size_engraver}@indexcode{Font_size_engraver}
3386
3387   @item @code{Key_engraver}@indexcode{Key_engraver}  
3388     Engraves the key signature.  Normally in @code{Staff}.
3389
3390   @item @code{Local_key_engraver}@indexcode{Local_key_engraver}
3391
3392   @item @code{Lyric_engraver}@indexcode{Lyric_engraver}  
3393     Engraves lyrics.  Normally in @code{LyricVoice}.
3394
3395   @item @code{Multi_measure_rest_engraver}
3396     @indexcode{Multi_measure_rest_engraver}  
3397     Engraves multi-measure rests that are produced with @code{R}. 
3398     Normally in @code{Voice}.
3399
3400   @item @code{Piano_bar_engraver}@indexcode{Piano_bar_engraver}
3401
3402   @item @code{Pitch_squash_engraver}@indexcode{Pitch_squash_engraver}  
3403     Treat all pitches as middle C.  Used in @code{RhythmicStaff}. 
3404     Note that the notes move, but the locations of accidentals stay
3405     the same.
3406
3407   @item @code{Priority_horizontal_align_engraver}
3408     @indexcode{Priority_horizontal_align_engraver}
3409
3410   @item @code{Repeat_engraver}@indexcode{Repeat_engraver}  
3411     Handles repeats?  In @code{Staff} and @code{RhythmicStaff}.
3412
3413   @item @code{Rest_collision_engraver}@indexcode{Rest_collision_engraver}  
3414     Handles collisions of rests.  In @code{Staff}.
3415
3416   @item @code{Rest_engraver}@indexcode{Rest_engraver}  
3417     Engraves rests.  Normally in @code{Voice}.
3418
3419   @item @code{Rhythmic_column_engraver}@indexcode{Rhythmic_column_engraver}
3420
3421   @item @code{Score_priority_engraver}@indexcode{Score_priority_engraver}
3422
3423   @item @code{Script_engraver}@indexcode{Script_engraver}  
3424     Handles note ornaments generated by @code{\script}.  Normally in
3425     @code{Voice}.
3426
3427   @item @code{Separating_line_group_engraver}
3428     @indexcode{Separating_line_group_engraver}
3429
3430   @item @code{Skip_req_swallow_translator}
3431     @indexcode{Skip_req_swallow_translator}
3432
3433   @item @code{Slur_engraver}@indexcode{Slur_engraver}  
3434     Engraves slurs.  Normally in @code{Voice}.
3435
3436   @item @code{Span_bar_engraver}@indexcode{Span_bar_engraver}  
3437     Engraves lines across multiple staffs.  Normally in
3438     @code{Staffgroup} and @code{GrandStaff}.  Removing this from
3439     @code{StaffGroup} gives the definition of @code{ChoirStaff}.
3440
3441   @item @code{Span_score_bar_engraver}@indexcode{Span_score_bar_engraver}
3442
3443   @item @code{Staff_group_bar_engraver}@indexcode{Staff_group_bar_engraver}
3444
3445   @item @code{Instrument_name_engraver}@indexcode{Instrument_name_engraver}
3446     Prints the name of the instrument (specified by
3447     @code{Staff.instrument} and @code{Staff.instr}) at the left of the
3448     staff.
3449
3450   @item @code{Staff_sym_engraver}@indexcode{Staff_sym_engraver}
3451
3452   @item @code{Stem_engraver}@indexcode{Stem_engraver}  
3453     Engraves stems.  Normally in @code{Voice}.
3454
3455   @item @code{Ties_engraver}@indexcode{Ties_engraver}  
3456     Engraves ties.  Normally in @code{Voice}.
3457
3458   @item @code{Time_signature_engraver}@indexcode{Time_signature_engraver}  
3459     Engraves the time signature.  Normally in @code{Staff} and
3460     @code{RhythmicStaff}.
3461
3462   @item @code{Timing_engraver}@indexcode{Timing_engraver}  
3463     Responsible for synchronizing timing information from staffs. 
3464     Normally in @code{Score}.  In order to create polyrhythmic music,
3465     this engraver should be removed from @code{Score} and placed in
3466     @code{Staff}.
3467
3468   @item @code{Tuplet_engraver}@indexcode{Tuplet_engraver}  
3469     Engraves tuplet brackets?  In @code{Staff}.
3470
3471   @item @code{Vertical_align_engraver}@indexcode{Vertical_align_engraver} 
3472 @end table
3473
3474
3475
3476 @node Sound output
3477 @section Sound output
3478
3479
3480
3481 The MIDI block is analogous to the paper block, but it is simpler.
3482 The @code{\midi} block can contain:
3483 @cindex MIDI block
3484
3485 @itemize @bullet
3486   @item  a @code{\tempo} definition
3487   @item  context definitions
3488 @end itemize
3489
3490 Assignments in the @code{\midi} block are not allowed.
3491
3492
3493
3494 @cindex context definition
3495
3496 Context definitions follow precisely the same syntax as within the
3497 \paper block.  Translation modules for sound are called performers.
3498 The contexts for MIDI output are defined in @file{ly/performer.ly}.
3499
3500
3501
3502 @cindex MIDI instrument names
3503
3504 @node midilist
3505 @section midilist
3506
3507 The MIDI instrument name is set by the
3508 @code{Staff.midiInstrument}@indexcode{Staff.midiInstrument} property or,
3509 if that property is not set, the
3510 @code{Staff.instrument}@indexcode{Staff.instrument} property.  The
3511 instrument name should be chosen from the following list.  If the
3512 selected string does not exactly match, then LilyPond uses the default
3513 piano.
3514
3515 @c @quotation
3516
3517 @example 
3518 "acoustic grand"            "contrabass"           "lead 7 (fifths)"
3519 "bright acoustic"           "tremolo strings"      "lead 8 (bass+lead)"
3520 "electric grand"            "pizzicato strings"    "pad 1 (new age)"
3521 "honky-tonk"                "orchestral strings"   "pad 2 (warm)"
3522 "electric piano 1"          "timpani"              "pad 3 (polysynth)"
3523 "electric piano 2"          "string ensemble 1"    "pad 4 (choir)"
3524 "harpsichord"               "string ensemble 2"    "pad 5 (bowed)"
3525 "clav"                      "synthstrings 1"       "pad 6 (metallic)"
3526 "celesta"                   "synthstrings 2"       "pad 7 (halo)"
3527 "glockenspiel"              "choir aahs"           "pad 8 (sweep)"
3528 "music box"                 "voice oohs"           "fx 1 (rain)"
3529 "vibraphone"                "synth voice"          "fx 2 (soundtrack)"
3530 "marimba"                   "orchestra hit"        "fx 3 (crystal)"
3531 "xylophone"                 "trumpet"              "fx 4 (atmosphere)"
3532 "tubular bells"             "trombone"             "fx 5 (brightness)"
3533 "dulcimer"                  "tuba"                 "fx 6 (goblins)"
3534 "drawbar organ"             "muted trumpet"        "fx 7 (echoes)"
3535 "percussive organ"          "french horn"          "fx 8 (sci-fi)"
3536 "rock organ"                "brass section"        "sitar"
3537 "church organ"              "synthbrass 1"         "banjo"
3538 "reed organ"                "synthbrass 2"         "shamisen"
3539 "accordion"                 "soprano sax"          "koto"
3540 "harmonica"                 "alto sax"             "kalimba"
3541 "concertina"                "tenor sax"            "bagpipe"
3542 "acoustic guitar (nylon)"   "baritone sax"         "fiddle"
3543 "acoustic guitar (steel)"   "oboe"                 "shanai"
3544 "electric guitar (jazz)"    "english horn"         "tinkle bell"
3545 "electric guitar (clean)"   "bassoon"              "agogo"
3546 "electric guitar (muted)"   "clarinet"             "steel drums"
3547 "overdriven guitar"         "piccolo"              "woodblock"
3548 "distorted guitar"          "flute"                "taiko drum"
3549 "guitar harmonics"          "recorder"             "melodic tom"
3550 "acoustic bass"             "pan flute"            "synth drum"
3551 "electric bass (finger)"    "blown bottle"         "reverse cymbal"
3552 "electric bass (pick)"      "skakuhachi"           "guitar fret noise"
3553 "fretless bass"             "whistle"              "breath noise"
3554 "slap bass 1"               "ocarina"              "seashore"
3555 "slap bass 2"               "lead 1 (square)"      "bird tweet"
3556 "synth bass 1"              "lead 2 (sawtooth)"    "telephone ring"
3557 "synth bass 2"              "lead 3 (calliope)"    "helicopter"
3558 "violin"                    "lead 4 (chiff)"       "applause"
3559 "viola"                     "lead 5 (charang)"     "gunshot"
3560 "cello"                     "lead 6 (voice)" 
3561 @end example 
3562
3563 @c @end quotation
3564
3565
3566 @cindex MIDI types and performers
3567
3568 The types available for  MIDI translators are:
3569
3570 @table @code
3571   @item @code{Performer_group_performer}@indexcode{Performer_group_performer}
3572   @item @code{Score_performer}@indexcode{Score_performer}
3573   @item @code{Staff_performer}@indexcode{Staff_performer}
3574 @end table
3575
3576 The performers for MIDI translators are:
3577
3578 @table @code
3579   @item @code{Key_performer}@indexcode{Key_performer}
3580   @item @code{Time_signature_performer}@indexcode{Time_signature_performer}
3581   @item @code{Note_performer}@indexcode{Note_performer}
3582   @item @code{Lyric_performer}@indexcode{Lyric_performer}
3583   @item @code{Swallow_performer}@indexcode{Swallow_performer}
3584 @end table
3585
3586
3587
3588 @node Pre-defined Identifiers
3589
3590 @section Pre-defined Identifiers
3591
3592 @cindex pre-defined identifiers
3593
3594
3595 Various identifiers are defined in the initialization files to
3596 provide shorthands for some settings.  Most of them are in
3597 @file{ly/declarations.ly}.
3598
3599 @table @code
3600   @item @code{\break}@keyindex{break}  
3601     Force a line break in music by using a large argument for the
3602     keyword @code{\penalty}.
3603
3604   @item @code{\center}@keyindex{center}  
3605     Used for setting direction  properties.  Equals 0.
3606
3607   @item @code{\down}@keyindex{down}  
3608     Used for setting direction setting properties.  Is equal
3609     to -1.
3610
3611   @item @code{\free}@keyindex{free}  
3612     Used for setting direction setting properties.  Is equal
3613     to 0.
3614
3615   @item @code{\left}@keyindex{left}  
3616     Used for setting text alignment property.  Is equal to -1.
3617
3618   @item @code{\nobreak}@keyindex{nobreak}  
3619     Prevent a line break in music by using a large negative argument
3620     for the keyword @code{\penalty}.
3621
3622   @item @code{\none}@keyindex{none}  
3623     Used for setting @code{Score.beamslopedamping} and
3624     @code{Score.beamquantisation} properties.  Is equal to 0.
3625
3626   @item @code{\normal}@keyindex{normal}  
3627     Used for setting @code{Score.beamslopedamping} and
3628     @code{Score.beamquantisation} properties.  Is equal to 1.
3629
3630   @item @code{\normalkey}@keyindex{normalkey}  
3631     Select normal key signatures where each octave has the same key
3632     signature.  This sets the @code{Staff.keyoctaviation} property.
3633
3634   @item @code{\right}@keyindex{right}  
3635     Used for setting text alignment property.  Is set to 1.
3636
3637   @item @code{\shiftoff}@keyindex{shiftoff}  
3638     Disable horizontal shifting of note heads that collide.  Sets the
3639     @code{Voice.horizontalNoteShift} property.
3640
3641   @item @code{\shifton}@keyindex{shifton}  
3642     Enable note heads that collide with other note heads to be
3643     shifted horiztonally.  Sets the @code{Voice.horizontalNoteShift}
3644     property.
3645
3646   @item @code{\slurboth}@keyindex{slurboth}  
3647     Allow slurs to be above or below notes.  This sets the
3648     @code{Voice.slurVerticalDirection} property.
3649
3650   @item @code{\slurdown}@keyindex{slurdown}  
3651     Force slurs to be below notes.  This sets the
3652     @code{Voice.slurVerticalDirection} property.
3653
3654   @item @code{\slurup}@keyindex{slurup}  
3655     Force slurs to be above notes.  This sets the
3656     @code{Voice.slurVerticalDirection} property.
3657
3658   @item @code{\specialkey}@keyindex{specialkey}  
3659     Allow key signatures do differ in different octaves.  This sets
3660     the @code{Staff.keyoctaviation} property.
3661
3662   @item @code{\stemboth}@keyindex{stemboth}  
3663     Allow stems, beams, and slurs to point either upwards or
3664     downwards, decided automatically by LilyPond.  This sets the
3665     @code{Voice.verticalDirection} property.
3666
3667   @item @code{\stemdown}@keyindex{stemdown}  
3668     Force stems, beams, and slurs to point down.  This sets the
3669     @code{Voice.verticalDirection} property.
3670
3671   @item @code{\stemup}@keyindex{stemup}  
3672     Force stems, beams and slurs to point up.  This sets the
3673     @code{Voice.verticalDirection} property.
3674
3675   @item @code{\traditional}@keyindex{traditional}  
3676     Used for setting the @code{Score.beamquantisation} property.  Is
3677     equal to 2.
3678
3679   @item @code{\up}@keyindex{up}  
3680     Used for setting various direction properties.  Is equal
3681     to 1.
3682 @end table