1 mailto(gnu-music-discuss@gnu.org)
5 whenlatex(latexcommand({\normalfont\scshape )ARG1+latexcommand(}))\
9 def(indexcode)(1)(cindex(ARG1@code(ARG1)))
10 def(indexandcode)(1)(code(ARG1)indexcode(ARG1))
11 def(keyindex)(1)(cindex(ARG1@code(\ARG1)))
13 redef(code)(1)(tt(ARG1))
15 whenlatex(latexcommand(\index{)ARG1+latexcommand(}))\
16 whentexinfo(XXnl()texinfocommand(@cindex )ARG1XXnl())\
23 restStyle=mensural doesn't seem to work (lots of characters not found
29 Music expression / music expression
34 This document contains Mudela fragments. You need at least
35 Yodl-1.30.18 to convert this to tex or html.
38 htmlbodyopt(bgcolor)(white)
39 htmlcommand(<font color=black>)
42 \setlength{\topmargin}{-0.25in}
43 \setlength{\textheight}{9in}
44 \setlength{\textwidth}{5.875in}
45 \setlength{\oddsidemargin}{0.25in}
46 \setlength{\evensidemargin}{0.25in}
52 whentexinfo(notableofcontents())
55 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
56 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
57 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
59 article(LilyPond 1.2.0 Reference Manual)
60 (Adrian Mariano, Han-Wen Nienhuys and Jan Nieuwenhuizen)
61 (nop()PIPETHROUGH(date "+%B %d, %Y")()()nop())
64 latexcommand(\def\interexample{})
65 latexcommand(\def\preexample{\par})
66 latexcommand(\def\postexample{\par\medskip})
67 latexcommand(\def\file#1{{code(#1)}})
69 latexcommand(\def\texttt#1{\tt #1})
70 latexcommand(\def\textbf#1{\bf #1})
73 COMMENT(urg, texinfo include breaks)
74 whenhtml(includefile(html-disclaimer.yo-urg))
77 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
78 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
82 This nop(document)footnote(This document has been revised for
83 LilyPond 1.2.) describes the the GNU LilyPond input format, which is
84 a language for defining music. We call this language em(Music
85 Definition Language) or em(Mudela), for short.footnote(If anybody
86 comes up with a better name, we'd gladly take this. Gourlay already
87 uses a ``Musical Description Language,'' ISO standard 10743 defines a
88 ``Standard Music Description Language.'' We're not being original
91 em(Mudela) is a language that allows you to
94 it() create musical expressions by combining pitches, durations
95 it() output those musical expressions to various formats
96 it() give those musical expressions and output definitions names, so
97 you can enter them in manageable chunks.
100 em(Mudela) aims to define a piece of music completely, both from
101 typesetting and from a performance point of view.
104 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
105 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
110 This section describes what you may enter at top level.
112 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
114 subsect(Score definitions)
115 cindex(score definition)
117 The output is generated combining a music expression with an output
118 definition. A score block has the following syntax:
121 code(\score {) var(musicexpr) var(outputdefs) code(})
124 var(outputdefs) are zero or more output definitions. If no output
125 definition is supplied, the default code(\paper) block will be added.
127 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
129 subsect(Information header)
136 code(\header) code({) var(key1) = var(val1);
137 var(key2) = var(val2); ellipsis() code(})
140 A header describes the file's contents. It can also appear in a
141 code(\score) block. Tools like indexandcode(ly2dvi) can use this
142 information for generating titles. Key values that are used by
143 code(ly2dvi) are: title, subtitle, composer, opus, poet, instrument,
144 metre, arranger, piece and tagline.
146 It is customary to put the code(\header) at the top of the file.
148 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
150 subsect(Setting notenames and chordnames)
153 Note name tables can be specified using
156 code(\notenames)keyindex(notenames)
157 code({) var(assignmentlist) code(})
160 var(assignmentlist) is a list of definitions of the form
163 var(name) = var(pitch)
166 Chord modifiers can be set analogously, with
167 code(\chordmodifiers)keyindex(chordmodifiers).
169 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
171 subsect(Output definitions)
173 A code(\paper) block at top level sets the default paper block. A
174 code(\midi) block at top level works similarly.
176 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
178 subsect(GUILE and Scheme)
180 LilyPond contains a Scheme interpreter (the GUILE library) for
181 internal use. The following commands access the interpreter
185 code(\scm)keyindex(scm) var(scheme) code(;)
188 Evaluates the specified Scheme code. The result is discarded.
191 code(\scmfile)keyindex(scmfile) var(filename) code(;)
194 Reads Scheme code from the specified file. The result is discarded.
197 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
201 Identifier assignments may appear at top level. Semicolons are
202 forbidden after top level assignments.
205 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
206 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
208 sect(Lexical conventions)
209 cindex(lexical conventions)
211 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
216 whenlatex(cindex(%A@latexcommand(\texttt{\%\textbraceleft})))
217 whenlatex(cindex(%B@latexcommand(\texttt{\%\textbraceright})))
219 A one line comment is introduced by a `code(%)' character.
220 Block comments are started by `code(%{)' and ended by `code(%})'.
221 They cannot be nested.
223 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
228 Keywords start with a backslash, followed by a number of lower case
229 alphabetic characters. These are all the keywords.
231 latexcommand(\begin{raggedright})
239 code(\chordmodifiers)
287 latexcommand(\end{raggedright})
289 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
294 Formed from an optional minus sign followed by digits. Arithmetic
295 operations cannot be done with integers, and integers cannot be mixed
298 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
303 Formed from an optional minus sign and a sequence of digits followed
304 by a em(required) decimal point and an optional exponent such as
305 code(-1.2e3). Reals can be built up using the usual operations:
306 `indexandcode(+)', `indexandcode(-)', `indexandcode(*)', and
307 `indexandcode(/)', with parentheses for grouping.
309 A real constant can be followed by one of the dimension
310 keywords:cindex(dimensions) code(\mm)keyindex(mm),
311 code(\pt)keyindex(pt), code(\in)keyindex(in), or
312 code(\cm)keyindex(cm), for millimeters, points, inches and
313 centimeters, respectively. This converts the number to a real that
314 is the internal representation of dimensions.
316 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
321 Begins and ends with the `code(")' character. To include a `code(")'
322 character in a string write `code(\")'. Various other backslash
323 sequences have special interpretations as in the C language. A
324 string that contains no spaces can be written without the quotes.
325 See bind(section)ref(modes) for details on unquoted strings; their
326 interpretation varies depending on the situation. Strings can be
327 concatenated with the `code(+)' operator.
329 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
331 subsect(Tokenizer commands)
333 The tokenizer accepts the following commands. They can appear
337 code(\maininput)keyindex(maininput)
340 This command is used in init files to signal that the user file must
341 be read. This command cannot be used in a user file.
344 code(\include)keyindex(include) var(file)
347 Include var(file). The argument var(file) may be a quoted string (an
348 unquoted string will not work here!) or a string identifier. The full
349 filename including the file(.ly) extension must be given,
352 code(\version)keyindex(version) var(string) code(;)
355 Specify the version of LilyPond that a file was written for. The
356 argument is a version string in quotes, for example code("1.2.0").
357 This is used to detect invalid input, and to aid
358 code(convert-mudela), a tool that automatically upgrades input files.
360 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
362 subsect(Pitch Names in Other Languages)
363 cindex(other languages)
366 Note name definitions have been provided in various languages.
367 Simply include the language specific init file. For example:
368 `code(\include "english.ly")'. The available language files and the
369 names they define are:
372 verb( Note Names sharp flat
374 nederlands.ly c d e f g a bes b -is -es
375 english.ly c d e f g a bf b -s/-sharp -f/-flat
376 deutsch.ly c d e f g a b h -is -es
377 norsk.ly c d e f g a b h -iss/-is -ess/-es
378 svenska.ly c d e f g a b h -iss -ess
379 italiano.ly do re mi fa sol la sid si -d -b
380 catalan.ly do re mi fa sol la sid si -d/-s -b)
383 Pitch names can be redefined using the
384 code(\notenames)keyindex(notenames) command, see
385 bind(subsection)ref(notenames).
387 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
389 subsect(Lexical modes)
390 cindex(lexical modes)
394 To simplify entering notes, lyrics, and chords, em(Mudela) has three
395 special input modes on top of the default mode. In each mode, words
396 are identified on the input. If code("word") is encountered, it is
397 treated as a string. If code(\word) is encountered, it is treated as
398 a keyword or as an identifier. The behavior of the modes differs in
399 two ways: Different modes treat unquoted words differently, and
400 different modes have different rules for deciding what is a word.
403 dit(Normal mode.)cindex(mode!normal)
404 At the start of parsing, em(Mudela) is in Normal mode. In Normal
405 mode, a word is an alphabetic character followed by alphanumeric
406 characters. If code(word) is encountered on the input it is
409 dit(Note mode.)cindex(mode!note)
411 Note mode is introduced by the keyword
412 code(\notes)keyindex(notes). In Note mode, words can only
413 contain alphabetic characters. If code(word) is encountered,
414 LilyPond first checks for a notename of code(word). If no
415 notename is found, then code(word) is treated as a string.
417 Since combinations of numbers and dots are used for indicating
418 durations, it is not possible to enter real numbers in this mode.
420 dit(Chord mode.)cindex(mode!chord)
421 Chord mode is introduced by the keyword
422 code(\chords)keyindex(chords). It is similar to Note mode, but
423 words are also looked up in a chord modifier table (containing
424 code(maj), code(dim), etc).
426 Since combinations of numbers and dots are used for indicating
427 durations, you can not enter real numbers in this mode. Dashes
428 and carets are used to indicate chord additions and subtractions,
429 so scripts can not be entered in Chord mode.
431 dit(Lyrics mode.) cindex(mode!lyric)
433 Lyrics mode is introduced by the keyword
434 code(\lyrics)keyindex(lyrics). This mode has rules that make it
435 easy to include punctuation and diacritical marks in words. A
436 word in Lyrics mode begins with: an alphabetic character,
437 `code(_)', `code(?)', `code(!)', `code(:)', `code(')', the
438 control characters code(^A) through code(^F), code(^Q) through
439 code(^W), code(^Y), code(^^), any 8-bit character with ASCII code
440 over 127, or a two-character combination of a backslash followed
441 by one of `code(`)', `code(')', `code(")', or
442 `code(^)'.footnote(The purpose of Lyrics mode is that you can
443 enter lyrics in TeX() format or a standard encoding without
444 needing quotes. The precise definition of this mode indeed is
445 ludicrous. This will remain so until the authors of LilyPond
446 acquire a deeper understanding of character encoding, or someone
447 else steps up to fix this.)
449 Subsequent characters of a word can be any character that is not
450 a digit and not white space. One important consequence of this
451 is that a word can end with `code(})', which may be confusing if
452 you thought the closing brace was going to terminate Lyrics
453 mode.footnote(LilyPond will issue a warning, though.) Any
454 `code(_)' characters which appear in an unquoted word are
455 converted to spaces. This provides a mechanism for introducing
456 spaces into words without using quotes. Quoted words can also be
457 used in Lyrics mode to specify words that cannot be written with
458 the above rules. Here are some examples. Not all of these words
459 are printable by TeX().
462 DOEXPAND(muckslash)^etre % a word
467 2B_||_!2B % not a word because it starts with a digit
468 ``Hello'' % not a word because it starts with `
469 _ _ _ _ % 4 words, each one a space)
472 Since combinations of numbers and dots are used for indicating
473 durations, you can not enter real numbers in this mode.
476 It is possible to create words that break the rules by prefixing them
477 with the dollar sign `indexandcode($)'. Regardless of the context, a
478 word beginning with `code($)' extends until the next white space
479 character. Such words can contain numbers (even in Note mode), or
480 other forbidden characters. The dollar sign can be used to create
481 and access identifiers that could not otherwise be used.footnote(Use
482 of `code($)' hampers readability and portability to future LilyPond
483 versions, thus the use of the dollar sign is discouraged.)
486 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
487 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
490 cindex(types and identifiers)
492 em(Mudela) has a limited set of types:
498 it() music expressions
499 it() durations of notes and rests (specified with
500 code(\notenames)keyindex(notenames))
501 it() note name tables
502 it() context definitions, part of output definitions. See
503 bind(section)ref(contextdefs) for more information
504 it() output definitions (like code(\paper)keyindex(paper) blocks
505 and code(\midi)keyindex(midi) blocks)
506 it() score definitions (code(\score)keyindex(score) blocks)
509 Type is a syntactical property: em(Mudela) has no real type system,
510 so there is no support for generic expressions, functions, or user
511 defined types. For the same reason, it is not possible to mix reals
512 and integers in arithmetic expressions, and ``type
513 errors''cindex(type error) (e.g., using a string identifier to
514 initialize a code(\paper)keyindex(paper) block) will yield a ``parse
517 Identifiers allow objects to be assigned to names. To assign an
518 identifier, you use `var(name)=var(value)' and to refer to an
519 identifier, you preceed its name with a backslash:
520 `code(\)var(name)'. Identifier assignments must appear at top level
521 in the em(Mudela) file. Semicolons are forbidden after assignments
522 appearing at top level but they are obligatory after assignments
523 appearing in the code(\paper) block, see bind(Section)ref(paper).
525 var(value) is any of the types listed above.
527 An identifier can be created with any string for its name, but you
528 will only be able to refer to identifiers whose names begin with a
529 letter, being entirely alphanumeric. It is impossible to refer to an
530 identifier whose name is the same as the name of a keyword.
532 The right hand side of an identifier assignment is parsed completely
533 before the assignment is done, so it is allowed to redefine an
534 identifier in terms of its old value, e.g.
537 code(foo = \foo * 2.0)
540 When an identifier is referenced, the information it points to is
541 copied. Therefore it only makes sense to put identifiers for
542 translators, output definitions, and code(\score)keyindex(score)
543 blocks as the first item in a block. For this reason, if you
544 reference a code(\foo) variable in a code(\foo) block, it must be the
545 first item in the list following code(\foo).footnote(code(\paper{\one
546 \two}) does not make sense, because the information of code(\two)
547 would overwrite the information of code(\one), thereby making the
548 reference to the first identifier useless.)
551 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
552 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
554 sect(Music expressions)
555 cindex(music expressions)
557 Music in em(Mudela) is entered as a music expression. Notes, rests,
558 lyric syllables are music expressions (the atomic
559 expressions)cindex(atomic music expressions), and you can combine
560 music expressions to form new ones. This example forms a compound
561 expressions out of the quarter code(c) note and a code(d)
565 verb(\sequential { c4 d4 })
568 The meaning of this compound expression is to play the `code(c)'
569 first, and then the `code(d)' (as opposed to playing them
570 simultaneously, for instance).
572 Atomic music expression are discussed in
573 bind(subsection)ref(atomicmusic). Compound music expressions are
574 discussed in bind(subsection)ref(compoundmusic).
577 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
578 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
580 sect(Atomic music expressions)
583 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
585 subsect(Pitch and duration)
589 The syntax for pitch specification is
592 code(\musicalpitch)keyindex(musicalpitch)
593 code({) var(octave) var(note) var(shift) code(})
596 var(octave) is specified by an integer, zero for the octave
597 containing middle C. var(note) is a number from 0 to 7, with 0
598 corresponding to C and 7 corresponding to B. The shift is zero for a
599 natural, negative to add flats, or positive to add sharps.
601 In Note and Chord mode, pitches may be designated by names. See
602 bind(section)ref(notelang) for pitch names in different languages.
604 The syntax for duration specification is
607 code(\duration)keyindex(duration)
608 code({) var(length) var(dotcount) code(})
611 var(length) is the negative logarithm (base 2) of the duration:
612 bind(1)is a half note, bind(2)is a quarter note, bind(3)is an eighth
613 note, etc. The number of dots after the note is given by
616 In Note, Chord, and Lyrics mode, durations may be designated by
617 numbers and dots. See bind(Section)ref(notelang) for details.
619 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
621 subsect(Note specification)
623 cindex(note specification)
625 cindex(entering notes)
627 A note specification has the form
630 var(pitch)[var(octavespec)][code(!)][code(?)][var(duration)]
633 The pitch of the note is specified by the note's name.
637 The default names are the Dutch note names. The notes are specified
638 by the letters `code(c)' through `code(b)', where `code(c)' is an
639 octave below middle C and the letters span the octave above that C.
640 In Dutchcindex(notenames!Dutch), a sharp is formed by adding
641 `code(-is)' to the end of a pitch name. A flat is formed by adding
642 `code(-es)'. Double sharps and double flats are obtained by adding
643 `code(-isis)' or `code(-eses)'. `code(aes)' and `code(ees)' are
644 contracted to `code(as)' and `code(es)' in Dutch, but both forms will
647 LilyPond has predefined sets of notenames for various languages. See
648 bind(section)ref(notelang) for details.
652 The optional octave specification takes the form of a series of
653 single quote (`indexandcode(')') characters or a series of comma
654 (`indexandcode(,)') characters. Each code(') raises the pitch by one
655 octave; each code(,) lowers the pitch by an octave.
657 mudela(fragment,verbatim,center)( c' d' e' f' g' a' b' c'')
659 mudela(fragment,verbatim,center)( cis' dis' eis' fis' gis' ais' bis')
661 mudela(fragment,verbatim,center)( ces' des' es' fes' ges' as' bes')
663 mudela(fragment,verbatim,center)( cisis' eisis' gisis' aisis' beses')
665 mudela(fragment,verbatim,center)( ceses' eses' geses' ases' beses')
667 Whenever a C-sharp is desired, you must specify a C-sharp. LilyPond
668 will determine what accidentals to typeset depending on the key and
669 context. A reminder accidental cindex(reminder accidental) can be
670 forced by adding an exclamation mark `code(!)' after the pitch. A
671 cautionary accidental, cindex(cautionary accidental) i.e., an
672 accidental within parentheses can be obtained by adding the question
673 mark `indexandcode(?)' after the pitch.
675 mudela(fragment,verbatim,center)( cis' d' e' cis' c'? d' e' c'!)
680 Durations are entered as their reciprocal values. For notes longer
681 than a whole note, use identifiers.
684 verb(c'\longa c'\breve
685 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64)
690 \notes \relative c'' {
692 a1 a2 a4 a8 a16 a32 a64 a64
695 loose_column_distance = 2.5 * \interline;
698 \type "Score_engraver";
700 \consists "Note_heads_engraver";
701 \consists "Stem_engraver";
702 \consists "Rhythmic_column_engraver";
710 r1 r2 r4 r8 r16 r32 r64 r64)
715 \notes \relative c'' {
717 r1 r2 r4 r8 r16 r32 r64 r64
720 loose_column_distance = 2.5 * \interline;
723 \type "Score_engraver";
725 \consists "Rest_engraver";
726 \consists "Stem_engraver";
727 \consists "Rhythmic_column_engraver";
733 If the duration is omitted then it is set equal to the previous
734 duration. If there is no previous duration, a quarter note is
735 assumed. The duration can be followed by a dot (`indexandcode(.)')
736 to obtain dotted note lengths.
738 mudela(fragment,verbatim,center)( a'4. b'4.)
740 You can alter the length of duration by writing
741 `code(*)var(fraction)' after it. This will not affect the
742 appearance of note heads or rests.
746 Rests are entered like notes, with note name `indexandcode(r)',
747 or `indexandcode(R)'. There is also a note name `indexandcode(s)',
748 which produces a space of the specified duration.
749 `code(R)' is specifically meant for entering parts: the code(R) rest
750 can expand to fill a score with rests, or it can be printed as a
751 single multimeasure rest.
753 subsubsect(Lyrics syllables)
754 cindex(lyrics expressions)
756 Syllables are entered like notes, with pitches replaced by text. For
757 example, `code(Twin-4 kle4 twin-4 kle4)' enters four syllables, each
758 with quarter note duration. Note that the hyphen has no special
759 meaning for lyrics, and does not introduce special symbols. See
760 bind(section)ref(modes) for a description of what is interpreted as
763 Spaces can be introduced into a lyric either by using quotes
764 (`code(")') or by using an underscore without quotes: `code(He_could4
765 not4)'. All unquoted underscores are converted to spaces. Printing
766 lyrics is discussed in bind(section)ref(lyricprint).
768 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
774 code(\property)keyindex(property)
775 var(contextname)code(.)var(propname) code(=) var(value)
778 Sets the var(propname) property of the context var(contextname) to
779 the specified var(value). All three arguments are strings.
780 Depending on the context, it may be necessary to quote the strings or
781 to leave space on both sides of the dot.
783 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
785 subsect(Translator switches)
786 cindex(translator switches)
789 code(\translator)keyindex(translator)
790 var(contexttype) = var(name)
793 A music expression indicating that the context which is a direct
794 child of the a context of type var(contexttype) should be shifted to
795 a context of type var(contexttype) and the specified name.
797 Usually this is used to switch staffs in Piano music, e.g.
800 code(\translator Staff = top) var(Music)
803 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
808 Commands are music expressions that have no duration.
810 subsubsect(Key signatures)
813 code(\key)keyindex(key) var(pitch) var(type) code(;)
816 Change the key signature. var(type) should be
817 code(\major)keyindex(major) or code(\minor)keyindex(minor) to get
818 var(pitch)-major or var(pitch)-minor, respectively. The second
819 argument is optional; the default is major keys. The var(\context)
820 argument can also be given as an integer, which tells the number of
821 semitones that should be added to the pitch given in the subsequent
822 code(\key)keyindex(key) commands to get the corresponding major key,
823 e.g., code(\minor)keyindex(minor) is defined bind(as)3. The standard
824 mode names code(\ionian)keyindex(ionian),
825 code(\locrian)keyindex(locrian), code(\aeolian)keyindex(aeolian),
826 code(\mixolydian)keyindex(mixolydian), code(\lydian)keyindex(lydian),
827 code(\phrygian)keyindex(phrygian), and code(\dorian)keyindex(dorian)
831 code(\keysignature)keyindex(keysignature) var(pitchseq) code(;)
834 Specify an arbitrary key signature. The pitches from var(pitch) will
835 be printed in the key signature in the order that they appear on the
838 subsubsect(Rehearsal marks)
841 code(\mark)keyindex(mark) var(unsigned) code(;) nl()
842 code(\mark) var(string) code(;)
845 Prints a mark over or under (depending on the
846 indexandcode(markDirection) property) the staff. You must add
847 indexandcode(Mark_engraver) to either the Score or Staff context for
850 subsubsect(Bar lines)
854 code(\bar)keyindex(bar) var(bartype) code(;)
857 This is a request to print a special bar symbol. It replaces the
858 regular bar symbol with a special
859 symbol. The argument var(bartype) is a string which specifies the
860 kind of bar to print. Options are code(":|")cindex("|A@code(:|)),
861 code("|:")cindex("|B@code(|:)), code(":|:")cindex("|C@code(:|:)),
862 code("||")cindex("|D@code(||)), code("|.")cindex("|E@code(|.)),
863 code(".|")cindex("|F@code(.|)), and code(".|.")cindex("|G@code(.|.)).
864 These produce, respectively, a right repeat, a left repeat, a double
865 repeat, a double bar, a start bar, an end bar, and a thick double
866 bar. If var(bartype) is set to code("empty") then nothing is
867 printed, but a line break is allowed at that spot.
869 You are encouraged to use code(\repeat) for repetitions.
870 See bind(section)ref(sec:repeats).
872 subsubsect(Timing commands)
875 code(\cadenza)keyindex(cadenza) var(togglevalue) code(;)
878 Music expression that toggles the automatic generation of bar lines.
879 If var(togglevalue) bind(is)1, bar line generation is turned off. If
880 var(togglevalue) bind(is)0, a bar line is immediately printed and
881 automatic bar generation is turned on.
884 code(\time)keyindex(time) var(numerator)code(/)var(denominator) code(;)
887 Change the time signature. The default time signature bind(is)4/4.
888 The time signature is used to generate bar lines.
891 code(\tempo)keyindex(tempo) var(duration) = var(perminute) code(;)
894 Used to specify the tempo. For example, `code(\tempo 4 = 76;)'
895 requests output with bind(76)quarter notes per minute.
898 code(\partial)keyindex(partial) var(duration) code(;)
903 This creates an incomplete measure (anacrusis, upbeat) at the start of
904 the music, e.g., `code(\partial 8*2;)' creates a starting measure
905 lasting two eighth notes.
908 code(|)indexcode(|)cindex(bar check)
910 cindex(shorten measures)
913 `code(|)' is a barcheck. Whenever a barcheck is encountered during
914 interpretation, a warning message is issued if it doesn't fall at a
915 measure boundary. This can help you finding errors in the input.
916 The beginning of the measure will be relocated, so this can also
917 be used to shorten measures.
919 subsubsect(Other commands)
922 code(\penalty)keyindex(penalty) var(int) code(;)
925 Discourage or encourage line breaks. See identifiers
926 code(\break)keyindex(break) and code(\nobreak)keyindex(nobreak) in
927 bind(section)ref(ident).
930 code(\clef)keyindex(clef) var(clefname) code(;)
933 Music expression that sets the current clef. The argument is a
934 string which specifies the name of the clef. Several clef names are
935 supported. If `code(_8)' or `code(^8)' is added to the end of a clef
936 name, then the clef lowered or raised an octave will be generated.
937 Here are the supported clef names with bind(middle)C shown in each
944 %\property Voice.textStyle = typewriter
945 \clef subbass; c'4-"\kern -5mm subbass"
946 \clef bass; c'4^"\kern -2mm bass"
947 \clef baritone; c'4_"\kern -5mm baritone"
948 \clef varbaritone; c'4^"\kern -6mm varbaritone"
949 \clef tenor; c'4_"\kern -3mm tenor"
950 \clef "G_8"; c'4^"\kern -2mm G\\texttt{\\_}8"
962 \clef alto; c'4_"\kern -2mm alto"
963 \clef mezzosoprano; c'4^"\kern -9mm mezzosoprano"
964 \clef soprano; c'4_"\kern -6mm soprano"
965 \clef treble; c'4^"\kern -4mm treble"
966 \clef french; c'4_"\kern -4mm french"
974 The three clef symbols can also be obtained using the names `code(G)',
975 `code(C)' or `code(F)', optionally followed by an integer which
976 indicates at which note line the clef is located. An as example, the
977 code(mezzosoprano) clef can also be given as `code(C2)'.
980 code(\skip)keyindex(skip) var(duration) code(;)
983 Skips the amount of time specified by var(duration). If no other
984 music is played, a gap will be left for the skipped time with no
985 notes printed. It works in Note Mode or Lyrics Mode. In Note mode,
986 this has the same effect as the space rest `code(s)'.
992 A beam is specified by surrounding the beamed notes with brackets
993 `indexandcode([)' and `indexandcode(])'.
995 mudela(fragment,verbatim,center)( [a'8 a'] [a'16 a' a' a'])
997 Some more elaborate constructions:
999 mudela(fragment,verbatim,center)( [a'16 <a' c''> c'' <a' c''>]
1000 \times 2/3 { [e'8 f' g'] })
1002 Beaming can be generated automatically; see bind(section)ref(autobeam).
1004 To place tremolo marks cindex(tremolo beams) between two notes, begin
1005 with `code([:)var(length)' and end with `code(])'. Tremolo marks
1006 will appear instead of beams. Putting more than two notes in such a
1007 construction will produce odd effects. To create tremolo beams on a
1008 single note, simply attach `code(:)var(length)' to the note itself
1009 (see also bind(section)ref(tremolo)).
1011 mudela(fragment,verbatim,center)( [:16 e'1 g'] [:8 e'4 f'])
1013 mudela(fragment,verbatim,center)( c'4:32 [:16 c'8 d'8])
1015 subsubsect(Lyric helpers)
1016 cindex(--@code(-)code(-))
1021 The syntax for an extender mark is `code(__)'. This syntax can only
1022 be used within lyrics mode. The syntax for a spanning hyphen (i.e.,
1023 a hyphen that will be printed between two lyric syllables) is
1029 A tie connects two adjacent note heads of the same pitch. When used
1030 with chords, it connects all of the note heads whose pitches match.
1031 Ties are indicated using the tilde symbol `indexandcode(~)'.
1032 If you try to tie together chords which have no common pitches, a
1033 warning message will appear and no ties will be created.
1035 mudela(fragment,verbatim,center)( e' ~ e' <c' e' g'> ~ <c' e' g'>)
1037 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1039 subsect(Atomic music expressions: add-ons)
1041 [TODO: explain Requests]
1043 subsubsect(Articulations)
1044 cindex(articulations)
1048 A variety of symbols can appear above and below notes to indicate
1049 different characteristics of the performance. These symbols can be
1050 added to a note with `var(note)code(-\)var(name)'. Numerous symbols
1051 are defined in file(script.ly) and file(script.scm). Symbols can be
1052 forced to appear above or below the note by writing
1053 `var(note)code(^\)var(name)' and `var(note)code(_\)var(name)'
1054 respectively. Here is a chart showing symbols above notes, with the
1055 name of the corresponding symbol appearing underneath.
1060 c''-\accent c''-\marcato c''-\staccatissimo c''-\fermata
1061 c''-\stopped c''-\staccato c''-\tenuto c''-\upbow
1062 c''-\downbow c''^\lheel c''-\rheel c''^\ltoe
1063 c''-\rtoe c''-\turn c''-\open c''-\flageolet
1064 c''-\reverseturn c''-\trill c''-\prall c''-\mordent
1065 c''-\prallprall c''-\prallmordent c''-\upprall c''-\downprall
1066 c''-\thumb c''-\segno c''-\coda
1068 \context Lyrics \lyrics {
1069 accent__ marcato__ staccatissimo__ fermata
1070 stopped__ staccato__ tenuto__ upbow
1071 downbow__ lheel__ rheel__ ltoe
1072 rtoe__ turn__ open__ flageolet
1073 reverseturn__ trill__ prall__ mordent
1074 prallprall__ prallmordent__ uprall__ downprall
1075 thumb__ segno__ coda
1079 linewidth = 5.875\in;
1085 In addition, it is possible to place arbitrary strings of text or
1086 TeX() above or below notes by using a string instead of an
1087 identifier: `code(c^"text")'. Fingerings cindex(fingering) can be
1088 placed by simply using digits. All of these note ornaments appear in
1089 the printed output but have no effect on the MIDI rendering of the
1092 To save typing, fingering instructions (digits 0 bind(to)9 are
1093 supported) and single characters shorthands exist for a few
1099 \property Voice.textStyle = typewriter
1105 c''4-^_"c-\\^{ }" s4
1112 linewidth = 5.875 \in;
1118 Dynamic marks are specified by using an identifier after a note:
1119 `code(c4-\ff)' (the dash is optional for dynamics: `code(c4 \ff))'.
1120 The available dynamic marks are:
1121 code(\ppp)keyindex(ppp),
1122 code(\pp)keyindex(pp), code(\p)keyindex(p), code(\mp)keyindex(mp),
1123 code(\mf)keyindex(mf), code(\f)keyindex(f), code(\ff)keyindex(ff),
1124 code(\fff)keyindex(fff), code(\fff)keyindex(ffff),
1125 code(\fp)keyindex(fp), code(\sf)keyindex(sf),
1126 code(\sff)keyindex(sff), code(\sp)keyindex(sp),
1127 code(\spp)keyindex(spp), code(\sfz)keyindex(sfz), and
1128 code(\rfz)keyindex(rfz).
1130 subsubsect(General text scripts)
1133 code(\textscript)keyindex(textscript) var(text) var(style)
1136 Defines a text to be printed over or under a note. var(style) is a
1137 string that may be one of code(roman), code(italic), code(typewriter),
1138 code(bold), code(Large), code(large), code(dynamic) or code(finger).
1140 You can attach a general textscript request using this syntax:
1143 verb(c4-\textscript "6" "finger"
1144 c4-\textscript "foo" "normal")
1147 This is equivalent to `code(c4-6 c4-"foo")'.
1149 subsubsect(General scripts)
1153 code(\script)keyindex(script) var(alias)
1156 Prints a symbol above or below a note. The argument is a string
1157 which points into the script-alias table defined in file(script.scm).
1158 The scheme definitions specify whether the symbol follows notes into
1159 the staff, dependence of symbol placement on staff direction, and a
1160 priority for placing several symbols over one note. Usually the
1161 code(\script)keyindex(script) keyword is not used directly. Various
1162 helpful identifier definitions appear in file(script.ly).
1167 Slurs connects chords and try to avoid crossing stems. A slur is
1168 started with `code(CHAR(40))' and stopped with `code(CHAR(41))'. The
1169 starting `code(CHAR(40))' appears to the right of the first note in
1170 the slur. The terminal `code(CHAR(41))' appears to the left of the
1171 first note in the slur. This makes it possible to put a note in
1172 slurs from both sides:
1174 mudela(fragment,verbatim,center)( f'()g'()a' [a'8 b'(] a'4 g'2 )f'4)
1176 subsubsect(Crescendo)
1179 A crescendo mark is started with code(\cr)keyindex(cr) and terminated
1180 with code(\rc)keyindex(rc). A decrescendo mark is started with
1181 code(\decr)keyindex(decr) and terminated with
1182 code(\rced)keyindex(rced). There are also shorthands for these
1183 marks. A crescendo can be started with code(\<)keyindex(<) and a
1184 decrescendo can be started with code(\>)keyindex(>). Either one can
1185 be terminated with code(\!)keyindex("!). Note that code(\!)
1186 must go before the last note of the dynamic mark whereas code(\rc)
1187 and code(\rced) go after the last note. Because these marks are
1188 bound to notes, if you want to get several marks during one note, you
1189 must use spacer notes.
1191 mudela(fragment,verbatim,center)( c'' \< \! c'' d'' \decr e'' \rced
1192 < f''1 { s4 \< \! s2 \> \! s4 } >)
1194 subsubsect(General spanners)
1197 code(\spanrequest)keyindex(spanrequest) var(startstop) var(type)
1200 Define a spanning request. The var(startstop) parameter is bind(either)-1
1201 (code(\start)keyindex(start)) bind(or)1 (code(\stop)keyindex(stop)) and
1202 var(type) is a string that describes what should be started.
1203 Supported types are code(crescendo), code(decrescendo),
1204 code(beam), code(slur). This is an internal command. Users should
1205 use the shorthands which are defined in the initialization file
1208 You can attach a (general) span request to a note using
1210 mudela(fragment,verbatim,center)( c'4-\spanrequest \start "slur"
1211 c'4-\spanrequest \stop "slur")
1213 The slur syntax with parentheses is a shorthand for this.
1215 COMMENT(came till here with indexifying)
1217 subsubsect(Tremolo marks)
1218 cindex(tremolo marks)
1221 Tremolo marks can be printed on a single note by adding
1222 `code(:)[var(length)]' after the note. The length must be at
1223 bind(least)8. A var(length) value bind(of)8 gives one line across
1224 the note stem. If the length is omitted, then the last value is
1225 used, or the value of the indexandcode(abbrev) property if there was
1228 mudela(verbatim,fragment,center)( c'2:8 c':32)
1231 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1232 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1234 sect(Compound music expressions)
1235 cindex(compound music expressions)
1236 label(compoundmusic)
1238 Music expressions are compound data structures. You can nest music
1239 expressions any way you like. This simple example shows how three
1240 chords can be expressed in two different ways:
1242 mudela(fragment,verbatim,center)( \notes \context Staff {
1244 <a c'> <b d' > <c' e' >
1245 <{a b c'}{c' d' e'}>
1248 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1250 subsect(Context selection)
1251 cindex(context selection)
1254 code(\context)keyindex(context)
1255 var(contexttype) [code(=) var(contextname)] var(musicexpr)
1258 Interpret var(musicexpr) within a context of type var(contexttype).
1259 If the context does not exist, it will be created. The new context
1260 can optionally be given a name. See
1261 bind(section)ref(contextselection) bind(and)ref(contextdefs) for more
1262 information on interpretation contexts.
1264 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1266 subsect(Music entry modes)
1270 Mode switching keywords form compound music expressions: code(\notes)
1271 keyindex(notes) var(musicexpr), code(\chords) keyindex(chords)
1272 var(musicexpr), and code(\lyrics) keyindex(lyrics) var(musicexpr).
1273 These expressions do not add anything to the meaning of their
1274 arguments. They are just a way to indicate that the arguments should
1275 be parsed in indicated mode. See bind(section)ref(modes) for more
1276 information on modes.
1278 More information on context selection can be found in
1279 bind(section)ref(contextselection).
1281 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1283 subsect(Sequential music)
1284 cindex(sequential music)
1285 COMMENT(It's not possible to index `{' and `}' directly, thus we
1287 whenlatex(cindex(?A@latexcommand(\texttt{\textbraceleft})))
1288 whenlatex(cindex(?B@latexcommand(\texttt{\textbraceright})))
1291 code(\sequential)keyindex(sequential)
1292 code({) var(musicexprlist) code(})
1295 This means that list should be played or written in sequence, i.e.,
1296 the second after the first, the third after the second. The duration
1297 of sequential music is the the sum of the durations of the elements.
1298 There is a shorthand, which leaves out the keyword:
1301 code({) var(musicexprlist) code(})
1304 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1306 subsect(Simultaneous music)
1307 cindex(simultaneous music)
1312 code(\simultaneous)keyindex(simultaneous)
1313 code({) var(musicexprlist) code(})
1316 It constructs a music expression where all of its arguments start at
1317 the same moment. The duration is the maximum of the durations of the
1318 elements. The following shorthand is a common idiom:
1321 code(<) var(musicexprlist) code(>)
1324 If you try to use a chord as the first thing in your score, you might
1325 get multiple staffs instead of a chord.
1327 mudela(verbatim,center)( \score {
1334 This happens because the chord is interpreted by a score context.
1335 Each time a note is encountered a default Voice context (along with a
1336 Staff context) is created. The solution is to explicitly instantiate
1339 mudela(verbatim,center)( \score {
1340 \notes\context Voice <c''4 e''>
1346 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1348 subsect(Relative Pitch Specification)
1349 cindex(relative pitch specification)
1352 It is easy to get confused by octave changing marks and accidentally
1353 putting a pitch in the wrong octave. A much better way of entering a
1354 note's octave is `the relative octave' mode.
1357 code(\relative)keyindex(relative) var(startpitch) var(musicexpr)
1360 The octave of notes that appear in var(musicexpr) are calculated as
1361 follows: If no octave changing marks are used, the basic interval
1362 between this and the last note is always taken to be a fourth or
1363 less.footnote(The interval is determined without regarding
1364 accidentals. A code(fisis) following a code(ceses) will be put above
1365 the code(ceses).) The octave changing marks `code(')' and `code(,)'
1366 can then be added to raise or lower the pitch by an extra octave.
1367 Upon entering relative mode, an absolute starting pitch must be
1368 specified that will act as the predecessor of the first note of
1371 Entering scales is straightforward in relative mode.
1373 mudela(fragment,verbatim,center)( \relative c' {
1377 And octave changing marks are used for intervals greater than a fourth.
1379 mudela(fragment,verbatim,center)( \relative c'' {
1380 c g c f, c' a, e'' })
1382 If the preceding item is a chord, the first note of the chord is used
1383 to determine the first note of the next chord. But other notes
1384 within the second chord are determined by looking at the immediately
1387 mudela(fragment,verbatim,center)( \relative c' {
1393 The pitch after the code(\relative) contains a notename. To parse
1394 the pitch as a notename, you have to be in note mode, so there must
1395 be a surrounding code(\notes)keyindex(notes) keyword (which is not
1398 The relative conversion will not affect code(\transpose) or
1399 code(\relative) sections in its argument. If you want to use
1400 relative within transposed music, you must place an additional
1401 code(\relative) inside the code(\transpose).
1403 It is strongly recommended to use relative pitch mode: less work,
1404 less error-prone, and more readable.
1406 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1408 subsect(Chord names)
1410 Chord names are a way to generate simultaneous music expressions that
1411 correspond with traditional chord names. It can only be used in
1412 Chord mode (see bind(section)ref(modes)).
1415 var(tonic)[var(duration)][code(-)var(modifiers)]\
1416 [code(^)var(subtractions)]\
1417 [code(/)var(inversion)].
1420 var(tonic) should be the tonic note of the chord, and var(duration)
1421 is the chord duration in the usual notation. There are two kinds of
1422 modifiers. One type is em(chord additions), which are obtained by
1423 listing intervals separated by dots. An interval is written by its
1424 number with an optional `code(+)' or `code(-)' to indicate raising or
1425 lowering by half a step. Chord additions has two effects: It adds
1426 the specified interval and all lower odd numbered intervals to the
1427 chord, and it may lower or raise the specified interval. Intervals
1428 must be separated by a dot (`code(.)').
1431 mudela(fragment,verbatim)(\transpose c'' {
1434 c-9 c-9-.5+.7+ c-3-.5- c-4.6.8
1440 The second type of modifier that may appear after the `code(-)' is a
1441 named modifier. Named modifiers are listed in the file
1442 file(chord-modifiers.ly). The available modifiers are `code(m)' and
1443 `code(min)' which lower the 3rd half a step, `indexandcode(aug)' which
1444 raises the 5th, `indexandcode(dim)' which lowers the 5th,
1445 `indexandcode(maj)' which adds a raised 7th, and `indexandcode(sus)'
1446 which replaces the 5th with a 4th.
1449 mudela(fragment,verbatim)(\transpose c'' {
1451 c1-m c-min7 c-maj c-aug c-dim c-sus
1457 Chord subtractions are used to eliminate notes from a chord. The
1458 notes to be subtracted are listed after a `code(^)' character,
1461 mudela(fragment,verbatim,center)( \transpose c'' {
1467 Chord inversions can be specified by appending `indexandcode(/)' and
1468 the name of a single note to a chord. This has the effect of
1469 lowering the specified note by an octave so it becomes the lowest
1470 note in the chord. If the specified note is not in the chord, a
1471 warning will be printed.
1473 mudela(fragment,verbatim,center)( \transpose c''' {
1480 Throughout these examples, chords have been shifted around the staff
1481 using code(\transpose).
1483 You should not combine code(\relative) with named chords.
1485 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1490 Tuplets are made out of a music expression by multiplying their
1491 duration with a fraction.
1494 code(\times)keyindex(times) var(fraction) var(musicexpr)
1497 The duration of var(musicexpr) will be multiplied by the fraction.
1498 In print, the fraction's denominator will be printed over the notes,
1499 optionally with a bracket. The most common tuplet is the triplet in
1500 which bind(3)notes have the length bind(of)2, so the notes are 2/3 of
1501 their written length:
1503 mudela(fragment,verbatim,center)( g'4 \times 2/3 {c'4 c' c'} d'4 d'4)
1505 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1507 subsect(Grace notes)
1511 code(\grace)keyindex(grace) var(musicexpr)
1514 A grace note expression has bind(duration)0; the next real note is
1515 assumed to be the main note.
1517 You cannot have the grace note after the main note, in terms of
1518 duration, and main notes, but you can typeset the grace notes to the
1519 right of the main note using the property
1520 indexandcode(graceAlignPosition).
1522 When grace music is interpreted, a score-within-a-score is set up:
1523 var(musicexpr) has its own time bookkeeping, and you could (for
1524 example) have a separate time signature within grace notes. While in
1525 this score-within-a-score, you can create notes, beams, slurs, etc.
1526 Unbeamed eighth notes and shorter by default have a slash through the
1527 stem. This behavior can be controlled with the
1528 indexandcode(stemStyle) property.
1531 mudela(fragment,verbatim)(\relative c'' {
1532 \grace c8 c4 \grace { [c16 c16] } c4
1533 \grace { \property Grace.stemStyle = "" c16 } c4
1538 At present, nesting code(\grace)keyindex(grace) notes, e.g.
1541 code(\grace { \grace c32 c16 } c4)
1544 may result in run-time errors of LilyPond. Since the meaning of such
1545 a construct is unclear, we don't consider this a loss. Similarly,
1546 juxtaposing two code(\grace) sections is syntactically valid, but
1547 makes no sense and may cause runtime errors.
1549 Ending a staff or score with grace notes may also generate a run-time
1550 error, since there will be no main note to attach the grace notes to.
1552 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1558 In order to specify repeats, use the code(\repeat)keyindex(repeat)
1559 keyword. Since repeats look and sound differently when played or
1560 printed, there are a few different variants of repeats.
1564 Repeated music is fully written (played) out. Useful for MIDI
1568 This is the normal notation: Repeats are not written out, but
1569 alternative endings (voltas) are printed, left to right.
1572 Alternative endings are written stacked, which is useful for
1576 The syntax for repeats is
1579 code(\repeat) var(variant) var(repeatcount) var(repeatbody)
1582 If you have alternative endings, you may add
1585 code(\alternative)keyindex(alternative)
1586 code({) var(alternative1)
1588 var(alternative3) ellipsis() code(})
1591 where each var(alternative) is a Music expression.
1593 Normal notation repeats are used like this:
1596 mudela(fragment,verbatim)( c'1
1597 \repeat volta 2 { c'4 d' e' f' }
1598 \repeat volta 2 { f' e' d' c' }
1602 With alternative endings:
1605 mudela(fragment,verbatim)( c'1
1606 \repeat volta 2 {c'4 d' e' f'}
1607 \alternative { {d'2 d'} {f' f} }
1611 Folded repeats look like this:footnote(Folded repeats offer little
1612 more over simultaneous music. However, it is to be expected that
1613 more functionality -- especially for the MIDI backend -- will be
1617 mudela(fragment,verbatim)( c'1
1618 \repeat fold 2 {c'4 d' e' f'}
1619 \alternative { {d'2 d'} {f' f} }
1624 mudela(fragment,verbatim)(\context Staff {
1627 \repeat volta 2 { e | c2 d2 | e2 f2 | }
1628 \alternative { { g4 g g } { a | a a a a | b1 } }
1634 If you don't give enough alternatives for all of the repeats, then
1635 the first alternative is assumed to be repeated often enough to equal
1636 the specified number of repeats.
1639 mudela(fragment,verbatim)(\context Staff {
1641 \repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
1642 \alternative { { g4 g g }
1643 {\partial 1; e4 e e }
1644 {\partial 1; a a a a | b1 } }
1650 It is possible to nest code(\repeat). This is not entirely
1651 supported: the notes will come be in the right places, but the repeat
1654 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1656 subsect(Transposition of Pitches)
1657 cindex(transposition of pitches)
1660 A music expression can be transposed with
1661 code(\transpose)keyindex(transpose). The syntax is
1664 code(\transpose) var(pitch) var(musicexpr)
1667 This means that middle C in var(musicexpr) is transposed to
1670 code(\transpose) distinguishes between enharmonic pitches: both
1671 code(\transpose cis') or code(\transpose des') will transpose up half
1672 a tone. The first version will print sharps and the second version
1676 mudela(fragment,verbatim)(\context Staff {
1680 \transpose des'' { \key e; c d e f }
1681 \transpose cis'' { \key e; c d e f }
1686 If you want to use both code(\transpose) and code(\relative), then
1687 you must use code(\transpose) first. code(\relative) will have no
1688 effect music that appears inside a code(\transpose).
1690 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1692 subsect(Automatic lyric durations)
1693 cindex(automatic lyric durations)
1695 If you have lyrics that are set to a melody, you can import the
1696 rhythm of that melody into the lyrics using code(\addlyrics).
1697 keyindex(addlyrics) The syntax for this is
1700 code(\addlyrics) var(musicexpr1 musicexpr2)
1703 This means that both var(musicexpr1) and var(musicexpr2) are
1704 interpreted, but that every non-command atomic music expression
1705 (``every syllable'') in var(musicexpr2) is interpreted using timing
1708 If the property indexandcode(automaticMelismata) is set in the
1709 context of var(musicexpr1), no lyrics will be put on slurred or tied
1713 mudela(verbatim,fragment)(\addlyrics
1715 \property Voice.automaticMelismata = "1"
1716 c8 () cis d8. e16 f2
1718 \context Lyrics \lyrics {
1723 You should use a single rhythm melody, and single rhythm lyrics (a
1724 constant duration is the obvious choice). If you do not, you will get
1725 undesired effects when using multiple stanzas:
1728 mudela(verbatim,fragment)(\addlyrics
1730 c8 () cis d8. e16 f2
1732 \context Lyrics \lyrics
1738 It is valid (but probably not very useful) to use notes instead of
1739 lyrics for var(musicexpr2).
1742 mudela(verbatim,fragment)(
1743 \context Voice \addlyrics
1750 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1751 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1756 The grammar contains a number of ambiguities.footnote(The authors
1757 hope to resolve them at a later time.)
1766 can be interpreted as making a string identifier code(\foo)
1767 containing code("bar"), or a music identifier code(\foo)
1768 containing the syllable `bar'.
1776 can be interpreted as making an integer identifier
1777 bind(containing)-6, or a Request identifier containing the
1778 bind(fingering)`6' (with neutral direction).
1780 it() If you do a nested repeat like
1788 then it is ambiguous to which code(\repeat) the
1789 code(\alternative) belongs. This is the classic if-then-else
1790 dilemma. It may be solved by using braces.
1792 it() (an as yet unidentified ambiguity :-)
1796 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1797 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1799 sect(Notation conversion specifics)
1801 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1803 subsect(Automatic Beam Generation)
1804 cindex(automatic beam generation)
1807 By default, LilyPond will generate beams automatically. This feature
1808 can be disabled by setting the indexandcode(Voice.noAutoBeaming)
1809 property bind(to)1. It can be overridden for specific cases by
1810 specifying explicit beams as described in
1811 bind(section)ref(manualbeam).
1813 A large number of Voice properties are used to decide how to generate
1814 beams. Their default values appear in file(auto-beam-settings.ly).
1815 In general, beams can begin anywhere, but their ending location is
1816 significant. Beams can end on a beat, or at durations specified by
1817 the indexandcode(Voice.beamAutoEnd) property. To end beams every
1818 quarter note, for example, you could set
1819 indexandcode(Voice.beamAutoEnd) equal to `code("1/4")'. To end beams
1820 at every three eighth notes you would set it to `code("3/8")'. The
1821 same syntax can be used to specify beam starting points using
1822 indexandcode(Voice.beamAutoBegin).
1824 To allow different settings for different time signatures, these
1825 property names can start with `code(time)var(N)code(_)var(M)' to
1826 restrict the definition to `var(N)code(/)var(M)' time. For example,
1827 to specify beams ending only for bind(6/8)time you would use the
1828 property code(Voice.time6_8beamAutoEnd). To allow different endings
1829 for notes of different durations, the duration can be tacked onto the
1830 end of the property. To specify beam endings for beams that contain
1831 bind(32nd)notes, you would use code(Voice.beamAutoEnd_32).
1833 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1835 subsect(Printing chord names)
1838 cindex(printing!chord names)
1840 For displaying printed chord names, use the indexandcode(ChordNames)
1841 and indexandcode(ChordNameVoice) contexts. The chords may be entered
1842 either using the notation described above, or directly using
1846 mudela(fragment,verbatim)(<
1847 \context ChordNames {
1848 \chords{a b c} \notes{<d f g> <e g b>}
1850 \context Staff \notes {
1857 LilyPond examines chords specified as lists of notes to determine a
1858 name to give the chord. By default, LilyPond will not try to
1859 identify chord inversions:
1861 mudela(fragment,verbatim,center)( <
1862 \context ChordNameVoice \notes {
1865 \context Thread \notes {
1870 If you want inversions to be recognized, you must set the property
1871 indexandcode(ChordNames.chordInversion):
1873 mudela(fragment,verbatim,center)( <
1874 \property Score.chordInversion = 1
1875 \context ChordNameVoice \notes {
1878 \context Thread \notes {
1883 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1885 subsect(Printing lyrics)
1887 cindex(printing!lyrics)
1890 Lyric syllables must be interpreted within a code(Lyrics) context
1891 cindex(context!Lyrics) for printing them.
1893 Here is a full example:
1896 mudela(verbatim)(\score {
1898 \notes \transpose c'' {
1900 e f g2 | e4 f g2 \bar "|.";
1902 \context Lyrics \lyrics {
1903 Va-4 der Ja- cob Va- der Ja- cob
1904 Slaapt gij nog?2 Slaapt4 gij nog?2
1911 You may want a continuous line after the syllables to show melismata.
1912 To achieve this effect, add a `code(__)' lyric as a separate word
1913 after the lyric to be extended. This will create an extender, a line
1914 that extends over the entire duration of the lyric. This line will
1915 run all the way to the start of the next lyric, so you may want to
1916 shorten it by using a blank lyric (using `code(_)').
1919 mudela(verbatim)(\score {
1921 \notes \relative c'' {
1922 a4 () b () c () d | c () d () b () a | c () d () b () a
1924 \context Lyrics \lyrics {
1925 foo1 __ | bar2. __ _4 | baz1 __
1932 If you want to have hyphens centered between syllables (rather than
1933 attached to the end of the first syllable) you can use the special
1934 `code(-)code(-)' lyric as a separate word between syllables. This
1935 will result in a hyphen which length varies depending on the space
1936 between syllables, and which will be centered between the syllables.
1940 mudela(verbatim)(\score {
1942 \notes \transpose c'' {
1944 e f g2 | e4 f g2 \bar "|.";
1946 \context Lyrics \lyrics {
1947 Va4 -- der Ja -- cob | Va -- der Ja -- cob |
1948 Slaapt gij nog?2 | Slaapt4 gij nog?2
1956 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1957 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
1959 sect(Notation Contexts)
1960 cindex(notation contexts)
1962 Notation contexts are objects that only exist during a run of
1963 LilyPond. During the interpretation phase of LilyPond, the Music
1964 expression contained in a code(\score) block is interpreted in time
1965 order. This is the order in which humans read, play, and write
1968 A context is an object that holds the reading state of the
1969 expression; it contains information like
1972 it() What notes are playing at this point?
1973 it() What symbols will be printed at this point?
1974 it() In what style will they printed?
1975 it() What is the current key signature, time signature, point within
1979 Contexts are grouped hierarchically: A code(Voice) context is
1980 contained in a code(Staff) context (because a staff can contain
1981 multiple voices at any point), a code(Staff) context is contained in
1982 a code(Score), code(StaffGroup), or code(ChoirStaff) context (because
1983 these can all contain multiple staffs).
1985 Contexts associated with sheet music output are called em(notation
1986 contexts), those for sound output are called playing contexts.
1988 Contexts are created either manually or automatically. Initially,
1989 the top level music expression is interpreted by the top level
1990 context (the code(Score) context). When a atomic music expression
1991 (i.e. a note, a rest, code(\bar), or code(\time) commands), a nested
1992 set of contexts is created that can process these atomic expressions,
1996 verb(\score { \notes < c4 > })
1999 The sequential music, `code({ c4 })' is interpreted by code(Score)
2000 context. When the note `code(c4)' itself is interpreted, a set of
2001 contexts is needed that will accept notes. The default for this is a
2002 code(Voice) context, contained in a code(Staff) context. Creation of
2003 these contexts results in the staff being printed.
2005 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2007 subsect(Context selection)
2008 label(contextselection)
2011 You can also create contexts manually, and you probably have to do so
2012 if you want to typeset complicated multiple part material. If a
2013 `code(\context) var(name) var(musicexpr)' expression is encountered
2014 during the interpretation phase, the var(musicexpr) argument will be
2015 interpreted with a context of type var(name). If you specify a name,
2016 the specific context with that name is searched.
2018 If a context of the specified type and name can not be found, a new
2019 one is created. For example,
2022 mudela(verbatim)(\score {
2023 \notes \relative c'' {
2024 c4 <d4 \context Staff = "another" e4> f
2030 In this example, the code(c) bind(and)code(d) are printed on the
2031 default staff. For bind(the)code(e), a context Staff called
2032 `code(another)' is specified; since that does not exist, a new
2033 context is created. Within code(another), a (default) Voice context
2034 is created for bind(the)code(e4). When all music referring to a
2035 context is finished, the context is ended as well. So after the
2036 third quarter, code(another) is removed.
2038 Almost all music expressions inherit their interpretation context
2039 from their parent. In other words, suppose that the syntax for a
2043 code(\keyword) var(musicexpr1) var(musicexpr2) ellipsis()
2046 When the interpretation of this music expression starts, the context
2047 for var(musicexpr1), var(musicexpr2), etc. is that of the total
2050 Lastly, you may wonder, why this:
2054 \notes \relative c'' {
2060 doesn't result in this:
2064 \notes \relative c'' {
2070 For bind(the)code(c4), a default code(Staff) (with a contained
2071 code(Voice)) context is created. After bind(the)code(c4) ends, no
2072 music refers to this default staff, so it would be ended, with the
2073 result shown. To prevent this inconvenient behavior, the context to
2074 which the sequential music refers is adjusted during the
2075 interpretation. So after bind(the)code(c4) ends, the context of the
2076 sequential music is also the default code(Voice) context.
2077 bind(The)code(d4) gets interpreted in the same context
2080 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2082 subsect(Predefined contexts)
2084 These are the contexts supplied with the package. They are defined
2085 in the initialization file file(ly/engraver.ly).
2088 dit(code(Grace))indexcode(Grace) nl()
2089 The context for handling grace notes. It is instantiated
2090 automatically when you use code(\grace). Basically, it is an
2091 `embedded' miniature of the Score context. Since this context
2092 needs special interaction with the rest of LilyPond, you should
2093 not explicitly instantiate it.
2095 dit(code(LyricVoice))indexcode(LyricVoice) nl()
2096 Corresponds to a voice with lyrics. Handles the printing of a
2097 single line of lyrics.
2099 dit(code(Thread))indexcode(Thread) nl()
2100 Handles note heads, and is contained in the Voice context. You
2101 have to instantiate this explicitly if you want to adjust the
2102 style of individual note heads.
2104 dit(code(Voice))indexcode(Voice) nl()
2105 Corresponds to a voice on a staff. This context handles the
2106 conversion of dynamic signs, stems, beams, super- and subscripts,
2107 slurs, ties, and rests.
2109 You have to instantiate this explicitly if you want to have
2110 multiple voices on the same staff.
2112 dit(code(ChordNamesVoice))indexcode(ChordNamesVoice) nl()
2113 A voice with chord names. Handles printing of a line of chord
2116 dit(code(ChordNames))indexcode(ChordNames) nl()
2117 Typesets chord names. Can contain code(ChordNamesVoice)
2120 dit(code(Lyrics))indexcode(Lyrics) nl()
2121 Typesets lyrics. It can contain code(LyricVoice) contexts.
2123 dit(code(Staff))indexcode(Staff) nl()
2124 Handles clefs, bar lines, keys, accidentals. It can contain
2125 code(Voice) contexts.
2127 dit(code(RhythmicStaff))indexcode(RhythmicStaff) nl()
2128 A context like code(Staff) but for printing rhythms. Pitches are
2129 ignored; the notes are printed on one line. It can contain
2130 code(Voice) contexts.
2132 dit(code(GrandStaff))indexcode(GrandStaff) nl()
2133 Contains code(Staff) or code(RhythmicStaff) contexts. It adds a
2134 brace on the left side, grouping the staffs together. The bar
2135 lines of the contained staffs are connected vertically. It can
2136 contain code(Staff) contexts.
2138 dit(code(PianoStaff))indexcode(PianoStaff) nl()
2139 Just like code(GrandStaff) but with code(minVerticalAlign) set
2140 equal to code(maxVerticalAlign) so that interstaff beaming and
2141 slurring can be used.
2143 dit(code(StaffGroup))indexcode(StaffGroup) nl()
2144 Contains code(Staff) or code(RhythmicStaff) contexts. Adds a
2145 bracket on the left side, grouping the staffs together. The bar
2146 lines of the contained staffs are connected vertically. It can
2147 contain code(Staff), code(RhythmicStaff), code(GrandStaff), or
2148 code(Lyrics) contexts.
2150 dit(code(ChoirStaff))indexcode(ChoirStaff) nl()
2151 Identical to code(StaffGroup) except that the contained staffs
2152 are not connected vertically.
2154 dit(code(Score))indexcode(Score) nl()
2155 This is the top level notation context. No other context can
2156 contain a code(Score) context. This context handles the
2157 administration of time signatures. It also makes sure that items
2158 such as clefs, time signatures, and key-signatures are aligned
2159 across staffs. It can contain code(Lyrics), code(Staff),
2160 code(RhythmicStaff), code(GrandStaff), code(StaffGroup), and
2161 code(ChoirStaff) contexts.
2163 You cannot explicitly instantiate a Score context (since it is
2164 not contained in any other context). It is instantiated
2165 automatically when an output definition (a code(\score) or
2166 code(\paper) block) is processed.
2169 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2171 subsect(Context properties)
2173 Properties that are set in one context are inherited by all of the
2174 contained contexts. This means that a property valid for the
2175 code(Voice) context can be set in the code(Score) context (for
2176 example) and thus take effect in all code(Voice) contexts.
2178 Properties can be preset within the code(\translator) block
2179 corresponding to the appropriate context. In this case, the syntax
2183 var(propname) code(=) var(value)
2186 This assignment happens before interpretation starts, so a
2187 code(\property) expression will override any predefined settings.
2189 The code(\property) expression will create any property you specify.
2190 There is no guarantee that a property will be used. So if you spell
2191 a property name wrong, there will be no error message.
2193 The property settings are used during the interpretation phase. They
2194 are read by the LilyPond modules where interpretation contexts are
2195 built of. These modules are called em(translators). Translators for
2196 notation are called em(engravers), and translators for sound are
2197 called em(performers).
2199 The precise result of a property is determined by the implementation
2200 of the translator that reads them. Therefore, the result of a
2201 property can vary, since it is implementation and configuration
2204 In order to fully find out what properties are used, you must
2205 currently search the source code for calls to code(get_property).
2206 The rest of the section is devoted to an (incomplete) overview of
2207 available properties.
2209 subsubsect(Lyrics properties)
2210 cindex(properties!Lyrics)
2213 dit(code(textStyle))indexcode(textStyle) nl()
2214 Set the font for lyrics. The available font choices are
2215 code(roman), code(italic), code(bold), code(large), code(Large),
2216 code(typewriter), and code(finger). The code(finger) font can
2217 only display numbers. Note also that you must be careful when
2218 using code(\property) in Lyrics mode, because of the way strings
2219 are parsed. Either put quotes around the arguments to
2220 code(\property) or be sure to leave a space on both sides of the
2224 subsubsect(Thread properties)
2225 cindex(properties!Thread)
2228 dit(code(noteheadStyle))indexcode(noteheadStyle) nl()
2229 Selects type of note head. Choices are code(cross),
2230 code(diamond), code(harmonic), code(transparent), and code("").
2231 They are shown in that order below.
2236 \property Staff.barNonAuto = 1
2237 \property Voice.noteHeadStyle = cross
2239 \property Voice.noteHeadStyle = diamond
2241 \property Voice.noteHeadStyle = harmonic
2243 \property Voice.noteHeadStyle = transparent
2245 \property Voice.noteHeadStyle = ""
2255 subsubsubsect(Grace properties)
2256 cindex(properties!Grace)
2259 dit(indexandcode(stemStyle)) nl()
2260 By default set to code("grace") meaning that all unbeamed
2261 notes with flags are typeset with a slash through the flag.
2262 Setting to code("") gives standard flags.
2265 subsubsect(Voice properties)
2266 cindex(properties!Voice)
2269 dit(code(stemLength))indexcode(stemLength) nl()
2270 Set length of stems. Unit is `code(interline)/2', so
2271 code(stemLength) defaults bind(to)7.
2273 dit(code(stemLeftBeamCount))indexcode(stemLeftBeamCount) nl()
2274 Specify the number of beams to draw on the left side of the next
2275 note. Overrides automatic beaming. The value is only used once,
2276 and then it is erased.
2278 dit(code(stemRightBeamCount))indexcode(stemRightBeamCount) nl()
2279 Specify the number of beams to draw on the right side of the next
2280 note. Overrides automatic beaming. The value is only used once,
2281 and then it is erased.
2283 dit(code(noAutoBeaming))indexcode(beamAuto) nl()
2284 If set bind(to)1 then beams are not generated automatically.
2286 dit(code(beamAutoEnd))indexcode(beamAutoEnd) nl()
2287 Specifies when automatically generated beams can end. See
2288 bind(section)ref(autobeam).
2290 dit(code(beamAutoBegin))indexcode(beamAutoBegin) nl()
2291 Specifies when automatically generated beams can start. See
2292 bind(section)ref(autobeam).
2294 dit(code(textEmptyDimension))indexcode(textEmptyDimension) nl()
2295 If set bind(to)1 then text placed above or below the staff is
2296 assumed to have zero width.
2298 dit(code(beamquantisation))indexcode(beamquantisation) nl()
2299 Set to code(\none) for no quantization. Set to code(\normal) to
2300 quantize position and slope. Set to code(\traditional) to avoid
2301 wedges. These three settings are available via
2302 code(\beamposfree)keyindex(beamposfree),
2303 code(\beamposnormal)keyindex(beamposnormal), and
2304 code(\beampostraditional)keyindex(beampostraditional).
2306 dit(code(beamslopedamping))indexcode(beamslopedamping) nl()
2307 Set to code(\none) for undamped beams. Set to code(\normal) for
2308 damped beams. Set to code(\infinity) for beams with zero slope.
2310 code(\beamslopeproportional)keyindex(beamslopeproportional),
2311 code(\beamslopedamped)keyindex(beamslopedamped), and
2312 code(\beamslopezero)keyindex(beamslopezero) each set the
2313 corresponding value.
2315 dit(code(restStyle))indexcode(restStyle) nl()
2316 Change the layout of rests shorter than quarter notes.
2317 Currently, the standard layout code("") and mensural notation
2318 code("mensural") are available. Mensural rests of duration
2319 32 or shorter are not available.
2321 dit(code(midiInstrument))indexcode(midiInstrument) nl()
2322 Sets the instrument for MIDI output. If this property is not set
2323 then LilyPond will use the code(instrument) property. This must
2324 be set to one of the strings on the list of MIDI instruments that
2325 appears in bind(section)ref(midilist). If you use a string which
2326 is not listed, LilyPond will silently substitute piano.
2328 dit(code(transposing))indexcode(transposing) nl()
2329 Transpose the MIDI output. Set this property to the number of
2330 half-steps to transpose by.
2332 dit(code(oldTieBehavior))indexcode(oldTieBehavior) nl()
2333 Set bind(to)1 in order to get old tie behavior where ties would
2334 connect unequal pitches. This property is deprecated, and its
2335 use is not recommended.
2337 dit(code(verticalDirection))indexcode(verticalDirection) nl()
2338 Determines the direction of stems, subscripts, beams, slurs, and
2339 ties. Set to code(\down) to force them down, code(\up) to force
2340 them up, or code(\free) to let LilyPond decide. This can be used
2341 to distinguish between voices on the same staff. The
2342 code(\stemdown)keyindex(stemdown), code(\stemup)keyindex(stemup),
2343 and code(\stemboth)keyindex(stemboth) identifiers set this
2346 dit(code(slurVerticalDirection))indexcode(slurVerticalDirection) nl()
2347 Set to code(\free) for free choice of slur direction, set to
2348 code(\up) to force slurs up, set to code(\down) to force slurs
2349 down. The shorthands code(\slurup)keyindex(slurup),
2350 code(\slurdown)keyindex(slurdown), and
2351 code(\slurboth)keyindex(slurboth) are available.
2353 dit(code(tieVerticalDirection))indexcode(tieVerticalDirection) nl()
2354 Set to code(\free) for free choice of tie direction, set to
2355 code(\up) to force ties up, set to code(\down) to force ties
2358 dit(code(slurDash))indexcode(slurDash) nl()
2359 Set bind(to)0 for normal slurs, bind(1)for dotted slurs, and a
2360 larger value for dashed slurs. Identifiers
2361 code(\slurnormal)keyindex(slurnormal) and
2362 code(\slurdotted)keyindex(slurdotted) are predefined to set the
2365 dit(code(horizontalNoteShift))indexcode(horizontalNoteShift) nl()
2366 Enable LilyPond to shift notes horizontally if they collide with
2367 other notes. This is useful when typesetting many voices on one
2368 staff. The identifier code(\shift)keyindex(shift) is defined to
2369 enable this. Traditionally, the outer chords (the upmost and
2370 downmost voices), should have no code(horizontalNoteShift).
2372 dit(code(forceHorizontalShift))indexcode(forceHorizontalShift) nl()
2373 Force horizontal shift for collision resolution. It overrides
2374 automatic collision resolution. The value is the shift amount
2375 expressed in code(note_width), as set in the paper section.
2377 dit(code(dynamicDirection))indexcode(dynamicDirection) nl()
2378 Determines location of dynamic marks. Set to code(\up) to print
2379 marks above the staff; set to code(\down) to print marks below
2382 dit(code(dynamicStyle))indexcode(dynamicStyle) nl()
2383 Set the text style for dynamics.
2385 dit(code(textStyle))indexcode(textStyle) nl()
2386 Set the text style for superscripts and subscripts. See above
2387 for list of text styles.
2389 dit(code(textScriptPadding))indexcode(textScriptPadding) nl()
2390 Determines the extra space added between superscripted resp.
2391 subscripted text and the closest staff line or note.
2393 dit(code(fontSize))indexcode(fontSize) nl()
2394 Can be used to select smaller font sizes for music. The normal
2395 font size bind(is)0, and the two smaller sizes are -1
2398 dit(code(abbrev))indexcode(abbrev) nl()
2399 Set length for tremolo to be used if no length is explicitly
2402 dit(code(tupletDirection))indexcode(tupletDirection) nl()
2403 Determines the direction of triplets and other tuplets. Set to
2404 code(\down) to force them below the staff, code(\up) to force
2405 them above, or code(\free) to let LilyPond decide.
2407 dit(code(tupletVisibility))indexcode(tupletVisibility) nl()
2408 Determines whether tuplets of notes are labelled. Setting
2409 bind(to)0 shows nothing; setting bind(to)1 shows a number;
2410 setting bind(to)2 shows a number and a bracket if there is no
2411 beam; setting bind(to)3 shows a number, and if there is no beam
2412 it adds a bracket; setting bind(to)4 shows both a number and a
2413 bracket unconditionally.
2415 dit(code(markScriptPadding))indexcode(markScriptPadding) nl()
2416 Determines the extra space added between the mark and the closest
2419 dit(code(markDirection))indexcode(markDirection) nl()
2420 Determines if marks should be printed above or below the staff.
2421 Set to code(\up) to print marks above the staff; set to
2422 code(\down) to print marks below the staff.
2424 dit(code(articulationScriptPadding))indexcode(articulationScriptPadding)
2426 Determines the extra space added between articulation marks, such
2427 as staccato, tenuto, trill, up/down bow or fermata, and the
2428 closest staff line or note.
2430 dit(code(articulationScriptVerticalDirection))
2431 indexcode(articulationScriptVerticalDirection) nl()
2432 Determines the location of articulation marks. Set to code(\up)
2433 to print marks above the staff; set to code(\down) to print marks
2434 below the staff. This property does not override explicit
2435 directions marked with `code(^)' or `code(_)' in the mudela file.
2438 subsubsubsect(Staff properties)
2439 cindex(properties!Staff)
2442 dit(code(createInitdefaultClef))indexcode(createInitdefaultClef) nl()
2443 Specify whether clefs are created on default? (Doesn't seem to
2446 dit(code(barNumberDirection))indexcode(barNumberDirection) nl()
2447 Set to code(\up) or code(\down) to put bar numbers above or below
2450 dit(code(barNumberHangOnClef))indexcode(barNumberHangOnClef) nl()
2451 Set bind(to)1 to cause bar numbers to appear above or below the
2452 clef instead of on the bar line. This property is deprecated.
2455 dit(code(barNumberScriptPadding))indexcode(barNumberScriptPadding) nl()
2456 Sets extra space between the bar number and the bar it labels.
2458 dit(code(barSize))indexcode(barSize) nl()
2459 Specify the height of the bar lines if it should be different
2460 than the staff height.
2462 dit(code(markHangOnClef))indexcode(markHangOnClef) nl()
2463 Set bind(to)1 to cause marks to appear by clefs instead of by bar
2464 lines. Deprecated, use is not recommended.
2466 dit(code(marginDirection))indexcode(marginDirection) nl()
2467 Set to code(\left) or code(\right) to specify location of
2470 dit(code(marginScriptPadding))indexcode(marginScriptPadding) nl()
2471 Specify extra space for marginal scripts.
2473 dit(code(forgetAccidentals))indexcode(forgetAccidentals) nl()
2474 Causes accidentals to be printed at every note instead of
2475 remembered for the duration of a measure.
2477 dit(code(noResetKey))indexcode(noResetKey) nl()
2478 Do not reset the key at the start of a measure. Accidentals will
2479 be printed only once and are in effect until overridden, possibly
2480 many measures later.
2482 dit(code(staffLineLeading))indexcode(staffLineLeading) nl()
2483 Specifies the distance (in points) between lines of the staff.
2485 dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) nl()
2486 Specifies the number of staff lines. The default bind(is)5.
2488 dit(code(postBreakPadding))indexcode(postBreakPadding) nl()
2489 Extra space in points to be added after the clef, time signature
2490 and key signature on the staff. Deprecated, do not use.
2492 dit(code(barAtLineStart))indexcode(barAtLineStart) nl()
2493 Set bind(to)1 to produce a bar line after the clef at the start
2494 of each line (but not at the beginning of the music).
2496 dit(code(noVoltaBraces))indexcode(noVoltaBraces) nl()
2497 Set to true to suppress the printing of brackets over alternate
2498 endings specified by the command code(\alternative).
2500 dit(code(voltaSpannerDuration))indexcode(voltaSpannerDuration) nl()
2501 Set to an integer to control the size of the brackets printed by
2502 code(\alternative). The integer specifies the number of whole
2503 notes duration to use for the brackets. It is rounded to the
2504 nearest measure. This can be used to shrink the length of
2505 brackets in the situation where one alternative is very large.
2506 It may have odd effects if the specified duration is longer than
2507 the music given in an code(\alternative).
2509 dit(code(barNonAuto))indexcode(barNonAuto) nl()
2510 If set bind(to)1 then bar lines will not be printed
2511 automatically; they must be explicitly created with code(\bar)
2512 keywords. Unlike with the code(\cadenza) keyword, measures are
2513 still counted. Bar generation will resume according to that
2514 count if this property is set to zero.
2516 dit(code(defaultClef))indexcode(defaultClef) nl()
2517 Determines the default clef. See code(\clef) keyword.
2519 dit(code(numberOfStaffLines))indexcode(numberOfStaffLines) nl()
2520 Sets the number of lines that the staff has.
2522 dit(code(barAlways))indexcode(barAlways) nl()
2523 If set bind(to)1 a bar line is drawn after each note.
2525 dit(code(defaultBarType))indexcode(defaultBarType) nl()
2526 Sets the default type of bar line. See bind(Section)ref(barlines)
2527 for a list of available bar types.
2529 dit(code(keyOctaviation))indexcode(keyOctaviation) nl()
2530 If set bind(to)1, then keys are the same in all octaves. If set
2531 bind(to)0 then the key signature for different octaves can be
2532 different and is specified independently:
2535 code(\keysignature bes fis')
2538 The default value bind(is)1. Can be set to zero with
2539 code(\specialkey) or reset bind(to)1 with code(\normalkey).
2541 dit(code(instrument), code(instr))
2542 indexcode(instrument)indexcode(instr) nl()
2543 If code(Staff_margin_engraver)cindex(Staff_margin_engraver) is
2544 added to the Staff translator, then the code(instrument) property
2545 is used to label the first line of the staff and the code(instr)
2546 property is used to label subsequent lines. If the
2547 code(midiInstrument) property is not set, then code(instrument)
2548 is used to determine the instrument for MIDI output.
2550 dit(code(createKeyOnClefChange))indexcode(createKeyOnClefChange) nl()
2551 Set to a nonempty string if you want key signatures to be printed
2552 when the clef changes. Set to the empty string if you do not
2553 want key signatures printed.
2555 dit(code(timeSignatureStyle))indexcode(timeSignatureStyle) nl()
2556 Changes the default two-digit layout for time signatures. The
2557 following values are recognized:
2560 dit(code(C))indexcode(C) nl()
2561 4/4 and 2/2 are typeset as C and struck C, respectively. All
2562 other time signatures are written with two digits.
2564 dit(code(old))indexcode(old) nl()
2565 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
2566 typeset with old-style mensuration marks. All other time
2567 signatures are written with two digits.
2569 dit(code(1))indexcode(1) nl()
2570 All time signatures are typeset with a single
2571 digit, e.g. 3/2 is written bind(as)3.
2573 dit(indexcode(CM/N)code(C)var(M)code(/)var(N),
2574 indexcode(oldM/N)code(old)var(M)code(/)var(N) or
2575 indexandcode(old6/8alt)) nl()
2576 Tells LilyPond to use a specific symbol as time signature.
2579 The different time signature characters are shown below with its
2584 \notes\relative c'' {
2585 \property Voice.textStyle = typewriter
2586 \property Staff.timeSignatureStyle = "C2/2"
2587 \time 2/2; a2^"C2/2" a2
2588 \property Staff.timeSignatureStyle = "C4/4"
2589 \time 2/2; a2^"C4/4" a2
2590 \property Staff.timeSignatureStyle = "old2/2"
2591 \time 2/2; a2^"old2/2" a2
2592 \property Staff.timeSignatureStyle = "old3/2"
2593 \time 2/2; a2^"old3/2" a2
2594 \property Staff.timeSignatureStyle = "old2/4"
2595 \time 2/2; a2^"old2/4" a2
2596 \property Staff.timeSignatureStyle = "old4/4"
2597 \time 2/2; a2^"old4/4" a2
2598 \property Staff.timeSignatureStyle = "old6/4"
2599 \time 2/2; a2^"old6/4" a2
2600 \property Staff.timeSignatureStyle = "old9/4"
2601 \time 2/2; a2^"old9/4" a2
2602 \property Staff.timeSignatureStyle = "old4/8"
2603 \time 2/2; a2^"old4/8" a2
2604 \property Staff.timeSignatureStyle = "old6/8"
2605 \time 2/2; a2^"old6/8" a2
2606 \property Staff.timeSignatureStyle = "old6/8alt"
2607 \time 2/2; a2^"old6/8alt" a2
2608 \property Staff.timeSignatureStyle = "old9/8"
2609 \time 2/2; a2^"old9/8" a2
2612 linewidth = 4.5 \in;
2617 dit(code(clefStyle))indexcode(clefStyle) nl()
2618 Determines how clefs are typeset. If set to code(transparent),
2619 the clefs are not printed at all, if set to
2620 code(fullSizeChanges), clef changes in the middle of a line are
2621 typeset with a full size clef. By default, clef changes are
2622 typeset in smaller size.
2625 subsubsect(GrandStaff properties)
2626 cindex(properties!GrandStaff)
2629 dit(code(alignmentReference))indexcode(alignmentReference) nl()
2630 Set to code(\center) for vertical alignment reference point to be
2631 in the center of the vertical group. Set to code(\up) to put the
2632 reference point at the top of the group.
2634 dit(code(maxVerticalAlign))indexcode(maxVerticalAlign) nl()
2635 Set the maximum vertical distance between staffs.
2637 dit(code(minVerticalAlign))indexcode(minVerticalAlign) nl()
2638 Set the minimum vertical distance between staffs.
2641 subsubsect(Score properties)
2642 cindex(properties!Score)
2645 dit(code(skipBars))indexcode(skipBars) nl()
2646 Set bind(to)1 to skip the empty bars that are produced by
2647 multimeasure notes and rests. These bars will not appear on the
2648 printed output. Set to zero (the default) to expand multimeasure
2649 notes and rests into their full length, printing the appropriate
2650 number of empty bars so that synchronization with other voices is
2654 mudela(fragment,verbatim,center)\
2655 (r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3
2660 subsubsect(ChordNamesVoice properties)
2661 cindex(properties!ChordNamesVoice)
2664 dit(code(chordInversion))indexcode(chordInversion) nl()
2665 Determines whether LilyPond should look for chord inversions when
2666 translating from notes to chord names. Set bind(to)1 to find
2667 inversions. The default bind(is)0 which does not look for
2672 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2673 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2675 sect(Notation output definitions)
2677 cindex(notation output)
2678 cindex(output definition)
2682 The most important output definition is the code(\paper) block, for
2683 music notation. The syntax is
2686 code(\paper {) [var(paperidentifier)] var(items) code(})
2689 where each of the items is one of
2692 it() An assignment. The assignment must be terminated by a
2693 semicolon. See bind(section)ref(papervars) for information on
2696 it() A context definition. See bind(section)ref(contextdefs) for
2697 more information on context definitions.
2699 it() A margin shape declaration. The syntax is
2702 code(\shape) var(indent1)code(,) var(width1)code(,)
2703 var(indent2)code(,) var(width2) ellipsis() code(;)
2707 Each pair of var(indent) and var(width) values is a dimension
2708 specifying how far to indent and how wide to make the line.
2709 The indentation and width of successive lines are specified by
2710 the successive pairs of dimensions. The last pair of
2711 dimensions will define the characeristics of all lines beyond
2712 those explicitly specified.
2714 it() A font declaration. Its syntax is
2717 var(fontsize) code(=) code(\font)keyindex(font) var(fontname)
2720 var(fontsize) is an integer describing the font to be used.
2721 bind(0)is the default font. var(fontname) is the basename of
2722 a font (usually a member of the Feta family).
2725 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2727 subsect(Changing Font Size and Paper Size)
2728 cindex(changing font size and paper size)
2730 The Feta font provides musical symbols at six different sizes. These
2731 fonts are bind(11)point, bind(13)point, bind(16)point, bind(20)point,
2732 bind(23)point, and bind(26)point. The point size of a font is the
2733 height of the five lines in a staff when displayed in the font.
2735 Definitions for these sizes are the files file(paperSZ.ly), where
2736 code(SZ) is one of 11, 13, 16, 20, 23 bind(and)26. If you include
2737 any of these files, the identifiers code(paper_eleven),
2738 code(paper_thirteen), code(paper_sixteen), code(paper_twenty),
2739 code(paper_twentythree), and code(paper_twentysix) are defined
2740 respectively. The default code(\paper) block is also set.
2742 To change the paper size, you must first set the
2743 indexandcode(papersize) variable at top level. Set it to the strings
2744 code(a4), code(letter), or code(legal). After this specification,
2745 you must set the font as described above. If you want the default
2746 font, then use the bind(20)point font. The new paper size will not
2747 take effect if the font is not loaded and selected afterwards. Paper
2748 size selection works by loading a file named after the paper size you
2751 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2753 subsect(Paper variables)
2754 cindex(paper variables)
2757 There is a large number of paper variables that are used to control
2758 details of the layout. These variables control the defaults for the
2759 entire score. Usually, they do not have to be changed; they are by
2760 default set to values that depend on the font size in use. The
2761 values are used by the graphic objects while formatting the score;
2762 they are therefore implementation dependent. Most variables are
2763 accompanied by documentation in the initalization file
2764 file(params.ly) or file(paperSZ.ly), where code(SZ) is the staff
2767 Nevertheless, here are some variables you may want to use or change:
2770 dit(code(indent))indexcode(indent) nl()
2771 The indentation of the first line of music.
2773 dit(code(interline))indexcode(interline) nl()
2774 The distance between two staff lines, calculated from the center
2775 of the lines. You should use either this or code(rulethickness)
2776 as a unit for distances you modify.
2778 dit(code(linewidth))indexcode(linewidth) nl()
2779 Sets the width of the lines. If set bind(to)-1.0, a single
2780 unjustified line is produced.
2782 dit(code(output))indexcode(output) nl()
2783 Specifies an alternate name for the the output file(s).
2784 A file(.tex), file(.midi) or file(.ps) extension will be
2785 added to the string you specify.
2787 dit(code(rulethickness))indexcode(rulethickness) nl()
2788 Determines the thickness of staff and bar lines.
2790 dit(code(castingalgorithm))indexcode(castingalgorithm) nl()
2791 The algorithm to use for breaking lines. Choices are
2792 code(\Gourlay)keyindex(Gourlay) for a TeX()-like dynamic
2793 programming algorithm, and code(\Wordwrap)keyindex(Wordwrap) for
2794 a simple algorithm. Gourlay breaking looks much better, but
2795 takes a lot more resources. Wordwrap leaves loosely spaced lines
2799 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
2801 subsect(Context definitions)
2803 cindex(context definition)
2805 A notation contexts is defined by the following information
2810 it() The LilyPond modules that do the actual conversion of music to
2811 notation. Each module is a so-called
2812 em(engraver)cindex(engraver).
2814 it() How these modules should cooperate, i.e. which ``cooperation
2815 module'' should be used. This cooperation module is a special
2818 it() What other contexts the context can contain,
2820 it() What properties are defined.
2823 A context definition has this syntax:
2826 code(\translator) code({)
2827 var(translatorinit) var(translatormodifierlist)
2831 var(translatorinit) can be an identifier or of the form
2834 code(\type) var(typename) code(;)
2837 var(typename) is one of
2840 dit(code(Engraver_group_engraver))indexcode(Engraver_group_engraver) nl()
2841 The standard cooperation engraver.
2843 dit(code(Score_engraver))indexcode(Score_engraver) nl()
2844 This is cooperation module that should be in the top level context.
2846 dit(code(Grace_engraver_group))indexcode(Grace_engraver_group) nl()
2847 This is a special cooperation module (resembling
2848 code(Score_engraver)) that is used to created an embedded
2852 var(translatormodifierlist) is a list of items where each item is
2856 it() code(\consists) var(engravername) code(;) nl()
2857 Add var(engravername) to the list of modules in this context.
2858 bind(Section)ref(engravers) contains an overview of the engravers
2859 available. The order of engravers added with code(\consists) is
2862 it() code(\consistsend) var(engravername) code(;) nl()
2863 Analogous to code(\consists), but makes sure that
2864 var(engravername) is always added to the end of the list of
2867 Some engraver types need to be at the end of the list; this
2868 insures they are put there, and stay there, if a user adds or
2869 removes engravers. This command is usually not needed for
2872 it() code(\accepts) var(contextname) code(;) nl()
2873 Add var(contextname) to the list of context this context can
2874 contain. The first listed context the context to create by
2877 it() code(\remove) var(engravername) code(;) nl()
2878 Remove a previously added (with code(\consists)) engraver.
2880 it() code(\name) var(contextname) code(;) nl()
2881 This sets name of the context, e.g. code(Staff), code(Voice). If
2882 the name is not specified, the translator won't do anything.
2884 it() var(propname) code(=) var(value) code(;) nl()
2885 A property assignment. It is allowed to use reals for
2889 In the code(\paper) block, it is also possible to define translator
2890 identifiers. Like other block identifiers, the identifier can only
2891 be used as the very first item of a translator. In order to define
2892 such an identifier outside of code(\score), you must do
2896 foo = \translator { ... }
2903 \translator { \foo ... }
2908 subsubsect(Paper Types, Engravers, and Pre-defined Translators)
2909 cindex(paper types, engravers, and pre-defined translators)
2911 Some pre-defined identifiers can simplify modification of
2912 translators. The pre-defined identifiers are:
2915 dit(code(StaffContext))indexcode(StaffContext) nl()
2916 Default Staff context.
2918 dit(code(RhythmicStaffContext))indexcode(RhythmicStaffContext) nl()
2919 Default RhythmicStaff context.
2921 dit(code(VoiceContext))indexcode(VoiceContext) nl()
2922 Default Voice context.
2924 dit(code(ScoreContext))indexcode(ScoreContext) nl()
2925 Default Score context.
2927 dit(code(ScoreWithNumbers))indexcode(ScoreWithNumbers) nl()
2928 Score context with numbering at the Score level.
2930 dit(code(BarNumberingStaffContext))indexcode(BarNumberingStaffContext) nl()
2931 Staff context with numbering at the Staff level.
2933 dit(code(HaraKiriStaffContext))indexcode(HaraKiriStaffContext) nl()
2934 Staff context that does not print if it only contains rests.
2935 Useful for orchestral scores.footnote(Harakiri, also called
2936 Seppuku, is the ritual suicide of the Samourai.)
2938 dit(code(OrchestralPartStaffContext))indexcode(OrchestralPartStaffContext)
2940 dit(code(OrchestralScoreContext))indexcode(OrchestralScoreContext)
2943 Using these pre-defined values, you can remove or add items to the
2950 \remove Some_engraver;
2951 \consists Different_engraver;
2956 subsubsect(Engravers)
2959 The engravers for paper output are:
2964 dit(code(Bar_engraver))indexcode(Bar_engraver) nl()
2965 Engraves bar lines. Normally in code(Staff) and
2966 code(RhythmicStaff).
2968 dit(code(Bar_number_engraver))indexcode(Bar_number_engraver) nl()
2969 Engrave bar numbers. These numbers appear at the start of each
2970 line. Not normally in any translator. Can be added to
2971 code(Score) for score-wide numbering or to code(Staff) for
2972 numbering on each staff.
2974 dit(code(Beam_engraver))indexcode(Beam_engraver) nl()
2975 Handles beam requests by engraving beams. Normally appears in
2976 the code(Voice) translator. If omitted, then notes will be
2977 printed with flags instead of beams.
2979 dit(code(Beam_req_swallow_translator))
2980 indexcode(Beam_req_swallow_translator) nl()
2981 Swallows beam requests. In code(LyricVoice).
2983 dit(code(Chord_name_engraver))indexcode(Chord_name_engraver) nl()
2984 Engraves chord names. Normally in code(ChordNameVoice) .
2986 dit(code(Chord_tremolo_engraver))indexcode(Chord_tremolo_engraver)
2988 dit(code(Clef_engraver))indexcode(Clef_engraver) nl()
2989 Engraves the clef symbol. Normally in code(Staff).
2991 dit(code(Collision_engraver))indexcode(Collision_engraver)
2993 dit(code(Dot_column_engraver))indexcode(Dot_column_engraver) nl()
2994 Engraves dots on dotted notes shifted to the right of the note.
2995 Normally in code(Voice). If omitted, then dots appear on top of
2998 dit(code(Dynamic_engraver))indexcode(Dynamic_engraver) nl()
2999 Engraves dynamics symbols. Normally in code(Voice).
3001 dit(code(Font_size_engraver))indexcode(Font_size_engraver)
3003 dit(code(Key_engraver))indexcode(Key_engraver) nl()
3004 Engraves the key signature. Normally in code(Staff).
3006 dit(code(Local_key_engraver))indexcode(Local_key_engraver)
3008 dit(code(Lyric_engraver))indexcode(Lyric_engraver) nl()
3009 Engraves lyrics. Normally in code(LyricVoice).
3011 dit(code(Multi_measure_rest_engraver))
3012 indexcode(Multi_measure_rest_engraver) nl()
3013 Engraves multi-measure rests that are produced with code(R).
3014 Normally in code(Voice).
3016 dit(code(Piano_bar_engraver))indexcode(Piano_bar_engraver)
3018 dit(code(Pitch_squash_engraver))indexcode(Pitch_squash_engraver) nl()
3019 Treat all pitches as middle C. Used in code(RhythmicStaff).
3020 Note that the notes move, but the locations of accidentals stay
3023 dit(code(Priority_horizontal_align_engraver))
3024 indexcode(Priority_horizontal_align_engraver)
3026 dit(code(Repeat_engraver))indexcode(Repeat_engraver) nl()
3027 Handles repeats? In code(Staff) and code(RhythmicStaff).
3029 dit(code(Rest_collision_engraver))indexcode(Rest_collision_engraver) nl()
3030 Handles collisions of rests. In code(Staff).
3032 dit(code(Rest_engraver))indexcode(Rest_engraver) nl()
3033 Engraves rests. Normally in code(Voice).
3035 dit(code(Rhythmic_column_engraver))indexcode(Rhythmic_column_engraver)
3037 dit(code(Score_priority_engraver))indexcode(Score_priority_engraver)
3039 dit(code(Script_engraver))indexcode(Script_engraver) nl()
3040 Handles note ornaments generated by code(\script). Normally in
3043 dit(code(Separating_line_group_engraver))
3044 indexcode(Separating_line_group_engraver)
3046 dit(code(Skip_req_swallow_translator))
3047 indexcode(Skip_req_swallow_translator)
3049 dit(code(Slur_engraver))indexcode(Slur_engraver) nl()
3050 Engraves slurs. Normally in code(Voice).
3052 dit(code(Span_bar_engraver))indexcode(Span_bar_engraver) nl()
3053 Engraves lines across multiple staffs. Normally in
3054 code(Staffgroup) and code(GrandStaff). Removing this from
3055 code(StaffGroup) gives the definition of code(ChoirStaff).
3057 dit(code(Span_score_bar_engraver))indexcode(Span_score_bar_engraver)
3059 dit(code(Staff_group_bar_engraver))indexcode(Staff_group_bar_engraver)
3061 dit(code(Staff_margin_engraver))indexcode(Staff_margin_engraver) nl()
3062 Prints the name of the instrument (specified by
3063 code(Staff.instrument) and code(Staff.instr)) at the left of the
3066 dit(code(Staff_sym_engraver))indexcode(Staff_sym_engraver)
3068 dit(code(Stem_engraver))indexcode(Stem_engraver) nl()
3069 Engraves stems. Normally in code(Voice).
3071 dit(code(Ties_engraver))indexcode(Ties_engraver) nl()
3072 Engraves ties. Normally in code(Voice).
3074 dit(code(Time_signature_engraver))indexcode(Time_signature_engraver) nl()
3075 Engraves the time signature. Normally in code(Staff) and
3076 code(RhythmicStaff).
3078 dit(code(Timing_engraver))indexcode(Timing_engraver) nl()
3079 Responsible for synchronizing timing information from staffs.
3080 Normally in code(Score). In order to create polyrhythmic music,
3081 this engraver should be removed from code(Score) and placed in
3084 dit(code(Tuplet_engraver))indexcode(Tuplet_engraver) nl()
3085 Engraves tuplet brackets? In code(Staff).
3087 dit(code(Vertical_align_engraver))indexcode(Vertical_align_engraver)
3091 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3092 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3096 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3098 subsect(output definition)
3100 The MIDI block is analogous to the paper block, but it is simpler.
3101 The code(\midi) block can contain:cindex(MIDI block)
3104 it() a code(\tempo) definition
3105 it() context definitions
3108 Assignments in the code(\midi) block are not allowed.
3110 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3112 subsect(Context definitions)
3113 cindex(context definition)
3115 Context definitions follow precisely the same syntax as within the
3116 \paper block. Translation modules for sound are called performers.
3117 The contexts for MIDI output are defined in file(ly/performer.ly).
3119 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3121 subsect(MIDI Instrument Names)
3122 cindex(MIDI instrument names)
3125 The MIDI instrument name is set by the
3126 indexandcode(Staff.midiInstrument) property or, if that property is
3127 not set, the indexandcode(Staff.instrument) property. The instrument
3128 name should be chosen from the following list. If the selected
3129 string does not exactly match, then LilyPond uses the default piano.
3131 COMMENT( acordina = accordion, tango accordian = concertina
3132 distortion guitar = distorted guitar
3133 orchestral strings = harp
3134 pan flute = wood flute? )
3137 verb("acoustic grand" "contrabass" "lead 7 (fifths)"
3138 "bright acoustic" "tremolo strings" "lead 8 (bass+lead)"
3139 "electric grand" "pizzicato strings" "pad 1 (new age)"
3140 "honky-tonk" "orchestral strings" "pad 2 (warm)"
3141 "electric piano 1" "timpani" "pad 3 (polysynth)"
3142 "electric piano 2" "string ensemble 1" "pad 4 (choir)"
3143 "harpsichord" "string ensemble 2" "pad 5 (bowed)"
3144 "clav" "synthstrings 1" "pad 6 (metallic)"
3145 "celesta" "synthstrings 2" "pad 7 (halo)"
3146 "glockenspiel" "choir aahs" "pad 8 (sweep)"
3147 "music box" "voice oohs" "fx 1 (rain)"
3148 "vibraphone" "synth voice" "fx 2 (soundtrack)"
3149 "marimba" "orchestra hit" "fx 3 (crystal)"
3150 "xylophone" "trumpet" "fx 4 (atmosphere)"
3151 "tubular bells" "trombone" "fx 5 (brightness)"
3152 "dulcimer" "tuba" "fx 6 (goblins)"
3153 "drawbar organ" "muted trumpet" "fx 7 (echoes)"
3154 "percussive organ" "french horn" "fx 8 (sci-fi)"
3155 "rock organ" "brass section" "sitar"
3156 "church organ" "synthbrass 1" "banjo"
3157 "reed organ" "synthbrass 2" "shamisen"
3158 "accordion" "soprano sax" "koto"
3159 "harmonica" "alto sax" "kalimba"
3160 "concertina" "tenor sax" "bagpipe"
3161 "acoustic guitar (nylon)" "baritone sax" "fiddle"
3162 "acoustic guitar (steel)" "oboe" "shanai"
3163 "electric guitar (jazz)" "english horn" "tinkle bell"
3164 "electric guitar (clean)" "bassoon" "agogo"
3165 "electric guitar (muted)" "clarinet" "steel drums"
3166 "overdriven guitar" "piccolo" "woodblock"
3167 "distorted guitar" "flute" "taiko drum"
3168 "guitar harmonics" "recorder" "melodic tom"
3169 "acoustic bass" "pan flute" "synth drum"
3170 "electric bass (finger)" "blown bottle" "reverse cymbal"
3171 "electric bass (pick)" "skakuhachi" "guitar fret noise"
3172 "fretless bass" "whistle" "breath noise"
3173 "slap bass 1" "ocarina" "seashore"
3174 "slap bass 2" "lead 1 (square)" "bird tweet"
3175 "synth bass 1" "lead 2 (sawtooth)" "telephone ring"
3176 "synth bass 2" "lead 3 (calliope)" "helicopter"
3177 "violin" "lead 4 (chiff)" "applause"
3178 "viola" "lead 5 (charang)" "gunshot"
3179 "cello" "lead 6 (voice)")
3182 subsubsect(MIDI Types and Performers)
3183 cindex(MIDI types and performers)
3185 The types available for MIDI translators are:
3188 dit(code(Performer_group_performer))indexcode(Performer_group_performer)
3189 dit(code(Score_performer))indexcode(Score_performer)
3190 dit(code(Staff_performer))indexcode(Staff_performer)
3193 The performers for MIDI translators are:
3196 dit(code(Key_performer))indexcode(Key_performer)
3197 dit(code(Time_signature_performer))indexcode(Time_signature_performer)
3198 dit(code(Note_performer))indexcode(Note_performer)
3199 dit(code(Lyric_performer))indexcode(Lyric_performer)
3200 dit(code(Swallow_performer))indexcode(Swallow_performer)
3204 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3205 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3207 sect(Pre-defined Identifiers)
3208 cindex(pre-defined identifiers)
3211 Various identifiers are defined in the initialization files to
3212 provide shorthands for some settings. Most of them are in
3213 file(ly/declarations.ly).
3216 dit(code(\break))keyindex(break) nl()
3217 Force a line break in music by using a large argument for the
3218 keyword code(\penalty).
3220 dit(code(\center))keyindex(center) nl()
3221 Used for setting direction properties. bind(Equals)0.
3223 dit(code(\down))keyindex(down) nl()
3224 Used for setting direction setting properties. Is equal
3227 dit(code(\free))keyindex(free) nl()
3228 Used for setting direction setting properties. Is equal
3231 dit(code(\left))keyindex(left) nl()
3232 Used for setting text alignment property. Is equal bind(to)-1.
3234 dit(code(\nobreak))keyindex(nobreak) nl()
3235 Prevent a line break in music by using a large negative argument
3236 for the keyword code(\penalty).
3238 dit(code(\none))keyindex(none) nl()
3239 Used for setting code(Score.beamslopedamping) and
3240 code(Score.beamquantisation) properties. Is equal bind(to)0.
3242 dit(code(\normal))keyindex(normal) nl()
3243 Used for setting code(Score.beamslopedamping) and
3244 code(Score.beamquantisation) properties. Is equal bind(to)1.
3246 dit(code(\normalkey))keyindex(normalkey) nl()
3247 Select normal key signatures where each octave has the same key
3248 signature. This sets the code(Staff.keyoctaviation) property.
3250 dit(code(\right))keyindex(right) nl()
3251 Used for setting text alignment property. Is set bind(to)1.
3253 dit(code(\shiftoff))keyindex(shiftoff) nl()
3254 Disable horizontal shifting of note heads that collide. Sets the
3255 code(Voice.horizontalNoteShift) property.
3257 dit(code(\shifton))keyindex(shifton) nl()
3258 Enable note heads that collide with other note heads to be
3259 shifted horiztonally. Sets the code(Voice.horizontalNoteShift)
3262 dit(code(\slurboth))keyindex(slurboth) nl()
3263 Allow slurs to be above or below notes. This sets the
3264 code(Voice.slurVerticalDirection) property.
3266 dit(code(\slurdown))keyindex(slurdown) nl()
3267 Force slurs to be below notes. This sets the
3268 code(Voice.slurVerticalDirection) property.
3270 dit(code(\slurup))keyindex(slurup) nl()
3271 Force slurs to be above notes. This sets the
3272 code(Voice.slurVerticalDirection) property.
3274 dit(code(\specialkey))keyindex(specialkey) nl()
3275 Allow key signatures do differ in different octaves. This sets
3276 the code(Staff.keyoctaviation) property.
3278 dit(code(\stemboth))keyindex(stemboth) nl()
3279 Allow stems, beams, and slurs to point either upwards or
3280 downwards, decided automatically by LilyPond. This sets the
3281 code(Voice.verticalDirection) property.
3283 dit(code(\stemdown))keyindex(stemdown) nl()
3284 Force stems, beams, and slurs to point down. This sets the
3285 code(Voice.verticalDirection) property.
3287 dit(code(\stemup))keyindex(stemup) nl()
3288 Force stems, beams and slurs to point up. This sets the
3289 code(Voice.verticalDirection) property.
3291 dit(code(\traditional))keyindex(traditional) nl()
3292 Used for setting the code(Score.beamquantisation) property. Is
3295 dit(code(\up))keyindex(up) nl()
3296 Used for setting various direction properties. Is equal
3301 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3302 COMMENT(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)
3304 sect(Running LilyPond)
3305 cindex(running LilyPond)
3308 When invoked with a filename that has no extension, LilyPond will try
3309 adding `file(.ly)' as an extension first, then `file(.fly)' and
3310 finally `file(.sly)' extension. If the filename ends with
3311 `file(.fly)', LilyPond processes the file as music using
3312 `file(init.fly)'. In this case, LilyPond does something like:
3317 \input "yourfile.fly"
3323 The result of `file(.sly)' is similar except that a single unjustified
3326 If you invoke LilyPond with a file `file(foo.)var(ext)' that doesn't
3327 have the `file(.ly)' extension, then LilyPond will look for a file
3328 called `file(init.)var(ext)' and process this file. The file
3329 `file(init.)var(ext)' must contain the code(\maininput) keyword or
3330 LilyPond will not read the user specified file.
3332 When LilyPond processes file(filename.ly) it will produce
3333 file(filename.tex) as output. If file(filename.ly) contains a second
3334 code(\paper) keyword, then LilyPond will produce file(filename-1.tex)
3335 as well. Subsequent code(\paper) keywords will produce sequentially
3336 numbered file names. Several files can be specified; they will each
3337 be processed independently.footnote(Not entirely true: The status of
3340 whenlatex(latexcommand(\printindex))
3342 COMMENT(End of reference-manual.yo)