1 mailto(gnu-music-discuss@gnu.org)
4 redef(var)(1)(whenlatex(latexcommand({\normalfont\scshape )ARG1+latexcommand(}))\
8 def(indexcode)(1)(cindex(ARG1@code(ARG1)))
9 def(indexandcode)(1)(code(ARG1)indexcode(ARG1))
10 def(keyindex)(1)(cindex(ARG1@code(\ARG1)))
12 redef(code)(1)(tt(ARG1))
19 restStyle=mensural doesn't seem to work (lots of characters not found
29 This document contains Mudela fragments. You need at least
30 Yodl-1.30.18 to convert this to tex or html.
33 htmlbodyopt(bgcolor)(white)
34 htmlcommand(<font color=black>)
37 \setlength{\topmargin}{-0.25in}
38 \setlength{\textheight}{9in}
39 \setlength{\textwidth}{5.875in}
40 \setlength{\oddsidemargin}{0.25in}
41 \setlength{\evensidemargin}{0.25in}
47 whentexinfo(notableofcontents())
49 article(LilyPond 1.2.0 Reference Manual)
50 (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen)
51 (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop())
54 latexcommand(\def\interexample{})
55 latexcommand(\def\preexample{\par})
56 latexcommand(\def\postexample{\par\medskip})
57 latexcommand(\def\file#1{{code(#1)}})
59 latexcommand(\def\texttt#1{\tt #1})
60 latexcommand(\def\textbf#1{\bf #1})
63 COMMENT(urg, texinfo include breaks)
65 includefile(html-disclaimer.yo-urg)
73 This nop(document)footnote(This document was revised for LilyPond
74 1.2.) describes the the GNU LilyPond input format, which is a
75 language for defining music. We call this language Music Definition
76 Language or Mudela, for short.footnote(If anybody comes up with a
77 better name, we'd gladly take this. Gourlay already uses Musical
78 Description Language, ISO standard
79 10743 defines a Standard Music Description Language. We're not being
82 Mudela is a language that allows you to
84 it() create musical expressions by combining pitches, durations
85 it() output those musical expressions to various formats
86 it() give those musical expressions and output definitions names, so
87 you can enter them in manageable chunks.
90 Mudela aims to define a piece of music completely, both from
91 typesetting and from a performance point of view.
93 sect(Top level)cindex(top level)
95 This section describes what you may enter at top level.
97 subsect(Score definitions)cindex(score definition)
99 The output is generated combining a music expression with an output
100 definition. A score block has the following syntax code(\score {)
101 var(musicexpr) var(outputdefs) code(}). var(outputdefs) are zero or
102 more output definitons. If no output definiton is supplied, the
103 default code(\paper) block will be added.
105 subsect(Information header)cindex(header)keyindex(header)
107 The syntax is code(\header) code({) var(key1) = var(val1); var(key2) = var(val2); ... code(}))
109 A header describes the file's contents. It can also appear in a
110 code(\score) block. Tools like indexandcode(ly2dvi) can use this
111 information for generating titles. Key values that are used by ly2dvi
112 are: title, subtitle, composer, opus, poet, instrument, metre,
113 arranger, piece and tagline.
115 It is customary to put the code(\header) at the top of the file.
117 subsect(Setting notenames and chordnames)
120 Note name tables can be specified using code(\notenames)keyindex(notenames) code({)
121 var(assignmentlist) code(}). var(assignmentlist) is a list of definitions of
122 the form var(name) = var(pitch).
124 Chord modifiers can be set analogously, with
125 code(\chordmodifiers)keyindex(chordmodifiers).
129 subsect(Output definitions)
131 A code(\paper) block at top level sets the default paper block. A
132 code(\midi) block at top level works similarly.
135 subsect(GUILE and Scheme)
137 LilyPond contains a Scheme interpreter (the GUILE library) for
138 internal use. The following commands access the interpreter directly.
140 code(\scm)keyindex(scm) var(scheme)code(;) evaluates the specified Scheme
141 code. The result is discarded. keyindex(scm)
143 code(\scmfile)keyindex(scmfile) var(filename)code(;) reads Scheme code from the
144 specified file. The result is discarded. keyindex(scmfile)
148 Identifier assignments may appear at top level. Semicolons are
149 forbidden after top level assignments.
152 sect(Lexical conventions)cindex(Lexical conventions)
154 subsect(Comments)cindex(Comments)
157 A one line comment is introduced by a indexandcode(%)
158 character. Block comments are started by code(%{) and ended by
159 code(%}). They cannot be nested.
165 Keywords start with a backslash, followed by a number of lower case
166 alphabetic characters. This are all the keywords.
168 verb(\accepts \addlyrics \alternative \bar \breathe \cadenza
169 \chordmodifiers \chords \clef \cm \consists \consistsend \context
170 \duration \font \grace \header \in \key \keysignature \lyrics \mark
171 \midi \mm \musicalpitch \name \notenames \notes \paper \partial
172 \penalty \property \pt \relative \remove \repeat \repetitions \scm
173 \scmfile \score \script \sequential \shape \simultaneous \skip
174 \spanrequest \tempo \textscript \time \times \translator \transpose
178 subsect(Integers)cindex(Integers)
180 Formed from an optional minus sign followed by digits. Arithmetic
181 operations cannot be done with integers, and integers cannot be mixed
184 subsect(Reals)cindex(Reals)
185 Formed from an optional minus sign and a sequence of digits followed
186 by a em(required) decimal point and an optional exponent such as
187 code(-1.2e3). Reals can be built up using the usual operations:
188 indexandcode(+), indexandcode(-), indexandcode(*), and indexandcode(/), with parentheses for grouping.
190 A real constant can be followed by one of the dimension keywords:
191 cindex(dimension) code(\mm)keyindex(mm), code(\pt)keyindex(pt),
192 code(\in)keyindex(in), or code(\cm)keyindex(cm), for millimeters,
193 points, inches and centimeters. This converts the number a real that
194 is the internal representation of dimensions.
196 subsect(String)cindex(String)
198 Begins and ends with the code(") character. To include a code(")
199 character in a string write code(\"). Various other backslash
200 sequences have special interpretations as in the C language. A string
201 that contains no spaces can be written without the quotes. See
202 Section ref(modes) for details on unquoted strings; their
203 interpretation varies depending on the situation. Strings can be
204 concatenated with the code(+) operator.
209 subsect(Tokenizer commands)
211 The tokenizer accepts the following commands. They can appear
216 dit(code(\maininput)) keyindex(maininput) This command is used in init
217 files to signal that the user file must be read. It is illegal to use
218 this command in a user file.
220 dit(code(\include) var(file))keyindex(include) Include var(file). The
221 argument var(file) may be a quoted string, (An unquoted string will
222 not work here.) or a string identifier. The full filename including
223 the file(.ly) extension must be given,
225 dit(code(\version) var(string)code(;))
227 Specify the version of LilyPond that a
228 file was written for. The argument is a version string in quotes, for example
229 code("1.2.0"). This is used to detect invalid input, and to aid
230 code(convert-mudela), a tool that automatically upgrades input files.
233 subsect(Pitch Names in Other Languages)cindex(other languages)
236 Note name definitions have been provided in various languages.
237 Simply include the language specific init file. For example:
238 code(\include "english.ly"). The available language files and the names
241 verb( Note Names sharp flat
242 nederlands.ly c d e f g a bes b -is -es
243 english.ly c d e f g a bf b -s/-sharp -f/-flat
244 deutsch.ly c d e f g a b h -is -es
245 norsk.ly c d e f g a b h -iss/-is -ess/-es
246 svenska.ly c d e f g a b h -iss -ess
247 italiano.ly do re mi fa sol la sid si -d -b
248 catalan.ly do re mi fa sol la sid si -d/-s -b)
250 Pitch names can be redefined using the
251 code(\notenames)keyindex(notenames) command, see Subsection
254 subsect(Lexical modes)cindex(Lexical modes)cindex(modes)
257 To simplify entering notes, lyrics and chrds Mudela has three special
258 input modes on top of the default mode. In each mode, words are
259 identified on the input. If code("word") is encountered, it is
260 treated as a string. If code(\word) is encountered it is treated as a
261 keyword or as an identifier. The behavior of the modes differs in two
262 ways: different modes treat unquoted words differently, and different
263 modes have different rules for deciding what is a word.
266 dit(Normal mode)cindex(mode!normal)
267 At the start of parsing, Mudela is in normal mode.
268 In normal mode, a word is an alphabetic character followed by
269 alphanumeric characters. If code(word) is encountered on the input it
270 is treated as a string.
272 dit(Note mode) cindex(mode!note) Note mode is introduced by the keyword
273 code(\notes)keyindex(notes). In Note mode, words can only contain alphabetic
274 characters. If code(word) is encountered, LilyPond first checks for a
275 notename of code(word). If no notename is found, then code(word) is
278 Since combinations of numbers and dots are used for indicating
279 durations, it is not possible to enter real numbers in this mode.
281 dit(Chord mode)cindex(mode!chord) Chord mode is introduced by the keyword
282 code(\chords)keyindex(chords). It is similar to note mode, but words are also looked
283 up in a chord modifier table (containg code(maj), code(dim) etc.)
285 Since combinations of numbers and dots are used for indicating
286 durations, you can not enter real numbers in this mode. Dashes and
287 carets are used to indicate chord additions and substractions, so
288 scripts can not be entered in chord mode.
290 dit(Lyric mode) cindex(mode!lyric) Lyrics mode is introduced by the keyword
291 code(\lyrics)keyindex(lyrics). This mode is has rules that make it easy to include
292 punctuation and diacritical marks in words. A word in Lyrics mode
293 begins with: an alphabetic character, code(_), code(?), code(!),
294 code(:), code('), the control characters code(^A) through code(^F),
295 code(^Q) through code(^W), code(^Y), code(^^), any 8-bit character
296 with ASCII code over 127, or a two character combination of a
297 backslash followed by one of code(`), code('), code(") or
298 code(^).footnote(The purpose of lyrics mode is that you can enter lyrics in
299 TeX() format or a standard encoding without needing quotes. The
300 precise definition of this mode indeed is ludicrous. This will remain
301 so until the authors of LilyPond acquire a deeper understanding of
302 character encoding, or someone else steps up to fix this.)
304 Subsequent characters of a word can be any character that is not a
305 digit and not white space. One important consequence of this is that
306 a word can end with code(}), which may be confusing if you thought the
307 code(}) was going to terminate lyrics mode.footnote(LilyPond will
308 issue a warning, though). Any code(_) characters
309 which appear in an unquoted word are converted to spaces. This
311 mechanism for introducing spaces into words without using quotes.
312 Quoted words can also be used in lyrics mode to specify words that
313 cannot be specified with the above rules. Here are some examples.
314 Not all of these words are printable by TeX().
316 DOEXPAND(muckslash)^etre % a word
318 2B_||_!2B % not a word because it starts with a digit
319 ``Hello'' % not a word because it starts with `
320 _ _ _ _ % 4 words, each one a space
324 Since combinations of numbers and dots are used for indicating
325 durations, you can not enter real numbers in this mode.
329 It is possible to create words that break the rules by prefixing them
330 with the dollar sign indexandcode($). Regardless of the context, a word
331 beginning with code($) extends until the next white space character.
332 Such words can contain numbers (even in Note mode), or other forbidden
333 characters. The dollar sign can be used to create and access
334 identifiers that could not otherwise be used.footnote(Use of $ hampers
335 readability and portability to future LilyPond versions. Use of $ is
341 sect(Types)cindex(Types and identifiers)
343 Mudela has a limited set of types:
348 it() music expressions,
349 it() durations of notes and rests (specified with code(\notenames)keyindex(notenames)),
350 it() note name tables,
351 it() context definitions, Part of output definitions. See Section ref(contextdefs) for more
353 it() output definitions (like code(\paper)keyindex(paper) blocks and
354 code(\midi)keyindex(midi) blocks),
355 it() score definitions. (code(\score)keyindex(score) blocks)
359 Type is a syntactical property: Mudela has no real type system, so
360 there is no support for generic expressions, functions or user defined
361 types. For the same reason, it is not possible to mix reals and
362 integers in arithmetic expressions, and ``type errors'' cindex(type error) (eg. using a
363 string identifier to initialize a code(\paper)keyindex(paper) block)
364 will yield ``parse error''.
366 Identifiers allow objects to be assigned to names. To assign an
367 identifier you use var(name)=var(value) and to refer to an identifier,
368 you preceed its name with a backslash: code(\)var(name). Identifier
369 assignments must appear at the top level in the Mudela file.
370 Semicolons are forbidden after assignments appearing at the top level
371 but they are obligatory after assignments appearing elsewhere.
373 var(value) is any of the types listed above.
375 An identifier can be created with any string for its name, but you
376 will only be able to refer to identifiers whose names begin with a
377 letter and are entirely alphanumeric. It is impossible to refer to an
378 identifier whose name is the same as the name of a keyword.
380 The right hand side of an identifier assignment is parsed completely
381 before the assignment is done, so it is legal to redefine an
382 identifier in terms of its old value: code(foo = \foo * 2.0).
385 When an identifier is referenced, the information that it points to is
386 copied. Therefore it only makes sense to put identifiers for
387 translators, output definitions and code(\score)keyindex(score) blocks as the first
388 item in a block. For this reason, if you reference to a code(\foo)
389 variable in a code(\foo) block, it must be the first item in the list
390 following code(\foo).footnote(code(\paper{\one \two}) does not make
391 sense, because the information of code(\two) would overwrite the
392 information of code(\one), thereby making the reference to the first
397 sect(Music expressions)cindex(Music expressions)
399 Music in mudela is entered as a music expression. Notes, rests, lyric
400 syllables are music expressions (the atomic expressions),
401 cindex(atomic music expressions) and you can
402 combine music expressions to form new ones. This example
403 forms a compound expressions out of the quarter code(c) note and a
404 code(d) note:COMMENT(
406 )verb(\sequential { c4 d4 })COMMENT(
408 )The meaning of this compound expression is to play the code(c) first,
409 and then the code(d) (as opposed to playing them simultaneously, for
412 Atomic music expression are discussed in
413 bind(Subsection)ref(atomicmusic). Compound music expressions are
414 discussed in bind(Subsection)ref(compoundmusic).
416 sect(Atomic music expressions)
419 subsect(Pitch and duration)cindex(pitch)cindex(duration)
421 The syntax for pitch specification is
422 code(\musicalpitch)keyindex(musicalpitch) code({) var(octave)
423 var(note) var(shift) code(}) The octave is specified by an integer,
424 zero for the octave containing middle C. The note is a number from 0
425 to 7, with 0 corresponding to C and 7 corresponding to B. The shift
426 is zero for a natural, negative to add flats, or positive to add
429 In note and chord mode, pitches may be designated by names.
430 See Section ref(notelang) for pitch names in different languages.
432 The syntax for duration specification is
433 code(\duration)keyindex(duration) code({) var(length) var(dotcount)
434 code(}) var(length) is the negative logarithm (base 2) of duration: 1
435 is a half note, 2 is a quarter note, 3 is an eighth note, etc. The
436 number of dots after the note is given by var(dotcount).
438 In note, chord and lyric mode, durations may be designated by numbers
439 and dots. See Section ref(notelang) for details.
444 subsect(Note specification)label(notedesc)
446 cindex(Note Specification)
447 cindex(pitches)cindex(entering notes)
449 A note specification has the form
450 var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)]. The
451 pitch of the note is specified by the note's name.
455 The default names are the Dutch note names. The notes are specified
456 by the letters code(c) through code(b), where code(c) is an octave
457 below middle C and the letters span the octave above that C. In
458 Dutch,cindex(notenames!Dutch) a sharp is formed by adding code(-is) to
459 the end of a pitch name. A flat is formed by adding code(-es).
460 Double sharps and double flats are obtained by adding code(-isis) or
461 code(-eses). code(aes) and code(ees) are contracted to code(as) and
462 code(es) in Dutch, but both forms will be accepted.q
465 Lily has predefined sets of notenames for various
466 languages. See Section ref(notelang) for details.
470 The optional octave specification takes the form of a series of single
471 quote indexandcode(') characters or a series of comma indexandcode(,)
472 characters. Each code(') raises the pitch by one octave; each code(,)
473 lowers the pitch by an octave.
475 mudela(fragment,verbatim,center)(
476 c' d' e' f' g' a' b' c''
479 mudela(fragment,verbatim,center)(
480 cis' dis' eis' fis' gis' ais' bis'
483 mudela(fragment,verbatim,center)(
484 ces' des' es' fes' ges' as' bes'
487 mudela(fragment,verbatim,center)(
488 cisis' eisis' gisis' aisis' beses'
491 mudela(fragment,verbatim,center)(
492 ceses' eses' geses' ases' beses'
495 Whenever a C-sharp is desired, you must specify a C-sharp. LilyPond
496 will determine what accidentals to typeset depending on the key and
498 A reminder accidental cindex(reminder accidental) can be forced by
499 adding an exclamation mark `code(!)'
501 A cautionary accidental, cindex(cautionary accidental) i.e., an accidental within parentheses
502 can be obtained by adding the question mark `indexandcode(?)' after
505 )mudela(fragment,verbatim,center)(
506 cis' d' e' cis' c'? d' e' c'!
512 Durations are entered as their reciprocal values. For notes longer
513 than a whole note, use identifiers.
516 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
520 \notes \relative c'' {
522 a1 a2 a4 a8 a16 a32 a64 a64
525 loose_column_distance = 2.5 * \interline;
527 \translator { \type "Score_engraver";
529 \consists "Note_heads_engraver";
530 \consists "Stem_engraver";
531 \consists "Rhythmic_column_engraver";
535 r1 r2 r4 r8 r16 r32 r64 r64
537 \notes \relative c'' {
539 r1 r2 r4 r8 r16 r32 r64 r64
542 loose_column_distance = 2.5 * \interline;
544 \translator { \type "Score_engraver";
546 \consists "Rest_engraver";
547 \consists "Stem_engraver";
548 \consists "Rhythmic_column_engraver";
551 If the duration is omitted then it is set equal to the previous
552 duration. If there is no previous duration, then a quarter note is
553 assumed. The duration can be followed by a dot indexandcode(.) to
554 obtain dotted note lengths. COMMENT(
556 )mudela(fragment,verbatim,center)(
560 You can alter the length of duration by writing code(*)var(fraction)
561 after a it. This will not affect the appearance of noteheads or
566 Rests are entered like notes, with note name indexandcode(r),
567 indexandcode(s) or indexandcode(R). There is also a note name which
568 produces a nonprinting note of the specified duration. code(R) is
569 specifically meant for entering parts: the code(R) rest can expand to
570 fill a score with rests, or it can be printed as a single multimeasure resst.
572 subsubsect(Lyrics syllables)cindex(Lyric expressions)
574 Syllables are entered like notes, with pitches replaced
575 by text. For example code(Twin-4 kle4 twin-4 kle4) enters four
576 syllables, each with quarter note duration. Note that the hyphen has
577 no special meaning for lyrics, and does not introduce special symbols.
578 See Section ref(modes) for a description of what is interpreted as a lyric.
580 Spaces can be introduced into a lyric either by using quotes (code("))
581 or by using an underscore without quotes: code(He_could4 not4). All
582 unquoted underscores are converted to spaces. Printing lyrics is
583 discussed in Section ref(lyricprint).
585 subsect(Properties)cindex(Properties)
587 code(\property)keyindex(property) var(contextname)code(.)var(propname) code(=) var(value)
588 Sets the var(propname) property of the context var(contextname) to the
589 specified var(value). All three arguments are strings. Depending on
590 the context it may be necessary to quote the strings or to leave space
591 on both sides of the dot.
593 subsect(Translator switches)cindex(Translator switches)
595 code(\translator)keyindex(translator) var(contexttype) = var(name)
596 A music expression that the context which is a direct child of the
597 a context of type var(contexttype) should be shifted to a context of
598 type var(contexttype) and the specified name.
600 Usually this is used to switch staffs in Piano music,
601 eg. code(\translator Staff = top )var(Music)
603 subsect(Commands)cindex(Commands)
605 Commands are music expressions that have no duration.
607 subsubsect(Key signatures)
609 code(\key)keyindex(key) var(pitch) var(type) code(;) Change the key
610 signature. var(type) should be code(\major)keyindex(major) or code(\minor)keyindex(minor)
611 to get var(pitch)-major or var(pitch)-minor, respectively. The second
612 argument is optional, the default is major keys. The var(\context)
613 argument can also be given as an integer, which tells the number of
614 semitones that should be added to the pitch given in the subsequent
615 code(\key)keyindex(key) commands to get the corresponding major key,
616 e.g. code(\minor)keyindex(minor) is defined as 3. The standard mode names
617 code(\ionian)keyindex(ionian), code(\locrian)keyindex(locrian), code(\aeolian)keyindex(aeolian),
618 code(\mixolydian)keyindex(mixolydian), code(\lydian)keyindex(lydian), code(\phrygian)keyindex(phrygian), and
619 code(\dorian)keyindex(dorian) are also defined.
622 code(\keysignature)keyindex(keysignature) var(pitchseq)code(;)
623 Specify an arbitrary key signature. The pitches from var(pitch) will
624 be printed in the key signature in the order that they appear on the list.
627 subsubsect(Rehearsal marks)
629 code(\mark)keyindex(mark) var(unsigned)code(;) or code(\mark)
630 var(string)code(;) A music expression. Prints a mark over or under
631 (depending on the indexandcode(markDirection) property) the staff. You must
632 add indexandcode(Mark_engraver) to the either Score or Staff context for this
636 subsubsect(Bar lines)
638 code(\bar)keyindex(bar) var(bartype)code(;) This is a request to print
639 a special bar symbol, or at measure boundaries. It replaces the
640 regular bar symbol with a special symbol. The argument var(bartype)
641 is a string which specifies the kind of bar to print. Options are
642 indexandcode(":|"), indexandcode("|:"), indexandcode(":|:"),
643 indexandcode("||"), indexandcode("|."), indexandcode(".|"), or
644 indexandcode(".|."). These produce respectively a right repeat, a
645 left repeat, a double repeat, a double bar, a start bar, an end bar,
646 or a thick double bar. If var(bartype) is set to code("empty") then
647 nothing is printed, but a line break is allowed at that spot.
649 You are encouraged to use code(\repeat) for repetitions. See Section ref(sec:repeats)
651 subsubsect(Timing commands)
653 code(\cadenza)keyindex(cadenza) var(togglevalue)code(;) Music expression that
654 toggles the automatic generation of bar lines. If var(togglevalue) is
655 0 then bar line generation is turned off. If var(togglevalue) is 1
656 then a bar is immediately printed and bar generation is turned on.
658 code(\time)keyindex(time) var(numerator)code(/)var(denominator)code(;) Change the time
659 signature. The default time signature is 4/4. The time signature is
660 used to generate bar lines.
662 code(\partial )var(duration)code(;) Music expression that makes
663 the first measure of the music last for the specified duration. keyindex(partial)
665 code(\tempo)keyindex(tempo) var(duration) = var(perminute)code(;) Used
666 to specify the tempo. For example, `code(\tempo 4 = 76;)' requests
667 output with 76 quarter notes per minute.
669 code(\partial)keyindex(partial)var( duration)code(;) This creates an incomplete
670 measure at the start of the music, eg. code(\partial 8*2;) creates a
671 starting measure lasting two eighth notes.cindex(anacrusis)cindex(upstep)
673 code(|)cindex(|)cindex(barcheck)
675 code(|) is a barcheck. Whenever a barcheck is encountered during
676 interpretation, a warning message is issued if it doesn't fall at a
677 measure boundary. This can help you finding errors in the input. The
678 beginning of the measure will also be relocated, so this can also be
679 used to shorten measures.cindex(shorten measures)cindex(upstep)
681 subsubsect(Other commands)
683 code(\penalty)keyindex(penalty) var(int)code(;)
684 Discourage or encourage line breaks. See identifiers code(\break)keyindex(break) and
685 code(\nobreak)keyindex(nobreak) in Section ref(ident).
687 code(\clef)keyindex(clef) var(clefname)code(;) Music expression that
688 sets the current clef. The argument is
689 a string which specifies the name of the clef. Several clef names are
690 supported. If code(_8) or code(^8) is added to the end of a clef
691 name then the clef lowered or raised an octave will be generated.
692 Here are the supported clef names with middle C shown in each clef:
696 %\property Voice.textStyle = typewriter
697 \clef subbass; c'4-"\kern-10mm subbass"
698 \clef bass; c'4^"\kern -8mm bass"
699 \clef baritone; c'4_"\kern -10mm baritone"
700 \clef varbaritone; c'4^"\kern -10mm varbaritone"
701 \clef tenor; c'4_"\kern -10mm tenor"
702 \clef "G_8"; c'4^"\kern -6mm G\_8"
704 \paper{ linewidth= 4.5 \in; }
709 \notes{\cadenza 1; \clef alto; c'4_"\kern -10mm alto"
710 \clef mezzosoprano; c'4^"\kern -10mm mezzosoprano"
711 \clef soprano; c'4_"\kern -10mm soprano"
712 \clef treble; c'4^"\kern -6mm treble"
713 \clef french; c'4_"\kern -10mm french" }
714 \paper{ linewidth= 4.5 \in; }
717 The treble clef can also be obtained using the names code(G) or
718 code(violin). The bass clef is also available by code(\clef F).
720 code(\skip)keyindex(skip) var(duration)code(;) Skips the amount of time
721 specified by var(duration). If no other music is played, a gap will
722 be left for the skipped time with no notes printed. It works in Note
723 Mode or Lyrics Mode. In note mode, this has the same effect as the
727 subsubsect(Beams)cindex(beams)
730 A beam is specified by surrounding the beamed notes with brackets
731 indexandcode([) and indexandcode(]).
732 mudela(fragment,verbatim,center)(
733 [a'8 a'] [a'16 a' a' a']
735 Some more elaborate constructions:
736 mudela(fragment,verbatim,center)(
737 [a'16 <a' c''> c'' <a' c''>]
738 \times 2/3 { [e'8 f' g'] }
741 Beaming can be generated automatically see Section ref(autobeam).
743 cindex(Tremolo beams)
745 To place tremolo marks in between two notes, begin with
746 code([:)var(length) and end with code(]). The tremolo marks will
747 appear instead of beams. Putting more than two notes in such a
748 construction will produce odd effects.
750 mudela(fragment,verbatim,center)(
751 [:16 e'1 g'] [:8 e'4 f']
754 mudela(fragment,verbatim,center)(
758 COMMENT(ref to normal tremolos?)
760 subsubsect(Lyric helpers)
761 cindex(--)cindex(__)cindex(extender)cindex(hyphen)
763 The syntax for an extender mark is code(__). This syntax can only be
764 used within lyrics mode. The syntax for a spanning hyphen (a hyphen
765 that will be printed between two lyric syllables) is code(-)code(-)
769 subsubsect(Tie)cindex(tie)
771 A tie connects two adjacent note heads of the same pitch. When used
772 with chords, it connects all of the note heads whose pitches match.
773 Ties are indicated using the tilde symbol indexandcode(~).
774 If you try to tie together chords which have no common pitches, a
775 warning message will appear. No ties will be created. COMMENT(
777 )mudela(fragment,verbatim,center)(
778 e' ~ e' <c' e' g'> ~ <c' e' g'>
781 subsect(Atomic music expressions: add-ons)
783 [TODO: explain Requests]
786 subsubsect(Articulations)cindex(articulations)cindex(scripts)cindex(ornaments)
788 A variety of symbols can appear above and below notes to indicate
789 different characteristics of the performance. These symbols can be
790 added to a note with `var(note)code(-\)var(name)'. Numerous symbols
791 are defined in file(script.ly) and file(script.scm). Symbols can be
792 forced to appear above or below the note by writing
793 `var(note)code(^\)var(name)' and `var(note)code(_\)var(name)'
794 respectively. Here is a chart showing symbols above notes, with the
795 name of the corresponding symbol appearing underneath.
799 < \notes{ c''-\accent c''-\marcato c''-\staccatissimo f'-\fermata
800 c''-\stopped c''-\staccato c''-\tenuto c''-\upbow c''-\downbow
801 c''-\lheel c''-\rheel c''-\ltoe c''-\rtoe c''-\turn
802 c''-\open c''-\flageolet c''-\reverseturn
804 c''-\prall c''-\mordent c''-\prallprall c''-\prallmordent
805 c''-\upprall c''-\downprall c''-\thumb c''-\segno c''-\coda}
806 \context Lyrics \lyrics{
807 accent__ marcato__ staccatissimo__ fermata stopped__
808 staccato__ tenuto__ upbow downbow__ lheel__ rheel__ ltoe
809 rtoe__ turn__ open__ flageolet reverseturn__ trill__ prall__
810 mordent prallprall__ prallmordent__ uprall__ downprall thumb
813 \paper{ linewidth = 5.875\in;
818 In addition, it is possible to place arbitrary strings of text or
819 TeX() above or below notes by using a string instead of an identifier:
820 `code(c^"text")'. Fingerings cindex(fingering) can be placed by
821 simply using digits. All of these note ornaments appear in the
822 printed output but have no effect on the MIDI rendering of the music.
824 To save typing, fingering instructions (digits 0 to 9 are supported)
825 and a few common symbols can be abbreviated with single characters:
830 \property Voice.textStyle = typewriter
842 % \paper { linewidth = 12.\cm; }
845 Dynamic marks are specified by using an identifier after a note:
846 code(c4-\ff). The available dynamic marks are: keyindex(pppp),
847 code(\ppp)keyindex(ppp), code(\pp)keyindex(pp), code(\p)keyindex(p),
848 code(\mp)keyindex(mp), code(\mf)keyindex(mf), code(\f)keyindex(f),
849 code(\ff)keyindex(ff), code(\fff)keyindex(fff),
850 code(\ffff)keyindex(ffff), code(\fp)keyindex(fp),
851 code(\sf)keyindex(sf), code(\sff)keyindex(sff), code(\sp)keyindex(sp),
852 code(\spp)keyindex(spp), code(\sfz)keyindex(sfz) and
853 code(\rfz)keyindex(rfz).
855 subsubsect(General text scripts)
857 code(\textscript)keyindex(textscript) var(text) var(style). Defines a text to be
858 printed over or under a note. var(style) is a string that may be one
859 of code(finger), code(roman), code(italic), code(dynamic), code(Large)
862 You can attach a general textscript request using this syntax
863 verb(c4-\textscript "6" "finger"
864 c4-\textscript "foo" "normal"
866 This is equivalent with code(c4-6 c4-"foo").
868 subsubsect(General scripts)cindex(scripts)
870 Syntax: code(\script)keyindex(script) var(alias).
872 Prints a symbol above or below a note. The argument is a string
873 which points into the script-alias table defined in file(script.scm).
874 The scheme definitions specify whether the symbol follows notes into
875 the staff, dependence of symbol placement on staff direction, and a
876 priority for placing several symbols over one note. Usually the
877 code(\script)keyindex(script) keyword is not used directly. Various
878 helpful identifier definitions appear in file(script.ly).
881 subsubsect(Slur)cindex(Slur)
883 Slurs connects chords and try to avoid crossing stems. A slur is
884 started with code(CHAR(40)) and stopped with code(CHAR(41)). The
885 starting code(CHAR(40)) appears to the right of the first note in the
886 slur. The terminal code(CHAR(41)) apppears to the left of the first
887 note in the slur. This makes it possible to put a note in slurs from
890 )mudela(fragment,verbatim,center)(
891 f'()g'()a' [a'8 b'(] a'4 g'2 )f'
895 subsubsect(Crescendo)cindex(Crescendo)
897 A crescendo mark is started with code(\cr)keyindex(cr) and terminated with
898 code(\rc)keyindex(rc). A decrescendo mark is started with code(\decr)keyindex(decr) and
899 terminated with code(\rced)keyindex(rced). There are also shorthands for these
900 marks. A crescendo can be started with code(\<)keyindex(<) and a decrescendo can
901 be started with code(\>)keyindex(>). Either one can be terminated with code(\!)keyindex(!).
902 Note that code(\!) must go before the last note of the dynamic mark whereas
903 code(\rc) and code(\rced) go after the last note. Because these marks are
904 bound to notes, if you want to get several marks during one note, you must use
905 spacer notes. COMMENT(
907 )mudela(fragment,verbatim,center)(
908 c'' \< \! c'' d'' \decr e'' \rced
909 < f''1 {s4 \< \! s2 \> \! s2 } >)
913 subsubsect(General spanners)
915 code(\spanrequest)keyindex(spanrequest) var(startstop) var(type).
916 Define a spanning request var(startstop) is either -1
917 (code(\start)keyindex(start)) or 1 (code(\stop)keyindex(stop)). The
918 var(type) parameter is a string that describes what should be started.
919 Supported types are code(crescendo), code(decrescendo), code(beam),
920 code(slur). This is an internal command. Users should use the
921 abbreviations which are defined in the initialization file
924 You can attach a (general) span request to a note using
925 mudela(fragment,center)(
926 c4-\spanrequest \start "slur"
927 c4-\spanrequest \stop "slur"
929 The slur syntax with parentheses is an abbreviation of this.
931 COMMENT(came till here with indexifying)
933 subsubsect(Tremolo marks)cindex(Tremolo marks)
935 Tremolo marks can be printed by a single note by adding code(:)[var(length)]
936 after the note. The length must be at least 8. A var(length) value
937 of 8 gives one line across the note stem.
938 If the length is omitted,
939 then the last value is used, or the value of the code(abbrev)
940 property if there was no last value.
941 mudela(verbatim,fragment,center)(c'2:8 c':32
944 sect(Compound music expressions)cindex(Compound music expressions)
948 Music expression are a compound data structure. You can nest music
949 expressions any way you like. This simple example shows how three
950 chords can be expressed in two different ways: COMMENT(
952 )mudela(fragment,verbatim,center)(
953 \notes\context Staff{
954 <a c'> <b d' > <c' e' >
959 subsect(Context selection)cindex(Context selection)
961 code(\context)keyindex(context) var(contexttype) [code(=) var(contextname)]
964 Interpret var(musicexpr) within a context of type var(contexttype).
965 If the context does not exist, it will be created. The new context
966 can optionally be given a name. See Section ref(contextselection) and
967 ref(contextdefs) for more
968 information on interpretation contexts.
970 subsect(Music entry modes)
974 Mode switching keywords form compound music
975 expressions:keyindex(notes)keyindex(chords)keyindex(lyrics)
976 code(\notes )var(musicexpr), code(\chords )var( musicexpr), and
977 code(\lyrics )var(musicexpr). These expressions do not add anything
978 to the meaning of their arguments. They are just a way to indicat
979 that the arguments should be parsed in indicated mode. See Section
980 ref(modes) for more information on modes.
983 More information on context selection can be found in Section ref(contextselection)
986 subsect(Sequential music)cindex(Sequential music)
989 The syntax is code(\sequential)code( {)var(musicexprlist)code( }). This means that list should be played or
990 written in sequence, i.e., the second after the first, the third after
991 the second. The duration of sequential music is the the sum of the
992 durations of the elements. There is an abbreviated form, which leaves
993 out the keyword: code({ )var(musicexprlist )code( }).
996 subsect(Simultaneous music)cindex(Simultaneous music)
998 The syntax is code(\simultaneous)keyindex(simultaneous)code({)var(
999 musicexprlist )code(}). It constructs a music expression where all of
1000 its arguments start at the same moment. The duration is the maximum
1001 of the durations of the elements. The abbreviated form, code(<)
1002 var(musicexprlist) code(>) is common idiom.
1004 If you try to use a chord as the first thing in your score, you
1005 might get multiple staffs in stead of a chord.COMMENT(
1007 )mudela(verbatim)(\score { \notes <c''4 e''>
1008 \paper { linewidth = -1.; }
1011 ) This happens because the chord is interpreted by a score context.
1012 Each time a note is encountered a default Voice context (along with a
1013 Staff context) is created. The solution is to explicitly instantiate a
1015 mudela(verbatim,center)(\score { \notes\context Voice <c''4 e''>
1016 \paper { linewidth = -1.; }
1020 subsect(Relative Pitch Specification)cindex(Relative Pitch Specification)
1023 It is easy to get confused by octave changing marks and accidentally
1024 put a pitch in the wrong octave. A much better way of entering a
1025 note's octave is `the relative octave' mode.
1027 The syntax for relative mode is code(\relative)keyindex(relative)
1028 var(startpitch) var(musicexpr).
1030 The octave of notes that appear in var(musicexpr) are calculated as
1031 follows: when no octave changing marks are used, the basic interval
1032 between this and the last note is always taken to be a fourth or
1033 less.footnote(The interval is determined without regard accidentals.
1034 A code(fisis) following a code(ceses) will be put above the
1035 code(ceses)) The octave changing marks code(') and code(,) can then be
1036 added to raise or lower the pitch by an extra octave. Upon entering
1037 relative mode, an absolute starting pitch must be specified that will
1038 act as the predecessor of the first note of var(musicexpr).
1040 Entering scales is straightforward in relative mode.
1042 mudela(fragment,verbatim,center)(
1043 \relative c' { c d e f g a b c c, }
1046 and octave changing marks are used for intervals greater than a fourth.
1048 mudela(fragment,verbatim,center)(
1049 \relative c'' { c g c f, c' a,, e''' }
1052 When the preceding item is a chord, the first note of the chord is used to
1053 determine the first note of the next chord. But other notes within the second
1054 chord are determined by looking at the immediately preceding note.
1056 mudela(fragment,verbatim,center)(
1057 \relative c' { c <c e g>
1058 <c' e g> <c, e' g> }
1061 The pitch after the code(\relative) contains a notename. To parse the
1062 pitch as a notename, you have to be in note mode, so there must be a
1063 surrounding code(\notes)keyindex(notes) keyword (which is not shown here).
1065 The relative conversion will not affect code(\transpose) or
1066 code(\relative) sections in its argument. If you want to use relative
1067 within transposed music, you must place an additional code(\relative)
1068 inside the code(\transpose).
1070 You are strongly recommended to use relative pitch mode: it is less
1071 work, less error-prone and more readable.
1075 subsect(Chord names)
1077 Chord names are a way to generate simultaneous music expressions that
1078 correspond with traditional chord names. It can only be used in chord
1079 mode (See Section ref(modes)). The syntax is
1080 var(tonic)[var(duration)][code(-)var(modifiers)][code(^)var(substractions)][code(/)var(inversion)].
1081 var(tonic) should be the tonic note of the chord, and the var(duration) is
1082 the chord duration in the usual notation. There are two kinds of modifiers.
1083 One type is chord additions, which are obtained by listing intervals separated
1084 by dots. An interval is written by its number with an optional code(+) or
1085 code(-) to indicate raising or lowering by half a step. A chord additions has
1086 two effects: it adds the specified interval and all lower odd numbered
1087 intervals to the chord, and it may lower or raise the specified interval.
1088 Intervals must be separated by a dot (code(.)).
1091 )mudela(fragment,verbatim)(
1095 c-9-.5+.7+ c-3-.5- c-4.6.8
1098 )The second type of modifier that may appear after the code(-) is
1100 Named modifiers are listed in the file file(chord-modifiers.ly). The
1101 available modifiers are code(m) and code(min) which lower
1102 the 3rd half a step, indexandcode(aug) which raises the 5th, indexandcode(dim) which lowers
1103 the 5th, indexandcode(maj) which adds a raised 7th, and indexandcode(sus) which replaces the
1105 mudela(fragment,verbatim,center)(
1108 c1-m c-min7 c-maj c-aug c-dim c-sus
1111 Chord substractions are used to eliminate notes from a chord. The notes to be
1112 substracted are listed after a code(^) character, separated by dots.
1113 mudela(fragment,verbatim,center)(
1119 Chord inversions can be specified by appending indexandcode(/) and the name of a
1120 single note to a chord. This has the effect of lowering the specified note by
1121 an octave so it becomes the lowest note in the chord. If the
1122 specified note is not in the chord then a warning will be printed.
1123 mudela(fragment,verbatim,center)(
1125 \chords { c1 c/e c/g c-7/e }
1127 Throughout these examples, chords have been shifted around the staff
1128 using code(\transpose). b
1130 You should not combine code(\relative) with named chords.
1135 subsect(Tuplets)cindex(Tuplets)
1137 Tuplets are made out of a music expression by multiplying their
1138 duration with a fraction. The syntax is code(\times)keyindex(times) var(fraction)
1141 The duration of var(musicexpr) will be multiplied by the fraction.
1142 In print, the fraction's denominator will be printed over the notes,
1143 optionally with a bracket. The most
1144 common tuplet is the triplet in which 3 notes have the length of 2, so
1145 the notes are 2/3 their written length:
1148 )mudela(fragment,verbatim,center)( b'4 \times 2/3 {c'4 c' c'} d'4 d'4 )
1150 subsect(Grace notes)cindex(Grace notes)
1152 Grace notes are specified as code(\grace )keyindex(grace )var(musicexpr). A grace
1153 note expression has duration 0; the next real note is assumed to the
1156 You cannot have the grace note after the main note, terms of duration
1157 and main notes, but you can typeset the grace notes to the right of
1158 the main note using the property indexandcode(graceAlignPosition).
1160 When grace music is interpreted, a score-within-a-score is set up:
1161 var(musicexpr) has its own time bookkeeping, and you could (for
1162 example) have a separate time signature within grace notes. Within
1163 this score-within-a-score you can create notes, beams, slurs,
1164 etc. Unbeamed eighth notes and shorter by default have a slash through
1165 the stem. This behavior can be controlled with the
1166 indexandcode(stemStyle) property.
1169 \relative c'' { \grace c8 c4 \grace { [c16 c16] } c4
1170 \grace { \property Grace.stemStyle = "" c16 } c4 }
1173 At present nesting code(\grace)keyindex(grace) notes, eg. code(\grace { \grace
1174 c32 c16} c4) may result in run-time errors of LilyPond. Since the
1175 meaning of such a construct is unclear, we don't consider this a loss.
1176 Similarly, juxtaposing two code(\grace) sections syntactically valid,
1177 but makes no sense and may cause runtime errors.
1179 Ending a staff or score with grace notes may generate a run-time
1180 error, since there will be no main note to attach the grace notes to.
1182 subsect(Repeats)cindex(Repeats)
1185 In order to specify repeats, use the code(\repeat)keyindex(repeat) keyword. Since
1186 repeats look and sound differently when played and when printed, there are a few
1187 different variants of repeats.
1190 dit(unfolded) repeated music is fully written (played) out. Useful
1192 dit(volta) This is the normal notation: repeats are not
1193 written out, but alternative endings (voltas), are printed, left to right.
1194 dit(folded) alternative endings are written stacked, which is useful
1198 The syntax for repeats is code(\repeat) var(variant) var(repeatcount)
1199 var(repeatbody). If you have alternative endings, you may add
1200 code(\alternative)keyindex(alternative)code( { )var(alternative1)
1201 var(alternative2) var(alternative3) .. code( }), where each
1202 var(alternative) is a Music expression.
1204 Normal notation repeats are used like this:
1205 mudela(fragment,verbatim,center)(
1207 \repeat volta 2 { c'4 d' e' f' }
1208 \repeat volta 2 { f' e' d' c' })
1210 With alternative endings:
1211 mudela(fragment,verbatim,center)(
1213 \repeat volta 2 {c'4 d' e' f'}
1214 \alternative { {d'2 d'} {f' f} })
1216 Folded repeats look like this:footnote(Folded repeats offer little
1217 more over simultaneous music. However, it is to be expected that more
1218 functionality --especially for the MIDI backend-- will be implemented)
1221 mudela(fragment,verbatim,center)(
1223 \repeat fold 2 {c'4 d' e' f'}
1224 \alternative { {d'2 d'} {f' f} })
1226 mudela(fragment,verbatim)(
1227 \context Staff { \relative c'{
1228 \partial 4; \repeat volta 2 { e | c2 d2 | e2 f2 | }
1229 \alternative { { g4 g g } { a a a a b1 } }
1232 If you don't give enough alternatives for all of the repeats, then the
1233 first alternative is assumed to be repeated often enough to equal the
1234 specified number of repeats.
1235 mudela(fragment,verbatim)(
1236 \context Staff { \relative c'{
1237 \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1238 \alternative { { g4 g g } {\partial 1; e4 e e }
1239 {\partial 1; a a a a | b1 } }
1244 It is possible to nest code(\repeat). This is not entirely supported:
1245 the notes will come be in the right places, but the repeat bars will
1251 subsect(Tranposition of Pitches)cindex(Tranposition of Pitches)
1254 A music expression can be transposed with code(\transpose)keyindex(transpose).
1255 The syntax is code(\transpose) var(pitch) var(musicexpr)
1256 This means that middle C in var(musicexpr) is tranposed to var(pitch).
1258 code(\transpose) distinguishes between enharmonic pitches: both
1259 code(\transpose cis') or code(\transpose des') will transpose up half
1260 a tone. The first version will print sharps and the second version
1261 will print flats. COMMENT(
1263 )mudela(fragment,verbatim)(
1265 \clef "F"; { \key e; c d e f } \clef "G";
1266 \transpose des'' { \key e; c d e f }
1267 \transpose cis'' { \key e; c d e f } }
1271 If you want to use both code(\transpose) and code(\relative), then you
1272 must use code(\transpose) first. code(\relative) will have no effect
1273 music that appears inside a code(\transpose).
1276 subsect(Automatic lyric durations)cindex(Automatic lyric durations)
1278 If you have lyrics that are set to a melody, you can import the rhythm
1279 of that melody into the lyrics using code(\addlyrics).
1280 keyindex(addlyrics) The syntax for this is code(\addlyrics)
1281 var(musicexpr1 musicexpr2). This means that both var(musicexpr1) and
1282 var(musicexpr2) are interpreted, but that every non-command atomic
1283 music expression (``every syllable'') in var(musicexpr2) is
1284 interpreted using timing of var(musicexpr1).
1286 If the property code(automaticMelismata) is set in the context of
1287 var(musicexpr1), then no lyrics will be put on slurred and tied notes.
1292 )mudela(verbatim,fragment)(
1295 \property Voice.automaticMelismata = "1"
1296 c8 () cis d8. e16 f2 }
1297 \context Lyrics \lyrics { do4 re mi fa }
1300 )You should use a single rhythm melody, and single rhythm lyrics (a
1301 constant duration is the obvious choice). If you do not, you will get
1302 undesired effects when using multiple stanzas: COMMENT(
1304 )mudela(verbatim,fragment)(
1306 \transpose c'' { c8 () cis d8. e16 f2 }
1307 \context Lyrics \lyrics < { do4 re mi fa }
1311 It is valid (but probably not very useful) to use notes in stead of lyrics
1312 for var(musicexpr2). COMMENT(
1314 mudela(verbatim,fragment)(
1315 \context Voice \addlyrics
1322 sect(Ambiguities)cindex(ambiguities)
1324 The grammar contains a number of ambiguities.footnote(The authors hope
1325 to resolve them at a later time.)
1334 )Can be interpreted as making a string identifier code(\foo)
1335 containing code("bar"), or a music identifier code(\foo) containing
1340 )Can be interpreted as making a integer identifier containing -6, or a
1341 Request identifier containing the fingering `6' (with neutral direction).
1344 If you do a nested repeat,
1349 ) then it is ambiguous to which code(\repeat) the code(\alternative)
1350 belongs. This is the classic if-then-else dilemma. It may be solved
1354 (an as yet unidentified ambiguity)
1357 sect(Notation conversion specifics)
1359 subsect(Automatic Beam Generation)cindex(Automatic Beam Generation)
1362 By default, Lilypond will generate beams automatically. This feature
1363 can be disabled by setting the indexandcode(Voice.noAutoBeaming)
1364 property to 1. It can be overridden for specific cases by specifying
1365 explicit beams as described in Section ref(manualbeam).
1367 A large number of Voice properties are used to decide how to generate
1368 beams. Their default values appear in file(auto-beam-settings.ly).
1369 In general, beams can begin anywhere, but their ending location is
1370 significant. Beams can end on a beat, or at durations specified by
1371 the indexandcode(Voice.beamAutoEnd) property. To end beams every
1372 quarter note, for example, you could use set
1373 indexandcode(Voice.beamAutoEnd) equal to code("1/4"). To end beams at
1374 every three eighth notes you would set it to code("3/8"). The same
1375 syntax can be used to specify beam starting points using
1376 indexandcode(Voice.beamAutoBegin).
1378 To allow different settings for different time signatures, these
1379 property names can start with code(time)var(N)code(_)var(M) to
1380 restrict the definition to var(N)code(/)code(M) time. For example,
1381 to specify beams ending only for 6/8 time you would use the property
1382 code(Voice.time6_8beamAutoEnd). To allow different endings for notes
1383 of different durations, the duration can be tacked onto the end of the
1384 property. To specify beam endings for beams that contain 32nd notes,
1385 you would use code(Voice.beamAutoEnd_32).
1387 subsect(Printing chord names)cindex(chord names)cindex(chords)cindex(printing!chord names)
1389 For displaying printed chord names, use the indexandcode(ChordNames) context.
1390 The chords may be entered either using the notation described above,
1391 or directly using simultaneous music.
1392 mudela(fragment,verbatim)(
1394 \context ChordNames { \chords{ a b c} \notes{ < d f g > < e g b > } }
1395 \context Staff \notes{ a b c' d' e' }
1398 Lilypond examines chords specified as lists of notes to determine a
1399 name to give the chord. By default, LilyPond will not try to identify
1401 mudela(fragment,verbatim,center)(
1403 \context ChordNameVoice {
1404 \notes{ < e'1 g' c'' > } }
1405 \context Thread \notes{ < e'1 g' c'' > }
1407 If you want inversions to be recognized, you must set the property
1408 indexandcode(ChordNames.chordInversion):
1409 mudela(fragment,verbatim,center)(
1411 \property Score.chordInversion = 1
1412 \context ChordNameVoice {
1413 \notes{ < e'1 g' c'' > } }
1414 \context Thread \notes{ < e'1 g' c'' > }
1419 subsect(Printing lyrics)cindex(Lyrics)cindex(printing!lyrics)
1422 Lyric syllables must be interpreted within a code(Lyrics) context
1423 cindex(context!Lyrics) for printing them.
1425 Here is a full example:
1426 mudela(verbatim)(\score{
1427 < \notes \transpose c'' {c d e c | c d e c | e f g2 |
1428 e4 f g2 \bar "|."; }
1429 \context Lyrics \lyrics {
1430 Va-4 der Ja- cob Va- der Ja- cob
1431 Slaapt gij nog?2 Slaapt4 gij nog?2 }
1437 want a continuous line after the syllables to show melismata. To achieve
1438 this effect, add a code(__) lyric as a separate word
1439 after the lyric to be extended.
1441 an extender, a line that extends over the entire duration of
1442 the lyric. This line will run all the way to the start of the next
1443 lyric, so you may want to shorten it by using a blank lyric.
1446 )mudela(verbatim)(\score{
1447 < \notes \relative c''{
1448 a4()b()c()d c()d()b()a c()d()b()a }
1449 \context Lyrics \lyrics {
1450 foo1 __ bar2. __ _4 baz1 __ }
1455 If you want to have hyphens centered between syllables (rather than attached
1456 to the end of the first syllable) you can use the special code(-)code(-) lyric as
1457 separate word between syllables. This will result in a hyphen whose length
1458 varies depending on the space between syllables, and centered between the
1459 syllables. For example:
1460 mudela(verbatim)(\score{
1461 < \notes \transpose c'' {c d e c | c d e c | e f g2 |
1462 e4 f g2 \bar "|."; }
1463 \context Lyrics \lyrics {
1464 Va4 -- der Ja -- cob Va -- der Ja -- cob
1465 Slaapt gij nog?2 Slaapt4 gij nog?2 }
1472 sect(Notation Contexts)cindex(Notation Contexts)
1474 Notation contexts are objects that only exist during a run of
1475 LilyPond. During the interpretation phase of LilyPond, the Music
1476 expression contained in a code(\score) block is interpreted in time
1477 order. This is the order in which humans read, play and write music.
1479 A context is an object that holds the reading state of the expression:
1480 it contains information like
1482 it() What notes are playing at this point?
1483 it() What symbols will be printed at this point?
1484 it() In what style will they printed?
1485 it() What is the current key signature, time signature, point within
1489 Contexts are grouped hierarchically: a code(Voice) context is
1490 contained in a code(Staff) context (because a staff can contain
1491 multiple voices at any point), a code(Staff) context is contained in a
1492 code(Score), code(StaffGroup) or code(ChoirStaff) context (because these
1493 can all contain multiple staffs.)
1495 Contexts associated with sheet music output are called notation
1496 contexts, those for sound output are called playing contexts.
1498 Contexts are created either manually or automatically.
1499 Initially, the top level music expression is interpreted by the top level
1500 context (the code(Score) context).
1501 When a atomic music expression (a note, a rest, a code(\bar),
1502 code(\time) command), a nested set of contexts is created that can process these
1503 atomic expressions, so in this example,COMMENT(
1505 )verb(\score { \notes < c4 > })COMMENT(
1507 )the sequential music, code({ c4 }) is interpreted by code(Score) context.
1508 When the note code(c4) itself is interpreted, a set of contexts is needed
1509 that will accept notes. The default for this is a code(Voice) context,
1510 contained in a code(Staff) context. Creation of these contexts
1511 results in the staff being printed.
1513 subsect(Context selection)
1514 label(contextselection)
1516 You can also create contexts manually, and you probably have to do so
1517 if you want to typeset complicated multiple part
1518 material. If a code(\context )var(name musicexpr) expression is
1519 encountered during the interpretation phase, the var(musicexpr)
1520 argument will be interpreted with a context of type var(name). If you
1521 specify a name, the specific context with that name is searched.
1523 If a context of the specified type and name can not be found, a new
1524 one is created. For example,
1527 )mudela(verbatim)(\score {
1528 \notes \relative c'' {
1529 c4 <d4 \context Staff = "another" e4> f } })COMMENT(
1531 ) in this example, the code(c) and code(d) are
1532 printed on the default staff. For the code(e), a context Staff called
1533 code(another) is specified; since that does not exist, a new context is
1534 created. Within code(another) a (default) Voice context is created
1535 for the code(e4). When all music referring to a context is finished, the
1536 context is ended as well. So after the third quarter, the
1537 code(another) is removed.
1539 Almost all music expressions inherit their interpretation context from
1540 their parent. In other words, suppose that the syntax for a music
1541 expression is code(\keyword) var(musicexpr1) var(musicexpr2) ellipsis().
1542 When the interpretation of this music expression starts, the context
1543 for var(musicexpr1), var(musicexpr2), etc. that of the total
1546 Lastly, you may wonder, why doesn't this:
1547 verb(\score { \notes \relative c'' { c4 d4 e4 }})
1549 mudela()(\score { \notes \relative c'' { <c4> <d4> <e4> }})
1551 For the code(c4) a default code(Staff) (with contained code(Voice)) context is
1552 created. After the code(c4), ends no music refers to this default
1553 staff, so it would be ended, with the result shown. To prevent this
1554 inconvenient behavior, the context to which the sequential music
1555 refers is adjusted during the interpretation. So after the code(c4)
1556 ends, the context of the sequential music is also the default code(Voice)
1557 context. The code(d4) gets interpreted in the same context as code(c4)
1560 subsect(Predefined contexts)
1562 These are the contexts are supplied with the package. They are
1563 defined in init file(ly/engraver.ly).
1567 dit(code(Grace))indexcode(Grace) The context for handling grace notes, it is
1568 instantiated automatically when you use code(\grace). It is a
1569 `embedded' miniature of the Score context. Since this context needs
1570 special interaction with the rest of LilyPond, you should not
1571 explicitly instantiate it.
1573 dit(code(LyricVoice))indexcode(LyricVoice) Corresponds to a voice with lyrics. Handles the printing
1574 of a single line of lyrics.
1576 dit(code(Thread))indexcode(Thread) Handles note heads, and is contained in the Voice
1577 context. You have to instantiate these explicitly if you want to
1578 adjust the style of individual noteheads.
1580 dit(code(Voice))indexcode(Voice) Corresponds to a voice on a staff. This context
1581 handles the conversion of dynamic signs, stems, beams, super- and
1582 subscripts, slurs, ties and rests.
1584 You have to instantiate these explicitly if you want to have
1585 multiple voices on the same staff.
1587 dit(code(ChordNamesVoice))indexcode(ChordNamesVoice) A voice with chord names. Handles printing
1588 of a line of chord names.
1590 dit(code(ChordNames))indexcode(ChordNames) Typesets chord names. Can contain
1591 code(ChordNamesVoice) contexts.
1593 dit(code(Lyrics))indexcode(Lyrics) Typesets lyrics. It can contain code(LyricVoice) contexts.
1595 dit(code(Staff))indexcode(Staff) Handles clefs, bar lines, keys,
1596 accidentals. It can contain code(Voice) contexts.
1598 dit(code(RhythmicStaff))indexcode(RhythmicStaff) A context like code(Staff) but for printing
1599 rhythms. Pitches are ignored; the notes are printed on one line.
1600 It can contain code(Voice) contexts.
1602 dit(code(GrandStaff))indexcode(GrandStaff) Contains code(Staff) or code(RhythmicStaff)
1603 contexts. It adds a brace on the left side grouping the staffs
1604 together. The bar lines of the contained staffs are connected vertically.
1605 It can contain code(Staff) contexts.
1607 dit(code(PianoStaff))indexcode(PianoStaff) Just like code(GrandStaff) but with
1608 code(minVerticalAlign) set equal to code(maxVerticalAlign) so that
1609 interstaff beaming and slurring can be used.
1611 dit(code(StaffGroup))indexcode(StaffGroup) Contains code(Staff) or code(RhythmicStaff)
1612 contexsts. Adds a bracket on the left side, grouping the staffs
1613 together. The bar lines of the contained staffs are connected vertically.
1614 It can contain code(Staff), code(RhythmicStaff), code(GrandStaff) or code(Lyrics) contexts.
1616 dit(code(ChoirStaff))indexcode(ChoirStaff) Identical to code(StaffGroup) except that the
1617 contained staffs are not connected vertically.
1619 dit(code(Score))indexcode(Score) This is the top level notation context. No
1620 other context can contain a code(Score) context. This context handles
1621 the administration of time signatures. It also makes sure that items
1622 such as clefs, time signatures, and key-signatures are aligned across
1623 staffs. It can contain code(Lyrics), code(Staff),
1624 code(RhythmicStaff), code(GrandStaff), code(StaffGroup), and
1625 code(ChoirStaff) contexts.
1627 You can not explicitly instantiate a Score context (since it is not
1628 contained in any other context.). It is instantiated automatically
1629 when an output definition (a code(\score) or code(\paper) block) is
1633 subsect(Context properties)
1635 Properties that are set in one context are inherited by all of the
1636 contained contexts. This means that a property valid for the Voice
1637 context can be set in the Score context (for example) and thus take
1638 effect in all Voice contexts.
1640 Properties can be preset within the code(\translator) block
1641 corresponding to the appropriate context. In this case, the syntax is
1642 `var(propname) code(=) var(value)'. This assignment happens before
1643 interpretation starts, so a code(\property) expression will override
1644 any pre defined settings.
1646 The code(\property) expression will create any property you specify.
1647 There is no guarantee that a property will be used. So if you spell a
1648 property name wrong, there will be no error message.
1650 The property settings are used during the interpretation phase. They
1651 are read by the LilyPond modules where interpretation contexts are
1652 built of. These modules are called em(translators). Translators for
1653 notation are called em(engravers) and translators for sound are called
1656 The precise result of a property is determined by the implementation
1657 of the translator that reads them. Therefore, the result of a
1658 property can vary, since it is implementation and configuration
1661 In order to fully find out what properties are used, you must search
1662 the source code for calls to code(get_property). The rest of the
1663 section is devoted to an (incomplete) overview of available properties.
1665 subsubsubsect(Lyrics properties)cindex(properties!Lyrics)
1669 dit(code(textStyle))indexcode(textStyle) Set the font for lyrics. The available font
1670 choices are code(roman), code(italic), code(bold), code(large),
1671 code(Large), code(typewriter), and code(finger). The code(finger)
1672 font can only display numbers. Note also that you must be careful
1673 when using code(\property) in Lyrics mode, because of the way strings
1674 are parsed. Either put quotes around the arguments to code(\property)
1675 or be sure to leave a space on both sides of the dot.
1680 subsubsubsect(Thread properties)cindex(properties!Thread)
1683 dit(code(noteheadStyle))indexcode(noteheadStyle) Selects type of note head. Choices are
1684 code(cross), code(diamond), code(harmonic), code(transparent), and
1685 code(""). They are shown in that order below.
1689 \property Staff.barNonAuto = 1
1690 \property Voice.noteHeadStyle = cross
1692 \property Voice.noteHeadStyle = diamond
1694 \property Voice.noteHeadStyle = harmonic
1696 \property Voice.noteHeadStyle = transparent
1698 \property Voice.noteHeadStyle = ""
1701 \paper{ linewidth = -1.;}
1707 subsubsubsect(Voice properties)cindex(properties!Voice)
1711 dit(code(stemLength))indexcode(stemLength) Set length of stems. Unit is
1712 code(interline)/2, so code(stemLength) defaults to 7.
1714 dit(code(stemLeftBeamCount))indexcode(stemLeftBeamCount) Specify the number of beams to draw on
1715 the left side of the next note. Overrides automatic beaming. The
1716 value is only used once, and then it is erased.
1718 dit(code(stemRightBeamCount))indexcode(stemRightBeamCount) Specify the number of beams to draw on
1719 the right side of the next note. Overrides automatic beaming. The
1720 value is only used once, and then it is erased.
1722 dit(code(noAutoBeaming))indexcode(beamAuto) If set to 1 then beams are
1723 not generated automatically.
1725 dit(code(beamAutoEnd))indexcode(beamAutoEnd) Specifies when automatically generated beams
1726 can end. See Section ref(autobeam).
1728 dit(code(beamAutoBegin))indexcode(beamAutoBegin) Specifies when automatically generated beams
1729 can start. See Section ref(autobeam).
1731 dit(code(textEmptyDimension))indexcode(textEmptyDimension) If set to 1 then text placed above or
1732 below the staff is assumed to have zero width.
1734 dit(code(beamquantisation))indexcode(beamquantisation) Set to
1735 code(\none) for no quantization. Set to code(\normal) to quantize
1736 position and slope. Set to code(\traditional) to avoid wedges. These
1737 three settings are available via code(\beamposfree),
1738 code(\beamposnormal), and code(\beampostraditional).
1740 dit(code(beamslopedamping))indexcode(beamslopedamping) Set to code(\none) for undamped beams.
1741 Set to code(\normal) for damped beams. Set to code(\infinity) for
1742 beams with zero slope. The identifiers code(\beamslopeproportional),
1743 code(\beamslopedamped), and code(\beamslopezero) each set the
1744 corresponding value.
1746 dit(code(restStyle))indexcode(restStyle) Change the layout of rests shorter than quarter notes.
1747 Currently, the standard layout code(restStyle="") and mensural notation
1748 code(restStyle="mensural") are available.
1750 dit(code(midiInstrument))indexcode(midiInstrument) Sets the instrument for MIDI output. If
1751 this property is not set then LilyPond will use the code(instrument)
1752 property. This must be set to one of the strings on the list of MIDI
1753 instruments that appears in Section ref(midilist). If you use a
1754 string which is not listed, LilyPond will silently substitute piano.
1756 dit(code(transposing))indexcode(transposing) Tranpose the MIDI output. Set this property to
1757 the number of half-steps to transpose by.
1759 dit(code(oldTieBehavior))indexcode(oldTieBehavior) Set to 1 in order to get old tie behavior
1760 where ties would connect unequal pitches. This property is
1761 deprecated, and use is not recommended.
1763 dit(code(verticalDirection))indexcode(verticalDirection) Determines the direction of stems, subscripts,
1764 beams, slurs, and ties. Set to code(\down) to force them down,
1765 code(\up) to force them up, or code(\free) to let LilyPond decide.
1766 This can be used to distinguish between voices on the same staff. The
1767 code(\stemdown), code(\stemup), and code(\stemboth) identifiers set
1770 dit(code(slurVerticalDirection))indexcode(slurVerticalDirection) Set to code(\free) for free choice of slur
1771 direction, set to code(\up) to force slurs up, set to code(\down) to
1772 force slurs down. The shorthands code(\slurup), code(\slurdown), and
1773 code(\slurboth) are available.
1775 dit(code(tieVerticalDirection))indexcode(tieVerticalDirection) Set to code(\free) for free choice of tie
1776 direction, set to code(\up) to force ties up, set to code(\down) to
1779 dit(code(slurDash))indexcode(slurDash) Set to 0 for normal slurs, 1 for dotted slurs, and
1780 a larger value for dashed slurs. Identifiers code(\slurnormal) and
1781 code(\slurdotted) are predefined to set the first two settings.
1783 dit(code(horizontalNoteShift))indexcode(horizontalNoteShift) Enable LilyPond to shift notes
1784 horizontally if they collide with other notes. This is useful when
1785 typesetting many voices on one staff. The identifier code(\shift) is
1786 defined to enable this. Traditionally, the outer chords (the upmost
1787 and downmost voices), should have no code(horizontalNoteShift).
1790 dit(code(forceHorizontalShift))indexcode(forceHorizontalShift) Force
1791 horizontal shift for collision resolution. It overrides automatic
1792 collision resolution. The value is the shift amount expressed in
1793 code(note_width), as set in the paper section.
1795 dit(code(dynamicDir))indexcode(dynamicDir) Determines location of dynamic marks. Set to
1796 code(\up) to print marks above the staff; set to code(\down) to print
1797 marks below the staff.
1799 dit(code(dynamicStyle))indexcode(dynamicStyle) Set the text style for dynamics.
1801 dit(code(textStyle))indexcode(textStyle) Set the text style for superscripts and
1802 subscripts. See above for list of text styles.
1804 dit(code(textScriptPadding))indexcode(textScriptPadding) Determines the extra space added between
1805 super-/subscripted text and the closest staff line or note.
1807 dit(code(fontSize))indexcode(fontSize) Can be used to select smaller font sizes for
1808 music. The normal font size is 0, and the two smaller sizes are -1
1811 dit(code(abbrev))indexcode(abbrev) Set length for tremolo to be used if no length is
1812 explicitly specified.
1814 dit(code(tupletDirection))indexcode(tupletDirection) Determines the direction of triplets and
1815 other tuplets. Set to code(\down) to force them below the staff,
1816 code(\up) to force them above, or code(\free) to let LilyPond decide.
1818 dit(code(tupletVisibility))indexcode(tupletVisibility) Determines whether tuplets of notes are
1819 labelled. Setting to 0 shows nothing; setting to 1 shows a number;
1820 setting to 2 shows a number and a bracket if there is no beam; setting
1821 to 3 shows a number, and if there is no beam it adds a bracket;
1822 setting to 4 shows both a number and a bracket unconditionally.
1825 dit(code(markScriptPadding))indexcode(markScriptPadding) Determines the extra space added between
1826 the mark and the closest staff line or note.
1828 dit(code(markDirection))indexcode(markDirection) Determines if marks should be printed above
1829 or below the staff. Set to code(\up) to print marks above the staff;
1830 set to code(\down) to print marks below the staff.
1832 dit(code(articulationScriptPadding))indexcode(articulationScriptPadding) Determines the extra space added
1833 between articulation marks, such as staccato, tenuto, trill, up/down
1834 bow or fermata, and the closest staff line or note.
1837 dit(code(articulationScriptVerticalDirection))indexcode(articulationScriptVerticalDirection) Determines the location
1838 of articulation marks. Set to code(\up) to print marks above the
1839 staff; set to code(\down) to print marks below the staff. This
1840 property does not override explicit directions marked with code(^) or
1841 code(_) in the mudela file.
1844 subsubsubsect(Staff properties)cindex(properties!Staff)
1848 dit(code(createInitdefaultClef))indexcode(createInitdefaultClef) Specify whether clefs are created on
1849 default? (Doesn't seem to do anything.)
1851 dit(code(barNumberDirection))indexcode(barNumberDirection) Set to code(\up) or code(\down) to put
1852 bar numbers above or below the staff.
1854 dit(code(barNumberHangOnClef))indexcode(barNumberHangOnClef) Set to 1
1855 to cause bar numbers to appear above or below the clef instead of on
1856 the bar line. This property is deprecated. Do not use.
1858 dit(code(barNumberScriptPadding))indexcode(barNumberScriptPadding) Sets extra space between the bar
1859 number and the bar it labels.
1861 dit(code(barSize))indexcode(barSize) Specify the height of the bar lines if it should be
1862 different than the staff height.
1864 dit(code(markHangOnClef))indexcode(markHangOnClef) Set to 1 to cause marks to appear by clefs
1865 instead of by bar lines. Deprecated, use is not recommended.
1867 dit(code(marginDirection))indexcode(marginDirection) Set to code(\left) or code(\right) to
1868 specify location of marginal scripts.
1870 dit(code(marginScriptPadding))indexcode(marginScriptPadding) Specify extra space for marginal scripts.
1872 dit(code(forgetAccidentals))indexcode(forgetAccidentals) Causes accidentals to be printed at every
1873 note instead of remembered for the duration of a measure.
1875 dit(code(noResetKey))indexcode(noResetKey) Do not reset the key at the start of a measure.
1876 Accidentals will be printed only once and are in effect until
1877 overridden, possibly many measures later.
1879 dit(code(staffLineLeading))indexcode(staffLineLeading) Specifies the distance (in points) between lines
1882 dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) Specifies the number of staff lines. The
1885 dit(code(postBreakPadding))indexcode(postBreakPadding) Extra space in points to be added after
1886 the clef, time signature and key signature on the staff. Deprecated,
1889 dit(code(barAtLineStart))indexcode(barAtLineStart) Set to 1 to produce a bar line after the
1890 clef at the start of each line (but not at the beginning of the
1893 dit(code(noVoltaBraces))indexcode(noVoltaBraces) Set to true to suppress the printing
1894 of brackets over alternate endings specified by code(\alternative).
1896 dit(code(voltaSpannerDuration))indexcode(voltaSpannerDuration) Set to an integer to control the size
1897 of the brackets printed by code(\alternative). The integer specifies
1898 the number of whole notes duration to use for the brackets. It seems
1899 to be rounded to the nearest measure. This can be used to shrink the
1900 length of brackets in the situation where one alternative is very
1901 large. It may have odd effects if the specified duration is longer
1902 than the music given in an code(\alternative). [FIXME: This was
1905 dit(code(barNonAuto))indexcode(barNonAuto) If set to 1 then bar lines will not be printed
1906 automatically; they must be explicitly created with code(\bar) keywords.
1907 Unlike with the code(\cadenza) keyword, measures are still counted. Bar
1908 generation will resume according to that count if this property is set to
1911 dit(code(defaultClef))indexcode(defaultClef) Determines the default clef. See code(\clef)
1914 dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) Sets the number of lines that the staff has.
1916 dit(code(barAlways))indexcode(barAlways) If set to 1 a bar line is drawn after each note.
1918 dit(code(defaultBarType))indexcode(defaultBarType) Sets the default type of bar line. See
1921 dit(code(keyOctaviation))indexcode(keyOctaviation) If set to 1, then keys are the same in all
1922 octaves. If set to 0 then the key signature for different octaves can
1923 be different and is specified independently: code(\keysignature bes
1924 fis'). The default value is 1. Can be set to zero with
1925 code(\specialkey) or reset to 1 with code(\normalkey).
1927 dit(code(instrument)) and code(instr) If code(Staff_margin_engraver)
1928 cindex(instrument)cindex(instr)cindex(Staff_margin_engraver)
1929 is added to the Staff translator, then the code(instrument) property
1930 is used to label the first line of the staff and the code(instr)
1931 property is used to label subsequent lines. If the
1932 code(midiInstrument) property is not set then code(instrument) is
1933 used to determine the instrument for MIDI output.
1935 dit(code(createKeyOnClefChange))indexcode(createKeyOnClefChange) Set
1936 to a nonempty string if you want key signatures to be printed when the
1937 clef changes. Set to the empty string if you do not want key
1940 dit(code(timeSignatureStyle))indexcode(timeSignatureStyle) Changes the default two-digit layout
1941 for time signatures. The following values are recognized:
1943 dit(code(C))indexcode(C) 4/4 and 2/2 are typeset as C and struck C,
1944 respectively. All other time signatures are written with two digits.
1945 dit(code(old))indexcode(old) 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and
1946 9/8 are typeset with old-style mensuration marks. All other time
1947 signatures are written with two digits.
1948 dit(code(1))indexcode(1) All time signatures are typeset with a single
1949 digit, e.g. 3/2 is written as 3.
1950 dit(indexandcode(C2/2), code(C4/4), code(old2/2), code(old3/2),
1951 code(old2/4), code(old3/4), code(old4/4), code(old6/4),
1952 code(old9/4), code(old4/8), code(old6/8), code(old6/8alt)
1953 or code(old9/8))Tells Lilypond to use a specific symbol as
1956 The different time signature characters are shown below with
1960 \notes\relative c'' {
1961 \property Voice.textStyle = typewriter
1962 \property Staff.timeSignatureStyle = "C2/2"
1963 \time 2/2; a2^"C2/2" a2
1964 \property Staff.timeSignatureStyle = "C4/4"
1965 \time 2/2; a2^"C4/4" a2
1966 \property Staff.timeSignatureStyle = "old2/2"
1967 \time 2/2; a2^"old2/2" a2
1968 \property Staff.timeSignatureStyle = "old3/2"
1969 \time 2/2; a2^"old3/2" a2
1970 \property Staff.timeSignatureStyle = "old2/4"
1971 \time 2/2; a2^"old2/4" a2
1972 \property Staff.timeSignatureStyle = "old4/4"
1973 \time 2/2; a2^"old4/4" a2
1974 \property Staff.timeSignatureStyle = "old6/4"
1975 \time 2/2; a2^"old6/4" a2
1976 \property Staff.timeSignatureStyle = "old9/4"
1977 \time 2/2; a2^"old9/4" a2
1978 \property Staff.timeSignatureStyle = "old4/8"
1979 \time 2/2; a2^"old4/8" a2
1980 \property Staff.timeSignatureStyle = "old6/8"
1981 \time 2/2; a2^"old6/8" a2
1982 \property Staff.timeSignatureStyle = "old6/8alt"
1983 \time 2/2; a2^"old6/8alt" a2
1984 \property Staff.timeSignatureStyle = "old9/8"
1985 \time 2/2; a2^"old9/8" a2
1987 \paper{ linewidth= 4.5 \in; }
1991 dit(code(clefStyle))indexcode(clefStyle) Determines how clefs are typeset. When set to
1992 code(transparent), the clefs are not printed at all, when set to
1993 code(fullSizeChanges), clef changes in the middle of a line are
1994 typeset with a full size clef. By default, clef changes are typeset in
1999 subsubsubsect(GrandStaff properties)cindex(properties!GrandStaff)
2003 dit(code(alignmentReference))indexcode(alignmentReference) Set to code(\center) for vertical
2004 alignment reference point to be in the center of the vertical group.
2005 Set to code(\up) to put the reference point at the top of the group.
2007 dit(code(maxVerticalAlign))indexcode(maxVerticalAlign) Set the maximum vertical distance between
2010 dit(code(minVerticalAlign))indexcode(minVerticalAlign) Set the minimum vertical distance between
2015 subsubsubsect(Score properties)cindex(properties!Score)
2019 dit(code(skipBars))indexcode(skipBars) Set to 1 to skip the empty bars that are produced
2020 by multimeasure notes and rests. These bars will not appear on the
2021 printed output. Set to zero (the default) to expand multimeasure
2022 notes and rests into their full length, printing the appropriate
2023 number of empty bars so that synchronization with other voices is
2025 mudela(fragment,verbatim,center)(
2026 r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
2031 subsubsubsect(ChordNamesVoice properties)cindex(properties!ChordNamesVoice)
2034 dit(code(chordInversion))indexcode(chordInversion) Determines whether LilyPond should look for
2035 chord inversions when translating from notes to chord names. Set to 1
2036 to find inversions. The default is 0 which does not look for inversions.
2040 sect(Notation output definitions)cindex(Output)cindex(Notation output)
2041 cindex(output definition)
2045 The most important output definition is the code(\paper) block, for
2046 music notation. The syntax is
2047 code(\paper {) [var(paperidentifier)] var(items) code(}),
2048 where each of the items is one of
2052 it() An assignment. The assignment must be terminated by a semicolon.
2053 See Section ref(papervars) for information on paper variables.
2055 it() A context definition, see Section ref(contextdefs) for more
2056 information on context definitions.
2058 it() A margin shape declaration. The syntax is code(\shape)
2059 var(indent1)code(,) var(width1)code(,) var(indent2)code(,) var(width2)
2062 Each pair of var(indent) and var(width) values is a
2063 dimension specifying how far to indent and how wide to make the line.
2064 The indentation and width of successive lines are specified by the
2065 successive pairs of dimensions. The last pair of dimensions will
2066 define the characeristics of all lines beyond those explicitly
2069 it() A font declaration. Its syntax is var(fontsize) code(=)
2070 code(\font)keyindex(font) var(fontname). var(fontsize) is an integer
2071 describing the font to be used. 0 is the default font. var(fontname)
2072 is the basename of a font (usually a member of the Feta family).
2079 subsect(Changing Font Size and Paper Size)cindex(Changing Font Size and Paper Size)
2081 The Feta font provides musical symbols at six different sizes. These
2082 fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and 26
2083 point. The point size of a font is the height of the five line staff
2084 when displayed in the font.
2086 Definitions for these sizes are the files file(paperSZ.ly), where
2087 code(SZ) is one of 11, 13, 16, 20, 23 and 26. If you include any of
2088 these files, the identifiers code(paper_eleven), code(paper_thirteen),
2089 code(paper_sixteen), code(paper_twenty), code(paper_twentythree), and
2090 code(paper_twentysix) are defined respectively. The default
2091 code(\paper) block is also set.
2093 To change the paper size, you must first set the code(papersize)
2094 variable at the top level. Set it to the strings code(a4),
2095 code(letter), or code(legal). After this specification, you must set
2096 the font as described above. If you want the default font, then use
2097 the 20 point font. The new paper size will not take effect if the
2098 font is not loaded and selected afterwards. Paper size selection
2099 works by loading a file named after the paper size you select.
2103 subsect(Paper variables)cindex(Paper variables)
2106 There are a large number of paper variables that are used to control
2107 details of the layout. These variables control the defaults for the
2108 entire score. Usually, they do not have to be changed; they are
2109 by default set to values that depend on the font size in use. The values
2110 are used by the graphic objects while formatting the score; they are
2111 therefore implementation dependent. Most variables are accompanied by
2112 documentation in the initalization file file(params.ly) or
2113 file(paperSZ.ly), where code(SZ) is the staff height in points.
2115 Nevertheless, here are some variables you may want to use or change:
2118 dit(code(indent))indexcode(indent) The indentation of the first line of music.
2120 dit(code(interline))indexcode(interline) The distance between two
2121 staff lines, calculated from the center of the lines. You should use
2122 either this or code(rulethickness) as a unit for distances you modify.
2124 dit(code(linewidth))indexcode(linewidth) Sets the width of the
2125 lines. If set to -1.0, then a single unjustified line is
2128 dit(code(output))indexcode(output) Specifies an alternate name for
2129 the TeX() output. A file(.tex) extension will be added to the string
2132 dit(code(rulethickness))indexcode(rulethickness) Determines thickness of staff lines and bars.
2134 code(castingalgorithm)indexcode(castingalgorithm) The algorithm to use
2135 for breaking lines. Choices are code(\Gourlay)keyindex(Gourlay) for a
2136 TeX() like dynamic programming algorithm, and
2137 code(\Wordwrap)keyindex(Wordwrap) for a simple algorithm. Gourlay
2138 breaking looks much better, but takes a lot more resources. Wordwrap
2139 leaves loosely spaced lines at the end
2145 subsect(Context definitions)
2146 label(contextdefs)cindex(context definition)
2148 A notation contexts is defined by the following information
2152 it() The LilyPond modules that do the actual conversion of music to
2153 notation. Each module is a so-called code(Engraver)cindex(Engraver).
2154 it() How these modules should cooperate, i.e. which ``cooperation
2155 module'' should be used. This cooperation module is a special type
2157 it() what other contexts the context can contain,
2158 it() what properties are defined
2162 A context definition has this syntax: code(\translator
2163 { )var(translatorinit) var(translatormodifierlist) code(}).
2165 var(translatorinit) can be an identifier, or code(\type
2166 )var(typename)code(;). var(typename) is one of
2168 it() indexandcode(Engraver_group_engraver) the standard cooperation engraver.
2169 it() indexandcode(Score_engraver) this is cooperation module that should be
2170 in the top level context.
2171 it() indexandcode(Grace_engraver_group)
2172 This is a special cooperation module (resembling Score_engraver),
2173 that is used to created an embedded `miniscore'
2176 var(translatormodifierlist) is a list of items, where each item is one
2180 it() code(\consists) var(engravername)code(;)
2181 Add var(engravername) to the list of modules in this
2182 context. Section ref(engravers) contains an overview of the
2183 engravers available. The order of engravers added with
2184 code(\consists) is significant.
2186 it() code(\consistsend) var(engravername)code(;)
2187 Analogous to code(\consists), but makes sure that var(engravername)
2188 is always added to the end of the list of engravers.
2190 Some engraver types need to be at the end of the list; this
2191 insures they are put there, and stay there, if a user adds or
2192 removes engravers. This command is usually not needed for
2197 it() code(\accepts) var(contextname)code(;)
2198 Add var(contextname) to the list of context this context can
2199 contain. The first listed context the context to create by
2202 it() code(\remove) var(engravername)code(;)
2203 Remove a previously added (with code(\consists)) engraver
2205 it() code(\name) var(contextname)code(;) This sets name of the
2206 context, eg. code(Staff), code(Voice). If the name is not
2207 specified, the translator won't do anything.
2210 var(propname)code(=)var(value)code(;) A property assignment. It is
2211 legal to use reals for var(value)
2217 In the code(\paper) block, it is also possible to define translator
2218 identifiers. Like other block identifiers, the identifier can only
2219 be used as the very first item of a translator. In order to define
2220 such an identifier outside of code(\score), you must do
2222 \paper{ foo=\translator{ ... } }
2225 \paper{ \translator{ \foo ... } }
2228 subsubsect(Paper Types and Engravers and Pre-defined Translators)cindex(Paper Types and Engravers and Pre-defined Translators)
2230 Some pre-defined identifiers can simplify modification of translators.
2231 The pre-defined identifiers are:
2233 dit(code(StaffContext))indexcode(StaffContext)
2234 Default Staff context.
2235 dit(code(RhythmicStaffContext))indexcode(RhythmicStaffContext)
2236 Default RhythmicStaff context.
2237 dit(code(VoiceContext))indexcode(VoiceContext)
2238 Default Voice context.
2239 dit(code(ScoreContext))indexcode(ScoreContext)
2240 Default Score context.
2241 dit(code(ScoreWithNumbers))indexcode(ScoreWithNumbers)
2242 Score context with numbering at the Score level.
2244 dit(code(BarNumberingStaffContext))indexcode(BarNumberingStaffContext)
2245 Staff context with numbering at the Staff level.
2247 dit(code(HaraKiriStaffContext))indexcode(HaraKiriStaffContext)
2248 Staff context that does not print if it only contains rests. Useful for
2249 orchestral scores.footnote(Hara kiri is the ritual suicide of the Samourai)
2250 dit(code(OrchestralPartStaffContext))indexcode(OrchestralPartStaffContext)
2251 dit(code(OrchestralScoreContext))indexcode(OrchestralScoreContext)
2254 Using these pre-defined values, you can remove or add items to the
2255 translator verb(\paper{ \translator{ \StaffContext
2256 \remove Some_engraver;
2257 \consists Different_engraver; }})
2260 subsubsect(Engravers)
2264 The engravers for paper output are:
2269 dit(code(Bar_engraver))indexcode(Bar_engraver) Engraves bar lines. Normally in code(Staff) and
2270 code(RhythmicStaff).
2271 dit(code(Bar_number_engraver))indexcode(Bar_number_engraver) Engrave bar numbers. These numbers
2272 appear at the start of each line. Not normally in any translator. Can
2273 be added to code(Score) for Score-wide numbering or to code(Staff) for
2274 numbering on each staff.
2276 dit(code(Beam_engraver))indexcode(Beam_engraver) Handles beam requests by engraving beams. Normally
2277 appears in the code(Voice) translator. If omitted, then notes will be printed
2278 with flags instead of beams.
2280 dit(code(Beam_req_swallow_translator))indexcode(Beam_req_swallow_translator) Swallows beam requests. In
2282 dit(code(Chord_name_engraver))indexcode(Chord_name_engraver) Engraves chord names. Normally in
2283 code(ChordNameVoice)
2284 dit(code(Chord_tremolo_engraver))indexcode(Chord_tremolo_engraver)
2285 dit(code(Clef_engraver))indexcode(Clef_engraver) Engraves the clef symbol. Normally in code(Staff).
2286 dit(code(Collision_engraver))indexcode(Collision_engraver)
2287 dit(code(Dot_column_engraver))indexcode(Dot_column_engraver) Engraves dots on dotted notes shifted to the
2288 right of the note. Normally in code(Voice). If omitted, then dots appear on
2290 dit(code(Dynamic_engraver))indexcode(Dynamic_engraver) Engraves dynamics symbols. Normally in code(Voice).
2291 dit(code(Font_size_engraver))indexcode(Font_size_engraver)
2292 dit(code(Key_engraver))indexcode(Key_engraver) Engraves the key signature. Normally in code(Staff).
2293 dit(code(Local_key_engraver))indexcode(Local_key_engraver)
2294 dit(code(Lyric_engraver))indexcode(Lyric_engraver) Engraves lyrics. Normally in code(LyricVoice).
2295 dit(code(Multi_measure_rest_engraver))indexcode(Multi_measure_rest_engraver) Engraves multi-measure rests that are
2296 produced with code(R). Normally in code(Voice).
2297 dit(code(Piano_bar_engraver))indexcode(Piano_bar_engraver)
2298 dit(code(Pitch_squash_engraver))indexcode(Pitch_squash_engraver) Treat all pitches as middle C. Used in
2299 code(RhythmicStaff). Note that the notes move, but the locations of
2300 accidentals stay the same.
2301 dit(code(Priority_horizontal_align_engraver))indexcode(Priority_horizontal_align_engraver)
2302 dit(code(Repeat_engraver))indexcode(Repeat_engraver) Handles repeats? In code(Staff) and
2303 code(RhythmicStaff).
2304 dit(code(Rest_collision_engraver))indexcode(Rest_collision_engraver) Handles collisions of rests. In code(Staff).
2305 dit(code(Rest_engraver))indexcode(Rest_engraver) Engraves rests. Normally in code(Voice).
2306 dit(code(Rhythmic_column_engraver))indexcode(Rhythmic_column_engraver)
2307 dit(code(Score_priority_engraver))indexcode(Score_priority_engraver)
2308 dit(code(Script_engraver))indexcode(Script_engraver) Handles note ornaments generated by code(\script).
2309 Normally in code(Voice).
2310 dit(code(Separating_line_group_engraver))indexcode(Separating_line_group_engraver)
2311 dit(code(Skip_req_swallow_translator))indexcode(Skip_req_swallow_translator)
2312 dit(code(Slur_engraver))indexcode(Slur_engraver) Engraves slurs. Normally in code(Voice).
2313 dit(code(Span_bar_engraver))indexcode(Span_bar_engraver) Engraves lines across multiple staffs. Normally
2314 in code(Staffgroup) and code(GrandStaff). Removing this from code(StaffGroup)
2315 gives the definition of code(ChoirStaff).
2316 dit(code(Span_score_bar_engraver))indexcode(Span_score_bar_engraver)
2317 dit(code(Staff_group_bar_engraver))indexcode(Staff_group_bar_engraver)
2318 dit(code(Staff_margin_engraver))indexcode(Staff_margin_engraver) Prints the name of the instrument
2319 (specified by code(Staff.instrument) and code(Staff.instr)) at the
2321 dit(code(Staff_sym_engraver))indexcode(Staff_sym_engraver)
2322 dit(code(Stem_engraver))indexcode(Stem_engraver) Engraves stems. Normally in code(Voice).
2323 dit(code(Ties_engraver))indexcode(Ties_engraver) Engraves ties. Normally in code(Voice).
2324 dit(code(Time_signature_engraver))indexcode(Time_signature_engraver) Engraves the time signature. Normally in
2325 code(Staff) and code(RhythmicStaff).
2326 dit(code(Timing_engraver))indexcode(Timing_engraver) Responsible for synchronizing timing information
2327 from staffs. Normally in code(Score). In order to create polyrhythmic music,
2328 this engraver should be removed from code(Score) and placed in code(Staff).
2329 dit(code(Tuplet_engraver))indexcode(Tuplet_engraver) Engraves tuplet brackets? In code(Staff).
2330 dit(code(Vertical_align_engraver))indexcode(Vertical_align_engraver)
2338 subsect(output definition)
2340 The MIDI block is analogous to the paper block, but it is simpler.
2341 The code(\midi) block can contain:cindex(MIDI block)
2344 it() a code(\tempo) definition.
2345 it() context definitions
2348 Assignments are illegal in the code(\midi) block.
2351 subsect(Context definitions) cindex(context definitions)
2353 Context definitions follow the precisely the same syntax as within the
2354 \paper block. Translation modules for sound are called performers.
2355 The contexts for MIDI output are defined in file(ly/performer.ly).
2358 subsect(MIDI Instrument Names)cindex(MIDI Instrument Names)
2361 The MIDI instrument name is set by the indexandcode(Staff.midiInstrument)
2362 property or, if that property is not set, the indexandcode(Staff.instrument)
2363 property. The instrument name should be chosen from this list. If
2364 string does not exactly match one from this list then LilyPond uses
2367 COMMENT( acordina = accordion, tango accordian = concertina
2368 distortion guitar = distorted guitar
2369 orchestral strings = harp
2370 pan flute = wood flute? )
2372 verb("acoustic grand" "contrabass" "lead 7 (fifths)"
2373 "bright acoustic" "tremolo strings" "lead 8 (bass+lead)"
2374 "electric grand" "pizzicato strings" "pad 1 (new age)"
2375 "honky-tonk" "orchestral strings" "pad 2 (warm)"
2376 "electric piano 1" "timpani" "pad 3 (polysynth)"
2377 "electric piano 2" "string ensemble 1" "pad 4 (choir)"
2378 "harpsichord" "string ensemble 2" "pad 5 (bowed)"
2379 "clav" "synthstrings 1" "pad 6 (metallic)"
2380 "celesta" "synthstrings 2" "pad 7 (halo)"
2381 "glockenspiel" "choir aahs" "pad 8 (sweep)"
2382 "music box" "voice oohs" "fx 1 (rain)"
2383 "vibraphone" "synth voice" "fx 2 (soundtrack)"
2384 "marimba" "orchestra hit" "fx 3 (crystal)"
2385 "xylophone" "trumpet" "fx 4 (atmosphere)"
2386 "tubular bells" "trombone" "fx 5 (brightness)"
2387 "dulcimer" "tuba" "fx 6 (goblins)"
2388 "drawbar organ" "muted trumpet" "fx 7 (echoes)"
2389 "percussive organ" "french horn" "fx 8 (sci-fi)"
2390 "rock organ" "brass section" "sitar"
2391 "church organ" "synthbrass 1" "banjo"
2392 "reed organ" "synthbrass 2" "shamisen"
2393 "accordion" "soprano sax" "koto"
2394 "harmonica" "alto sax" "kalimba"
2395 "concertina" "tenor sax" "bagpipe"
2396 "acoustic guitar (nylon)" "baritone sax" "fiddle"
2397 "acoustic guitar (steel)" "oboe" "shanai"
2398 "electric guitar (jazz)" "english horn" "tinkle bell"
2399 "electric guitar (clean)" "bassoon" "agogo"
2400 "electric guitar (muted)" "clarinet" "steel drums"
2401 "overdriven guitar" "piccolo" "woodblock"
2402 "distorted guitar" "flute" "taiko drum"
2403 "guitar harmonics" "recorder" "melodic tom"
2404 "acoustic bass" "pan flute" "synth drum"
2405 "electric bass (finger)" "blown bottle" "reverse cymbal"
2406 "electric bass (pick)" "skakuhachi" "guitar fret noise"
2407 "fretless bass" "whistle" "breath noise"
2408 "slap bass 1" "ocarina" "seashore"
2409 "slap bass 2" "lead 1 (square)" "bird tweet"
2410 "synth bass 1" "lead 2 (sawtooth)" "telephone ring"
2411 "synth bass 2" "lead 3 (calliope)" "helicopter"
2412 "violin" "lead 4 (chiff)" "applause"
2413 "viola" "lead 5 (charang)" "gunshot"
2414 "cello" "lead 6 (voice)")
2417 subsubsect(MIDI Types and Performers)cindex(MIDI Types and Performers)
2419 The types available for MIDI translators are:
2421 dit(code(Performer_group_performer))indexcode(Performer_group_performer)
2422 dit(code(Score_performer))indexcode(Score_performer)
2423 dit(code(Staff_performer))indexcode(Staff_performer)
2426 The performers for MIDI translators are:
2428 dit(code(Key_performer))indexcode(Key_performer)
2429 dit(code(Time_signature_performer))indexcode(Time_signature_performer)
2430 dit(code(Note_performer))indexcode(Note_performer)
2431 dit(code(Lyric_performer))indexcode(Lyric_performer)
2432 dit(code(Swallow_performer))indexcode(Swallow_performer)
2436 sect(Pre-defined Identifiers)cindex(Pre-defined Identifiers)
2439 Various identifiers are defined in the initialization files to
2440 provide shorthands for some settings. Most of them are in file(ly/declarations.ly).
2443 dit(code(\break))keyindex(break) Force a line break in music by using a large
2444 argument for the keyword code(\penalty).
2445 dit(code(\center))keyindex(center) Used for setting direction properties. Equals 0.
2446 dit(code(\down))keyindex(down) Used for setting direction setting properties. Is
2448 dit(code(\free))keyindex(free) Used for setting direction setting properties. Is
2450 dit(code(\left))keyindex(left) Used for setting textalignment property. Is equal to -1.
2451 dit(code(\nobreak))keyindex(nobreak) Prevent a line break in music by using a large
2452 negative argument for the keyword code(\penalty).
2453 dit(code(\none))keyindex(none) Used for setting code(Score.beamslopedamping) and
2454 code(Score.beamquantisation) properties. Is equal to 0.
2455 dit(code(\normal))keyindex(normal) Used for setting code(Score.beamslopedamping) and
2456 code(Score.beamquantisation) properties. Is equal to 1.
2457 dit(code(\normalkey))keyindex(normalkey) Select normal key signatures where each octave
2458 has the same key signature. This sets the code(Staff.keyoctaviation) property.
2459 dit(code(\right))keyindex(right) Used for setting textalignment property. Is set to 1.
2460 dit(code(\shiftoff))keyindex(shiftoff) Disable horizontal shifting of note heads that collide.
2461 Sets the code(Voice.horizontalNoteShift) property.
2462 dit(code(\shifton))keyindex(shifton) Enable note heads that collide with other note heads
2463 to be shifted horiztonally. Sets the code(Voice.horizontalNoteShift) property.
2464 dit(code(\slurboth))keyindex(slurboth) Allow slurs to be above or below notes. This
2465 sets the code(Voice.slurVerticalDirection) property.
2466 dit(code(\slurdown))keyindex(slurdown) Force slurs to be below notes. This sets the
2467 code(Voice.slurVerticalDirection) property.
2468 dit(code(\slurup))keyindex(slurup) Force slurs to be above notes. This sets the
2469 code(Voice.slurVerticalDirection) property.
2470 dit(code(\specialkey))keyindex(specialkey) Allow keys signatures do differ in different
2471 octaves. This sets the code(Staff.keyoctaviation) property.
2472 dit(code(\stemboth))keyindex(stemboth) Allow stems, beams, and slurs to point either
2473 direction. This sets the code(Voice.verticalDirection) property.
2474 dit(code(\stemdown))keyindex(stemdown) Force stems, beams, and slurs to point down.
2475 This sets the code(Voice.verticalDirection) property.
2476 dit(code(\stemup))keyindex(stemup) Force stems, beams and slurs to point up. This
2477 sets the code(Voice.verticalDirection) property.
2478 dit(code(\traditional))keyindex(traditional) Used for setting the
2479 code(Score.beamquantisation) property. Is equal to 2.
2480 dit(code(\up))keyindex(up) Used for setting various direction properties. Is
2487 sect(Running LilyPond)cindex(Running LilyPond)
2490 When invoked with a filename that has no extension, LilyPond will try
2491 adding a file(.ly) extension first, then a file(.sly) and then a
2492 file(.ly) extension second. If the filename ends with file(.fly),
2493 LilyPond processes the file as music using file(init.fly). In this
2494 case, LilyPond does something like: COMMENT(
2498 \input "yourfile.fly"
2503 If you invoke LilyPond with a file file(foo.)var(ext) that doesn't
2504 have the file(.ly) extension then LilyPond will look for a file called
2505 file(init.)var(ext) and process this file. The file
2506 file(init.)var(ext) must contain the code(\maininput) keyword or LilyPond
2507 will not read the user specified file.
2509 When LilyPond processes file(filename.ly) it will produce
2510 file(filename.tex) as output. If file(filename.ly) contains a second
2511 code(\paper) keyword, then LilyPond will produce file(filename-1.tex)
2512 as well. Subsequent code(\paper) keywords will produces sequentially
2513 numbered file names. Several files can be specified; they will each
2514 be processed independently.footnote(Not entirely true: the status of
2519 latexcommand(\printindex)