3 @node Reference Manual, , , Top
6 * Top level:: Top level
7 * notenames:: notenames
8 * Lexical conventions:: Lexical conventions
9 * Other languages:: notelang
12 * Music expressions:: Music expressions
13 * Atomic music expressions:: Atomic music expressions
14 * Note specification:: notedesc
16 * Manual beams:: Manual beam
18 * Compound music expressions:: Compound music expressions
21 * transpose:: transpose
22 * Ambiguities:: Ambiguities
23 * Notation conversion specifics:: Notation conversion specifics
25 * lyricprint:: lyricprint
26 * Notation Contexts:: Notation Contexts
27 * Properties:: Changing formatting
28 * Notation output definitions:: Notation output definitions
30 * Paper variables:: papervars
31 * contextdefs:: contextdefs
32 * engravers:: engravers
33 * Sound output:: Sound output
35 * Pre-defined Identifiers:: Pre-defined Identifiers
38 @chapter Reference Manual
42 @node Overview, , , Reference Manual
45 This document@footnote{This document has been revised for
46 LilyPond 1.2.} describes the the GNU LilyPond input format, which is
47 a language for defining music. We call this language @emph{Music
48 Definition Language} or @emph{Mudela}, for short.@footnote{If anybody
49 comes up with a better name, we'd gladly take this. Gourlay already
50 uses a ``Musical Description Language,'' ISO standard 10743 defines a
51 ``Standard Music Description Language.'' We're not being original
54 @emph{Mudela} is a language that allows you to
57 @item create musical expressions by combining pitches, durations
58 @item output those musical expressions to various formats
59 @item give those musical expressions and output definitions names, so
60 you can enter them in manageable chunks.
63 @emph{Mudela} aims to define a piece of music completely, both from
64 typesetting and from a performance point of view.
68 @node Top level, , , Reference Manual
73 This section describes what you may enter at top level.
77 @cindex score definition
79 The output is generated combining a music expression with an output
80 definition. A score block has the following syntax:
83 \score @{ @var{musicexpr} @var{outputdefs} @}
86 @var{outputdefs} are zero or more output definitions. If no output
87 definition is supplied, the default @code{\paper} block will be added.
98 \header @{ @var{key1} = @var{val1};
99 @var{key2} = @var{val2}; @dots{} @}
102 A header describes the file's contents. It can also appear in a
103 @code{\score} block. Tools like @code{ly2dvi}@indexcode{ly2dvi} can use this
104 information for generating titles. Key values that are used by
105 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
106 metre, arranger, piece and tagline.
108 It is customary to put the @code{\header} at the top of the file.
111 @node notenames, , , Reference Manual
113 Note name tables can be specified using
116 \notenames@keyindex{notenames}
117 @{ @var{assignmentlist} @}
120 @var{assignmentlist} is a list of definitions of the form
123 @var{name} = @var{pitch}
126 Chord modifiers can be set analogously, with
127 @code{\chordmodifiers}@keyindex{chordmodifiers}.
129 A @code{\paper} block at top level sets the default paper block. A
130 @code{\midi} block at top level works similarly.
134 LilyPond contains a Scheme interpreter (the GUILE library) for
135 internal use. The following commands access the interpreter
139 \scm @keyindex{scm} @var{scheme} ;
142 Evaluates the specified Scheme code. The result is discarded.
145 \scmfile@keyindex{scmfile} @var{filename};
148 Reads Scheme code from the specified file. The result is discarded.
152 Identifier assignments may appear at top level. Semicolons are
153 forbidden after top level assignments.
157 @node Lexical conventions, , , Reference Manual
158 @section Lexical conventions
160 @cindex lexical conventions
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.
177 Keywords start with a backslash, followed by a number of lower case
178 alphabetic characters. These are all the keywords.
239 Formed from an optional minus sign followed by digits. Arithmetic
240 operations cannot be done with integers, and integers cannot be mixed
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.
254 A real constant can be followed by one of the dimension
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.
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.
277 The tokenizer accepts the following commands. They can appear
281 \maininput@keyindex{maininput}
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.
288 \include@keyindex{include} @var{file}
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,
296 \version@keyindex{version} @var{string} ;
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.
306 @cindex other languages
308 @node Other languages, , , Reference Manual
310 Note name definitions have been provided in various languages.
311 Simply include the language specific init file. For example:
312 `@code{\include "english.ly"}'. The available language files and the
313 names they define are:
316 Note Names sharp flat
317 nederlands.ly c d e f g a bes b -is -es
318 english.ly c d e f g a bf b -s/-sharp -f/-flat
319 deutsch.ly c d e f g a b h -is -es
320 norsk.ly c d e f g a b h -iss/-is -ess/-es
321 svenska.ly c d e f g a b h -iss -ess
322 italiano.ly do re mi fa sol la sid si -d -b
323 catalan.ly do re mi fa sol la sid si -d/-s -b
326 Pitch names can be redefined using the
327 @code{\notenames}@keyindex{notenames} command, see
328 subsection XREF-notenames [FIXME].
332 @cindex lexical modes
336 @node modes, , , Reference Manual
338 To simplify entering notes, lyrics, and chords, @emph{Mudela} has three
339 special input modes on top of the default mode. In each mode, words
340 are identified on the input. If @code{"word"} is encountered, it is
341 treated as a string. If @code{\word} is encountered, it is treated as
342 a keyword or as an identifier. The behavior of the modes differs in
343 two ways: Different modes treat unquoted words differently, and
344 different modes have different rules for deciding what is a word.
350 At the start of parsing, @emph{Mudela} is in Normal mode. In Normal
351 mode, a word is an alphabetic character followed by alphanumeric
352 characters. If @code{word} is encountered on the input it is
358 Note mode is introduced by the keyword
359 @code{\notes}@keyindex{notes}. In Note mode, words can only
360 contain alphabetic characters. If @code{word} is encountered,
361 LilyPond first checks for a notename of @code{word}. If no
362 notename is found, then @code{word} is treated as a string.
364 Since combinations of numbers and dots are used for indicating
365 durations, it is not possible to enter real numbers in this mode.
370 Chord mode is introduced by the keyword
371 @code{\chords}@keyindex{chords}. It is similar to Note mode, but
372 words are also looked up in a chord modifier table (containing
373 @code{maj}, @code{dim}, etc).
375 Since combinations of numbers and dots are used for indicating
376 durations, you can not enter real numbers in this mode. Dashes
377 and carets are used to indicate chord additions and subtractions,
378 so scripts can not be entered in Chord mode.
383 Lyrics mode is introduced by the keyword
384 @code{\lyrics}@keyindex{lyrics}. This mode has rules that make it
385 easy to include punctuation and diacritical marks in words. A
386 word in Lyrics mode begins with: an alphabetic character,
387 `@code{_}', `@code{?}', `@code{!}', `@code{:}', `@code{'}', the
388 control characters @code{^A} through @code{^F}, @code{^Q} through
389 @code{^W}, @code{^Y}, @code{^^}, any 8-bit character with ASCII code
390 over 127, or a two-character combination of a backslash followed
391 by one of `@code{`}', `@code{'}', `@code{"}', or
392 `@code{^}'.@footnote{The purpose of Lyrics mode is that you can
393 enter lyrics in @TeX{} format or a standard encoding without
394 needing quotes. The precise definition of this mode indeed is
395 ludicrous. This will remain so until the authors of LilyPond
396 acquire a deeper understanding of character encoding, or someone
397 else steps up to fix this.}
399 Subsequent characters of a word can be any character that is not
400 a digit and not white space. One important consequence of this
401 is that a word can end with `@code{@}}', which may be confusing if
402 you thought the closing brace was going to terminate Lyrics
403 mode.@footnote{LilyPond will issue a warning, though.} Any
404 `@code{_}' characters which appear in an unquoted word are
405 converted to spaces. This provides a mechanism for introducing
406 spaces into words without using quotes. Quoted words can also be
407 used in Lyrics mode to specify words that cannot be written with
408 the above rules. Here are some examples. Not all of these words
409 are printable by @TeX{}.
413 2B_||_!2B % not a word because it starts with a digit
414 ``Hello'' % not a word because it starts with `
415 _ _ _ _ % 4 words, each one a space
418 Since combinations of numbers and dots are used for indicating
419 durations, you can not enter real numbers in this mode.
422 It is possible to create words that break the rules by prefixing them
423 with the dollar sign `@code{$}@indexcode{$}'. Regardless of the context, a
424 word beginning with `@code{$}' extends until the next white space
425 character. Such words can contain numbers (even in Note mode), or
426 other forbidden characters. The dollar sign can be used to create
427 and access identifiers that could not otherwise be used.@footnote{Use
428 of `@code{$}' hampers readability and portability to future LilyPond
429 versions, thus the use of the dollar sign is discouraged.}
433 @node Types, , , Reference Manual
436 @cindex types and identifiers
438 @emph{Mudela} has a limited set of types:
444 @item music expressions
445 @item durations of notes and rests (specified with
446 @code{\notenames}@keyindex{notenames})
447 @item note name tables
448 @item context definitions, part of output definitions. See
449 section XREF-contextdefs [FIXME] for more information
450 @item output definitions (like @code{\paper}@keyindex{paper} blocks
451 and @code{\midi}@keyindex{midi} blocks)
452 @item score definitions (@code{\score}@keyindex{score} blocks)
455 Type is a syntactical property: @emph{Mudela} has no real type system,
456 so there is no support for generic expressions, functions, or user
457 defined types. For the same reason, it is not possible to mix reals
458 and integers in arithmetic expressions, and ``type
461 (e.g., using a string identifier to
462 initialize a @code{\paper}@keyindex{paper} block) will yield a ``parse
465 Identifiers allow objects to be assigned to names. To assign an
466 identifier, you use `@var{name}=@var{value}' and to refer to an
467 identifier, you preceed its name with a backslash:
468 `@code{\}@var{name}'. Identifier assignments must appear at top level
469 in the @emph{Mudela} file. Semicolons are forbidden after assignments
470 appearing at top level but they are obligatory after assignments
471 appearing in the @code{\paper} block, see Section XREF-paper [FIXME].
473 @var{value} is any of the types listed above.
475 An identifier can be created with any string for its name, but you
476 will only be able to refer to identifiers whose names begin with a
477 letter, being entirely alphanumeric. It is impossible to refer to an
478 identifier whose name is the same as the name of a keyword.
480 The right hand side of an identifier assignment is parsed completely
481 before the assignment is done, so it is allowed to redefine an
482 identifier in terms of its old value, e.g.
488 When an identifier is referenced, the information it points to is
489 copied. Therefore it only makes sense to put identifiers for
490 translators, output definitions, and @code{\score}@keyindex{score}
491 blocks as the first item in a block. For this reason, if you
492 reference a @code{\foo} variable in a @code{\foo} block, it must be the
493 first item in the list following @code{\foo}.@footnote{@code{\paper@{\one
494 \two@}} does not make sense, because the information of @code{\two}
495 would overwrite the information of @code{\one}, thereby making the
496 reference to the first identifier useless.}
500 @node Music expressions, , , Reference Manual
501 @section Music expressions
503 @cindex music expressions
505 Music in @emph{Mudela} is entered as a music expression. Notes, rests,
506 lyric syllables are music expressions (the atomic
508 @cindex atomic music expressions
509 , and you can combine
510 music expressions to form new ones. This example forms a compound
511 expressions out of the quarter @code{c} note and a @code{d}
515 \sequential @{ c4 d4 @}
518 The meaning of this compound expression is to play the `@code{c}'
519 first, and then the `@code{d}' (as opposed to playing them
520 simultaneously, for instance).
522 Atomic music expression are discussed in
523 subsection XREF-atomicmusic [FIXME]. Compound music expressions are
524 discussed in subsection XREF-compoundmusic [FIXME].
528 @node Atomic music expressions, , , Reference Manual
529 @section Atomic music expressions
539 The syntax for pitch specification is
543 \musicalpitch@keyindex{musicalpitch} @{ @var{octave} @var{note} @var{shift} @}
546 @var{octave} is specified by an integer, zero for the octave
547 containing middle C. @var{note} is a number from 0 to 7, with 0
548 corresponding to C and 7 corresponding to B. The shift is zero for a
549 natural, negative to add flats, or positive to add sharps.
551 In Note and Chord mode, pitches may be designated by names. See
552 section XREF-notelang [FIXME] for pitch names in different languages.
554 The syntax for duration specification is
557 \duration@keyindex{duration}
558 @{ @var{length} @var{dotcount} @}
561 @var{length} is the negative logarithm (base 2) of the duration:
562 1 is a half note, 2 is a quarter note, 3 is an eighth
563 note, etc. The number of dots after the note is given by
566 In Note, Chord, and Lyrics mode, durations may be designated by
567 numbers and dots. See Section XREF-notelang [FIXME] for details.
570 @node Note specification, , , Reference Manual
572 @cindex note specification
576 @cindex entering notes
578 A note specification has the form
581 @var{pitch}[@var{octavespec}][!][?][@var{duration}]
584 The pitch of the note is specified by the note's name.
587 The default names are the Dutch note names. The notes are specified
588 by the letters `@code{c}' through `@code{b}', where `@code{c}' is an
589 octave below middle C and the letters span the octave above that C.
590 In Dutchcindex(notenames!Dutch), a sharp is formed by adding
591 `@code{-is}' to the end of a pitch name. A flat is formed by adding
592 `@code{-es}'. Double sharps and double flats are obtained by adding
593 `@code{-isis}' or `@code{-eses}'. `@code{aes}' and `@code{ees}' are
594 contracted to `@code{as}' and `@code{es}' in Dutch, but both forms will
597 LilyPond has predefined sets of notenames for various languages. See
598 section XREF-notelang [FIXME] for details.
601 The optional octave specification takes the form of a series of
602 single quote (`@code{'}@indexcode{'}') characters or a series of comma
603 (`@code{,}@indexcode{,}') characters. Each @code{'} raises the pitch by one
604 octave; each @code{,} lowers the pitch by an octave.
606 @mudela[fragment,verbatim,center]
607 c' d' e' f' g' a' b' c''
610 @mudela[fragment,verbatim,center]
611 cis' dis' eis' fis' gis' ais' bis'
614 @mudela[fragment,verbatim,center]
615 ces' des' es' fes' ges' as' bes'
618 @mudela[fragment,verbatim,center]
619 cisis' eisis' gisis' aisis' beses'
622 @mudela[fragment,verbatim,center]
623 ceses' eses' geses' ases' beses'
626 Whenever a C-sharp is desired, you must specify a C-sharp. LilyPond
627 will determine what accidentals to typeset depending on the key and
628 context. A reminder accidental
629 @cindex reminder accidental
631 forced by adding an exclamation mark `@code{!}' after the pitch. A
632 cautionary accidental,
633 @cindex cautionary accidental
635 accidental within parentheses can be obtained by adding the question
636 mark `@code{?}@indexcode{?}' after the pitch.
638 @mudela[fragment,verbatim,center]
639 cis' d' e' cis' c'? d' e' c'!
645 Durations are entered as their reciprocal values. For notes longer
646 than a whole note, use identifiers.
652 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
661 \notes \relative c'' {
663 a1 a2 a4 a8 a16 a32 a64 a64
668 \remove "Clef_engraver";
669 \remove "Staff_symbol_engraver";
680 r1 r2 r4 r8 r16 r32 r64 r64
689 \notes \relative c'' {
691 r1 r2 r4 r8 r16 r32 r64 r64
694 loose_column_distance = 2.5 * \interline;
697 \type "Score_engraver";
699 \consists "Rest_engraver";
700 \consists "Stem_engraver";
701 \consists "Rhythmic_column_engraver";
708 If the duration is omitted then it is set equal to the previous
709 duration. If there is no previous duration, a quarter note is
710 assumed. The duration can be followed by a dot (`@code{.}@indexcode{.}')
711 to obtain dotted note lengths.
713 @mudela[fragment,verbatim,center]
717 You can alter the length of duration by writing
718 `@code{*}@var{fraction}' after it. This will not affect the
719 appearance of note heads or rests.
722 Rests are entered like notes, with note name `@code{r}@indexcode{r}',
723 or `@code{R}@indexcode{R}'. There is also a note name `@code{s}@indexcode{s}',
724 which produces a space of the specified duration.
725 `@code{R}' is specifically meant for entering parts: the @code{R} rest
726 can expand to fill a score with rests, or it can be printed as a
727 single multimeasure rest.
730 @cindex lyrics expressions
732 Syllables are entered like notes, with pitches replaced by text. For
733 example, `@code{Twin-4 kle4 twin-4 kle4}' enters four syllables, each
734 with quarter note duration. Note that the hyphen has no special
735 meaning for lyrics, and does not introduce special symbols. See
736 section XREF-modes [FIXME] for a description of what is interpreted as
739 Spaces can be introduced into a lyric either by using quotes
740 (`@code{"}') or by using an underscore without quotes: `@code{He_could4
741 not4}'. All unquoted underscores are converted to spaces. Printing
742 lyrics is discussed in section XREF-lyricprint [FIXME].
749 \property@keyindex{property}
750 @var{contextname}.@var{propname} = @var{value}
753 Sets the @var{propname} property of the context @var{contextname} to
754 the specified @var{value}. All three arguments are strings.
755 Depending on the context, it may be necessary to quote the strings or
756 to leave space on both sides of the dot.
760 @cindex translator switches
763 \translator@keyindex{translator}
764 @var{contexttype} = @var{name}
767 A music expression indicating that the context which is a direct
768 child of the a context of type @var{contexttype} should be shifted to
769 a context of type @var{contexttype} and the specified name.
771 Usually this is used to switch staffs in Piano music, e.g.
774 \translator Staff = top @var{Music}
778 @cindex output properties
781 These allow you to tweak what is happening in the back-end
782 directly. If you want to control every detail of the output
783 formatting, this is the feature to use. The downside to this is that
784 you need to know exactly how the backend works. Example:
787 @mudela[fragment,verbatim]
789 \context Staff \outputproperty
790 #(make-type-checker 'Note_head)
791 #'extra-offset = #'(5.0 . 7.5)
795 This selects all note heads occurring at current staff level, and sets
796 the extra-offset of those heads to (5,7.5), shifting them up and
799 Use of this feature is entirely on your own risk: if you use this, the
800 result will depend very heavily on the implentation of the backend,
801 which we change unscrupulously.
808 Commands are music expressions that have no duration.
813 @code{\key}@keyindex{key} @var{pitch} @var{type} @code{;}
816 Change the key signature. @var{type} should be
817 @code{\major}@keyindex{major} or @code{\minor}@keyindex{minor} to get
818 @var{pitch}-major or @var{pitch}-minor, respectively. The second
819 argument is optional; the default is major keys. The @var{\context}
820 argument can also be given as an integer, which tells the number of
821 semitones that should be added to the pitch given in the subsequent
822 @code{\key}@keyindex{key} commands to get the corresponding major key,
823 e.g., @code{\minor}@keyindex{minor} is defined as 3. The standard
824 mode names @code{\ionian}@keyindex{ionian},
825 @code{\locrian}@keyindex{locrian}, @code{\aeolian}@keyindex{aeolian},
826 @code{\mixolydian}@keyindex{mixolydian}, @code{\lydian}@keyindex{lydian},
827 @code{\phrygian}@keyindex{phrygian}, and @code{\dorian}@keyindex{dorian}
832 @code{\keysignature}@keyindex{keysignature} @var{pitchseq} @code{;}
835 Specify an arbitrary key signature. The pitches from @var{pitch} will
836 be printed in the key signature in the order that they appear on the
841 \mark@keyindex{mark} @var{unsigned};
845 Prints a mark over or under (depending on the
846 @code{markDirection}@indexcode{markDirection} property) the staff. You must add
847 @code{Mark_engraver}@indexcode{Mark_engraver} to either the Score or Staff context for
850 @node barlines, , , Reference Manual
853 \bar@keyindex{bar} @var{bartype};
856 This is a request to print a special bar symbol. It replaces the
857 regular bar symbol with a special
858 symbol. The argument @var{bartype} is a string which specifies the
859 kind of bar to print. Options are @code{":|"}
860 @cindex "|A@@@code{:|}
863 @cindex "|B@@@code{|:}
865 @cindex "|C@@@code{:|:}
868 @cindex "|D@@@code{||}
870 @cindex "|E@@@code{|.}
873 @cindex "|F@@@code{.|}
875 @cindex "|G@@@code{.|.}
877 These produce, respectively, a right repeat, a left repeat, a double
878 repeat, a double bar, a start bar, an end bar, and a thick double
879 bar. If @var{bartype} is set to @code{"empty"} then nothing is
880 printed, but a line break is allowed at that spot.
882 You are encouraged to use @code{\repeat} for repetitions.
883 See section XREF-sec-repeats [FIXME].
890 \time@keyindex{time} @var{numerator}@code{/}@var{denominator} @code{;}
893 Change the time signature. The default time signature is 4/4.
894 The time signature is used to generate bar lines.
898 \tempo@keyindex{tempo} @var{duration} = @var{perminute} @code{;}
901 Used to specify the tempo. For example, `@code{\tempo 4 = 76;}'
902 requests output with 76 quarter notes per minute.
906 \partial@keyindex{partial} @var{duration} @code{;}
913 This creates an incomplete measure (anacrusis, upbeat) at the start of
914 the music, e.g., `@code{\partial 8*2;}' creates a starting measure
915 lasting two eighth notes.
919 @code{|}@indexcode{|}
924 @cindex shorten measures
928 `@code{|}' is a barcheck. Whenever a barcheck is encountered during
929 interpretation, a warning message is issued if it doesn't fall at a
930 measure boundary. This can help you finding errors in the input.
931 The beginning of the measure will be relocated, so this can also
932 be used to shorten measures.
937 \penalty@keyindex{penalty} @var{int} @code{;}
940 Discourage or encourage line breaks. See identifiers
941 @code{\break}@keyindex{break} and @code{\nobreak}@keyindex{nobreak} in
942 section [on identifiers] [FIXME].
946 \clef@keyindex{clef} @var{clefname} @code{;}
949 Music expression that sets the current clef. The argument is a
950 string which specifies the name of the clef. Several clef names are
951 supported. If `@code{_8}' or `@code{^8}' is added to the end of a clef
952 name, then the clef lowered or raised an octave will be generated.
953 Here are the supported clef names with middle C shown in each
962 %\property Voice.textStyle = typewriter
963 \clef subbass; c'4-"\kern -5mm subbass"
964 \clef bass; c'4^"\kern -2mm bass"
965 \clef baritone; c'4_"\kern -5mm baritone"
966 \clef varbaritone; c'4^"\kern -6mm varbaritone"
967 \clef tenor; c'4_"\kern -3mm tenor"
968 \clef "G_8"; c'4^"\kern -2mm G\\_8"
983 \clef alto; c'4_"\kern -2mm alto"
984 \clef mezzosoprano; c'4^"\kern -9mm mezzosoprano"
985 \clef soprano; c'4_"\kern -6mm soprano"
986 \clef treble; c'4^"\kern -4mm treble"
987 \clef french; c'4_"\kern -4mm french"
996 The three clef symbols can also be obtained using the names `@code{G}',
997 `@code{C}' or `@code{F}', optionally followed by an integer which
998 indicates at which note line the clef is located. An as example, the
999 @code{mezzosoprano} clef can also be given as `@code{C2}'.
1003 \skip@keyindex{skip} @var{duration} @code{;}
1006 Skips the amount of time specified by @var{duration}. If no other
1007 music is played, a gap will be left for the skipped time with no
1008 notes printed. It works in Note Mode or Lyrics Mode. In Note mode,
1009 this has the same effect as the space rest `@code{s}'.
1014 @node Manual beams, , , Reference Manual
1016 A beam is specified by surrounding the beamed notes with brackets
1017 `@code{[}@indexcode{[}' and `@code{]}@indexcode{]}'.
1019 @mudela[fragment,verbatim,center]
1020 [a'8 a'] [a'16 a' a' a']
1023 Some more elaborate constructions:
1025 @mudela[fragment,verbatim,center]
1026 [a'16 <a' c''> c'' <a' c''>]
1027 \times 2/3 { [e'8 f' g'] }
1030 Beaming can be generated automatically; see section XREF-autobeam [FIXME].
1034 To place tremolo marks
1035 @cindex tremolo beams
1036 between two notes, begin
1037 with `@code{[:}@var{length}' and end with `@code{]}'. Tremolo marks
1038 will appear instead of beams. Putting more than two notes in such a
1039 construction will produce odd effects. To create tremolo beams on a
1040 single note, simply attach `@code{:}@var{length}' to the note itself
1041 (see also section XREF-tremolo [FIXME]).
1044 @mu dela[fragment,verbatim,center]
1045 [:16 e'1 g'] [:8 e'4 f']
1048 @mud ela[fragment,verbatim,center]
1049 c'4:32 [:16 c'8 d'8]
1053 @cindex --@@@code{-}@code{-}
1061 The syntax for an extender mark is `@code{__}'. This syntax can only
1062 be used within lyrics mode. The syntax for a spanning hyphen (i.e.,
1063 a hyphen that will be printed between two lyric syllables) is
1069 A tie connects two adjacent note heads of the same pitch. When used
1070 with chords, it connects all of the note heads whose pitches match.
1071 Ties are indicated using the tilde symbol `@code{~}@indexcode{~}'.
1072 If you try to tie together chords which have no common pitches, a
1073 warning message will appear and no ties will be created.
1075 @mudela[fragment,verbatim,center]
1076 e' ~ e' <c' e' g'> ~ <c' e' g'>
1081 [TODO: explain Requests]
1084 @cindex articulations
1090 A variety of symbols can appear above and below notes to indicate
1091 different characteristics of the performance. These symbols can be
1092 added to a note with `@var{note}@code{-\}@var{name}'. Numerous symbols
1093 are defined in @file{script.ly} and @file{script.scm}. Symbols can be
1094 forced to appear above or below the note by writing
1095 `@var{note}@code{^\}@var{name}' and `@var{note}@code{_\}@var{name}'
1096 respectively. Here is a chart showing symbols above notes, with the
1097 name of the corresponding symbol appearing underneath.
1103 c''-\accent c''-\marcato c''-\staccatissimo c''-\fermata
1104 c''-\stopped c''-\staccato c''-\tenuto c''-\upbow
1105 c''-\downbow c''^\lheel c''-\rheel c''^\ltoe
1106 c''-\rtoe c''-\turn c''-\open c''-\flageolet
1107 c''-\reverseturn c''-\trill c''-\prall c''-\mordent
1108 c''-\prallprall c''-\prallmordent c''-\upprall c''-\downprall
1109 c''-\thumb c''-\segno c''-\coda
1111 \context Lyrics \lyrics {
1112 accent__ marcato__ staccatissimo__ fermata
1113 stopped__ staccato__ tenuto__ upbow
1114 downbow__ lheel__ rheel__ ltoe
1115 rtoe__ turn__ open__ flageolet
1116 reverseturn__ trill__ prall__ mordent
1117 prallprall__ prallmordent__ uprall__ downprall
1118 thumb__ segno__ coda
1122 linewidth = 5.875\in;
1129 In addition, it is possible to place arbitrary strings of text or
1130 @TeX{} above or below notes by using a string instead of an
1131 identifier: `@code{c^"text"}'. Fingerings
1134 placed by simply using digits. All of these note ornaments appear in
1135 the printed output but have no effect on the MIDI rendering of the
1138 To save typing, fingering instructions (digits 0 to 9 are
1139 supported) and single characters shorthands exist for a few
1146 \property Voice.textStyle = typewriter
1152 c''4-^_"c-\\^{ }" s4
1159 linewidth = 5.875 \in;
1166 Dynamic marks are specified by using an identifier after a note:
1167 `@code{c4-\ff}' (the dash is optional for dynamics: `@code{c4 \ff})'.
1168 The available dynamic marks are:
1169 @code{\ppp}@keyindex{ppp},
1170 @code{\pp}@keyindex{pp}, @code{\p}@keyindex{p}, @code{\mp}@keyindex{mp},
1171 @code{\mf}@keyindex{mf}, @code{\f}@keyindex{f}, @code{\ff}@keyindex{ff},
1172 @code{\fff}@keyindex{fff}, @code{\fff}@keyindex{ffff},
1173 @code{\fp}@keyindex{fp}, @code{\sf}@keyindex{sf},
1174 @code{\sff}@keyindex{sff}, @code{\sp}@keyindex{sp},
1175 @code{\spp}@keyindex{spp}, @code{\sfz}@keyindex{sfz}, and
1176 @code{\rfz}@keyindex{rfz}.
1181 \textscript@keyindex{textscript} @var{text} @var{style}
1184 Defines a text to be printed over or under a note. @var{style} is a
1185 string that may be one of @code{roman}, @code{italic}, @code{typewriter},
1186 @code{bold}, @code{Large}, @code{large}, @code{dynamic} or @code{finger}.
1188 You can attach a general textscript request using this syntax:
1193 c4-\textscript "6" "finger"
1194 c4-\textscript "foo" "normal"
1199 This is equivalent to `@code{c4-6 c4-"foo"}'.
1206 \script@keyindex{script} @var{alias}
1209 Prints a symbol above or below a note. The argument is a string
1210 which points into the script-alias table defined in @file{script.scm}.
1211 The scheme definitions specify whether the symbol follows notes into
1212 the staff, dependence of symbol placement on staff direction, and a
1213 priority for placing several symbols over one note. Usually the
1214 @code{\script}@keyindex{script} keyword is not used directly. Various
1215 helpful identifier definitions appear in @file{script.ly}.
1220 Slurs connects chords and try to avoid crossing stems. A slur is
1221 started with `@code{(}' and stopped with `@code{)}'. The
1222 starting `@code{(}' appears to the right of the first note in
1223 the slur. The terminal `@code{)}' appears to the left of the
1224 first note in the slur. This makes it possible to put a note in
1225 slurs from both sides:
1227 @mudela[fragment,verbatim,center]
1228 f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
1234 A crescendo mark is started with @code{\cr}@keyindex{cr} and terminated
1235 with @code{\rc}@keyindex{rc}. A decrescendo mark is started with
1236 @code{\decr}@keyindex{decr} and terminated with
1237 @code{\rced}@keyindex{rced}. There are also shorthands for these
1238 marks. A crescendo can be started with @code{\<}@keyindex{<} and a
1239 decrescendo can be started with @code{\>}@keyindex{>}. Either one can
1240 be terminated with @code{\!}@keyindex{"!}. Note that @code{\!}
1241 must go before the last note of the dynamic mark whereas @code{\rc}
1242 and @code{\rced} go after the last note. Because these marks are
1243 bound to notes, if you want to get several marks during one note, you
1244 must use spacer notes.
1246 @mudela[fragment,verbatim,center]
1247 c'' \< \! c'' d'' \decr e'' \rced
1248 < f''1 { s4 \< \! s2 \> \! s4 } >
1254 \spanrequest@keyindex{spanrequest} @var{startstop} @var{type}
1257 Define a spanning request. The @var{startstop} parameter is either -1
1258 (@code{\start}@keyindex{start}) or 1 (@code{\stop}@keyindex{stop}) and
1259 @var{type} is a string that describes what should be started.
1260 Supported types are @code{crescendo}, @code{decrescendo},
1261 @code{beam}, @code{slur}. This is an internal command. Users should
1262 use the shorthands which are defined in the initialization file
1265 You can attach a (general) span request to a note using
1267 @mudela[fragment,verbatim,center]
1268 c'4-\spanrequest \start "slur"
1269 c'4-\spanrequest \stop "slur"
1272 The slur syntax with parentheses is a shorthand for this.
1276 @cindex tremolo marks
1278 @node stem tremolo, , , Reference Manual
1280 Tremolo marks can be printed on a single note by adding
1281 `@code{:}[@var{length}]' after the note. The length must be at
1282 least 8. A @var{length} value of 8 gives one line across
1283 the note stem. If the length is omitted, then the last value is
1284 used, or the value of the @code{tremoloFlags}@indexcode{tremoloFlags} property if there was
1287 @mudela[verbatim,fragment,center]
1293 @node Compound music expressions, , , Reference Manual
1294 @section Compound music expressions
1296 @cindex compound music expressions
1298 Music expressions are compound data structures. You can nest music
1299 expressions any way you like. This simple example shows how three
1300 chords can be expressed in two different ways:
1302 @mudela[fragment,verbatim,center]
1303 \notes \context Staff {
1305 <a c'> <b d' > <c' e'>
1306 < { a b c' } { c' d' e' } >
1310 @cindex context selection
1311 @c @keyindex{context}
1314 \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
1317 Interpret @var{musicexpr} within a context of type @var{contexttype}.
1318 If the context does not exist, it will be created. The new context
1319 can optionally be given a name. See
1320 section XREF-contextselection [FIXME] and XREF-contextdefs [FIXME] for more
1321 information on interpretation contexts.
1329 Mode switching keywords form compound music expressions: @code{\notes}
1330 @keyindex{notes} @var{musicexpr}, @code{\chords} @keyindex{chords}
1331 @var{musicexpr}, and @code{\lyrics} @keyindex{lyrics} @var{musicexpr}.
1332 These expressions do not add anything to the meaning of their
1333 arguments. They are just a way to indicate that the arguments should
1334 be parsed in indicated mode. See section XREF-modes [FIXME] for more
1335 information on modes.
1337 More information on context selection can be found in
1338 section XREF-contextselection [FIXME].
1342 @cindex sequential music
1348 \sequential@keyindex{sequential}
1349 @code{@{} @var{musicexprlist} @code{@}}
1352 This means that list should be played or written in sequence, i.e.,
1353 the second after the first, the third after the second. The duration
1354 of sequential music is the the sum of the durations of the elements.
1355 There is a shorthand, which leaves out the keyword:
1359 @code{@{} @var{musicexprlist} @code{@}}
1364 @cindex simultaneous music
1371 \simultaneous@keyindex{simultaneous}
1372 @code{@{} @var{musicexprlist} @code{@}}
1375 It constructs a music expression where all of its arguments start at
1376 the same moment. The duration is the maximum of the durations of the
1377 elements. The following shorthand is a common idiom:
1381 @code{<} @var{musicexprlist} @code{>}
1384 If you try to use a chord as the first thing in your score, you might
1385 get multiple staffs instead of a chord.
1387 @mudela[verbatim,center]
1396 This happens because the chord is interpreted by a score context.
1397 Each time a note is encountered a default Voice context (along with a
1398 Staff context) is created. The solution is to explicitly instantiate
1401 @mudela[verbatim,center]
1403 \notes\context Voice <c''4 e''>
1412 @cindex relative pitch specification
1414 @node relative, , , Reference Manual
1416 It is easy to get confused by octave changing marks and accidentally
1417 putting a pitch in the wrong octave. A much better way of entering a
1418 note's octave is `the relative octave' mode.
1422 \relative@keyindex{relative} @var{startpitch} @var{musicexpr}
1425 The octave of notes that appear in @var{musicexpr} are calculated as
1426 follows: If no octave changing marks are used, the basic interval
1427 between this and the last note is always taken to be a fourth or
1428 less.@footnote{The interval is determined without regarding
1429 accidentals. A @code{fisis} following a @code{ceses} will be put above
1430 the @code{ceses}.} The octave changing marks `@code{'}' and `@code{,}'
1431 can then be added to raise or lower the pitch by an extra octave.
1432 Upon entering relative mode, an absolute starting pitch must be
1433 specified that will act as the predecessor of the first note of
1436 Entering scales is straightforward in relative mode.
1438 @mudela[fragment,verbatim,center]
1444 And octave changing marks are used for intervals greater than a fourth.
1446 @mudela[fragment,verbatim,center]
1448 c g c f, c' a, e'' }
1451 If the preceding item is a chord, the first note of the chord is used
1452 to determine the first note of the next chord. But other notes
1453 within the second chord are determined by looking at the immediately
1456 @mudela[fragment,verbatim,center]
1464 The pitch after the @code{\relative} contains a notename. To parse
1465 the pitch as a notename, you have to be in note mode, so there must
1466 be a surrounding @code{\notes}@keyindex{notes} keyword (which is not
1469 The relative conversion will not affect @code{\transpose} or
1470 @code{\relative} sections in its argument. If you want to use
1471 relative within transposed music, you must place an additional
1472 @code{\relative} inside the @code{\transpose}.
1474 It is strongly recommended to use relative pitch mode: less work,
1475 less error-prone, and more readable.
1479 Chord names are a way to generate simultaneous music expressions that
1480 correspond with traditional chord names. It can only be used in
1481 Chord mode (see section XREF-modes [FIXME]).
1485 @var{tonic}[@var{duration}][@code{-}@var{modifiers}][@code{^}@var{subtractions}][@code{/}@var{inversion}][@code{/+}@var{bass}].
1488 @var{tonic} should be the tonic note of the chord, and @var{duration}
1489 is the chord duration in the usual notation. There are two kinds of
1490 modifiers. One type is @emph{chord additions}, which are obtained by
1491 listing intervals separated by dots. An interval is written by its
1492 number with an optional `@code{+}' or `@code{-}' to indicate raising or
1493 lowering by half a step. Chord additions has two effects: It adds
1494 the specified interval and all lower odd numbered intervals to the
1495 chord, and it may lower or raise the specified interval. Intervals
1496 must be separated by a dot (`@code{.}').
1500 @mudela[fragment,verbatim]
1504 c:9 c:9-.5+.7+ c:3-.5- c:4.6.8
1511 The second type of modifier that may appear after the `@code{:}' is a
1512 named modifier. Named modifiers are listed in the file
1513 @file{chord-modifiers.ly}. The available modifiers are `@code{m}' and
1514 `@code{min}' which lower the 3rd half a step, `@code{aug}@indexcode{aug}' which
1515 raises the 5th, `@code{dim}@indexcode{dim}' which lowers the 5th,
1516 `@code{maj}@indexcode{maj}' which adds a raised 7th, and `@code{sus}@indexcode{sus}'
1517 which replaces the 5th with a 4th.
1521 @mudela[fragment,verbatim]
1524 c1:m c:min7 c:maj c:aug c:dim c:sus
1532 Chord subtractions are used to eliminate notes from a chord. The
1533 notes to be subtracted are listed after a `@code{^}' character,
1536 @mudela[fragment,verbatim,center]
1544 Chord inversions can be specified by appending `@code{/}@indexcode{/}' and
1545 the name of a single note to a chord. This has the effect of
1546 lowering the specified note by an octave so it becomes the lowest
1547 note in the chord. If the specified note is not in the chord, a
1548 warning will be printed.
1550 @mudela[fragment,verbatim,center]
1559 Bass notes can be added by `@code{/+}@indexcode{/+}' and
1560 the name of a single note to a chord. This has the effect of
1561 adding the specified note to the chord, lowered by an octave,
1562 so it becomes the lowest note in the chord.
1564 @mudela[fragment,verbatim,center]
1573 Throughout these examples, chords have been shifted around the staff
1574 using @code{\transpose}.
1576 You should not combine @code{\relative} with named chords.
1582 Tuplets are made out of a music expression by multiplying their
1583 duration with a fraction.
1587 \times@keyindex{times} @var{fraction} @var{musicexpr}
1590 The duration of @var{musicexpr} will be multiplied by the fraction.
1591 In print, the fraction's denominator will be printed over the notes,
1592 optionally with a bracket. The most common tuplet is the triplet in
1593 which 3 notes have the length of 2, so the notes are 2/3 of
1594 their written length:
1596 @mudela[fragment,verbatim,center]
1597 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
1606 \grace@keyindex{grace} @var{musicexpr}
1609 A grace note expression has duration 0; the next real note is
1610 assumed to be the main note.
1612 You cannot have the grace note after the main note, in terms of
1613 duration, and main notes, but you can typeset the grace notes to the
1614 right of the main note using the property
1615 @code{graceAlignPosition}@indexcode{graceAlignPosition}.
1617 When grace music is interpreted, a score-within-a-score is set up:
1618 @var{musicexpr} has its own time bookkeeping, and you could (for
1619 example) have a separate time signature within grace notes. While in
1620 this score-within-a-score, you can create notes, beams, slurs, etc.
1621 Unbeamed eighth notes and shorter by default have a slash through the
1622 stem. This behavior can be controlled with the
1623 @code{stemStyle}@indexcode{stemStyle} property.
1627 @mudela[fragment,verbatim]
1629 \grace c8 c4 \grace { [c16 c16] } c4
1630 \grace { \property Grace.stemStyle = "" c16 } c4
1636 At present, nesting @code{\grace}@keyindex{grace} notes, e.g.
1640 @code{\grace @{ \grace c32 c16 @} c4}
1643 may result in run-time errors of LilyPond. Since the meaning of such
1644 a construct is unclear, we don't consider this a loss. Similarly,
1645 juxtaposing two @code{\grace} sections is syntactically valid, but
1646 makes no sense and may cause runtime errors.
1648 Ending a staff or score with grace notes may also generate a run-time
1649 error, since there will be no main note to attach the grace notes to.
1655 @node Repeats, , , Reference Manual
1657 In order to specify repeats, use the @code{\repeat}@keyindex{repeat}
1658 keyword. Since repeats look and sound differently when played or
1659 printed, there are a few different variants of repeats.
1663 Repeated music is fully written (played) out. Useful for MIDI
1667 This is the normal notation: Repeats are not written out, but
1668 alternative endings (voltas) are printed, left to right.
1671 Alternative endings are written stacked, which is useful for
1675 The syntax for repeats is
1679 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
1682 If you have alternative endings, you may add
1686 \alternative@keyindex{alternative}
1687 @code{@{} @var{alternative1}
1689 @var{alternative3} @dots{} @code{@}}
1692 where each @var{alternative} is a Music expression.
1694 Normal notation repeats are used like this:
1698 @mudela[fragment,verbatim]
1700 \repeat volta 2 { c'4 d' e' f' }
1701 \repeat volta 2 { f' e' d' c' }
1706 With alternative endings:
1710 @mudela[fragment,verbatim]
1712 \repeat volta 2 {c'4 d' e' f'}
1713 \alternative { {d'2 d'} {f' f} }
1718 Folded repeats look like this:@footnote{Folded repeats offer little
1719 more over simultaneous music. However, it is to be expected that
1720 more functionality -- especially for the MIDI backend -- will be
1725 @mudela[fragment,verbatim]
1727 \repeat fold 2 {c'4 d' e' f'}
1728 \alternative { {d'2 d'} {f' f} }
1735 @mudela[fragment,verbatim]
1739 \repeat volta 2 { e | c2 d2 | e2 f2 | }
1740 \alternative { { g4 g g } { a | a a a a | b1 } }
1747 If you don't give enough alternatives for all of the repeats, then
1748 the first alternative is assumed to be repeated often enough to equal
1749 the specified number of repeats.
1753 @mudela[fragment,verbatim]
1756 \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1757 \alternative { { g4 g g }
1758 {\partial 1; e4 e e }
1759 {\partial 1; a a a a | b1 } }
1766 It is possible to nest @code{\repeat}. This is not entirely
1767 supported: the notes will come be in the right places, but the repeat
1772 @cindex transposition of pitches
1774 @node transpose, , , Reference Manual
1776 A music expression can be transposed with
1777 @code{\transpose}@keyindex{transpose}. The syntax is
1781 \transpose @var{pitch} @var{musicexpr}
1784 This means that middle C in @var{musicexpr} is transposed to
1787 @code{\transpose} distinguishes between enharmonic pitches: both
1788 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
1789 a tone. The first version will print sharps and the second version
1794 @mudela[fragment,verbatim]
1799 \transpose des'' { \key e; c d e f }
1800 \transpose cis'' { \key e; c d e f }
1806 If you want to use both @code{\transpose} and @code{\relative}, then
1807 you must use @code{\transpose} first. @code{\relative} will have no
1808 effect music that appears inside a @code{\transpose}.
1812 @cindex automatic lyric durations
1814 If you have lyrics that are set to a melody, you can import the
1815 rhythm of that melody into the lyrics using @code{\addlyrics}.
1816 @keyindex{addlyrics} The syntax for this is
1820 \addlyrics @var{musicexpr1 musicexpr2}
1823 This means that both @var{musicexpr1} and @var{musicexpr2} are
1824 interpreted, but that every non-command atomic music expression
1825 (``every syllable'') in @var{musicexpr2} is interpreted using timing
1826 of @var{musicexpr1}.
1828 If the property @code{automaticMelismata}@indexcode{automaticMelismata} is set in the
1829 context of @var{musicexpr1}, no lyrics will be put on slurred or tied
1834 @mudela[verbatim,fragment]
1837 \property Voice.automaticMelismata = "1"
1838 c8 () cis d8. e16 f2
1840 \context Lyrics \lyrics {
1846 You should use a single rhythm melody, and single rhythm lyrics (a
1847 constant duration is the obvious choice). If you do not, you will get
1848 undesired effects when using multiple stanzas:
1852 @mudela[verbatim,fragment]
1855 c8 () cis d8. e16 f2
1857 \context Lyrics \lyrics
1864 It is valid (but probably not very useful) to use notes instead of
1865 lyrics for @var{musicexpr2}.
1870 @node Ambiguities, , , Reference Manual
1871 @section Ambiguities
1875 The grammar contains a number of ambiguities.@footnote{The authors
1876 hope to resolve them at a later time.}
1879 @item The assignment
1885 can be interpreted as making a string identifier @code{\foo}
1886 containing @code{"bar"}, or a music identifier @code{\foo}
1887 containing the syllable `bar'.
1889 @item The assignment
1895 can be interpreted as making an integer identifier
1896 containing -6, or a Request identifier containing the
1897 fingering `6' (with neutral direction).
1899 @item If you do a nested repeat like
1911 then it is ambiguous to which @code{\repeat} the
1912 @code{\alternative} belongs. This is the classic if-then-else
1913 dilemma. It may be solved by using braces.
1915 @item (an as yet unidentified ambiguity :-)
1920 @node Notation conversion specifics, , , Reference Manual
1921 @section Notation conversion specifics
1925 @cindex automatic beam generation
1927 @node autobeam, , , Reference Manual
1929 By default, LilyPond will generate beams automatically. This feature
1930 can be disabled by setting the @code{Voice.noAutoBeaming}@indexcode{Voice.noAutoBeaming}
1931 property to 1. It can be overridden for specific cases by
1932 specifying explicit beams as described in
1933 section XREF-manualbeam [FIXME].
1935 A large number of Voice properties are used to decide how to generate
1936 beams. Their default values appear in @file{auto-beam-settings.ly}.
1937 In general, beams can begin anywhere, but their ending location is
1938 significant. Beams can end on a beat, or at durations specified by
1939 the @code{Voice.beamAutoEnd}@indexcode{Voice.beamAutoEnd} property. To end beams every
1940 quarter note, for example, you could set
1941 @code{Voice.beamAutoEnd}@indexcode{Voice.beamAutoEnd} equal to `@code{"1/4"}'. To end beams
1942 at every three eighth notes you would set it to `@code{"3/8"}'. The
1943 same syntax can be used to specify beam starting points using
1944 @code{Voice.beamAutoBegin}@indexcode{Voice.beamAutoBegin}.
1946 To allow different settings for different time signatures, these
1947 property names can start with `@code{time}@var{N}@code{_}@var{M}' to
1948 restrict the definition to `@var{N}@code{/}@var{M}' time. For example,
1949 to specify beams ending only for 6/8 time you would use the
1950 property @code{Voice.time6_8beamAutoEnd}. To allow different endings
1951 for notes of different durations, the duration can be tacked onto the
1952 end of the property. To specify beam endings for beams that contain
1953 32nd notes, you would use @code{Voice.beamAutoEnd_32}.
1961 @cindex printing!chord names
1963 For displaying printed chord names, use the @code{ChordNames}@indexcode{ChordNames}
1964 and @code{ChordNameVoice}@indexcode{ChordNameVoice} contexts. The chords may be entered
1965 either using the notation described above, or directly using
1970 @mudela[fragment,verbatim]
1972 \context ChordNames {
1973 \chords{a b c} \notes{<d f g> <e g b>}
1975 \context Staff \notes {
1983 LilyPond examines chords specified as lists of notes to determine a
1984 name to give the chord. By default, LilyPond will not try to
1985 identify chord inversions:
1987 @mudela[fragment,verbatim,center]
1989 \context ChordNameVoice \notes {
1992 \context Thread \notes {
1998 If you want inversions to be recognized, you must set the property
1999 @code{ChordNames.chordInversion}@indexcode{ChordNames.chordInversion}:
2001 @mudela[fragment,verbatim,center]
2003 \property Score.chordInversion = 1
2004 \context ChordNameVoice \notes {
2007 \context Thread \notes {
2017 @cindex printing!lyrics
2019 @node lyricprint, , , Reference Manual
2021 Lyric syllables must be interpreted within a @code{Lyrics} context
2023 @cindex context!Lyrics
2026 Here is a full example:
2033 \notes \transpose c'' {
2035 e f g2 | e4 f g2 \bar "|.";
2037 \context Lyrics \lyrics {
2038 Va-4 der Ja- cob Va- der Ja- cob
2039 Slaapt gij nog?2 Slaapt4 gij nog?2
2047 You may want a continuous line after the syllables to show melismata.
2048 To achieve this effect, add a `@code{__}' lyric as a separate word
2049 after the lyric to be extended. This will create an extender, a line
2050 that extends over the entire duration of the lyric. This line will
2051 run all the way to the start of the next lyric, so you may want to
2052 shorten it by using a blank lyric (using `@code{_}').
2059 \notes \relative c'' {
2060 a4 () b () c () d | c () d () b () a | c () d () b () a
2062 \context Lyrics \lyrics {
2063 foo1 __ | bar2. __ _4 | baz1 __
2072 If you want to have hyphens centered between syllables (rather than
2073 attached to the end of the first syllable) you can use the special
2074 `@code{-}@code{-}' lyric as a separate word between syllables. This
2075 will result in a hyphen which length varies depending on the space
2076 between syllables, and which will be centered between the syllables.
2084 \notes \transpose c'' {
2086 e f g2 | e4 f g2 \bar "|.";
2088 \context Lyrics \lyrics {
2089 Va4 -- der Ja -- cob | Va -- der Ja -- cob |
2090 Slaapt gij nog?2 | Slaapt4 gij nog?2
2100 @node Notation Contexts, , , Reference Manual
2101 @section Notation Contexts
2103 @cindex notation contexts
2105 Notation contexts are objects that only exist during a run of
2106 LilyPond. During the interpretation phase of LilyPond, the Music
2107 expression contained in a @code{\score} block is interpreted in time
2108 order. This is the order in which humans read, play, and write
2111 A context is an object that holds the reading state of the
2112 expression; it contains information like
2115 @item What notes are playing at this point?
2116 @item What symbols will be printed at this point?
2117 @item In what style will they printed?
2118 @item What is the current key signature, time signature, point within
2122 Contexts are grouped hierarchically: A @code{Voice} context is
2123 contained in a @code{Staff} context (because a staff can contain
2124 multiple voices at any point), a @code{Staff} context is contained in
2125 a @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context (because
2126 these can all contain multiple staffs).
2128 Contexts associated with sheet music output are called @emph{notation
2129 contexts}, those for sound output are called playing contexts.
2131 Contexts are created either manually or automatically. Initially,
2132 the top level music expression is interpreted by the top level
2133 context (the @code{Score} context). When a atomic music expression
2134 (i.e. a note, a rest, @code{\bar}, or @code{\time} commands), a nested
2135 set of contexts is created that can process these atomic expressions,
2141 \score @{ \notes < c4 > @}
2146 The sequential music, `@code{@{ c4 @}}' is interpreted by @code{Score}
2147 context. When the note `@code{c4}' itself is interpreted, a set of
2148 contexts is needed that will accept notes. The default for this is a
2149 @code{Voice} context, contained in a @code{Staff} context. Creation of
2150 these contexts results in the staff being printed.
2155 You can also create contexts manually, and you probably have to do so
2156 if you want to typeset complicated multiple part material. If a
2157 `@code{\context} @var{name} @var{musicexpr}' expression is encountered
2158 during the interpretation phase, the @var{musicexpr} argument will be
2159 interpreted with a context of type @var{name}. If you specify a name,
2160 the specific context with that name is searched.
2162 If a context of the specified type and name can not be found, a new
2163 one is created. For example,
2169 \notes \relative c'' {
2170 c4 <d4 \context Staff = "another" e4> f
2177 In this example, the @code{c} and @code{d} are printed on the
2178 default staff. For the @code{e}, a context Staff called
2179 `@code{another}' is specified; since that does not exist, a new
2180 context is created. Within @code{another}, a (default) Voice context
2181 is created for the @code{e4}. When all music referring to a
2182 context is finished, the context is ended as well. So after the
2183 third quarter, @code{another} is removed.
2185 Almost all music expressions inherit their interpretation context
2186 from their parent. In other words, suppose that the syntax for a
2191 \keyword @var{musicexpr1} @var{musicexpr2} @dots{}
2194 When the interpretation of this music expression starts, the context
2195 for @var{musicexpr1}, @var{musicexpr2}, etc. is that of the total
2198 Lastly, you may wonder, why this:
2204 \notes \relative c'' @{
2212 doesn't result in this:
2217 \notes \relative c'' {
2224 For the @code{c4}, a default @code{Staff} (with a contained
2225 @code{Voice}) context is created. After the @code{c4} ends, no
2226 music refers to this default staff, so it would be ended, with the
2227 result shown. To prevent this inconvenient behavior, the context to
2228 which the sequential music refers is adjusted during the
2229 interpretation. So after the @code{c4} ends, the context of the
2230 sequential music is also the default @code{Voice} context.
2231 The @code{d4} gets interpreted in the same context
2236 These are the contexts supplied with the package. They are defined
2237 in the initialization file @file{ly/engraver.ly}.
2240 @item @code{Grace}@indexcode{Grace}
2241 The context for handling grace notes. It is instantiated
2242 automatically when you use @code{\grace}. Basically, it is an
2243 `embedded' miniature of the Score context. Since this context
2244 needs special interaction with the rest of LilyPond, you should
2245 not explicitly instantiate it.
2247 @item @code{LyricVoice}@indexcode{LyricVoice}
2248 Corresponds to a voice with lyrics. Handles the printing of a
2249 single line of lyrics.
2251 @item @code{Thread}@indexcode{Thread}
2252 Handles note heads, and is contained in the Voice context. You
2253 have to instantiate this explicitly if you want to adjust the
2254 style of individual note heads.
2256 @item @code{Voice}@indexcode{Voice}
2257 Corresponds to a voice on a staff. This context handles the
2258 conversion of dynamic signs, stems, beams, super- and subscripts,
2259 slurs, ties, and rests.
2261 You have to instantiate this explicitly if you want to have
2262 multiple voices on the same staff.
2264 @item @code{ChordNamesVoice}@indexcode{ChordNamesVoice}
2265 A voice with chord names. Handles printing of a line of chord
2268 @item @code{ChordNames}@indexcode{ChordNames}
2269 Typesets chord names. Can contain @code{ChordNamesVoice}
2272 @item @code{Lyrics}@indexcode{Lyrics}
2273 Typesets lyrics. It can contain @code{LyricVoice} contexts.
2275 @item @code{Staff}@indexcode{Staff}
2276 Handles clefs, bar lines, keys, accidentals. It can contain
2277 @code{Voice} contexts.
2279 @item @code{RhythmicStaff}@indexcode{RhythmicStaff}
2280 A context like @code{Staff} but for printing rhythms. Pitches are
2281 ignored; the notes are printed on one line. It can contain
2282 @code{Voice} contexts.
2284 @item @code{GrandStaff}@indexcode{GrandStaff}
2285 Contains @code{Staff} or @code{RhythmicStaff} contexts. It adds a
2286 brace on the left side, grouping the staffs together. The bar
2287 lines of the contained staffs are connected vertically. It can
2288 contain @code{Staff} contexts.
2290 @item @code{PianoStaff}@indexcode{PianoStaff}
2291 Just like @code{GrandStaff} but with @code{minVerticalAlign} set
2292 equal to @code{maxVerticalAlign} so that interstaff beaming and
2293 slurring can be used.
2295 @item @code{StaffGroup}@indexcode{StaffGroup}
2296 Contains @code{Staff} or @code{RhythmicStaff} contexts. Adds a
2297 bracket 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}, @code{RhythmicStaff}, @code{GrandStaff}, or
2300 @code{Lyrics} contexts.
2302 @item @code{ChoirStaff}@indexcode{ChoirStaff}
2303 Identical to @code{StaffGroup} except that the contained staffs
2304 are not connected vertically.
2306 @item @code{Score}@indexcode{Score}
2307 This is the top level notation context. No other context can
2308 contain a @code{Score} context. This context handles the
2309 administration of time signatures. It also makes sure that items
2310 such as clefs, time signatures, and key-signatures are aligned
2311 across staffs. It can contain @code{Lyrics}, @code{Staff},
2312 @code{RhythmicStaff}, @code{GrandStaff}, @code{StaffGroup}, and
2313 @code{ChoirStaff} contexts.
2315 You cannot explicitly instantiate a Score context (since it is
2316 not contained in any other context). It is instantiated
2317 automatically when an output definition (a @code{\score} or
2318 @code{\paper} block) is processed.
2323 Properties that are set in one context are inherited by all of the
2324 contained contexts. This means that a property valid for the
2325 @code{Voice} context can be set in the @code{Score} context (for
2326 example) and thus take effect in all @code{Voice} contexts.
2328 Properties can be preset within the @code{\translator} block
2329 corresponding to the appropriate context. In this case, the syntax
2334 @var{propname} @code{=} @var{value}
2337 This assignment happens before interpretation starts, so a
2338 @code{\property} expression will override any predefined settings.
2340 The @code{\property} expression will create any property you specify.
2341 There is no guarantee that a property will be used. So if you spell
2342 a property name wrong, there will be no error message.
2344 The property settings are used during the interpretation phase. They
2345 are read by the LilyPond modules where interpretation contexts are
2346 built of. These modules are called @emph{translators}. Translators for
2347 notation are called @emph{engravers}, and translators for sound are
2348 called @emph{performers}.
2350 The precise result of a property is determined by the implementation
2351 of the translator that reads them. Therefore, the result of a
2352 property can vary, since it is implementation and configuration
2355 In order to fully find out what properties are used, you must
2356 currently search the source code for calls to @code{get_property}.
2357 The rest of the section is devoted to an (incomplete) overview of
2358 available properties.
2360 @mbinclude properties.itely
2362 @node Notation output definitions, , , Reference Manual
2363 @section Notation output definitions
2367 @cindex notation output
2369 @cindex output definition
2371 @node paper, , , Reference Manual
2373 The most important output definition is the @code{\paper} block, for
2374 music notation. The syntax is
2378 @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}}
2381 where each of the items is one of
2384 @item An assignment. The assignment must be terminated by a
2385 semicolon. See section XREF-papervars [FIXME] for information on
2388 @item A context definition. See section XREF-contextdefs [FIXME] for
2389 more information on context definitions.
2394 A margin shape declaration. The syntax is
2398 \shape @var{indent1}@code{,} @var{width1}@code{,}
2399 @var{indent2}@code{,} @var{width2} @dots{} @code{;}
2404 Each pair of @var{indent} and @var{width} values is a dimension
2405 specifying how far to indent and how wide to make the line.
2406 The indentation and width of successive lines are specified by
2407 the successive pairs of dimensions. The last pair of
2408 dimensions will define the characeristics of all lines beyond
2409 those explicitly specified.
2411 @item A font declaration. Its syntax is
2415 @var{fontsize} @code{=} \font@keyindex{font} @var{fontname}
2418 @var{fontsize} is an integer describing the font to be used.
2419 0 is the default font. @var{fontname} is the basename of
2420 a font (usually a member of the Feta family).
2425 @cindex changing font size and paper size
2427 The Feta font provides musical symbols at six different sizes. These
2428 fonts are 11 point, 13 point, 16 point, 20 point,
2429 23 point, and 26 point. The point size of a font is the
2430 height of the five lines in a staff when displayed in the font.
2432 Definitions for these sizes are the files @file{paperSZ.ly}, where
2433 @code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include
2434 any of these files, the identifiers @code{paper_eleven},
2435 @code{paper_thirteen}, @code{paper_sixteen}, @code{paper_twenty},
2436 @code{paper_twentythree}, and @code{paper_twentysix} are defined
2437 respectively. The default @code{\paper} block is also set.
2439 To change the paper size, you must first set the
2440 @code{papersize}@indexcode{papersize} variable at top level. Set it to the strings
2441 @code{a4}, @code{letter}, or @code{legal}. After this specification,
2442 you must set the font as described above. If you want the default
2443 font, then use the 20 point font. The new paper size will not
2444 take effect if the font is not loaded and selected afterwards. Paper
2445 size selection works by loading a file named after the paper size you
2450 @cindex paper variables
2452 @node Paper variables, , , Reference Manual
2454 There is a large number of paper variables that are used to control
2455 details of the layout. These variables control the defaults for the
2456 entire score. Usually, they do not have to be changed; they are by
2457 default set to values that depend on the font size in use. The
2458 values are used by the graphic objects while formatting the score;
2459 they are therefore implementation dependent. Most variables are
2460 accompanied by documentation in the initalization file
2461 @file{params.ly} or @file{paperSZ.ly}, where @code{SZ} is the staff
2464 Nevertheless, here are some variables you may want to use or change:
2467 @item @code{indent}@indexcode{indent}
2468 The indentation of the first line of music.
2470 @item @code{interline}@indexcode{interline}
2471 The distance between two staff lines, calculated from the center
2472 of the lines. You should use either this or @code{rulethickness}
2473 as a unit for distances you modify.
2475 @item @code{linewidth}@indexcode{linewidth}
2476 Sets the width of the lines. If set to -1.0, a single
2477 unjustified line is produced.
2479 @item @code{output}@indexcode{output}
2480 Specifies an alternate name for the the output @file{s}.
2481 A @file{.tex}, @file{.midi} or @file{.ps} extension will be
2482 added to the string you specify.
2484 @item @code{rulethickness}@indexcode{rulethickness}
2485 Determines the thickness of staff and bar lines.
2489 @node contextdefs, , , Reference Manual
2491 @cindex context definition
2493 A notation contexts is defined by the following information
2498 @item The LilyPond modules that do the actual conversion of music to
2499 notation. Each module is a so-called
2504 @item How these modules should cooperate, i.e. which ``cooperation
2505 module'' should be used. This cooperation module is a special
2508 @item What other contexts the context can contain,
2510 @item What properties are defined.
2513 A context definition has this syntax:
2517 \translator @code{@{}
2518 @var{translatorinit} @var{translatormodifierlist}
2522 @var{translatorinit} can be an identifier or of the form
2526 \type @var{typename} @code{;}
2529 @var{typename} is one of
2532 @item @code{Engraver_group_engraver}@indexcode{Engraver_group_engraver}
2533 The standard cooperation engraver.
2535 @item @code{Score_engraver}@indexcode{Score_engraver}
2536 This is cooperation module that should be in the top level context.
2538 @item @code{Grace_engraver_group}@indexcode{Grace_engraver_group}
2539 This is a special cooperation module (resembling
2540 @code{Score_engraver}) that is used to created an embedded
2544 @var{translatormodifierlist} is a list of items where each item is
2548 @item @code{\consists} @var{engravername} @code{;}
2549 Add @var{engravername} to the list of modules in this context.
2550 Section XREF-engravers [FIXME] contains an overview of the engravers
2551 available. The order of engravers added with @code{\consists} is
2554 @item @code{\consistsend} @var{engravername} @code{;}
2555 Analogous to @code{\consists}, but makes sure that
2556 @var{engravername} is always added to the end of the list of
2559 Some engraver types need to be at the end of the list; this
2560 insures they are put there, and stay there, if a user adds or
2561 removes engravers. This command is usually not needed for
2564 @item @code{\accepts} @var{contextname} @code{;}
2565 Add @var{contextname} to the list of context this context can
2566 contain. The first listed context the context to create by
2569 @item @code{\remove} @var{engravername} @code{;}
2570 Remove a previously added (with @code{\consists}) engraver.
2572 @item @code{\name} @var{contextname} @code{;}
2573 This sets name of the context, e.g. @code{Staff}, @code{Voice}. If
2574 the name is not specified, the translator won't do anything.
2576 @item @var{propname} @code{=} @var{value} @code{;}
2577 A property assignment. It is allowed to use reals for
2581 In the @code{\paper} block, it is also possible to define translator
2582 identifiers. Like other block identifiers, the identifier can only
2583 be used as the very first item of a translator. In order to define
2584 such an identifier outside of @code{\score}, you must do
2590 foo = \translator @{ @dots{} @}
2597 \translator @{ \foo @dots{} @}
2605 @cindex paper types, engravers, and pre-defined translators
2607 Some pre-defined identifiers can simplify modification of
2608 translators. The pre-defined identifiers are:
2611 @item @code{StaffContext}@indexcode{StaffContext}
2612 Default Staff context.
2614 @item @code{RhythmicStaffContext}@indexcode{RhythmicStaffContext}
2615 Default RhythmicStaff context.
2617 @item @code{VoiceContext}@indexcode{VoiceContext}
2618 Default Voice context.
2620 @item @code{ScoreContext}@indexcode{ScoreContext}
2621 Default Score context.
2623 @item @code{ScoreWithNumbers}@indexcode{ScoreWithNumbers}
2624 Score context with numbering at the Score level.
2626 @item @code{BarNumberingStaffContext}@indexcode{BarNumberingStaffContext}
2627 Staff context with numbering at the Staff level.
2629 @item @code{HaraKiriStaffContext}@indexcode{HaraKiriStaffContext}
2630 Staff context that does not print if it only contains rests.
2631 Useful for orchestral scores.@footnote{Harakiri, also called
2632 Seppuku, is the ritual suicide of the Samourai.}
2634 @item @code{OrchestralPartStaffContext}@indexcode{OrchestralPartStaffContext}
2636 @item @code{OrchestralScoreContext}@indexcode{OrchestralScoreContext}
2639 Using these pre-defined values, you can remove or add items to the
2648 \remove Some_engraver;
2649 \consists Different_engraver;
2658 @node engravers, , , Reference Manual
2660 The engravers for paper output are:
2665 @item @code{Bar_engraver}@indexcode{Bar_engraver}
2666 Engraves bar lines. Normally in @code{Staff} and
2667 @code{RhythmicStaff}.
2669 @item @code{Bar_number_engraver}@indexcode{Bar_number_engraver}
2670 Engrave bar numbers. These numbers appear at the start of each
2671 line. Not normally in any translator. Can be added to
2672 @code{Score} for score-wide numbering or to @code{Staff} for
2673 numbering on each staff.
2675 @item @code{Beam_engraver}@indexcode{Beam_engraver}
2676 Handles beam requests by engraving beams. Normally appears in
2677 the @code{Voice} translator. If omitted, then notes will be
2678 printed with flags instead of beams.
2680 @item @code{Beam_req_swallow_translator}
2681 @indexcode{Beam_req_swallow_translator}
2682 Swallows beam requests. In @code{LyricVoice}.
2684 @item @code{Chord_name_engraver}@indexcode{Chord_name_engraver}
2685 Engraves chord names. Normally in @code{ChordNameVoice} .
2687 @item @code{Chord_tremolo_engraver}@indexcode{Chord_tremolo_engraver}
2689 @item @code{Clef_engraver}@indexcode{Clef_engraver}
2690 Engraves the clef symbol. Normally in @code{Staff}.
2692 @item @code{Collision_engraver}@indexcode{Collision_engraver}
2694 @item @code{Dot_column_engraver}@indexcode{Dot_column_engraver}
2695 Engraves dots on dotted notes shifted to the right of the note.
2696 Normally in @code{Voice}. If omitted, then dots appear on top of
2699 @item @code{Dynamic_engraver}@indexcode{Dynamic_engraver}
2700 Engraves dynamics symbols. Normally in @code{Voice}.
2702 @item @code{Font_size_engraver}@indexcode{Font_size_engraver}
2704 @item @code{Key_engraver}@indexcode{Key_engraver}
2705 Engraves the key signature. Normally in @code{Staff}.
2707 @item @code{Local_key_engraver}@indexcode{Local_key_engraver}
2709 @item @code{Lyric_engraver}@indexcode{Lyric_engraver}
2710 Engraves lyrics. Normally in @code{LyricVoice}.
2712 @item @code{Multi_measure_rest_engraver}
2713 @indexcode{Multi_measure_rest_engraver}
2714 Engraves multi-measure rests that are produced with @code{R}.
2715 Normally in @code{Voice}.
2717 @item @code{Piano_bar_engraver}@indexcode{Piano_bar_engraver}
2719 @item @code{Pitch_squash_engraver}@indexcode{Pitch_squash_engraver}
2720 Treat all pitches as middle C. Used in @code{RhythmicStaff}.
2721 Note that the notes move, but the locations of accidentals stay
2724 @item @code{Priority_horizontal_align_engraver}
2725 @indexcode{Priority_horizontal_align_engraver}
2727 @item @code{Repeat_engraver}@indexcode{Repeat_engraver}
2728 Handles repeats? In @code{Staff} and @code{RhythmicStaff}.
2730 @item @code{Rest_collision_engraver}@indexcode{Rest_collision_engraver}
2731 Handles collisions of rests. In @code{Staff}.
2733 @item @code{Rest_engraver}@indexcode{Rest_engraver}
2734 Engraves rests. Normally in @code{Voice}.
2736 @item @code{Rhythmic_column_engraver}@indexcode{Rhythmic_column_engraver}
2738 @item @code{Score_priority_engraver}@indexcode{Score_priority_engraver}
2740 @item @code{Script_engraver}@indexcode{Script_engraver}
2741 Handles note ornaments generated by @code{\script}. Normally in
2744 @item @code{Separating_line_group_engraver}
2745 @indexcode{Separating_line_group_engraver}
2747 @item @code{Skip_req_swallow_translator}
2748 @indexcode{Skip_req_swallow_translator}
2750 @item @code{Slur_engraver}@indexcode{Slur_engraver}
2751 Engraves slurs. Normally in @code{Voice}.
2753 @item @code{Span_bar_engraver}@indexcode{Span_bar_engraver}
2754 Engraves lines across multiple staffs. Normally in
2755 @code{Staffgroup} and @code{GrandStaff}. Removing this from
2756 @code{StaffGroup} gives the definition of @code{ChoirStaff}.
2758 @item @code{Span_score_bar_engraver}@indexcode{Span_score_bar_engraver}
2760 @item @code{Staff_group_bar_engraver}@indexcode{Staff_group_bar_engraver}
2762 @item @code{Staff_margin_engraver}@indexcode{Staff_margin_engraver}
2763 Prints the name of the instrument (specified by
2764 @code{Staff.instrument} and @code{Staff.instr}) at the left of the
2767 @item @code{Staff_sym_engraver}@indexcode{Staff_sym_engraver}
2769 @item @code{Stem_engraver}@indexcode{Stem_engraver}
2770 Engraves stems. Normally in @code{Voice}.
2772 @item @code{Ties_engraver}@indexcode{Ties_engraver}
2773 Engraves ties. Normally in @code{Voice}.
2775 @item @code{Time_signature_engraver}@indexcode{Time_signature_engraver}
2776 Engraves the time signature. Normally in @code{Staff} and
2777 @code{RhythmicStaff}.
2779 @item @code{Timing_engraver}@indexcode{Timing_engraver}
2780 Responsible for synchronizing timing information from staffs.
2781 Normally in @code{Score}. In order to create polyrhythmic music,
2782 this engraver should be removed from @code{Score} and placed in
2785 @item @code{Tuplet_engraver}@indexcode{Tuplet_engraver}
2786 Engraves tuplet brackets? In @code{Staff}.
2788 @item @code{Vertical_align_engraver}@indexcode{Vertical_align_engraver}
2793 @node Sound output, , , Reference Manual
2794 @section Sound output
2798 The MIDI block is analogous to the paper block, but it is simpler.
2799 The @code{\midi} block can contain:
2803 @item a @code{\tempo} definition
2804 @item context definitions
2807 Assignments in the @code{\midi} block are not allowed.
2811 @cindex context definition
2813 Context definitions follow precisely the same syntax as within the
2814 \paper block. Translation modules for sound are called performers.
2815 The contexts for MIDI output are defined in @file{ly/performer.ly}.
2819 @cindex MIDI instrument names
2821 @node midilist, , , Reference Manual
2823 The MIDI instrument name is set by the
2824 @code{Staff.midiInstrument}@indexcode{Staff.midiInstrument} property or,
2825 if that property is not set, the
2826 @code{Staff.instrument}@indexcode{Staff.instrument} property. The
2827 instrument name should be chosen from the following list. If the
2828 selected string does not exactly match, then LilyPond uses the default
2834 "acoustic grand" "contrabass" "lead 7 (fifths)"
2835 "bright acoustic" "tremolo strings" "lead 8 (bass+lead)"
2836 "electric grand" "pizzicato strings" "pad 1 (new age)"
2837 "honky-tonk" "orchestral strings" "pad 2 (warm)"
2838 "electric piano 1" "timpani" "pad 3 (polysynth)"
2839 "electric piano 2" "string ensemble 1" "pad 4 (choir)"
2840 "harpsichord" "string ensemble 2" "pad 5 (bowed)"
2841 "clav" "synthstrings 1" "pad 6 (metallic)"
2842 "celesta" "synthstrings 2" "pad 7 (halo)"
2843 "glockenspiel" "choir aahs" "pad 8 (sweep)"
2844 "music box" "voice oohs" "fx 1 (rain)"
2845 "vibraphone" "synth voice" "fx 2 (soundtrack)"
2846 "marimba" "orchestra hit" "fx 3 (crystal)"
2847 "xylophone" "trumpet" "fx 4 (atmosphere)"
2848 "tubular bells" "trombone" "fx 5 (brightness)"
2849 "dulcimer" "tuba" "fx 6 (goblins)"
2850 "drawbar organ" "muted trumpet" "fx 7 (echoes)"
2851 "percussive organ" "french horn" "fx 8 (sci-fi)"
2852 "rock organ" "brass section" "sitar"
2853 "church organ" "synthbrass 1" "banjo"
2854 "reed organ" "synthbrass 2" "shamisen"
2855 "accordion" "soprano sax" "koto"
2856 "harmonica" "alto sax" "kalimba"
2857 "concertina" "tenor sax" "bagpipe"
2858 "acoustic guitar (nylon)" "baritone sax" "fiddle"
2859 "acoustic guitar (steel)" "oboe" "shanai"
2860 "electric guitar (jazz)" "english horn" "tinkle bell"
2861 "electric guitar (clean)" "bassoon" "agogo"
2862 "electric guitar (muted)" "clarinet" "steel drums"
2863 "overdriven guitar" "piccolo" "woodblock"
2864 "distorted guitar" "flute" "taiko drum"
2865 "guitar harmonics" "recorder" "melodic tom"
2866 "acoustic bass" "pan flute" "synth drum"
2867 "electric bass (finger)" "blown bottle" "reverse cymbal"
2868 "electric bass (pick)" "skakuhachi" "guitar fret noise"
2869 "fretless bass" "whistle" "breath noise"
2870 "slap bass 1" "ocarina" "seashore"
2871 "slap bass 2" "lead 1 (square)" "bird tweet"
2872 "synth bass 1" "lead 2 (sawtooth)" "telephone ring"
2873 "synth bass 2" "lead 3 (calliope)" "helicopter"
2874 "violin" "lead 4 (chiff)" "applause"
2875 "viola" "lead 5 (charang)" "gunshot"
2876 "cello" "lead 6 (voice)"
2882 @cindex MIDI types and performers
2884 The types available for MIDI translators are:
2887 @item @code{Performer_group_performer}@indexcode{Performer_group_performer}
2888 @item @code{Score_performer}@indexcode{Score_performer}
2889 @item @code{Staff_performer}@indexcode{Staff_performer}
2892 The performers for MIDI translators are:
2895 @item @code{Key_performer}@indexcode{Key_performer}
2896 @item @code{Time_signature_performer}@indexcode{Time_signature_performer}
2897 @item @code{Note_performer}@indexcode{Note_performer}
2898 @item @code{Lyric_performer}@indexcode{Lyric_performer}
2899 @item @code{Swallow_performer}@indexcode{Swallow_performer}
2904 @node Pre-defined Identifiers, , , Reference Manual
2906 @section Pre-defined Identifiers
2908 @cindex pre-defined identifiers
2911 Various identifiers are defined in the initialization files to
2912 provide shorthands for some settings. Most of them are in
2913 @file{ly/declarations.ly}.
2916 @item @code{\break}@keyindex{break}
2917 Force a line break in music by using a large argument for the
2918 keyword @code{\penalty}.
2920 @item @code{\center}@keyindex{center}
2921 Used for setting direction properties. Equals 0.
2923 @item @code{\down}@keyindex{down}
2924 Used for setting direction setting properties. Is equal
2927 @item @code{\free}@keyindex{free}
2928 Used for setting direction setting properties. Is equal
2931 @item @code{\left}@keyindex{left}
2932 Used for setting text alignment property. Is equal to -1.
2934 @item @code{\nobreak}@keyindex{nobreak}
2935 Prevent a line break in music by using a large negative argument
2936 for the keyword @code{\penalty}.
2938 @item @code{\none}@keyindex{none}
2939 Used for setting @code{Score.beamslopedamping} and
2940 @code{Score.beamquantisation} properties. Is equal to 0.
2942 @item @code{\normal}@keyindex{normal}
2943 Used for setting @code{Score.beamslopedamping} and
2944 @code{Score.beamquantisation} properties. Is equal to 1.
2946 @item @code{\normalkey}@keyindex{normalkey}
2947 Select normal key signatures where each octave has the same key
2948 signature. This sets the @code{Staff.keyoctaviation} property.
2950 @item @code{\right}@keyindex{right}
2951 Used for setting text alignment property. Is set to 1.
2953 @item @code{\shiftoff}@keyindex{shiftoff}
2954 Disable horizontal shifting of note heads that collide. Sets the
2955 @code{Voice.horizontalNoteShift} property.
2957 @item @code{\shifton}@keyindex{shifton}
2958 Enable note heads that collide with other note heads to be
2959 shifted horiztonally. Sets the @code{Voice.horizontalNoteShift}
2962 @item @code{\slurboth}@keyindex{slurboth}
2963 Allow slurs to be above or below notes. This sets the
2964 @code{Voice.slurVerticalDirection} property.
2966 @item @code{\slurdown}@keyindex{slurdown}
2967 Force slurs to be below notes. This sets the
2968 @code{Voice.slurVerticalDirection} property.
2970 @item @code{\slurup}@keyindex{slurup}
2971 Force slurs to be above notes. This sets the
2972 @code{Voice.slurVerticalDirection} property.
2974 @item @code{\specialkey}@keyindex{specialkey}
2975 Allow key signatures do differ in different octaves. This sets
2976 the @code{Staff.keyoctaviation} property.
2978 @item @code{\stemboth}@keyindex{stemboth}
2979 Allow stems, beams, and slurs to point either upwards or
2980 downwards, decided automatically by LilyPond. This sets the
2981 @code{Voice.verticalDirection} property.
2983 @item @code{\stemdown}@keyindex{stemdown}
2984 Force stems, beams, and slurs to point down. This sets the
2985 @code{Voice.verticalDirection} property.
2987 @item @code{\stemup}@keyindex{stemup}
2988 Force stems, beams and slurs to point up. This sets the
2989 @code{Voice.verticalDirection} property.
2991 @item @code{\traditional}@keyindex{traditional}
2992 Used for setting the @code{Score.beamquantisation} property. Is
2995 @item @code{\up}@keyindex{up}
2996 Used for setting various direction properties. Is equal