1 mailto(gnu-music-discuss@gnu.org)
5 whenlatex(latexcommand({\normalfont\scshape )ARG1+latexcommand(}))\
9 def(indexcode)(1)(cindex(ARG1@code(ARG1)))
10 def(indexandcode)(1)(code(ARG1)indexcode(ARG1))
11 def(keyindex)(1)(cindex(ARG1@code(\ARG1)))
13 redef(code)(1)(tt(ARG1))
15 whenlatex(latexcommand(\index{)ARG1+latexcommand(}))\
16 whentexinfo(XXnl()texinfocommand(@cindex )ARG1XXnl())\
23 restStyle=mensural doesn't seem to work (lots of characters not found
29 Music expression / music expression
30 property lists should be alphabetic.
36 This document contains Mudela fragments. You need at least
37 Yodl-1.30.18 to convert this to tex or html.
40 htmlbodyopt(bgcolor)(white)
41 htmlcommand(<font color=black>)
44 \setlength{\topmargin}{-0.25in}
45 \setlength{\textheight}{9in}
46 \setlength{\textwidth}{5.875in}
47 \setlength{\oddsidemargin}{0.25in}
48 \setlength{\evensidemargin}{0.25in}
54 whentexinfo(notableofcontents())
57 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
58 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
59 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
61 article(LilyPond 1.2.0 Reference Manual)
62 (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen)
63 (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop())
66 latexcommand(\def\interexample{})
67 latexcommand(\def\preexample{\par})
68 latexcommand(\def\postexample{\par\medskip})
69 latexcommand(\def\file#1{{code(#1)}})
71 latexcommand(\def\texttt#1{\tt #1})
72 latexcommand(\def\textbf#1{\bf #1})
75 COMMENT(urg, texinfo include breaks)
76 whenhtml(includefile(html-disclaimer.yo-urg))
79 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
80 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
84 This nop(document)footnote(This document has been revised for
85 LilyPond 1.2.) describes the the GNU LilyPond input format, which is
86 a language for defining music. We call this language em(Music
87 Definition Language) or em(Mudela), for short.footnote(If anybody
88 comes up with a better name, we'd gladly take this. Gourlay already
89 uses a ``Musical Description Language,'' ISO standard 10743 defines a
90 ``Standard Music Description Language.'' We're not being original
93 em(Mudela) is a language that allows you to
96 it() create musical expressions by combining pitches, durations
97 it() output those musical expressions to various formats
98 it() give those musical expressions and output definitions names, so
99 you can enter them in manageable chunks.
102 em(Mudela) aims to define a piece of music completely, both from
103 typesetting and from a performance point of view.
106 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
107 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
112 This section describes what you may enter at top level.
114 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
116 subsect(Score definitions)
117 cindex(score definition)
119 The output is generated combining a music expression with an output
120 definition. A score block has the following syntax:
123 code(\score {) var(musicexpr) var(outputdefs) code(})
126 var(outputdefs) are zero or more output definitions. If no output
127 definition is supplied, the default code(\paper) block will be added.
129 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
131 subsect(Information header)
138 code(\header) code({) var(key1) = var(val1);
139 var(key2) = var(val2); ellipsis() code(})
142 A header describes the file's contents. It can also appear in a
143 code(\score) block. Tools like indexandcode(ly2dvi) can use this
144 information for generating titles. Key values that are used by
145 code(ly2dvi) are: title, subtitle, composer, opus, poet, instrument,
146 metre, arranger, piece and tagline.
148 It is customary to put the code(\header) at the top of the file.
150 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
152 subsect(Setting notenames and chordnames)
155 Note name tables can be specified using
158 code(\notenames)keyindex(notenames)
159 code({) var(assignmentlist) code(})
162 var(assignmentlist) is a list of definitions of the form
165 var(name) = var(pitch)
168 Chord modifiers can be set analogously, with
169 code(\chordmodifiers)keyindex(chordmodifiers).
171 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
173 subsect(Output definitions)
175 A code(\paper) block at top level sets the default paper block. A
176 code(\midi) block at top level works similarly.
178 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
180 subsect(GUILE and Scheme)
182 LilyPond contains a Scheme interpreter (the GUILE library) for
183 internal use. The following commands access the interpreter
187 code(\scm)keyindex(scm) var(scheme) code(;)
190 Evaluates the specified Scheme code. The result is discarded.
193 code(\scmfile)keyindex(scmfile) var(filename) code(;)
196 Reads Scheme code from the specified file. The result is discarded.
199 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
203 Identifier assignments may appear at top level. Semicolons are
204 forbidden after top level assignments.
207 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
208 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
210 sect(Lexical conventions)
211 cindex(lexical conventions)
213 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
218 whenlatex(cindex(%A@latexcommand(\texttt{\%\textbraceleft})))
219 whenlatex(cindex(%B@latexcommand(\texttt{\%\textbraceright})))
221 A one line comment is introduced by a `code(%)' character.
222 Block comments are started by `code(%{)' and ended by `code(%})'.
223 They cannot be nested.
225 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
230 Keywords start with a backslash, followed by a number of lower case
231 alphabetic characters. These are all the keywords.
233 latexcommand(\begin{raggedright})
241 code(\chordmodifiers)
289 latexcommand(\end{raggedright})
291 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
296 Formed from an optional minus sign followed by digits. Arithmetic
297 operations cannot be done with integers, and integers cannot be mixed
300 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
305 Formed from an optional minus sign and a sequence of digits followed
306 by a em(required) decimal point and an optional exponent such as
307 code(-1.2e3). Reals can be built up using the usual operations:
308 `indexandcode(+)', `indexandcode(-)', `indexandcode(*)', and
309 `indexandcode(/)', with parentheses for grouping.
311 A real constant can be followed by one of the dimension
312 keywords:cindex(dimensions) code(\mm)keyindex(mm),
313 code(\pt)keyindex(pt), code(\in)keyindex(in), or
314 code(\cm)keyindex(cm), for millimeters, points, inches and
315 centimeters, respectively. This converts the number to a real that
316 is the internal representation of dimensions.
318 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
323 Begins and ends with the `code(")' character. To include a `code(")'
324 character in a string write `code(\")'. Various other backslash
325 sequences have special interpretations as in the C language. A
326 string that contains no spaces can be written without the quotes.
327 See bind(section)ref(modes) for details on unquoted strings; their
328 interpretation varies depending on the situation. Strings can be
329 concatenated with the `code(+)' operator.
331 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
333 subsect(Tokenizer commands)
335 The tokenizer accepts the following commands. They can appear
339 code(\maininput)keyindex(maininput)
342 This command is used in init files to signal that the user file must
343 be read. This command cannot be used in a user file.
346 code(\include)keyindex(include) var(file)
349 Include var(file). The argument var(file) may be a quoted string (an
350 unquoted string will not work here!) or a string identifier. The full
351 filename including the file(.ly) extension must be given,
354 code(\version)keyindex(version) var(string) code(;)
357 Specify the version of LilyPond that a file was written for. The
358 argument is a version string in quotes, for example code("1.2.0").
359 This is used to detect invalid input, and to aid
360 code(convert-mudela), a tool that automatically upgrades input files.
362 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
364 subsect(Pitch Names in Other Languages)
365 cindex(other languages)
368 Note name definitions have been provided in various languages.
369 Simply include the language specific init file. For example:
370 `code(\include "english.ly")'. The available language files and the
371 names they define are:
374 verb( Note Names sharp flat
376 nederlands.ly c d e f g a bes b -is -es
377 english.ly c d e f g a bf b -s/-sharp -f/-flat
378 deutsch.ly c d e f g a b h -is -es
379 norsk.ly c d e f g a b h -iss/-is -ess/-es
380 svenska.ly c d e f g a b h -iss -ess
381 italiano.ly do re mi fa sol la sid si -d -b
382 catalan.ly do re mi fa sol la sid si -d/-s -b)
385 Pitch names can be redefined using the
386 code(\notenames)keyindex(notenames) command, see
387 bind(subsection)ref(notenames).
389 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
391 subsect(Lexical modes)
392 cindex(lexical modes)
396 To simplify entering notes, lyrics, and chords, em(Mudela) has three
397 special input modes on top of the default mode. In each mode, words
398 are identified on the input. If code("word") is encountered, it is
399 treated as a string. If code(\word) is encountered, it is treated as
400 a keyword or as an identifier. The behavior of the modes differs in
401 two ways: Different modes treat unquoted words differently, and
402 different modes have different rules for deciding what is a word.
405 dit(Normal mode.)cindex(mode!normal)
406 At the start of parsing, em(Mudela) is in Normal mode. In Normal
407 mode, a word is an alphabetic character followed by alphanumeric
408 characters. If code(word) is encountered on the input it is
411 dit(Note mode.)cindex(mode!note)
413 Note mode is introduced by the keyword
414 code(\notes)keyindex(notes). In Note mode, words can only
415 contain alphabetic characters. If code(word) is encountered,
416 LilyPond first checks for a notename of code(word). If no
417 notename is found, then code(word) is treated as a string.
419 Since combinations of numbers and dots are used for indicating
420 durations, it is not possible to enter real numbers in this mode.
422 dit(Chord mode.)cindex(mode!chord)
423 Chord mode is introduced by the keyword
424 code(\chords)keyindex(chords). It is similar to Note mode, but
425 words are also looked up in a chord modifier table (containing
426 code(maj), code(dim), etc).
428 Since combinations of numbers and dots are used for indicating
429 durations, you can not enter real numbers in this mode. Dashes
430 and carets are used to indicate chord additions and subtractions,
431 so scripts can not be entered in Chord mode.
433 dit(Lyrics mode.) cindex(mode!lyric)
435 Lyrics mode is introduced by the keyword
436 code(\lyrics)keyindex(lyrics). This mode has rules that make it
437 easy to include punctuation and diacritical marks in words. A
438 word in Lyrics mode begins with: an alphabetic character,
439 `code(_)', `code(?)', `code(!)', `code(:)', `code(')', the
440 control characters code(^A) through code(^F), code(^Q) through
441 code(^W), code(^Y), code(^^), any 8-bit character with ASCII code
442 over 127, or a two-character combination of a backslash followed
443 by one of `code(`)', `code(')', `code(")', or
444 `code(^)'.footnote(The purpose of Lyrics mode is that you can
445 enter lyrics in TeX() format or a standard encoding without
446 needing quotes. The precise definition of this mode indeed is
447 ludicrous. This will remain so until the authors of LilyPond
448 acquire a deeper understanding of character encoding, or someone
449 else steps up to fix this.)
451 Subsequent characters of a word can be any character that is not
452 a digit and not white space. One important consequence of this
453 is that a word can end with `code(})', which may be confusing if
454 you thought the closing brace was going to terminate Lyrics
455 mode.footnote(LilyPond will issue a warning, though.) Any
456 `code(_)' characters which appear in an unquoted word are
457 converted to spaces. This provides a mechanism for introducing
458 spaces into words without using quotes. Quoted words can also be
459 used in Lyrics mode to specify words that cannot be written with
460 the above rules. Here are some examples. Not all of these words
461 are printable by TeX().
464 DOEXPAND(muckslash)^etre % a word
469 2B_||_!2B % not a word because it starts with a digit
470 ``Hello'' % not a word because it starts with `
471 _ _ _ _ % 4 words, each one a space)
474 Since combinations of numbers and dots are used for indicating
475 durations, you can not enter real numbers in this mode.
478 It is possible to create words that break the rules by prefixing them
479 with the dollar sign `indexandcode($)'. Regardless of the context, a
480 word beginning with `code($)' extends until the next white space
481 character. Such words can contain numbers (even in Note mode), or
482 other forbidden characters. The dollar sign can be used to create
483 and access identifiers that could not otherwise be used.footnote(Use
484 of `code($)' hampers readability and portability to future LilyPond
485 versions, thus the use of the dollar sign is discouraged.)
488 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
489 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
492 cindex(types and identifiers)
494 em(Mudela) has a limited set of types:
500 it() music expressions
501 it() durations of notes and rests (specified with
502 code(\notenames)keyindex(notenames))
503 it() note name tables
504 it() context definitions, part of output definitions. See
505 bind(section)ref(contextdefs) for more information
506 it() output definitions (like code(\paper)keyindex(paper) blocks
507 and code(\midi)keyindex(midi) blocks)
508 it() score definitions (code(\score)keyindex(score) blocks)
511 Type is a syntactical property: em(Mudela) has no real type system,
512 so there is no support for generic expressions, functions, or user
513 defined types. For the same reason, it is not possible to mix reals
514 and integers in arithmetic expressions, and ``type
515 errors''cindex(type error) (e.g., using a string identifier to
516 initialize a code(\paper)keyindex(paper) block) will yield a ``parse
519 Identifiers allow objects to be assigned to names. To assign an
520 identifier, you use `var(name)=var(value)' and to refer to an
521 identifier, you preceed its name with a backslash:
522 `code(\)var(name)'. Identifier assignments must appear at top level
523 in the em(Mudela) file. Semicolons are forbidden after assignments
524 appearing at top level but they are obligatory after assignments
525 appearing in the code(\paper) block, see bind(Section)ref(paper).
527 var(value) is any of the types listed above.
529 An identifier can be created with any string for its name, but you
530 will only be able to refer to identifiers whose names begin with a
531 letter, being entirely alphanumeric. It is impossible to refer to an
532 identifier whose name is the same as the name of a keyword.
534 The right hand side of an identifier assignment is parsed completely
535 before the assignment is done, so it is allowed to redefine an
536 identifier in terms of its old value, e.g.
539 code(foo = \foo * 2.0)
542 When an identifier is referenced, the information it points to is
543 copied. Therefore it only makes sense to put identifiers for
544 translators, output definitions, and code(\score)keyindex(score)
545 blocks as the first item in a block. For this reason, if you
546 reference a code(\foo) variable in a code(\foo) block, it must be the
547 first item in the list following code(\foo).footnote(code(\paper{\one
548 \two}) does not make sense, because the information of code(\two)
549 would overwrite the information of code(\one), thereby making the
550 reference to the first identifier useless.)
553 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
554 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
556 sect(Music expressions)
557 cindex(music expressions)
559 Music in em(Mudela) is entered as a music expression. Notes, rests,
560 lyric syllables are music expressions (the atomic
561 expressions)cindex(atomic music expressions), and you can combine
562 music expressions to form new ones. This example forms a compound
563 expressions out of the quarter code(c) note and a code(d)
567 verb(\sequential { c4 d4 })
570 The meaning of this compound expression is to play the `code(c)'
571 first, and then the `code(d)' (as opposed to playing them
572 simultaneously, for instance).
574 Atomic music expression are discussed in
575 bind(subsection)ref(atomicmusic). Compound music expressions are
576 discussed in bind(subsection)ref(compoundmusic).
579 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
580 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
582 sect(Atomic music expressions)
585 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
587 subsect(Pitch and duration)
591 The syntax for pitch specification is
594 code(\musicalpitch)keyindex(musicalpitch)
595 code({) var(octave) var(note) var(shift) code(})
598 var(octave) is specified by an integer, zero for the octave
599 containing middle C. var(note) is a number from 0 to 7, with 0
600 corresponding to C and 7 corresponding to B. The shift is zero for a
601 natural, negative to add flats, or positive to add sharps.
603 In Note and Chord mode, pitches may be designated by names. See
604 bind(section)ref(notelang) for pitch names in different languages.
606 The syntax for duration specification is
609 code(\duration)keyindex(duration)
610 code({) var(length) var(dotcount) code(})
613 var(length) is the negative logarithm (base 2) of the duration:
614 bind(1)is a half note, bind(2)is a quarter note, bind(3)is an eighth
615 note, etc. The number of dots after the note is given by
618 In Note, Chord, and Lyrics mode, durations may be designated by
619 numbers and dots. See bind(Section)ref(notelang) for details.
621 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
623 subsect(Note specification)
625 cindex(note specification)
627 cindex(entering notes)
629 A note specification has the form
632 var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)]
635 The pitch of the note is specified by the note's name.
639 The default names are the Dutch note names. The notes are specified
640 by the letters `code(c)' through `code(b)', where `code(c)' is an
641 octave below middle C and the letters span the octave above that C.
642 In Dutchcindex(notenames!Dutch), a sharp is formed by adding
643 `code(-is)' to the end of a pitch name. A flat is formed by adding
644 `code(-es)'. Double sharps and double flats are obtained by adding
645 `code(-isis)' or `code(-eses)'. `code(aes)' and `code(ees)' are
646 contracted to `code(as)' and `code(es)' in Dutch, but both forms will
649 LilyPond has predefined sets of notenames for various languages. See
650 bind(section)ref(notelang) for details.
654 The optional octave specification takes the form of a series of
655 single quote (`indexandcode(')') characters or a series of comma
656 (`indexandcode(,)') characters. Each code(') raises the pitch by one
657 octave; each code(,) lowers the pitch by an octave.
659 mudela(fragment,verbatim,center)( c' d' e' f' g' a' b' c'')
661 mudela(fragment,verbatim,center)( cis' dis' eis' fis' gis' ais' bis')
663 mudela(fragment,verbatim,center)( ces' des' es' fes' ges' as' bes')
665 mudela(fragment,verbatim,center)( cisis' eisis' gisis' aisis' beses')
667 mudela(fragment,verbatim,center)( ceses' eses' geses' ases' beses')
669 Whenever a C-sharp is desired, you must specify a C-sharp. LilyPond
670 will determine what accidentals to typeset depending on the key and
671 context. A reminder accidental cindex(reminder accidental) can be
672 forced by adding an exclamation mark `code(!)' after the pitch. A
673 cautionary accidental, cindex(cautionary accidental) i.e., an
674 accidental within parentheses can be obtained by adding the question
675 mark `indexandcode(?)' after the pitch.
677 mudela(fragment,verbatim,center)( cis' d' e' cis' c'? d' e' c'!)
682 Durations are entered as their reciprocal values. For notes longer
683 than a whole note, use identifiers.
686 verb(c'\longa c'\breve
687 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64)
692 \notes \relative c'' {
694 a1 a2 a4 a8 a16 a32 a64 a64
697 loose_column_distance = 2.5 * \interline;
700 \type "Score_engraver";
702 \consists "Note_heads_engraver";
703 \consists "Stem_engraver";
704 \consists "Rhythmic_column_engraver";
712 r1 r2 r4 r8 r16 r32 r64 r64)
717 \notes \relative c'' {
719 r1 r2 r4 r8 r16 r32 r64 r64
722 loose_column_distance = 2.5 * \interline;
725 \type "Score_engraver";
727 \consists "Rest_engraver";
728 \consists "Stem_engraver";
729 \consists "Rhythmic_column_engraver";
735 If the duration is omitted then it is set equal to the previous
736 duration. If there is no previous duration, a quarter note is
737 assumed. The duration can be followed by a dot (`indexandcode(.)')
738 to obtain dotted note lengths.
740 mudela(fragment,verbatim,center)( a'4. b'4.)
742 You can alter the length of duration by writing
743 `code(*)var(fraction)' after it. This will not affect the
744 appearance of note heads or rests.
748 Rests are entered like notes, with note name `indexandcode(r)',
749 or `indexandcode(R)'. There is also a note name `indexandcode(s)',
750 which produces a space of the specified duration.
751 `code(R)' is specifically meant for entering parts: the code(R) rest
752 can expand to fill a score with rests, or it can be printed as a
753 single multimeasure rest.
755 subsubsect(Lyrics syllables)
756 cindex(lyrics expressions)
758 Syllables are entered like notes, with pitches replaced by text. For
759 example, `code(Twin-4 kle4 twin-4 kle4)' enters four syllables, each
760 with quarter note duration. Note that the hyphen has no special
761 meaning for lyrics, and does not introduce special symbols. See
762 bind(section)ref(modes) for a description of what is interpreted as
765 Spaces can be introduced into a lyric either by using quotes
766 (`code(")') or by using an underscore without quotes: `code(He_could4
767 not4)'. All unquoted underscores are converted to spaces. Printing
768 lyrics is discussed in bind(section)ref(lyricprint).
770 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
776 code(\property)keyindex(property)
777 var(contextname)code(.)var(propname) code(=) var(value)
780 Sets the var(propname) property of the context var(contextname) to
781 the specified var(value). All three arguments are strings.
782 Depending on the context, it may be necessary to quote the strings or
783 to leave space on both sides of the dot.
785 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
787 subsect(Translator switches)
788 cindex(translator switches)
791 code(\translator)keyindex(translator)
792 var(contexttype) = var(name)
795 A music expression indicating that the context which is a direct
796 child of the a context of type var(contexttype) should be shifted to
797 a context of type var(contexttype) and the specified name.
799 Usually this is used to switch staffs in Piano music, e.g.
802 code(\translator Staff = top) var(Music)
805 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
810 Commands are music expressions that have no duration.
812 subsubsect(Key signatures)
815 code(\key)keyindex(key) var(pitch) var(type) code(;)
818 Change the key signature. var(type) should be
819 code(\major)keyindex(major) or code(\minor)keyindex(minor) to get
820 var(pitch)-major or var(pitch)-minor, respectively. The second
821 argument is optional; the default is major keys. The var(\context)
822 argument can also be given as an integer, which tells the number of
823 semitones that should be added to the pitch given in the subsequent
824 code(\key)keyindex(key) commands to get the corresponding major key,
825 e.g., code(\minor)keyindex(minor) is defined bind(as)3. The standard
826 mode names code(\ionian)keyindex(ionian),
827 code(\locrian)keyindex(locrian), code(\aeolian)keyindex(aeolian),
828 code(\mixolydian)keyindex(mixolydian), code(\lydian)keyindex(lydian),
829 code(\phrygian)keyindex(phrygian), and code(\dorian)keyindex(dorian)
833 code(\keysignature)keyindex(keysignature) var(pitchseq) code(;)
836 Specify an arbitrary key signature. The pitches from var(pitch) will
837 be printed in the key signature in the order that they appear on the
840 subsubsect(Rehearsal marks)
843 code(\mark)keyindex(mark) var(unsigned) code(;) nl()
844 code(\mark) var(string) code(;)
847 Prints a mark over or under (depending on the
848 indexandcode(markDirection) property) the staff. You must add
849 indexandcode(Mark_engraver) to either the Score or Staff context for
852 subsubsect(Bar lines)
856 code(\bar)keyindex(bar) var(bartype) code(;)
859 This is a request to print a special bar symbol. It replaces the
860 regular bar symbol with a special
861 symbol. The argument var(bartype) is a string which specifies the
862 kind of bar to print. Options are code(":|")cindex("|A@code(:|)),
863 code("|:")cindex("|B@code(|:)), code(":|:")cindex("|C@code(:|:)),
864 code("||")cindex("|D@code(||)), code("|.")cindex("|E@code(|.)),
865 code(".|")cindex("|F@code(.|)), and code(".|.")cindex("|G@code(.|.)).
866 These produce, respectively, a right repeat, a left repeat, a double
867 repeat, a double bar, a start bar, an end bar, and a thick double
868 bar. If var(bartype) is set to code("empty") then nothing is
869 printed, but a line break is allowed at that spot.
871 You are encouraged to use code(\repeat) for repetitions.
872 See bind(section)ref(sec:repeats).
874 subsubsect(Timing commands)
877 code(\cadenza)keyindex(cadenza) var(togglevalue) code(;)
880 Music expression that toggles the automatic generation of bar lines.
881 If var(togglevalue) bind(is)1, bar line generation is turned off. If
882 var(togglevalue) bind(is)0, a bar line is immediately printed and
883 automatic bar generation is turned on.
886 code(\time)keyindex(time) var(numerator)code(/)var(denominator) code(;)
889 Change the time signature. The default time signature bind(is)4/4.
890 The time signature is used to generate bar lines.
893 code(\tempo)keyindex(tempo) var(duration) = var(perminute) code(;)
896 Used to specify the tempo. For example, `code(\tempo 4 = 76;)'
897 requests output with bind(76)quarter notes per minute.
900 code(\partial)keyindex(partial) var(duration) code(;)
905 This creates an incomplete measure (anacrusis, upbeat) at the start of
906 the music, e.g., `code(\partial 8*2;)' creates a starting measure
907 lasting two eighth notes.
910 code(|)indexcode(|)cindex(bar check)
912 cindex(shorten measures)
915 `code(|)' is a barcheck. Whenever a barcheck is encountered during
916 interpretation, a warning message is issued if it doesn't fall at a
917 measure boundary. This can help you finding errors in the input.
918 The beginning of the measure will be relocated, so this can also
919 be used to shorten measures.
921 subsubsect(Other commands)
924 code(\penalty)keyindex(penalty) var(int) code(;)
927 Discourage or encourage line breaks. See identifiers
928 code(\break)keyindex(break) and code(\nobreak)keyindex(nobreak) in
929 bind(section)ref(ident).
932 code(\clef)keyindex(clef) var(clefname) code(;)
935 Music expression that sets the current clef. The argument is a
936 string which specifies the name of the clef. Several clef names are
937 supported. If `code(_8)' or `code(^8)' is added to the end of a clef
938 name, then the clef lowered or raised an octave will be generated.
939 Here are the supported clef names with bind(middle)C shown in each
946 %\property Voice.textStyle = typewriter
947 \clef subbass; c'4-"\kern -5mm subbass"
948 \clef bass; c'4^"\kern -2mm bass"
949 \clef baritone; c'4_"\kern -5mm baritone"
950 \clef varbaritone; c'4^"\kern -6mm varbaritone"
951 \clef tenor; c'4_"\kern -3mm tenor"
952 \clef "G_8"; c'4^"\kern -2mm G\\texttt{\\_}8"
964 \clef alto; c'4_"\kern -2mm alto"
965 \clef mezzosoprano; c'4^"\kern -9mm mezzosoprano"
966 \clef soprano; c'4_"\kern -6mm soprano"
967 \clef treble; c'4^"\kern -4mm treble"
968 \clef french; c'4_"\kern -4mm french"
976 The three clef symbols can also be obtained using the names `code(G)',
977 `code(C)' or `code(F)', optionally followed by an integer which
978 indicates at which note line the clef is located. An as example, the
979 code(mezzosoprano) clef can also be given as `code(C2)'.
982 code(\skip)keyindex(skip) var(duration) code(;)
985 Skips the amount of time specified by var(duration). If no other
986 music is played, a gap will be left for the skipped time with no
987 notes printed. It works in Note Mode or Lyrics Mode. In Note mode,
988 this has the same effect as the space rest `code(s)'.
994 A beam is specified by surrounding the beamed notes with brackets
995 `indexandcode([)' and `indexandcode(])'.
997 mudela(fragment,verbatim,center)( [a'8 a'] [a'16 a' a' a'])
999 Some more elaborate constructions:
1001 mudela(fragment,verbatim,center)( [a'16 <a' c''> c'' <a' c''>]
1002 \times 2/3 { [e'8 f' g'] })
1004 Beaming can be generated automatically; see bind(section)ref(autobeam).
1006 To place tremolo marks cindex(tremolo beams) between two notes, begin
1007 with `code([:)var(length)' and end with `code(])'. Tremolo marks
1008 will appear instead of beams. Putting more than two notes in such a
1009 construction will produce odd effects. To create tremolo beams on a
1010 single note, simply attach `code(:)var(length)' to the note itself
1011 (see also bind(section)ref(tremolo)).
1013 mudela(fragment,verbatim,center)( [:16 e'1 g'] [:8 e'4 f'])
1015 mudela(fragment,verbatim,center)( c'4:32 [:16 c'8 d'8])
1017 subsubsect(Lyric helpers)
1018 cindex(--@code(-)code(-))
1023 The syntax for an extender mark is `code(__)'. This syntax can only
1024 be used within lyrics mode. The syntax for a spanning hyphen (i.e.,
1025 a hyphen that will be printed between two lyric syllables) is
1031 A tie connects two adjacent note heads of the same pitch. When used
1032 with chords, it connects all of the note heads whose pitches match.
1033 Ties are indicated using the tilde symbol `indexandcode(~)'.
1034 If you try to tie together chords which have no common pitches, a
1035 warning message will appear and no ties will be created.
1037 mudela(fragment,verbatim,center)( e' ~ e' <c' e' g'> ~ <c' e' g'>)
1039 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1041 subsect(Atomic music expressions: add-ons)
1043 [TODO: explain Requests]
1045 subsubsect(Articulations)
1046 cindex(articulations)
1050 A variety of symbols can appear above and below notes to indicate
1051 different characteristics of the performance. These symbols can be
1052 added to a note with `var(note)code(-\)var(name)'. Numerous symbols
1053 are defined in file(script.ly) and file(script.scm). Symbols can be
1054 forced to appear above or below the note by writing
1055 `var(note)code(^\)var(name)' and `var(note)code(_\)var(name)'
1056 respectively. Here is a chart showing symbols above notes, with the
1057 name of the corresponding symbol appearing underneath.
1062 c''-\accent c''-\marcato c''-\staccatissimo c''-\fermata
1063 c''-\stopped c''-\staccato c''-\tenuto c''-\upbow
1064 c''-\downbow c''^\lheel c''-\rheel c''^\ltoe
1065 c''-\rtoe c''-\turn c''-\open c''-\flageolet
1066 c''-\reverseturn c''-\trill c''-\prall c''-\mordent
1067 c''-\prallprall c''-\prallmordent c''-\upprall c''-\downprall
1068 c''-\thumb c''-\segno c''-\coda
1070 \context Lyrics \lyrics {
1071 accent__ marcato__ staccatissimo__ fermata
1072 stopped__ staccato__ tenuto__ upbow
1073 downbow__ lheel__ rheel__ ltoe
1074 rtoe__ turn__ open__ flageolet
1075 reverseturn__ trill__ prall__ mordent
1076 prallprall__ prallmordent__ uprall__ downprall
1077 thumb__ segno__ coda
1081 linewidth = 5.875\in;
1087 In addition, it is possible to place arbitrary strings of text or
1088 TeX() above or below notes by using a string instead of an
1089 identifier: `code(c^"text")'. Fingerings cindex(fingering) can be
1090 placed by simply using digits. All of these note ornaments appear in
1091 the printed output but have no effect on the MIDI rendering of the
1094 To save typing, fingering instructions (digits 0 bind(to)9 are
1095 supported) and single characters shorthands exist for a few
1101 \property Voice.textStyle = typewriter
1107 c''4-^_"c-\\^{ }" s4
1114 linewidth = 5.875 \in;
1120 Dynamic marks are specified by using an identifier after a note:
1121 `code(c4-\ff)' (the dash is optional for dynamics: `code(c4 \ff))'.
1122 The available dynamic marks are:
1123 code(\ppp)keyindex(ppp),
1124 code(\pp)keyindex(pp), code(\p)keyindex(p), code(\mp)keyindex(mp),
1125 code(\mf)keyindex(mf), code(\f)keyindex(f), code(\ff)keyindex(ff),
1126 code(\fff)keyindex(fff), code(\fff)keyindex(ffff),
1127 code(\fp)keyindex(fp), code(\sf)keyindex(sf),
1128 code(\sff)keyindex(sff), code(\sp)keyindex(sp),
1129 code(\spp)keyindex(spp), code(\sfz)keyindex(sfz), and
1130 code(\rfz)keyindex(rfz).
1132 subsubsect(General text scripts)
1135 code(\textscript)keyindex(textscript) var(text) var(style)
1138 Defines a text to be printed over or under a note. var(style) is a
1139 string that may be one of code(roman), code(italic), code(typewriter),
1140 code(bold), code(Large), code(large), code(dynamic) or code(finger).
1142 You can attach a general textscript request using this syntax:
1145 verb(c4-\textscript "6" "finger"
1146 c4-\textscript "foo" "normal")
1149 This is equivalent to `code(c4-6 c4-"foo")'.
1151 subsubsect(General scripts)
1155 code(\script)keyindex(script) var(alias)
1158 Prints a symbol above or below a note. The argument is a string
1159 which points into the script-alias table defined in file(script.scm).
1160 The scheme definitions specify whether the symbol follows notes into
1161 the staff, dependence of symbol placement on staff direction, and a
1162 priority for placing several symbols over one note. Usually the
1163 code(\script)keyindex(script) keyword is not used directly. Various
1164 helpful identifier definitions appear in file(script.ly).
1169 Slurs connects chords and try to avoid crossing stems. A slur is
1170 started with `code(CHAR(40))' and stopped with `code(CHAR(41))'. The
1171 starting `code(CHAR(40))' appears to the right of the first note in
1172 the slur. The terminal `code(CHAR(41))' appears to the left of the
1173 first note in the slur. This makes it possible to put a note in
1174 slurs from both sides:
1176 mudela(fragment,verbatim,center)( f'()g'()a' [a'8 b'(] a'4 g'2 )f'4)
1178 subsubsect(Crescendo)
1181 A crescendo mark is started with code(\cr)keyindex(cr) and terminated
1182 with code(\rc)keyindex(rc). A decrescendo mark is started with
1183 code(\decr)keyindex(decr) and terminated with
1184 code(\rced)keyindex(rced). There are also shorthands for these
1185 marks. A crescendo can be started with code(\<)keyindex(<) and a
1186 decrescendo can be started with code(\>)keyindex(>). Either one can
1187 be terminated with code(\!)keyindex("!). Note that code(\!)
1188 must go before the last note of the dynamic mark whereas code(\rc)
1189 and code(\rced) go after the last note. Because these marks are
1190 bound to notes, if you want to get several marks during one note, you
1191 must use spacer notes.
1193 mudela(fragment,verbatim,center)( c'' \< \! c'' d'' \decr e'' \rced
1194 < f''1 { s4 \< \! s2 \> \! s4 } >)
1196 subsubsect(General spanners)
1199 code(\spanrequest)keyindex(spanrequest) var(startstop) var(type)
1202 Define a spanning request. The var(startstop) parameter is bind(either)-1
1203 (code(\start)keyindex(start)) bind(or)1 (code(\stop)keyindex(stop)) and
1204 var(type) is a string that describes what should be started.
1205 Supported types are code(crescendo), code(decrescendo),
1206 code(beam), code(slur). This is an internal command. Users should
1207 use the shorthands which are defined in the initialization file
1210 You can attach a (general) span request to a note using
1212 mudela(fragment,verbatim,center)( c'4-\spanrequest \start "slur"
1213 c'4-\spanrequest \stop "slur")
1215 The slur syntax with parentheses is a shorthand for this.
1217 COMMENT(came till here with indexifying)
1219 subsubsect(Tremolo marks)
1220 cindex(tremolo marks)
1223 Tremolo marks can be printed on a single note by adding
1224 `code(:)[var(length)]' after the note. The length must be at
1225 bind(least)8. A var(length) value bind(of)8 gives one line across
1226 the note stem. If the length is omitted, then the last value is
1227 used, or the value of the indexandcode(abbrev) property if there was
1230 mudela(verbatim,fragment,center)( c'2:8 c':32)
1233 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1234 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1236 sect(Compound music expressions)
1237 cindex(compound music expressions)
1238 label(compoundmusic)
1240 Music expressions are compound data structures. You can nest music
1241 expressions any way you like. This simple example shows how three
1242 chords can be expressed in two different ways:
1244 mudela(fragment,verbatim,center)( \notes \context Staff {
1246 <a c'> <b d' > <c' e' >
1247 <{a b c'}{c' d' e'}>
1250 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1252 subsect(Context selection)
1253 cindex(context selection)
1256 code(\context)keyindex(context)
1257 var(contexttype) [code(=) var(contextname)] var(musicexpr)
1260 Interpret var(musicexpr) within a context of type var(contexttype).
1261 If the context does not exist, it will be created. The new context
1262 can optionally be given a name. See
1263 bind(section)ref(contextselection) bind(and)ref(contextdefs) for more
1264 information on interpretation contexts.
1266 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1268 subsect(Music entry modes)
1272 Mode switching keywords form compound music expressions: code(\notes)
1273 keyindex(notes) var(musicexpr), code(\chords) keyindex(chords)
1274 var(musicexpr), and code(\lyrics) keyindex(lyrics) var(musicexpr).
1275 These expressions do not add anything to the meaning of their
1276 arguments. They are just a way to indicate that the arguments should
1277 be parsed in indicated mode. See bind(section)ref(modes) for more
1278 information on modes.
1280 More information on context selection can be found in
1281 bind(section)ref(contextselection).
1283 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1285 subsect(Sequential music)
1286 cindex(sequential music)
1287 COMMENT(It's not possible to index `{' and `}' directly, thus we
1289 whenlatex(cindex(?A@latexcommand(\texttt{\textbraceleft})))
1290 whenlatex(cindex(?B@latexcommand(\texttt{\textbraceright})))
1293 code(\sequential)keyindex(sequential)
1294 code({) var(musicexprlist) code(})
1297 This means that list should be played or written in sequence, i.e.,
1298 the second after the first, the third after the second. The duration
1299 of sequential music is the the sum of the durations of the elements.
1300 There is a shorthand, which leaves out the keyword:
1303 code({) var(musicexprlist) code(})
1306 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1308 subsect(Simultaneous music)
1309 cindex(simultaneous music)
1314 code(\simultaneous)keyindex(simultaneous)
1315 code({) var(musicexprlist) code(})
1318 It constructs a music expression where all of its arguments start at
1319 the same moment. The duration is the maximum of the durations of the
1320 elements. The following shorthand is a common idiom:
1323 code(<) var(musicexprlist) code(>)
1326 If you try to use a chord as the first thing in your score, you might
1327 get multiple staffs instead of a chord.
1329 mudela(verbatim,center)( \score {
1336 This happens because the chord is interpreted by a score context.
1337 Each time a note is encountered a default Voice context (along with a
1338 Staff context) is created. The solution is to explicitly instantiate
1341 mudela(verbatim,center)( \score {
1342 \notes\context Voice <c''4 e''>
1348 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1350 subsect(Relative Pitch Specification)
1351 cindex(relative pitch specification)
1354 It is easy to get confused by octave changing marks and accidentally
1355 putting a pitch in the wrong octave. A much better way of entering a
1356 note's octave is `the relative octave' mode.
1359 code(\relative)keyindex(relative) var(startpitch) var(musicexpr)
1362 The octave of notes that appear in var(musicexpr) are calculated as
1363 follows: If no octave changing marks are used, the basic interval
1364 between this and the last note is always taken to be a fourth or
1365 less.footnote(The interval is determined without regarding
1366 accidentals. A code(fisis) following a code(ceses) will be put above
1367 the code(ceses).) The octave changing marks `code(')' and `code(,)'
1368 can then be added to raise or lower the pitch by an extra octave.
1369 Upon entering relative mode, an absolute starting pitch must be
1370 specified that will act as the predecessor of the first note of
1373 Entering scales is straightforward in relative mode.
1375 mudela(fragment,verbatim,center)( \relative c' {
1379 And octave changing marks are used for intervals greater than a fourth.
1381 mudela(fragment,verbatim,center)( \relative c'' {
1382 c g c f, c' a, e'' })
1384 If the preceding item is a chord, the first note of the chord is used
1385 to determine the first note of the next chord. But other notes
1386 within the second chord are determined by looking at the immediately
1389 mudela(fragment,verbatim,center)( \relative c' {
1395 The pitch after the code(\relative) contains a notename. To parse
1396 the pitch as a notename, you have to be in note mode, so there must
1397 be a surrounding code(\notes)keyindex(notes) keyword (which is not
1400 The relative conversion will not affect code(\transpose) or
1401 code(\relative) sections in its argument. If you want to use
1402 relative within transposed music, you must place an additional
1403 code(\relative) inside the code(\transpose).
1405 It is strongly recommended to use relative pitch mode: less work,
1406 less error-prone, and more readable.
1408 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1410 subsect(Chord names)
1412 Chord names are a way to generate simultaneous music expressions that
1413 correspond with traditional chord names. It can only be used in
1414 Chord mode (see bind(section)ref(modes)).
1417 var(tonic)[var(duration)][code(-)var(modifiers)]\
1418 [code(^)var(subtractions)]\
1419 [code(/)var(inversion)].
1422 var(tonic) should be the tonic note of the chord, and var(duration)
1423 is the chord duration in the usual notation. There are two kinds of
1424 modifiers. One type is em(chord additions), which are obtained by
1425 listing intervals separated by dots. An interval is written by its
1426 number with an optional `code(+)' or `code(-)' to indicate raising or
1427 lowering by half a step. Chord additions has two effects: It adds
1428 the specified interval and all lower odd numbered intervals to the
1429 chord, and it may lower or raise the specified interval. Intervals
1430 must be separated by a dot (`code(.)').
1433 mudela(fragment,verbatim)(\transpose c'' {
1436 c-9 c-9-.5+.7+ c-3-.5- c-4.6.8
1442 The second type of modifier that may appear after the `code(-)' is a
1443 named modifier. Named modifiers are listed in the file
1444 file(chord-modifiers.ly). The available modifiers are `code(m)' and
1445 `code(min)' which lower the 3rd half a step, `indexandcode(aug)' which
1446 raises the 5th, `indexandcode(dim)' which lowers the 5th,
1447 `indexandcode(maj)' which adds a raised 7th, and `indexandcode(sus)'
1448 which replaces the 5th with a 4th.
1451 mudela(fragment,verbatim)(\transpose c'' {
1453 c1-m c-min7 c-maj c-aug c-dim c-sus
1459 Chord subtractions are used to eliminate notes from a chord. The
1460 notes to be subtracted are listed after a `code(^)' character,
1463 mudela(fragment,verbatim,center)( \transpose c'' {
1469 Chord inversions can be specified by appending `indexandcode(/)' and
1470 the name of a single note to a chord. This has the effect of
1471 lowering the specified note by an octave so it becomes the lowest
1472 note in the chord. If the specified note is not in the chord, a
1473 warning will be printed.
1475 mudela(fragment,verbatim,center)( \transpose c''' {
1482 Throughout these examples, chords have been shifted around the staff
1483 using code(\transpose).
1485 You should not combine code(\relative) with named chords.
1487 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1492 Tuplets are made out of a music expression by multiplying their
1493 duration with a fraction.
1496 code(\times)keyindex(times) var(fraction) var(musicexpr)
1499 The duration of var(musicexpr) will be multiplied by the fraction.
1500 In print, the fraction's denominator will be printed over the notes,
1501 optionally with a bracket. The most common tuplet is the triplet in
1502 which bind(3)notes have the length bind(of)2, so the notes are 2/3 of
1503 their written length:
1505 mudela(fragment,verbatim,center)( g'4 \times 2/3 {c'4 c' c'} d'4 d'4)
1507 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1509 subsect(Grace notes)
1513 code(\grace)keyindex(grace) var(musicexpr)
1516 A grace note expression has bind(duration)0; the next real note is
1517 assumed to be the main note.
1519 You cannot have the grace note after the main note, in terms of
1520 duration, and main notes, but you can typeset the grace notes to the
1521 right of the main note using the property
1522 indexandcode(graceAlignPosition).
1524 When grace music is interpreted, a score-within-a-score is set up:
1525 var(musicexpr) has its own time bookkeeping, and you could (for
1526 example) have a separate time signature within grace notes. While in
1527 this score-within-a-score, you can create notes, beams, slurs, etc.
1528 Unbeamed eighth notes and shorter by default have a slash through the
1529 stem. This behavior can be controlled with the
1530 indexandcode(stemStyle) property.
1533 mudela(fragment,verbatim)(\relative c'' {
1534 \grace c8 c4 \grace { [c16 c16] } c4
1535 \grace { \property Grace.stemStyle = "" c16 } c4
1540 At present, nesting code(\grace)keyindex(grace) notes, e.g.
1543 code(\grace { \grace c32 c16 } c4)
1546 may result in run-time errors of LilyPond. Since the meaning of such
1547 a construct is unclear, we don't consider this a loss. Similarly,
1548 juxtaposing two code(\grace) sections is syntactically valid, but
1549 makes no sense and may cause runtime errors.
1551 Ending a staff or score with grace notes may also generate a run-time
1552 error, since there will be no main note to attach the grace notes to.
1554 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1560 In order to specify repeats, use the code(\repeat)keyindex(repeat)
1561 keyword. Since repeats look and sound differently when played or
1562 printed, there are a few different variants of repeats.
1566 Repeated music is fully written (played) out. Useful for MIDI
1570 This is the normal notation: Repeats are not written out, but
1571 alternative endings (voltas) are printed, left to right.
1574 Alternative endings are written stacked, which is useful for
1578 The syntax for repeats is
1581 code(\repeat) var(variant) var(repeatcount) var(repeatbody)
1584 If you have alternative endings, you may add
1587 code(\alternative)keyindex(alternative)
1588 code({) var(alternative1)
1590 var(alternative3) ellipsis() code(})
1593 where each var(alternative) is a Music expression.
1595 Normal notation repeats are used like this:
1598 mudela(fragment,verbatim)( c'1
1599 \repeat volta 2 { c'4 d' e' f' }
1600 \repeat volta 2 { f' e' d' c' }
1604 With alternative endings:
1607 mudela(fragment,verbatim)( c'1
1608 \repeat volta 2 {c'4 d' e' f'}
1609 \alternative { {d'2 d'} {f' f} }
1613 Folded repeats look like this:footnote(Folded repeats offer little
1614 more over simultaneous music. However, it is to be expected that
1615 more functionality -- especially for the MIDI backend -- will be
1619 mudela(fragment,verbatim)( c'1
1620 \repeat fold 2 {c'4 d' e' f'}
1621 \alternative { {d'2 d'} {f' f} }
1626 mudela(fragment,verbatim)(\context Staff {
1629 \repeat volta 2 { e | c2 d2 | e2 f2 | }
1630 \alternative { { g4 g g } { a | a a a a | b1 } }
1636 If you don't give enough alternatives for all of the repeats, then
1637 the first alternative is assumed to be repeated often enough to equal
1638 the specified number of repeats.
1641 mudela(fragment,verbatim)(\context Staff {
1643 \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1644 \alternative { { g4 g g }
1645 {\partial 1; e4 e e }
1646 {\partial 1; a a a a | b1 } }
1652 It is possible to nest code(\repeat). This is not entirely
1653 supported: the notes will come be in the right places, but the repeat
1656 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1658 subsect(Transposition of Pitches)
1659 cindex(transposition of pitches)
1662 A music expression can be transposed with
1663 code(\transpose)keyindex(transpose). The syntax is
1666 code(\transpose) var(pitch) var(musicexpr)
1669 This means that middle C in var(musicexpr) is transposed to
1672 code(\transpose) distinguishes between enharmonic pitches: both
1673 code(\transpose cis') or code(\transpose des') will transpose up half
1674 a tone. The first version will print sharps and the second version
1678 mudela(fragment,verbatim)(\context Staff {
1682 \transpose des'' { \key e; c d e f }
1683 \transpose cis'' { \key e; c d e f }
1688 If you want to use both code(\transpose) and code(\relative), then
1689 you must use code(\transpose) first. code(\relative) will have no
1690 effect music that appears inside a code(\transpose).
1692 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1694 subsect(Automatic lyric durations)
1695 cindex(automatic lyric durations)
1697 If you have lyrics that are set to a melody, you can import the
1698 rhythm of that melody into the lyrics using code(\addlyrics).
1699 keyindex(addlyrics) The syntax for this is
1702 code(\addlyrics) var(musicexpr1 musicexpr2)
1705 This means that both var(musicexpr1) and var(musicexpr2) are
1706 interpreted, but that every non-command atomic music expression
1707 (``every syllable'') in var(musicexpr2) is interpreted using timing
1710 If the property indexandcode(automaticMelismata) is set in the
1711 context of var(musicexpr1), no lyrics will be put on slurred or tied
1715 mudela(verbatim,fragment)(\addlyrics
1717 \property Voice.automaticMelismata = "1"
1718 c8 () cis d8. e16 f2
1720 \context Lyrics \lyrics {
1725 You should use a single rhythm melody, and single rhythm lyrics (a
1726 constant duration is the obvious choice). If you do not, you will get
1727 undesired effects when using multiple stanzas:
1730 mudela(verbatim,fragment)(\addlyrics
1732 c8 () cis d8. e16 f2
1734 \context Lyrics \lyrics
1740 It is valid (but probably not very useful) to use notes instead of
1741 lyrics for var(musicexpr2).
1744 mudela(verbatim,fragment)(
1745 \context Voice \addlyrics
1752 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1753 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1758 The grammar contains a number of ambiguities.footnote(The authors
1759 hope to resolve them at a later time.)
1768 can be interpreted as making a string identifier code(\foo)
1769 containing code("bar"), or a music identifier code(\foo)
1770 containing the syllable `bar'.
1778 can be interpreted as making an integer identifier
1779 bind(containing)-6, or a Request identifier containing the
1780 bind(fingering)`6' (with neutral direction).
1782 it() If you do a nested repeat like
1790 then it is ambiguous to which code(\repeat) the
1791 code(\alternative) belongs. This is the classic if-then-else
1792 dilemma. It may be solved by using braces.
1794 it() (an as yet unidentified ambiguity :-)
1798 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1799 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1801 sect(Notation conversion specifics)
1803 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1805 subsect(Automatic Beam Generation)
1806 cindex(automatic beam generation)
1809 By default, LilyPond will generate beams automatically. This feature
1810 can be disabled by setting the indexandcode(Voice.noAutoBeaming)
1811 property bind(to)1. It can be overridden for specific cases by
1812 specifying explicit beams as described in
1813 bind(section)ref(manualbeam).
1815 A large number of Voice properties are used to decide how to generate
1816 beams. Their default values appear in file(auto-beam-settings.ly).
1817 In general, beams can begin anywhere, but their ending location is
1818 significant. Beams can end on a beat, or at durations specified by
1819 the indexandcode(Voice.beamAutoEnd) property. To end beams every
1820 quarter note, for example, you could set
1821 indexandcode(Voice.beamAutoEnd) equal to `code("1/4")'. To end beams
1822 at every three eighth notes you would set it to `code("3/8")'. The
1823 same syntax can be used to specify beam starting points using
1824 indexandcode(Voice.beamAutoBegin).
1826 To allow different settings for different time signatures, these
1827 property names can start with `code(time)var(N)code(_)var(M)' to
1828 restrict the definition to `var(N)code(/)var(M)' time. For example,
1829 to specify beams ending only for bind(6/8)time you would use the
1830 property code(Voice.time6_8beamAutoEnd). To allow different endings
1831 for notes of different durations, the duration can be tacked onto the
1832 end of the property. To specify beam endings for beams that contain
1833 bind(32nd)notes, you would use code(Voice.beamAutoEnd_32).
1835 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1837 subsect(Printing chord names)
1840 cindex(printing!chord names)
1842 For displaying printed chord names, use the indexandcode(ChordNames)
1843 and indexandcode(ChordNameVoice) contexts. The chords may be entered
1844 either using the notation described above, or directly using
1848 mudela(fragment,verbatim)(<
1849 \context ChordNames {
1850 \chords{a b c} \notes{<d f g> <e g b>}
1852 \context Staff \notes {
1859 LilyPond examines chords specified as lists of notes to determine a
1860 name to give the chord. By default, LilyPond will not try to
1861 identify chord inversions:
1863 mudela(fragment,verbatim,center)( <
1864 \context ChordNameVoice \notes {
1867 \context Thread \notes {
1872 If you want inversions to be recognized, you must set the property
1873 indexandcode(ChordNames.chordInversion):
1875 mudela(fragment,verbatim,center)( <
1876 \property Score.chordInversion = 1
1877 \context ChordNameVoice \notes {
1880 \context Thread \notes {
1885 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1887 subsect(Printing lyrics)
1889 cindex(printing!lyrics)
1892 Lyric syllables must be interpreted within a code(Lyrics) context
1893 cindex(context!Lyrics) for printing them.
1895 Here is a full example:
1898 mudela(verbatim)(\score {
1900 \notes \transpose c'' {
1902 e f g2 | e4 f g2 \bar "|.";
1904 \context Lyrics \lyrics {
1905 Va-4 der Ja- cob Va- der Ja- cob
1906 Slaapt gij nog?2 Slaapt4 gij nog?2
1913 You may want a continuous line after the syllables to show melismata.
1914 To achieve this effect, add a `code(__)' lyric as a separate word
1915 after the lyric to be extended. This will create an extender, a line
1916 that extends over the entire duration of the lyric. This line will
1917 run all the way to the start of the next lyric, so you may want to
1918 shorten it by using a blank lyric (using `code(_)').
1921 mudela(verbatim)(\score {
1923 \notes \relative c'' {
1924 a4 () b () c () d | c () d () b () a | c () d () b () a
1926 \context Lyrics \lyrics {
1927 foo1 __ | bar2. __ _4 | baz1 __
1934 If you want to have hyphens centered between syllables (rather than
1935 attached to the end of the first syllable) you can use the special
1936 `code(-)code(-)' lyric as a separate word between syllables. This
1937 will result in a hyphen which length varies depending on the space
1938 between syllables, and which will be centered between the syllables.
1942 mudela(verbatim)(\score {
1944 \notes \transpose c'' {
1946 e f g2 | e4 f g2 \bar "|.";
1948 \context Lyrics \lyrics {
1949 Va4 -- der Ja -- cob | Va -- der Ja -- cob |
1950 Slaapt gij nog?2 | Slaapt4 gij nog?2
1958 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1959 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1961 sect(Notation Contexts)
1962 cindex(notation contexts)
1964 Notation contexts are objects that only exist during a run of
1965 LilyPond. During the interpretation phase of LilyPond, the Music
1966 expression contained in a code(\score) block is interpreted in time
1967 order. This is the order in which humans read, play, and write
1970 A context is an object that holds the reading state of the
1971 expression; it contains information like
1974 it() What notes are playing at this point?
1975 it() What symbols will be printed at this point?
1976 it() In what style will they printed?
1977 it() What is the current key signature, time signature, point within
1981 Contexts are grouped hierarchically: A code(Voice) context is
1982 contained in a code(Staff) context (because a staff can contain
1983 multiple voices at any point), a code(Staff) context is contained in
1984 a code(Score), code(StaffGroup), or code(ChoirStaff) context (because
1985 these can all contain multiple staffs).
1987 Contexts associated with sheet music output are called em(notation
1988 contexts), those for sound output are called playing contexts.
1990 Contexts are created either manually or automatically. Initially,
1991 the top level music expression is interpreted by the top level
1992 context (the code(Score) context). When a atomic music expression
1993 (i.e. a note, a rest, code(\bar), or code(\time) commands), a nested
1994 set of contexts is created that can process these atomic expressions,
1998 verb(\score { \notes < c4 > })
2001 The sequential music, `code({ c4 })' is interpreted by code(Score)
2002 context. When the note `code(c4)' itself is interpreted, a set of
2003 contexts is needed that will accept notes. The default for this is a
2004 code(Voice) context, contained in a code(Staff) context. Creation of
2005 these contexts results in the staff being printed.
2007 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2009 subsect(Context selection)
2010 label(contextselection)
2013 You can also create contexts manually, and you probably have to do so
2014 if you want to typeset complicated multiple part material. If a
2015 `code(\context) var(name) var(musicexpr)' expression is encountered
2016 during the interpretation phase, the var(musicexpr) argument will be
2017 interpreted with a context of type var(name). If you specify a name,
2018 the specific context with that name is searched.
2020 If a context of the specified type and name can not be found, a new
2021 one is created. For example,
2024 mudela(verbatim)(\score {
2025 \notes \relative c'' {
2026 c4 <d4 \context Staff = "another" e4> f
2032 In this example, the code(c) bind(and)code(d) are printed on the
2033 default staff. For bind(the)code(e), a context Staff called
2034 `code(another)' is specified; since that does not exist, a new
2035 context is created. Within code(another), a (default) Voice context
2036 is created for bind(the)code(e4). When all music referring to a
2037 context is finished, the context is ended as well. So after the
2038 third quarter, code(another) is removed.
2040 Almost all music expressions inherit their interpretation context
2041 from their parent. In other words, suppose that the syntax for a
2045 code(\keyword) var(musicexpr1) var(musicexpr2) ellipsis()
2048 When the interpretation of this music expression starts, the context
2049 for var(musicexpr1), var(musicexpr2), etc. is that of the total
2052 Lastly, you may wonder, why this:
2056 \notes \relative c'' {
2062 doesn't result in this:
2066 \notes \relative c'' {
2072 For bind(the)code(c4), a default code(Staff) (with a contained
2073 code(Voice)) context is created. After bind(the)code(c4) ends, no
2074 music refers to this default staff, so it would be ended, with the
2075 result shown. To prevent this inconvenient behavior, the context to
2076 which the sequential music refers is adjusted during the
2077 interpretation. So after bind(the)code(c4) ends, the context of the
2078 sequential music is also the default code(Voice) context.
2079 bind(The)code(d4) gets interpreted in the same context
2082 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2084 subsect(Predefined contexts)
2086 These are the contexts supplied with the package. They are defined
2087 in the initialization file file(ly/engraver.ly).
2090 dit(code(Grace))indexcode(Grace) nl()
2091 The context for handling grace notes. It is instantiated
2092 automatically when you use code(\grace). Basically, it is an
2093 `embedded' miniature of the Score context. Since this context
2094 needs special interaction with the rest of LilyPond, you should
2095 not explicitly instantiate it.
2097 dit(code(LyricVoice))indexcode(LyricVoice) nl()
2098 Corresponds to a voice with lyrics. Handles the printing of a
2099 single line of lyrics.
2101 dit(code(Thread))indexcode(Thread) nl()
2102 Handles note heads, and is contained in the Voice context. You
2103 have to instantiate this explicitly if you want to adjust the
2104 style of individual note heads.
2106 dit(code(Voice))indexcode(Voice) nl()
2107 Corresponds to a voice on a staff. This context handles the
2108 conversion of dynamic signs, stems, beams, super- and subscripts,
2109 slurs, ties, and rests.
2111 You have to instantiate this explicitly if you want to have
2112 multiple voices on the same staff.
2114 dit(code(ChordNamesVoice))indexcode(ChordNamesVoice) nl()
2115 A voice with chord names. Handles printing of a line of chord
2118 dit(code(ChordNames))indexcode(ChordNames) nl()
2119 Typesets chord names. Can contain code(ChordNamesVoice)
2122 dit(code(Lyrics))indexcode(Lyrics) nl()
2123 Typesets lyrics. It can contain code(LyricVoice) contexts.
2125 dit(code(Staff))indexcode(Staff) nl()
2126 Handles clefs, bar lines, keys, accidentals. It can contain
2127 code(Voice) contexts.
2129 dit(code(RhythmicStaff))indexcode(RhythmicStaff) nl()
2130 A context like code(Staff) but for printing rhythms. Pitches are
2131 ignored; the notes are printed on one line. It can contain
2132 code(Voice) contexts.
2134 dit(code(GrandStaff))indexcode(GrandStaff) nl()
2135 Contains code(Staff) or code(RhythmicStaff) contexts. It adds a
2136 brace on the left side, grouping the staffs together. The bar
2137 lines of the contained staffs are connected vertically. It can
2138 contain code(Staff) contexts.
2140 dit(code(PianoStaff))indexcode(PianoStaff) nl()
2141 Just like code(GrandStaff) but with code(minVerticalAlign) set
2142 equal to code(maxVerticalAlign) so that interstaff beaming and
2143 slurring can be used.
2145 dit(code(StaffGroup))indexcode(StaffGroup) nl()
2146 Contains code(Staff) or code(RhythmicStaff) contexts. Adds a
2147 bracket on the left side, grouping the staffs together. The bar
2148 lines of the contained staffs are connected vertically. It can
2149 contain code(Staff), code(RhythmicStaff), code(GrandStaff), or
2150 code(Lyrics) contexts.
2152 dit(code(ChoirStaff))indexcode(ChoirStaff) nl()
2153 Identical to code(StaffGroup) except that the contained staffs
2154 are not connected vertically.
2156 dit(code(Score))indexcode(Score) nl()
2157 This is the top level notation context. No other context can
2158 contain a code(Score) context. This context handles the
2159 administration of time signatures. It also makes sure that items
2160 such as clefs, time signatures, and key-signatures are aligned
2161 across staffs. It can contain code(Lyrics), code(Staff),
2162 code(RhythmicStaff), code(GrandStaff), code(StaffGroup), and
2163 code(ChoirStaff) contexts.
2165 You cannot explicitly instantiate a Score context (since it is
2166 not contained in any other context). It is instantiated
2167 automatically when an output definition (a code(\score) or
2168 code(\paper) block) is processed.
2171 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2173 subsect(Context properties)
2175 Properties that are set in one context are inherited by all of the
2176 contained contexts. This means that a property valid for the
2177 code(Voice) context can be set in the code(Score) context (for
2178 example) and thus take effect in all code(Voice) contexts.
2180 Properties can be preset within the code(\translator) block
2181 corresponding to the appropriate context. In this case, the syntax
2185 var(propname) code(=) var(value)
2188 This assignment happens before interpretation starts, so a
2189 code(\property) expression will override any predefined settings.
2191 The code(\property) expression will create any property you specify.
2192 There is no guarantee that a property will be used. So if you spell
2193 a property name wrong, there will be no error message.
2195 The property settings are used during the interpretation phase. They
2196 are read by the LilyPond modules where interpretation contexts are
2197 built of. These modules are called em(translators). Translators for
2198 notation are called em(engravers), and translators for sound are
2199 called em(performers).
2201 The precise result of a property is determined by the implementation
2202 of the translator that reads them. Therefore, the result of a
2203 property can vary, since it is implementation and configuration
2206 In order to fully find out what properties are used, you must
2207 currently search the source code for calls to code(get_property).
2208 The rest of the section is devoted to an (incomplete) overview of
2209 available properties.
2211 subsubsect(Lyrics properties)
2212 cindex(properties!Lyrics)
2215 dit(code(textStyle))indexcode(textStyle) nl()
2216 Set the font for lyrics. The available font choices are
2217 code(roman), code(italic), code(bold), code(large), code(Large),
2218 code(typewriter), and code(finger). The code(finger) font can
2219 only display numbers. Note also that you must be careful when
2220 using code(\property) in Lyrics mode, because of the way strings
2221 are parsed. Either put quotes around the arguments to
2222 code(\property) or be sure to leave a space on both sides of the
2226 subsubsect(Thread properties)
2227 cindex(properties!Thread)
2230 dit(code(noteheadStyle))indexcode(noteheadStyle) nl()
2231 Selects type of note head. Choices are code(cross),
2232 code(diamond), code(harmonic), code(transparent), and code("").
2233 They are shown in that order below.
2238 \property Staff.barNonAuto = 1
2239 \property Voice.noteHeadStyle = cross
2241 \property Voice.noteHeadStyle = diamond
2243 \property Voice.noteHeadStyle = harmonic
2245 \property Voice.noteHeadStyle = transparent
2247 \property Voice.noteHeadStyle = ""
2257 subsubsubsect(Grace properties)
2258 cindex(properties!Grace)
2261 dit(indexandcode(stemStyle)) nl()
2262 By default set to code("grace") meaning that all unbeamed
2263 notes with flags are typeset with a slash through the flag.
2264 Setting to code("") gives standard flags.
2267 subsubsect(Voice properties)
2268 cindex(properties!Voice)
2271 dit(code(abbrev))indexcode(abbrev) nl()
2272 Set length for tremolo to be used if no length is explicitly
2275 dit(code(articulationScriptPadding))indexcode(articulationScriptPadding)
2277 Determines the extra space added between articulation marks, such
2278 as staccato, tenuto, trill, up/down bow or fermata, and the
2279 closest staff line or note.
2281 dit(code(articulationScriptVerticalDirection))
2282 indexcode(articulationScriptVerticalDirection) nl()
2283 Determines the location of articulation marks. Set to code(\up)
2284 to print marks above the staff; set to code(\down) to print marks
2285 below the staff. This property does not override explicit
2286 directions marked with `code(^)' or `code(_)' in the mudela file.
2288 dit(code(noAutoBeaming))indexcode(beamAuto) nl()
2289 If set bind(to)1 then beams are not generated automatically.
2291 dit(code(beamAutoEnd))indexcode(beamAutoEnd) nl()
2292 Specifies when automatically generated beams can end. See
2293 bind(section)ref(autobeam).
2295 dit(code(beamAutoBegin))indexcode(beamAutoBegin) nl()
2296 Specifies when automatically generated beams can start. See
2297 bind(section)ref(autobeam).
2299 dit(code(beamquantisation))indexcode(beamquantisation) nl()
2300 Set to code(\none) for no quantization. Set to code(\normal) to
2301 quantize position and slope. Set to code(\traditional) to avoid
2302 wedges. These three settings are available via
2303 code(\beamposfree)keyindex(beamposfree),
2304 code(\beamposnormal)keyindex(beamposnormal), and
2305 code(\beampostraditional)keyindex(beampostraditional).
2307 dit(code(beamslopedamping))indexcode(beamslopedamping) nl()
2308 Set to code(\none) for undamped beams. Set to code(\normal) for
2309 damped beams. Set to code(\infinity) for beams with zero slope.
2311 code(\beamslopeproportional)keyindex(beamslopeproportional),
2312 code(\beamslopedamped)keyindex(beamslopedamped), and
2313 code(\beamslopezero)keyindex(beamslopezero) each set the
2314 corresponding value.
2316 dit(code(dynamicDirection))indexcode(dynamicDirection) nl()
2317 Determines location of dynamic marks. Set to code(\up) to print
2318 marks above the staff; set to code(\down) to print marks below
2321 dit(code(dynamicStyle))indexcode(dynamicStyle) nl()
2322 Set the text style for dynamics.
2324 dit(code(fontSize))indexcode(fontSize) nl()
2325 Can be used to select smaller font sizes for music. The normal
2326 font size bind(is)0, and the two smaller sizes are -1
2330 dit(code(forceHorizontalShift))indexcode(forceHorizontalShift) nl()
2331 Force horizontal shift for collision resolution. It overrides
2332 automatic collision resolution. The value is the shift amount
2333 expressed in code(note_width), as set in the paper section.
2336 dit(code(horizontalNoteShift))indexcode(horizontalNoteShift) nl()
2337 Enable LilyPond to shift notes horizontally if they collide with
2338 other notes. This is useful when typesetting many voices on one
2339 staff. The identifier code(\shift)keyindex(shift) is defined to
2340 enable this. Traditionally, the outer chords (the upmost and
2341 downmost voices), should have no code(horizontalNoteShift).
2343 dit(code(markScriptPadding))indexcode(markScriptPadding) nl()
2344 Determines the extra space added between the mark and the closest
2347 dit(code(markDirection))indexcode(markDirection) nl()
2348 Determines if marks should be printed above or below the staff.
2349 Set to code(\up) to print marks above the staff; set to
2350 code(\down) to print marks below the staff.
2352 dit(code(midiInstrument))indexcode(midiInstrument) nl()
2353 Sets the instrument for MIDI output. If this property is not set
2354 then LilyPond will use the code(instrument) property. This must
2355 be set to one of the strings on the list of MIDI instruments that
2356 appears in bind(section)ref(midilist). If you use a string which
2357 is not listed, LilyPond will silently substitute piano.
2360 dit(code(oldTieBehavior))indexcode(oldTieBehavior) nl()
2361 Set bind(to)1 in order to get old tie behavior where ties would
2362 connect unequal pitches. This property is deprecated, and its
2363 use is not recommended.
2365 dit(code(restStyle))indexcode(restStyle) nl()
2366 Change the layout of rests shorter than quarter notes.
2367 Currently, the standard layout code("") and mensural notation
2368 code("mensural") are available. Mensural rests of duration
2369 32 or shorter are not available.
2371 dit(code(scriptHorizontal))indexcode(scriptHorizontal) nl()
2372 Put scripts left or right of note heads. Support for this is
2373 limited. Accidentals will collide with scripts.
2375 dit(code(slurVerticalDirection))indexcode(slurVerticalDirection) nl()
2376 Set to code(\free) for free choice of slur direction, set to
2377 code(\up) to force slurs up, set to code(\down) to force slurs
2378 down. The shorthands code(\slurup)keyindex(slurup),
2379 code(\slurdown)keyindex(slurdown), and
2380 code(\slurboth)keyindex(slurboth) are available.
2383 dit(code(slurDash))indexcode(slurDash) nl()
2384 Set bind(to)0 for normal slurs, bind(1)for dotted slurs, and a
2385 larger value for dashed slurs. Identifiers
2386 code(\slurnormal)keyindex(slurnormal) and
2387 code(\slurdotted)keyindex(slurdotted) are predefined to set the
2390 dit(code(stemLength))indexcode(stemLength) nl()
2391 Set length of stems. Unit is `code(interline)/2', so
2392 code(stemLength) defaults bind(to)7.
2394 dit(code(stemLeftBeamCount))indexcode(stemLeftBeamCount) nl()
2395 Specify the number of beams to draw on the left side of the next
2396 note. Overrides automatic beaming. The value is only used once,
2397 and then it is erased.
2399 dit(code(stemRightBeamCount))indexcode(stemRightBeamCount) nl()
2400 Specify the number of beams to draw on the right side of the next
2401 note. Overrides automatic beaming. The value is only used once,
2402 and then it is erased.
2403 dit(code(tieVerticalDirection))indexcode(tieVerticalDirection) nl()
2404 Set to code(\free) for free choice of tie direction, set to
2405 code(\up) to force ties up, set to code(\down) to force ties
2408 dit(code(transposing))indexcode(transposing) nl()
2409 Transpose the MIDI output. Set this property to the number of
2410 half-steps to transpose by.
2413 dit(code(textEmptyDimension))indexcode(textEmptyDimension) nl()
2414 If set bind(to)1 then text placed above or below the staff is
2415 assumed to have zero width.
2417 dit(code(textStyle))indexcode(textStyle) nl()
2418 Set the text style for superscripts and subscripts. See above
2419 for list of text styles.
2421 dit(code(textScriptPadding))indexcode(textScriptPadding) nl()
2422 Determines the extra space added between superscripted resp.
2423 subscripted text and the closest staff line or note.
2425 dit(code(verticalDirection))indexcode(verticalDirection) nl()
2426 Determines the direction of stems, subscripts, beams, slurs, and
2427 ties. Set to code(\down) to force them down, code(\up) to force
2428 them up, or code(\free) to let LilyPond decide. This can be used
2429 to distinguish between voices on the same staff. The
2430 code(\stemdown)keyindex(stemdown), code(\stemup)keyindex(stemup),
2431 and code(\stemboth)keyindex(stemboth) identifiers set this
2435 dit(code(tupletDirection))indexcode(tupletDirection) nl()
2436 Determines the direction of triplets and other tuplets. Set to
2437 code(\down) to force them below the staff, code(\up) to force
2438 them above, or code(\free) to let LilyPond decide.
2440 dit(code(tupletVisibility))indexcode(tupletVisibility) nl()
2441 Determines whether tuplets of notes are labelled. Setting
2442 bind(to)0 shows nothing; setting bind(to)1 shows a number;
2443 setting bind(to)2 shows a number and a bracket if there is no
2444 beam; setting bind(to)3 shows a number, and if there is no beam
2445 it adds a bracket; setting bind(to)4 shows both a number and a
2446 bracket unconditionally.
2450 subsubsubsect(Staff properties)
2451 cindex(properties!Staff)
2455 dit(code(barNonAuto))indexcode(barNonAuto) nl()
2456 If set bind(to)1 then bar lines will not be printed
2457 automatically; they must be explicitly created with code(\bar)
2458 keywords. Unlike with the code(\cadenza) keyword, measures are
2459 still counted. Bar generation will resume according to that
2460 count if this property is set to zero.
2462 dit(code(barNumberDirection))indexcode(barNumberDirection) nl()
2463 Set to code(\up) or code(\down) to put bar numbers above or below
2466 dit(code(barNumberHangOnClef))indexcode(barNumberHangOnClef) nl()
2467 Set bind(to)1 to cause bar numbers to appear above or below the
2468 clef instead of on the bar line. This property is deprecated.
2471 dit(code(barNumberScriptPadding))indexcode(barNumberScriptPadding) nl()
2472 Sets extra space between the bar number and the bar it labels.
2474 dit(code(barSize))indexcode(barSize) nl()
2475 Specify the height of the bar lines if it should be different
2476 than the staff height.
2478 dit(code(barAtLineStart))indexcode(barAtLineStart) nl()
2479 Set bind(to)1 to produce a bar line after the clef at the start
2480 of each line (but not at the beginning of the music).
2482 dit(code(clefStyle))indexcode(clefStyle) nl()
2483 Determines how clefs are typeset. If set to code(transparent),
2484 the clefs are not printed at all, if set to
2485 code(fullSizeChanges), clef changes in the middle of a line are
2486 typeset with a full size clef. By default, clef changes are
2487 typeset in smaller size.
2489 dit(code(createKeyOnClefChange))indexcode(createKeyOnClefChange) nl()
2490 Set to a nonempty string if you want key signatures to be printed
2491 when the clef changes. Set to the empty string if you do not
2492 want key signatures printed.
2494 dit(code(createInitdefaultClef))indexcode(createInitdefaultClef) nl()
2495 Specify whether clefs are created on default? (Doesn't seem to
2498 dit(code(defaultClef))indexcode(defaultClef) nl()
2499 Determines the default clef. See code(\clef) keyword.
2501 dit(code(markHangOnClef))indexcode(markHangOnClef) nl()
2502 Set bind(to)1 to cause marks to appear by clefs instead of by bar
2503 lines. Deprecated, use is not recommended.
2505 dit(code(marginDirection))indexcode(marginDirection) nl()
2506 Set to code(\left) or code(\right) to specify location of
2509 dit(code(marginScriptPadding))indexcode(marginScriptPadding) nl()
2510 Specify extra space for marginal scripts.
2512 dit(code(forgetAccidentals))indexcode(forgetAccidentals) nl()
2513 Causes accidentals to be printed at every note instead of
2514 remembered for the duration of a measure.
2516 dit(code(noResetKey))indexcode(noResetKey) nl()
2517 Do not reset the key at the start of a measure. Accidentals will
2518 be printed only once and are in effect until overridden, possibly
2519 many measures later.
2521 dit(code(staffLineLeading))indexcode(staffLineLeading) nl()
2522 Specifies the distance (in points) between lines of the staff.
2524 dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) nl()
2525 Specifies the number of staff lines. The default bind(is)5.
2527 dit(code(postBreakPadding))indexcode(postBreakPadding) nl()
2528 Extra space in points to be added after the clef, time signature
2529 and key signature on the staff. Deprecated, do not use.
2531 dit(code(noVoltaBraces))indexcode(noVoltaBraces) nl()
2532 Set to true to suppress the printing of brackets over alternate
2533 endings specified by the command code(\alternative).
2535 dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) nl()
2536 Sets the number of lines that the staff has.
2538 dit(code(barAlways))indexcode(barAlways) nl()
2539 If set bind(to)1 a bar line is drawn after each note.
2541 dit(code(defaultBarType))indexcode(defaultBarType) nl()
2542 Sets the default type of bar line. See bind(Section)ref(barlines)
2543 for a list of available bar types.
2545 dit(code(instrument), code(instr))
2546 indexcode(instrument)indexcode(instr) nl()
2547 If code(Staff_margin_engraver)cindex(Staff_margin_engraver) is
2548 added to the Staff translator, then the code(instrument) property
2549 is used to label the first line of the staff and the code(instr)
2550 property is used to label subsequent lines. If the
2551 code(midiInstrument) property is not set, then code(instrument)
2552 is used to determine the instrument for MIDI output.
2554 dit(code(keyOctaviation))indexcode(keyOctaviation) nl()
2555 If set bind(to)1, then keys are the same in all octaves. If set
2556 bind(to)0 then the key signature for different octaves can be
2557 different and is specified independently:
2560 code(\keysignature bes fis')
2563 The default value bind(is)1. Can be set to zero with
2564 code(\specialkey) or reset bind(to)1 with code(\normalkey).
2566 dit(code(timeSignatureStyle))indexcode(timeSignatureStyle) nl()
2567 Changes the default two-digit layout for time signatures. The
2568 following values are recognized:
2571 dit(code(C))indexcode(C) nl()
2572 4/4 and 2/2 are typeset as C and struck C, respectively. All
2573 other time signatures are written with two digits.
2575 dit(code(old))indexcode(old) nl()
2576 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
2577 typeset with old-style mensuration marks. All other time
2578 signatures are written with two digits.
2580 dit(code(1))indexcode(1) nl()
2581 All time signatures are typeset with a single
2582 digit, e.g. 3/2 is written bind(as)3.
2584 dit(indexcode(CM/N)code(C)var(M)code(/)var(N),
2585 indexcode(oldM/N)code(old)var(M)code(/)var(N) or
2586 indexandcode(old6/8alt)) nl()
2587 Tells LilyPond to use a specific symbol as time signature.
2590 The different time signature characters are shown below with its
2595 \notes\relative c'' {
2596 \property Voice.textStyle = typewriter
2597 \property Staff.timeSignatureStyle = "C2/2"
2598 \time 2/2; a2^"C2/2" a2
2599 \property Staff.timeSignatureStyle = "C4/4"
2600 \time 2/2; a2^"C4/4" a2
2601 \property Staff.timeSignatureStyle = "old2/2"
2602 \time 2/2; a2^"old2/2" a2
2603 \property Staff.timeSignatureStyle = "old3/2"
2604 \time 2/2; a2^"old3/2" a2
2605 \property Staff.timeSignatureStyle = "old2/4"
2606 \time 2/2; a2^"old2/4" a2
2607 \property Staff.timeSignatureStyle = "old4/4"
2608 \time 2/2; a2^"old4/4" a2
2609 \property Staff.timeSignatureStyle = "old6/4"
2610 \time 2/2; a2^"old6/4" a2
2611 \property Staff.timeSignatureStyle = "old9/4"
2612 \time 2/2; a2^"old9/4" a2
2613 \property Staff.timeSignatureStyle = "old4/8"
2614 \time 2/2; a2^"old4/8" a2
2615 \property Staff.timeSignatureStyle = "old6/8"
2616 \time 2/2; a2^"old6/8" a2
2617 \property Staff.timeSignatureStyle = "old6/8alt"
2618 \time 2/2; a2^"old6/8alt" a2
2619 \property Staff.timeSignatureStyle = "old9/8"
2620 \time 2/2; a2^"old9/8" a2
2623 linewidth = 4.5 \in;
2628 dit(code(voltaSpannerDuration))indexcode(voltaSpannerDuration) nl()
2629 Set to an integer to control the size of the brackets printed by
2630 code(\alternative). The integer specifies the number of whole
2631 notes duration to use for the brackets. It is rounded to the
2632 nearest measure. This can be used to shrink the length of
2633 brackets in the situation where one alternative is very large.
2634 It may have odd effects if the specified duration is longer than
2635 the music given in an code(\alternative).
2638 subsubsect(GrandStaff properties)
2639 cindex(properties!GrandStaff)
2642 dit(code(alignmentReference))indexcode(alignmentReference) nl()
2643 Set to code(\center) for vertical alignment reference point to be
2644 in the center of the vertical group. Set to code(\up) to put the
2645 reference point at the top of the group.
2647 dit(code(maxVerticalAlign))indexcode(maxVerticalAlign) nl()
2648 Set the maximum vertical distance between staffs.
2650 dit(code(minVerticalAlign))indexcode(minVerticalAlign) nl()
2651 Set the minimum vertical distance between staffs.
2654 subsubsect(Score properties)
2655 cindex(properties!Score)
2658 dit(code(skipBars))indexcode(skipBars) nl()
2659 Set bind(to)1 to skip the empty bars that are produced by
2660 multimeasure notes and rests. These bars will not appear on the
2661 printed output. Set to zero (the default) to expand multimeasure
2662 notes and rests into their full length, printing the appropriate
2663 number of empty bars so that synchronization with other voices is
2667 mudela(fragment,verbatim,center)\
2668 (r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
2673 subsubsect(ChordNamesVoice properties)
2674 cindex(properties!ChordNamesVoice)
2677 dit(code(chordInversion))indexcode(chordInversion) nl()
2678 Determines whether LilyPond should look for chord inversions when
2679 translating from notes to chord names. Set bind(to)1 to find
2680 inversions. The default bind(is)0 which does not look for
2685 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2686 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2688 sect(Notation output definitions)
2690 cindex(notation output)
2691 cindex(output definition)
2695 The most important output definition is the code(\paper) block, for
2696 music notation. The syntax is
2699 code(\paper {) [var(paperidentifier)] var(items) code(})
2702 where each of the items is one of
2705 it() An assignment. The assignment must be terminated by a
2706 semicolon. See bind(section)ref(papervars) for information on
2709 it() A context definition. See bind(section)ref(contextdefs) for
2710 more information on context definitions.
2712 it() A margin shape declaration. The syntax is
2715 code(\shape) var(indent1)code(,) var(width1)code(,)
2716 var(indent2)code(,) var(width2) ellipsis() code(;)
2720 Each pair of var(indent) and var(width) values is a dimension
2721 specifying how far to indent and how wide to make the line.
2722 The indentation and width of successive lines are specified by
2723 the successive pairs of dimensions. The last pair of
2724 dimensions will define the characeristics of all lines beyond
2725 those explicitly specified.
2727 it() A font declaration. Its syntax is
2730 var(fontsize) code(=) code(\font)keyindex(font) var(fontname)
2733 var(fontsize) is an integer describing the font to be used.
2734 bind(0)is the default font. var(fontname) is the basename of
2735 a font (usually a member of the Feta family).
2738 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2740 subsect(Changing Font Size and Paper Size)
2741 cindex(changing font size and paper size)
2743 The Feta font provides musical symbols at six different sizes. These
2744 fonts are bind(11)point, bind(13)point, bind(16)point, bind(20)point,
2745 bind(23)point, and bind(26)point. The point size of a font is the
2746 height of the five lines in a staff when displayed in the font.
2748 Definitions for these sizes are the files file(paperSZ.ly), where
2749 code(SZ) is one of 11, 13, 16, 20, 23 bind(and)26. If you include
2750 any of these files, the identifiers code(paper_eleven),
2751 code(paper_thirteen), code(paper_sixteen), code(paper_twenty),
2752 code(paper_twentythree), and code(paper_twentysix) are defined
2753 respectively. The default code(\paper) block is also set.
2755 To change the paper size, you must first set the
2756 indexandcode(papersize) variable at top level. Set it to the strings
2757 code(a4), code(letter), or code(legal). After this specification,
2758 you must set the font as described above. If you want the default
2759 font, then use the bind(20)point font. The new paper size will not
2760 take effect if the font is not loaded and selected afterwards. Paper
2761 size selection works by loading a file named after the paper size you
2764 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2766 subsect(Paper variables)
2767 cindex(paper variables)
2770 There is a large number of paper variables that are used to control
2771 details of the layout. These variables control the defaults for the
2772 entire score. Usually, they do not have to be changed; they are by
2773 default set to values that depend on the font size in use. The
2774 values are used by the graphic objects while formatting the score;
2775 they are therefore implementation dependent. Most variables are
2776 accompanied by documentation in the initalization file
2777 file(params.ly) or file(paperSZ.ly), where code(SZ) is the staff
2780 Nevertheless, here are some variables you may want to use or change:
2783 dit(code(indent))indexcode(indent) nl()
2784 The indentation of the first line of music.
2786 dit(code(interline))indexcode(interline) nl()
2787 The distance between two staff lines, calculated from the center
2788 of the lines. You should use either this or code(rulethickness)
2789 as a unit for distances you modify.
2791 dit(code(linewidth))indexcode(linewidth) nl()
2792 Sets the width of the lines. If set bind(to)-1.0, a single
2793 unjustified line is produced.
2795 dit(code(output))indexcode(output) nl()
2796 Specifies an alternate name for the the output file(s).
2797 A file(.tex), file(.midi) or file(.ps) extension will be
2798 added to the string you specify.
2800 dit(code(rulethickness))indexcode(rulethickness) nl()
2801 Determines the thickness of staff and bar lines.
2803 dit(code(castingalgorithm))indexcode(castingalgorithm) nl()
2804 The algorithm to use for breaking lines. Choices are
2805 code(\Gourlay)keyindex(Gourlay) for a TeX()-like dynamic
2806 programming algorithm, and code(\Wordwrap)keyindex(Wordwrap) for
2807 a simple algorithm. Gourlay breaking looks much better, but
2808 takes a lot more resources. Wordwrap leaves loosely spaced lines
2812 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2814 subsect(Context definitions)
2816 cindex(context definition)
2818 A notation contexts is defined by the following information
2823 it() The LilyPond modules that do the actual conversion of music to
2824 notation. Each module is a so-called
2825 em(engraver)cindex(engraver).
2827 it() How these modules should cooperate, i.e. which ``cooperation
2828 module'' should be used. This cooperation module is a special
2831 it() What other contexts the context can contain,
2833 it() What properties are defined.
2836 A context definition has this syntax:
2839 code(\translator) code({)
2840 var(translatorinit) var(translatormodifierlist)
2844 var(translatorinit) can be an identifier or of the form
2847 code(\type) var(typename) code(;)
2850 var(typename) is one of
2853 dit(code(Engraver_group_engraver))indexcode(Engraver_group_engraver) nl()
2854 The standard cooperation engraver.
2856 dit(code(Score_engraver))indexcode(Score_engraver) nl()
2857 This is cooperation module that should be in the top level context.
2859 dit(code(Grace_engraver_group))indexcode(Grace_engraver_group) nl()
2860 This is a special cooperation module (resembling
2861 code(Score_engraver)) that is used to created an embedded
2865 var(translatormodifierlist) is a list of items where each item is
2869 it() code(\consists) var(engravername) code(;) nl()
2870 Add var(engravername) to the list of modules in this context.
2871 bind(Section)ref(engravers) contains an overview of the engravers
2872 available. The order of engravers added with code(\consists) is
2875 it() code(\consistsend) var(engravername) code(;) nl()
2876 Analogous to code(\consists), but makes sure that
2877 var(engravername) is always added to the end of the list of
2880 Some engraver types need to be at the end of the list; this
2881 insures they are put there, and stay there, if a user adds or
2882 removes engravers. This command is usually not needed for
2885 it() code(\accepts) var(contextname) code(;) nl()
2886 Add var(contextname) to the list of context this context can
2887 contain. The first listed context the context to create by
2890 it() code(\remove) var(engravername) code(;) nl()
2891 Remove a previously added (with code(\consists)) engraver.
2893 it() code(\name) var(contextname) code(;) nl()
2894 This sets name of the context, e.g. code(Staff), code(Voice). If
2895 the name is not specified, the translator won't do anything.
2897 it() var(propname) code(=) var(value) code(;) nl()
2898 A property assignment. It is allowed to use reals for
2902 In the code(\paper) block, it is also possible to define translator
2903 identifiers. Like other block identifiers, the identifier can only
2904 be used as the very first item of a translator. In order to define
2905 such an identifier outside of code(\score), you must do
2909 foo = \translator { ... }
2916 \translator { \foo ... }
2921 subsubsect(Paper Types, Engravers, and Pre-defined Translators)
2922 cindex(paper types, engravers, and pre-defined translators)
2924 Some pre-defined identifiers can simplify modification of
2925 translators. The pre-defined identifiers are:
2928 dit(code(StaffContext))indexcode(StaffContext) nl()
2929 Default Staff context.
2931 dit(code(RhythmicStaffContext))indexcode(RhythmicStaffContext) nl()
2932 Default RhythmicStaff context.
2934 dit(code(VoiceContext))indexcode(VoiceContext) nl()
2935 Default Voice context.
2937 dit(code(ScoreContext))indexcode(ScoreContext) nl()
2938 Default Score context.
2940 dit(code(ScoreWithNumbers))indexcode(ScoreWithNumbers) nl()
2941 Score context with numbering at the Score level.
2943 dit(code(BarNumberingStaffContext))indexcode(BarNumberingStaffContext) nl()
2944 Staff context with numbering at the Staff level.
2946 dit(code(HaraKiriStaffContext))indexcode(HaraKiriStaffContext) nl()
2947 Staff context that does not print if it only contains rests.
2948 Useful for orchestral scores.footnote(Harakiri, also called
2949 Seppuku, is the ritual suicide of the Samourai.)
2951 dit(code(OrchestralPartStaffContext))indexcode(OrchestralPartStaffContext)
2953 dit(code(OrchestralScoreContext))indexcode(OrchestralScoreContext)
2956 Using these pre-defined values, you can remove or add items to the
2963 \remove Some_engraver;
2964 \consists Different_engraver;
2969 subsubsect(Engravers)
2972 The engravers for paper output are:
2977 dit(code(Bar_engraver))indexcode(Bar_engraver) nl()
2978 Engraves bar lines. Normally in code(Staff) and
2979 code(RhythmicStaff).
2981 dit(code(Bar_number_engraver))indexcode(Bar_number_engraver) nl()
2982 Engrave bar numbers. These numbers appear at the start of each
2983 line. Not normally in any translator. Can be added to
2984 code(Score) for score-wide numbering or to code(Staff) for
2985 numbering on each staff.
2987 dit(code(Beam_engraver))indexcode(Beam_engraver) nl()
2988 Handles beam requests by engraving beams. Normally appears in
2989 the code(Voice) translator. If omitted, then notes will be
2990 printed with flags instead of beams.
2992 dit(code(Beam_req_swallow_translator))
2993 indexcode(Beam_req_swallow_translator) nl()
2994 Swallows beam requests. In code(LyricVoice).
2996 dit(code(Chord_name_engraver))indexcode(Chord_name_engraver) nl()
2997 Engraves chord names. Normally in code(ChordNameVoice) .
2999 dit(code(Chord_tremolo_engraver))indexcode(Chord_tremolo_engraver)
3001 dit(code(Clef_engraver))indexcode(Clef_engraver) nl()
3002 Engraves the clef symbol. Normally in code(Staff).
3004 dit(code(Collision_engraver))indexcode(Collision_engraver)
3006 dit(code(Dot_column_engraver))indexcode(Dot_column_engraver) nl()
3007 Engraves dots on dotted notes shifted to the right of the note.
3008 Normally in code(Voice). If omitted, then dots appear on top of
3011 dit(code(Dynamic_engraver))indexcode(Dynamic_engraver) nl()
3012 Engraves dynamics symbols. Normally in code(Voice).
3014 dit(code(Font_size_engraver))indexcode(Font_size_engraver)
3016 dit(code(Key_engraver))indexcode(Key_engraver) nl()
3017 Engraves the key signature. Normally in code(Staff).
3019 dit(code(Local_key_engraver))indexcode(Local_key_engraver)
3021 dit(code(Lyric_engraver))indexcode(Lyric_engraver) nl()
3022 Engraves lyrics. Normally in code(LyricVoice).
3024 dit(code(Multi_measure_rest_engraver))
3025 indexcode(Multi_measure_rest_engraver) nl()
3026 Engraves multi-measure rests that are produced with code(R).
3027 Normally in code(Voice).
3029 dit(code(Piano_bar_engraver))indexcode(Piano_bar_engraver)
3031 dit(code(Pitch_squash_engraver))indexcode(Pitch_squash_engraver) nl()
3032 Treat all pitches as middle C. Used in code(RhythmicStaff).
3033 Note that the notes move, but the locations of accidentals stay
3036 dit(code(Priority_horizontal_align_engraver))
3037 indexcode(Priority_horizontal_align_engraver)
3039 dit(code(Repeat_engraver))indexcode(Repeat_engraver) nl()
3040 Handles repeats? In code(Staff) and code(RhythmicStaff).
3042 dit(code(Rest_collision_engraver))indexcode(Rest_collision_engraver) nl()
3043 Handles collisions of rests. In code(Staff).
3045 dit(code(Rest_engraver))indexcode(Rest_engraver) nl()
3046 Engraves rests. Normally in code(Voice).
3048 dit(code(Rhythmic_column_engraver))indexcode(Rhythmic_column_engraver)
3050 dit(code(Score_priority_engraver))indexcode(Score_priority_engraver)
3052 dit(code(Script_engraver))indexcode(Script_engraver) nl()
3053 Handles note ornaments generated by code(\script). Normally in
3056 dit(code(Separating_line_group_engraver))
3057 indexcode(Separating_line_group_engraver)
3059 dit(code(Skip_req_swallow_translator))
3060 indexcode(Skip_req_swallow_translator)
3062 dit(code(Slur_engraver))indexcode(Slur_engraver) nl()
3063 Engraves slurs. Normally in code(Voice).
3065 dit(code(Span_bar_engraver))indexcode(Span_bar_engraver) nl()
3066 Engraves lines across multiple staffs. Normally in
3067 code(Staffgroup) and code(GrandStaff). Removing this from
3068 code(StaffGroup) gives the definition of code(ChoirStaff).
3070 dit(code(Span_score_bar_engraver))indexcode(Span_score_bar_engraver)
3072 dit(code(Staff_group_bar_engraver))indexcode(Staff_group_bar_engraver)
3074 dit(code(Staff_margin_engraver))indexcode(Staff_margin_engraver) nl()
3075 Prints the name of the instrument (specified by
3076 code(Staff.instrument) and code(Staff.instr)) at the left of the
3079 dit(code(Staff_sym_engraver))indexcode(Staff_sym_engraver)
3081 dit(code(Stem_engraver))indexcode(Stem_engraver) nl()
3082 Engraves stems. Normally in code(Voice).
3084 dit(code(Ties_engraver))indexcode(Ties_engraver) nl()
3085 Engraves ties. Normally in code(Voice).
3087 dit(code(Time_signature_engraver))indexcode(Time_signature_engraver) nl()
3088 Engraves the time signature. Normally in code(Staff) and
3089 code(RhythmicStaff).
3091 dit(code(Timing_engraver))indexcode(Timing_engraver) nl()
3092 Responsible for synchronizing timing information from staffs.
3093 Normally in code(Score). In order to create polyrhythmic music,
3094 this engraver should be removed from code(Score) and placed in
3097 dit(code(Tuplet_engraver))indexcode(Tuplet_engraver) nl()
3098 Engraves tuplet brackets? In code(Staff).
3100 dit(code(Vertical_align_engraver))indexcode(Vertical_align_engraver)
3104 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3105 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3109 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3111 subsect(output definition)
3113 The MIDI block is analogous to the paper block, but it is simpler.
3114 The code(\midi) block can contain:cindex(MIDI block)
3117 it() a code(\tempo) definition
3118 it() context definitions
3121 Assignments in the code(\midi) block are not allowed.
3123 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3125 subsect(Context definitions)
3126 cindex(context definition)
3128 Context definitions follow precisely the same syntax as within the
3129 \paper block. Translation modules for sound are called performers.
3130 The contexts for MIDI output are defined in file(ly/performer.ly).
3132 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3134 subsect(MIDI Instrument Names)
3135 cindex(MIDI instrument names)
3138 The MIDI instrument name is set by the
3139 indexandcode(Staff.midiInstrument) property or, if that property is
3140 not set, the indexandcode(Staff.instrument) property. The instrument
3141 name should be chosen from the following list. If the selected
3142 string does not exactly match, then LilyPond uses the default piano.
3144 COMMENT( acordina = accordion, tango accordian = concertina
3145 distortion guitar = distorted guitar
3146 orchestral strings = harp
3147 pan flute = wood flute? )
3150 verb("acoustic grand" "contrabass" "lead 7 (fifths)"
3151 "bright acoustic" "tremolo strings" "lead 8 (bass+lead)"
3152 "electric grand" "pizzicato strings" "pad 1 (new age)"
3153 "honky-tonk" "orchestral strings" "pad 2 (warm)"
3154 "electric piano 1" "timpani" "pad 3 (polysynth)"
3155 "electric piano 2" "string ensemble 1" "pad 4 (choir)"
3156 "harpsichord" "string ensemble 2" "pad 5 (bowed)"
3157 "clav" "synthstrings 1" "pad 6 (metallic)"
3158 "celesta" "synthstrings 2" "pad 7 (halo)"
3159 "glockenspiel" "choir aahs" "pad 8 (sweep)"
3160 "music box" "voice oohs" "fx 1 (rain)"
3161 "vibraphone" "synth voice" "fx 2 (soundtrack)"
3162 "marimba" "orchestra hit" "fx 3 (crystal)"
3163 "xylophone" "trumpet" "fx 4 (atmosphere)"
3164 "tubular bells" "trombone" "fx 5 (brightness)"
3165 "dulcimer" "tuba" "fx 6 (goblins)"
3166 "drawbar organ" "muted trumpet" "fx 7 (echoes)"
3167 "percussive organ" "french horn" "fx 8 (sci-fi)"
3168 "rock organ" "brass section" "sitar"
3169 "church organ" "synthbrass 1" "banjo"
3170 "reed organ" "synthbrass 2" "shamisen"
3171 "accordion" "soprano sax" "koto"
3172 "harmonica" "alto sax" "kalimba"
3173 "concertina" "tenor sax" "bagpipe"
3174 "acoustic guitar (nylon)" "baritone sax" "fiddle"
3175 "acoustic guitar (steel)" "oboe" "shanai"
3176 "electric guitar (jazz)" "english horn" "tinkle bell"
3177 "electric guitar (clean)" "bassoon" "agogo"
3178 "electric guitar (muted)" "clarinet" "steel drums"
3179 "overdriven guitar" "piccolo" "woodblock"
3180 "distorted guitar" "flute" "taiko drum"
3181 "guitar harmonics" "recorder" "melodic tom"
3182 "acoustic bass" "pan flute" "synth drum"
3183 "electric bass (finger)" "blown bottle" "reverse cymbal"
3184 "electric bass (pick)" "skakuhachi" "guitar fret noise"
3185 "fretless bass" "whistle" "breath noise"
3186 "slap bass 1" "ocarina" "seashore"
3187 "slap bass 2" "lead 1 (square)" "bird tweet"
3188 "synth bass 1" "lead 2 (sawtooth)" "telephone ring"
3189 "synth bass 2" "lead 3 (calliope)" "helicopter"
3190 "violin" "lead 4 (chiff)" "applause"
3191 "viola" "lead 5 (charang)" "gunshot"
3192 "cello" "lead 6 (voice)")
3195 subsubsect(MIDI Types and Performers)
3196 cindex(MIDI types and performers)
3198 The types available for MIDI translators are:
3201 dit(code(Performer_group_performer))indexcode(Performer_group_performer)
3202 dit(code(Score_performer))indexcode(Score_performer)
3203 dit(code(Staff_performer))indexcode(Staff_performer)
3206 The performers for MIDI translators are:
3209 dit(code(Key_performer))indexcode(Key_performer)
3210 dit(code(Time_signature_performer))indexcode(Time_signature_performer)
3211 dit(code(Note_performer))indexcode(Note_performer)
3212 dit(code(Lyric_performer))indexcode(Lyric_performer)
3213 dit(code(Swallow_performer))indexcode(Swallow_performer)
3217 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3218 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3220 sect(Pre-defined Identifiers)
3221 cindex(pre-defined identifiers)
3224 Various identifiers are defined in the initialization files to
3225 provide shorthands for some settings. Most of them are in
3226 file(ly/declarations.ly).
3229 dit(code(\break))keyindex(break) nl()
3230 Force a line break in music by using a large argument for the
3231 keyword code(\penalty).
3233 dit(code(\center))keyindex(center) nl()
3234 Used for setting direction properties. bind(Equals)0.
3236 dit(code(\down))keyindex(down) nl()
3237 Used for setting direction setting properties. Is equal
3240 dit(code(\free))keyindex(free) nl()
3241 Used for setting direction setting properties. Is equal
3244 dit(code(\left))keyindex(left) nl()
3245 Used for setting text alignment property. Is equal bind(to)-1.
3247 dit(code(\nobreak))keyindex(nobreak) nl()
3248 Prevent a line break in music by using a large negative argument
3249 for the keyword code(\penalty).
3251 dit(code(\none))keyindex(none) nl()
3252 Used for setting code(Score.beamslopedamping) and
3253 code(Score.beamquantisation) properties. Is equal bind(to)0.
3255 dit(code(\normal))keyindex(normal) nl()
3256 Used for setting code(Score.beamslopedamping) and
3257 code(Score.beamquantisation) properties. Is equal bind(to)1.
3259 dit(code(\normalkey))keyindex(normalkey) nl()
3260 Select normal key signatures where each octave has the same key
3261 signature. This sets the code(Staff.keyoctaviation) property.
3263 dit(code(\right))keyindex(right) nl()
3264 Used for setting text alignment property. Is set bind(to)1.
3266 dit(code(\shiftoff))keyindex(shiftoff) nl()
3267 Disable horizontal shifting of note heads that collide. Sets the
3268 code(Voice.horizontalNoteShift) property.
3270 dit(code(\shifton))keyindex(shifton) nl()
3271 Enable note heads that collide with other note heads to be
3272 shifted horiztonally. Sets the code(Voice.horizontalNoteShift)
3275 dit(code(\slurboth))keyindex(slurboth) nl()
3276 Allow slurs to be above or below notes. This sets the
3277 code(Voice.slurVerticalDirection) property.
3279 dit(code(\slurdown))keyindex(slurdown) nl()
3280 Force slurs to be below notes. This sets the
3281 code(Voice.slurVerticalDirection) property.
3283 dit(code(\slurup))keyindex(slurup) nl()
3284 Force slurs to be above notes. This sets the
3285 code(Voice.slurVerticalDirection) property.
3287 dit(code(\specialkey))keyindex(specialkey) nl()
3288 Allow key signatures do differ in different octaves. This sets
3289 the code(Staff.keyoctaviation) property.
3291 dit(code(\stemboth))keyindex(stemboth) nl()
3292 Allow stems, beams, and slurs to point either upwards or
3293 downwards, decided automatically by LilyPond. This sets the
3294 code(Voice.verticalDirection) property.
3296 dit(code(\stemdown))keyindex(stemdown) nl()
3297 Force stems, beams, and slurs to point down. This sets the
3298 code(Voice.verticalDirection) property.
3300 dit(code(\stemup))keyindex(stemup) nl()
3301 Force stems, beams and slurs to point up. This sets the
3302 code(Voice.verticalDirection) property.
3304 dit(code(\traditional))keyindex(traditional) nl()
3305 Used for setting the code(Score.beamquantisation) property. Is
3308 dit(code(\up))keyindex(up) nl()
3309 Used for setting various direction properties. Is equal
3314 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3315 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3317 sect(Running LilyPond)
3318 cindex(running LilyPond)
3321 When invoked with a filename that has no extension, LilyPond will try
3322 adding `file(.ly)' as an extension first, then `file(.fly)' and
3323 finally `file(.sly)' extension. If the filename ends with
3324 `file(.fly)', LilyPond processes the file as music using
3325 `file(init.fly)'. In this case, LilyPond does something like:
3330 \input "yourfile.fly"
3336 The result of `file(.sly)' is similar except that a single unjustified
3339 If you invoke LilyPond with a file `file(foo.)var(ext)' that doesn't
3340 have the `file(.ly)' extension, then LilyPond will look for a file
3341 called `file(init.)var(ext)' and process this file. The file
3342 `file(init.)var(ext)' must contain the code(\maininput) keyword or
3343 LilyPond will not read the user specified file.
3345 When LilyPond processes file(filename.ly) it will produce
3346 file(filename.tex) as output. If file(filename.ly) contains a second
3347 code(\paper) keyword, then LilyPond will produce file(filename-1.tex)
3348 as well. Subsequent code(\paper) keywords will produce sequentially
3349 numbered file names. Several files can be specified; they will each
3350 be processed independently.footnote(Not entirely true: The status of
3353 whenlatex(latexcommand(\printindex))
3355 COMMENT(End of reference-manual.yo)