3 % this document should be run through the mudela-book script after lilypond
4 % has been installed. The rules have been precooked into the
5 % Documentation/Rules.make file; do
7 % make out/introduction.dvi
11 % mudela-book --outdir=out/ --outname=introduction.mudtex introduction.doc
12 % latex '\nonstopmode \input out/introduction.mudtex'
14 % Hoi Tim, hier staan wat 'enge' commando's (die dingen met een '\'
15 % zoals \documentclass en \def\mudela...).
16 % Daar moet je je niets van aantrekken, ga gewoon naar Introduction
19 \documentclass{report}
22 \author{Jan Nieuwenhuizen \& Han-Wen Nienhuys}
25 \def\file#1{\verb+#1+}
27 % ugh: trick to get examples not generate par
29 \def\mudelapaperlinewidth{-28.452756}%
30 \def\mudelapaperindent{28.452756}%
31 \def\mudelapaperrulethickness{0.400000}%
32 \def\mudelapaperbarsize{16.000000}%
33 \def\mudelapaperinterline{4.000000}%
34 \def\mudelapapernotewidth{5.930000}%
35 \def\mudelapaperwholewidth{8.640000}%
36 \def\mudelapaperunitspace{22.000000}%
37 \def\mudelapaperbasicspace{4.000000}%
38 \def\mudelapapergeometric{0.000000}%
39 \def\mudelapaperarithmetic_basicspace{2.000000}%
40 \def\mudelapaperarithmetic_multiplier{4.800000}%
41 \def\mudelapaperinterbeam{3.140000}%
42 \def\mudelapapergourlay_energybound{100000.000000}%
43 \def\mudelapapergourlay_maxmeasures{14.000000}%
45 % \def\exampleheight{2\mudelapaperbarsize pt}
46 \def\exampleheight{2cm}
48 % ful of pars, needs the above
52 \def\musixsixteendefs{}
55 \def\turnOnPostScript{}
63 %\def\interexample{\hskip15mm$\Longrightarrow$\hskip15mm}
64 %\def\interexample{\hbox to10mm{\hfill\hbox to0pt{\hss\vbox to\exampleheight{\vss$\Longrightarrow$\vss}\hss}\hfill}}
67 \def\postexample{\par\medskip}
69 \def\file#1{{\texttt{#1}}}
70 \setcounter{secnumdepth}{-1}
74 \emph{\Large ***Under construction***}
76 \section{Introduction}
78 This chapter is a gentle introduction to using LilyPond to typeset
81 LilyPond is a so called ``batch'' program. This means, that you use a
82 text editor (such as \texttt{emacs} or \texttt{vi}) to create an input
83 file. When you are done editing your input file, you save it, and you
84 run LilyPond on the file. If Lily finds any errors in your input file
85 then she\footnote{ We're sure that if computer programs could have
86 gender, LilyPond would be a female computer program. So we will refer
87 to the program as a she. This gender-bending is not to tease you, dear
88 reader. We do it in real life as well. In the past two years LilyPond
89 has become sort of a baby daughter to us, keeping us awake at night,
90 but also providing us lots of joy. We hope you do not mind our little
91 aberration from computer-manual tradition.
93 % The name LilyPond is actually sort of a girl's name. Can you guess which
96 } will complain. If everything is well, than she'll generate a file, that
97 you can process further to view or print.
99 Using LilyPond to print or view some music is a procedure with four
100 steps. To get you started we'll run down the full procedure for you
105 Fire up your favourite editor (if you know none, try \texttt{joe silly.ly}),
106 and key in the following text:
110 \type Staff = aStaff \melodic { g'2 e'4 }
111 \type Lyrics = yell \lyric { Air2 ball!4 }
117 Save your file as \file{silly.ly}.
119 %The input files for LilyPond have the default extension \file{.ly}.
122 Run LilyPond on your newly created file: enter \verb+lilypond silly+.
123 LilyPond will then print all kinds of mumbo jumbo that can safely be
124 ignored. You might see something like this:
126 GNU LilyPond 0.1.55/FlowerLib 1.1.39
127 Parsing ... [/home/hanwen/musix/spacer/init/lily-init.ly[/home/hanwen/
129 ... stuff left out here ...
131 Documentation/silly.ly]
132 Interpreting music ...[1] (time: 0.04 seconds)
133 Preprocessing elements...
134 Calculating column positions ... [2]
135 Approximated: 1 lines, (with an average of 4.0 columns)
137 warning: Can not solve this casting problem exactly; revert to Word_wrap
138 [2]Time: 0.00 seconds
140 Postprocessing elements...
141 TeX output to silly.tex ...
143 All has gone well; there were some warning but no errors. The output
144 is a TeX file, and it is called \file{silly.tex}. \file{TeX} is
145 usually spelled as \TeX. It is batch program for typesetting text,
146 developed by the great programmer and scientist Donald Knuth to
147 typeset his famous The Art of Computer Programming bookseries. As you
148 can see \TeX\ can be adapted to do a lot more. In fact, the document
149 that you are reading now was also done with \TeX.
151 To do something useful with the output you have to run \TeX\ on it
152 first. Run the command \verb+tex silly+. The output should resemble this:
154 This is TeX, Version 3.14159 (C version 6.1)
156 Babel <v3.6h> and hyphenation patterns for american, dutch, loaded.
157 (/home/hanwen/lib/texmf/tex/lilypond/lilyponddefs.tex
158 (/home/hanwen/lib/texmf/tex/lilypond/dyndefs.tex)
159 (/home/hanwen/lib/texmf/tex/lilypond/fetdefs.tex
160 (/home/hanwen/lib/texmf/tex/lilypond/feta20.tex)
161 (/home/hanwen/lib/texmf/tex/lilypond/lily-ps-defs.tex))) [1] )
162 Output written on silly.dvi (1 page, 3084 bytes).
163 Transcript written on silly.log.
165 The human translation is ``everything went OK, the result is one
166 page long, and I put it in \file{silly.dvi}.''
168 \item The \file{silly.dvi} file is a description of how a piece of
169 text looks when it is printed. You can view it, or print it. If you
170 are using a Unix system equipped with X-Windows, then you can issue
171 the command \file{xdvi silly} to view the result. If this is not the
172 case, consult your local \TeX\ guru on printing and viewing DVI files.
173 What is in your window should look like this:
177 \type Staff = aStaff \melodic { g'2 e'4 }
178 \type Lyrics = yell \lyric { Air2 ball!4 }
184 The remainder of this document is not about \TeX, and mostly not even
185 about LilyPond. What you entered into your text editor in step~1. and
186 fed to LilyPond is a special kind of file composed of notenames,
187 special words and punctation. The remainder of this document explains
188 how to combine these elements to express a piece of music in the
189 language that LilyPond understands. In other words, we try to explain
190 how to use LilyPond, and not how LilyPond works. For want of a better
191 name we call this language Mudela (short for Music Description
194 This document does not cover all of Mudela. Due to technical details,
195 the precise working of Mudela is coupled to the innards of LilyPond.
196 If you really want to know all the details, your best bet would be to
197 get the sources to LilyPond and read the parser and scanner source.
198 They are in \file{lilypond-x.y.z/lily/parser.y},
199 \file{lilypond-x.y.z/lily/lexer.l\footnote{Of course, it would be even
200 better if you would improve LilyPond and send the resulting diffs to
201 us. But that would a really different ballpark (And we haven't
202 started with the programming guide yet.)}
204 In the following sections the basic elements of Mudela are presented.
205 We don't want to bore you too much with details, so we will leave-out
206 some red tape that's needed for a valid piece of Mudela: to be
207 precise, we will write \verb+X Y Z+, when we really mean
214 Usually, we will also print the resulting fragment of music on the
215 right just as it was produced by LilyPond.
217 For the remainder we will assume that you can carry out steps 1 to 4
218 from the above instruction. We will also assume that you know how
219 music notation works. If you are not familiar with the English terms
220 for music notation, then you should consult XXXX [FIXME], it contains
221 a glossary of musical terms.
223 \section{Music copying versus music definition}
225 If you have done music copying before, then using LilyPond may seem
226 awkward to you in the beginning. The purpose of LilyPond is informally
227 explained by the term ``music typesetter.''
229 This may give the impression that the program is like a drawing tool
230 that lets you control precisely how the music is formatted. This is
231 not the case: not only does the program print musical symbols,
232 LilyPond also tries to make esthetic decisions---to be precise, we
233 programmed her to do what we find pretty. You do not have complete
234 control over what is happening. On the other hand, good engraving is
235 a very complex trade, so it is a Good Thing that you do not have to
236 worry about what is happening.
238 Secondly, LilyPond operates on musical definitions. This really is
239 something different from graphical definitions. If you copy music by
240 hand from a printed score, you don't have to know what the score
241 means; you just copy the symbols. With LilyPond such a thing is not
242 possible: we expect you to enter the meaning of the score, not the
243 score itself. If put more concretely: you do not enter ``black
244 notehead without flag, fourth staff line'', but ``a quarter note,
245 pitch d$^2$''. LilyPond will figure out from the musical info what
246 kind of graphic presentation is needed.
248 This has some drawbacks: most notably, it is difficult to enter sheet
249 music that you cannot read. On the other hand, any piece of music
250 once entered can be played and transposed automatically.
253 \section{When you know the notes to print\ldots}
255 The basic building block of music is the note. You can have LilyPond
256 print a note by specifying its pitch and the duration. The pitch of
257 the central C, also known as c$^1$, is written as \verb+c'+. A quarter
258 note duration is written as \verb+4+. So, to print quarter note with
259 central C pitch, you enter the following
260 \begin[fragment,verbatim,center]{mudela}
263 The pitch \verb+c'+ actually consists of two parts: one for the note
264 name, and one part for the octave. The number of apostrophes
265 specifies the octave to use, and the letter which note name to use.
266 The note names simply are the letters \verb+a+ to \verb+g+.
269 \begin[fragment,verbatim]{mudela}
270 c'4 d'4 e'4 c'4 c''4 d''4 e''4 f''4 g''4 a''4 b''4 c'''4
273 The duration of a note is specified as a number: a whole note is
274 denoted by 1, the half note by 2, the quarter by 4, and so on. Here
275 are some random notes to show how it works
276 \begin[fragment,verbatim]{mudela}
277 'c8 c8 c'16 c''32 d''64 b'64 c'''2 c1 c'4 d'4 e'4 f'4 g'4 a'4
280 This gives us already enough material to make simple songs:
281 \begin[fragment,verbatim]{mudela}
284 g''8 a''8 g''8 f''8 e''4 c''4
288 There is only one part about pitches that we haven't told you:
289 chromatically altered pitches. The names ``a'' to ``g'' for typing
290 pitches are convenient: they are short, pronounceable and they
291 resemble the normal vocabulary for pitches.
293 Enter flats and sharps. In English there is no standard terse word
294 for C sharp or C flat. For this reason, we implemented a different,
295 non-english convention for entering altered pitches, see
296 table~\ref{notename-tab}: one makes a note sharp by adding the suffix
297 ``--is'' to the name, one makes the a note flat by adding the suffix
298 ``--es.'' For a double sharp you simply add another ``--is'' suffix,
304 \caption{Defaults note names}\label{notename-tab}
308 c double flat &ceses\\
312 c double sharp &cisis\\
318 Variations on this convention are used in a number of germanic
319 languages, notably Dutch, German, Swedish, and Norwegian. To be
320 precise, LilyPond actually defaults to dutch notenames, with aes,
321 aeses, ees and eeses added for consistency.
323 If you are not comfortable with these names, you can make your own
324 names. Included with the example initialisation files are note names
325 for different languages, among others English (C sharp is abbreviated
326 to cs), Italian, Swedish, Norwegian
328 \section{Hairy rhythms}
330 \section{Handy input}
332 % \subsection{Durations}
334 However, having only quarter notes may get a bit dull.
335 Durations are entered as their reciproce values
336 % a1 a2 a4 a a8 a a16 a a32 a a64 a a a a
337 \begin[fragment,verbatim,center]{mudela}
338 a1 a2 a4 a a8 a a16 a32 a64
340 note that you only have to specify
341 the duration when it changes:
342 Lily assumes a note has the same duration as the previous one.
344 Now we can already write a little tune
345 \begin[fragment,verbatim,center]{mudela}
346 c d e c | c d e c | e f g2
348 As you'll probably have guessed,
349 the vertical bar (pipe) \verb+|+ may be used to mark
352 In the scale shown above
353 we left-out the last c note of the next octave.
354 Postfixing the pitch with a quote \verb+'+
355 produces a note by one octave higher
356 \begin[fragment,verbatim,center]{mudela}
360 Prefixing the pitch with a quote \verb+'+
361 produces a note by one octave lower
362 \begin[fragment,verbatim,center]{mudela}
366 \section{Slurs and Ties}
368 A tie connects two adjacent noteheads
370 \begin[fragment,verbatim,center]{mudela}
374 Whereas a slur rather connects `chords',
375 and tries to avoid crossing stems
377 \begin[fragment,verbatim,center]{mudela}
381 And of course, such a (legato) slur can span several notes
382 \begin[fragment,verbatim,center]{mudela}
386 \section{Beams and Plets}
389 \begin[fragment,verbatim,center]{mudela}
393 Here's a beamed triplet
394 \begin[fragment,verbatim,center]{mudela}
398 a triplet without a beam
399 \begin[fragment,verbatim,center]{mudela}
404 \begin[fragment,verbatim,center]{mudela}
409 \begin[fragment,verbatim,center]{mudela}
413 \begin[fragment,verbatim,center]{mudela}
419 Lily has predefined sets of notenames
420 for various languages%
421 \footnote{These are Dutch, English, German, Italian and Swedish.
422 Simply include the language specific init file \file{<language.ly>}.}.
423 The default set are the ones we like best are the Dutch notenames.
425 A sharp is formed by adding \verb+is+
426 \begin[fragment,verbatim,center]{mudela}
427 cis dis eis fis gis ais bis
430 and a flat is formed by adding \verb+es+%
431 %\footnote{Exceptions: \verb+es+ and \verb+as+.}
432 \footnote{Exceptions: {\tt es} and {\tt as}.}
433 \begin[fragment,verbatim,center]{mudela}
434 ces des es fes ges as bes
437 With the obvious names for double sharps
438 \begin[fragment,verbatim,center]{mudela}
439 cisis disis eisis fisis gisis aisis bisis
443 \begin[fragment,verbatim,center]{mudela}
444 ceses deses eses feses geses ases beses
448 There are two special `notenames', the rest
449 \begin[fragment,verbatim,center]{mudela}
454 \begin[fragment,verbatim,center]{mudela}
455 a2 s-"diminuendo" | a
461 \begin[fragment,verbatim,center]{mudela}
466 \begin[fragment,verbatim,center]{mudela}
467 \clef "violin"; f' e' \clef "alto"; d' c'
470 \begin[fragment,verbatim,center]{mudela}
474 \begin[fragment,verbatim,center]{mudela}
476 'g 'a 'b cis d e fis g'
478 Note how Mudela allows you to
479 convey a musical message
480 rather than forces you to produce a list of typesetting commands.
481 If the music a \verb+cis+, you type a \verb+cis+.
482 Depending on the key and context of the note
483 Lily will determine what accidentals to typeset.
485 A reminder accidental can be forced by
486 using an exclamation mark \verb+!+
487 on a pitch a reminder accidental
488 \begin[fragment,verbatim,center]{mudela}
489 cis d e cis | c! d e c |
492 \begin[fragment,verbatim,center]{mudela}
494 \bar "|:"; c c \bar ":|:"; c c \bar ":|"; c c \bar "|.";
497 \section{Chords and Voices}
499 Here's a simple chord
500 \begin[fragment,verbatim,center]{mudela}
505 \begin[fragment,verbatim,center]{mudela}
514 \begin[fragment,verbatim,center]{mudela}
516 { \voiceone c g c g }
517 { \voicetwo 'c2 'g2 }
522 \section{A complete example}
525 A Mudela file needs some red tape
527 \begin[verbatim,center]{mudela}
540 \begin[verbatim,center]{mudela}
563 Check-out this handy little script
564 that not only may save you quite some keystrokes,
565 but produces titles and takes care of
566 margins and (hopefully) papersizes.
567 See \file{ly2dvi (1)}.
569 \chapter{Input format reference}
573 This document describes the the GNU LilyPond input format, which is an
574 effective language for defining music. We call this language (rather
575 arrogantly) The Musical Definition Language or Mudela, for
576 short.\footnote{If anybody comes up with a better name, we'd gladly
577 take this. Gourlay already uses Musical Description Language,
578 G-Sharp Score Definition Language. ISO standard 10743 defines a
579 Standard Music Description Language. We're not being original here}
581 The first aim of Mudela is to define a piece of music, being complete
582 from both from a musical typesetting, as from a musical performing
585 The Musical Definition Language (Mudela), has a logical structure,
586 making use of identifiers, that allows for flexible input, and
587 definition reuse. See \file{MANIFESTO} for reasons and design considerations.
589 The below included for explanatory purposes only (i.e., for a complete
590 and up-to-date definition, see \file{lily/parser.y} and
591 \file{lily/lexer.l}):
593 As a related note, you should take a look at the examples and the init
594 files, as this document does not cover every aspect of mudela yet, and
595 may be out of date.\footnote{Ok, I am being pessimistic here. This
596 just is a disclaimer. Docs usually are written after the program
597 itself.} This document intends to give an idea of how it works, it
598 is not a guide on how to use it.
601 \section{Basic elements}
605 The de-facto extension of Mudela is \file{.ly}. Files may be included by
606 entering \verb+\include+ at the start of a line:
613 \subsection{Comments}
615 Line comments are introduced by a
617 Block comments are delimited
624 \subsection{Versions}
626 Occasionally, small changes in syntax across different versions of
627 Mudela might give syntax errors. To warn you about possible
628 incompatibilities, you can specify the Mudela version for which the
629 inputfile was written,
634 A perl-script which tries to convert to newer versions
635 (\file{convert-mudela}) is included in the LilyPond distribution.
639 Keywords are preceded by a backslash: \verb+\+. They contain
640 alphabetic characters only.
642 Identifiers in their normal form consist start with a backslash, a
643 alpha character, followed by alpha-numerics. Identifiers can contain
644 any characters (except whitespace,
645 and \verb+%+), if you use this construct:
648 \$i'm_a_weird!!!identifier
651 (which is the identifier with the name
652 \verb+i'm_a_weird!!!identifier+). \verb+$+ Takes any sequence of
653 characters which are not whitespace, \verb+$+ and \verb+%+.
654 \verb+$i'm_a_weird!!!string+
655 \def\foobar{$} % silly fontlock mode
657 \subsection{Nesting characters}
659 Mudela uses the brace (\verb+{+ and \verb+}+) for most hierarchical
660 structures. For chords the \verb+<+ and the \verb+>+ are used as
663 \subsection{Constants}
665 Please note that -.5 is not a Real.
674 \subsection{Identifiers}
676 When assigning identifiers you use
682 If you reuse identifiers, then the previous contents will be thrown
683 away after the right hand is evaluated, eg
685 bla = \melodic { \bla }
689 When using identifiers they have to be escaped:
692 oboe = \melodic { ... }
693 \score{ \melodic { \oboe }}
696 The left-hand part of the assignment is really a string, so
698 "Foo bar 4 2 " = \melodic { .. }
701 is also a valid assignment (but you would have trouble referencing to it)
704 \subsection{Hierarchical structures}
706 The general structure consists of declarations:
715 \TYPE{ <type specific data> }
718 (Currently, \verb+\score+ is the only type that can be instantiated
719 at top level. Currently declarations can only be done at top level)
721 Most instantiations that use an IDENTIFIER are specified as follows:
724 \TYPE{ IDENTIFIER [...] }
727 Some exceptions on this rule have been made to prevent inputting
728 Mudela becoming tedious
733 To simplify different aspects of music definition (entering the notes
734 and manipulating them) Mudela has a number of different input "modes":
741 At the start of parsing, Mudela assumes normal mode.
742 In Normal mode, a word is looked up in the following order:
744 \item{\verb+word+} string
745 \item{\verb|"string"|} string
746 \item{\verb|\word|} keyword, identifier
748 In normal mode, a word is assumed to start with an alphabetic
749 character, followed by alpha-numeric characters.
751 \item[Note mode] Note mode is introduced by the keyword
752 \verb+\melodic+. In Note mode, a word is looked up in the following
755 \item{\verb+word+} notename, string
756 \item{\verb|"string"|} string
757 \item{\verb|\word|} keyword, identifier
760 In Note mode a word is considered to have alphabetic characters only,
761 so the underscore (\_) is illegal. If you accidently mistype a
762 notename, the parser will assume that you are entering a string (and
763 it will most likely complain that you should be in \verb|\lyrics| mode to
767 \item[Lyric mode] Lyrics mode (and thus Simple mudela) is introduced
768 by the keyword \verb+\lyrics+. Because of the various control
769 characters that can appear in lyrics, eg, ``foreign language''
770 accents, the inputting a string containing these has been made very
773 In Lyrics mode, a word is looked up in the following order:
775 \item{\verb+word+} string (thus a lyric)
776 \item{\verb|"string"|} string
777 \item{\verb|\word|} keyword, identifier
780 In Lyric mode every sequence of non-digit and non-white characters
781 starting with an alphabetic character or the \_ is considered a word.
784 a&@&@&TSI|{[ % a word
785 1THtrhortho % not a "word"
786 Leise Fl\"u\ss{}teren meine Sapfe % 4 words
787 _ _ _ _ % 4 words: 4 spaces
791 These modes are of a lexical nature. Normal and Note mode largely
792 resemble each other, save the possibility of entering Reals,
793 meaning of \verb+_+ and the resolution of words
797 You enter a note by giving the name and the reciprocal of the duration:
799 \begin[fragment,verbatim]{mudela}
803 is a A-1 pitched crotchet. The ' signifies an octave change. A-1 is 440
804 Hz concert-pitch. \verb+c'+ is also known as the central c. More examples:
806 \begin[fragment,verbatim]{mudela}
809 A % 110, uppercase octavates down
815 The last one is an A flat, (just below 110 Hz concert-pitch). The \verb+*2/3+
816 signifies that this note is part of a triplet (3 in stead of 2). The
817 duration is one and a half quarter note (\verb+4.+) times 2/3.
819 Notenames are just a special kind of identifiers, and can be declared
820 for any language appropriate (see \file{init/dutch.ly}). The default language
821 for notenames is defined to be Dutch. In Dutch, the notenames are
822 a,b,c,d,e,f and g. Sharps are formed by adding the extension "is",
823 flats by adding ``es''
827 cisis disis eisis fisis gisis aisis bisis
829 cis dis eis fis gis ais bis
833 ces des es fes ges as bes
835 ceses deses eses feses geses ases beses
838 Rests are named r or s
841 s % a "space" rest, nothing is printed.
844 These notenames along with duration are enough material to construct
847 \begin[verbatim,fragment]{mudela}
853 Music is able to express more. generally speaking, the other
854 'features' are either connected between notes (slurs, beams: spanning
855 requests) or attached to notes (eg. accents). The former are
856 implemented as START and STOP stop features and then attached to the note.
859 \item{[ and ]} start and stop a beam
860 \item{( and )} start and stop a slur
864 \begin[verbatim,fragment]{mudela}
867 e8(] [)g8 <c'8] e'8> % NO nesting!
868 [2/3 c8 c8 c8]1/1 % a triplet
871 Please note that these two characters do \emph{not} necessarrily nest,
872 they should be attached to the note. For this reason, the construct
873 \verb+[ <c4 c4>]+ will generate a parse error.
875 \subsection{Slurs and Ties}
877 Ties connect the noteheads of adjacent notes. They are entered as follows:
879 \begin[verbatim,fragment]{mudela}
883 Slurs connect whole chords, and try to avoid crossing stems. They are
886 \begin[verbatim,fragment]{mudela}
892 Symbols which can be put at either side (above or below) of a staff
893 are entered as follows:
894 \begin[verbatim,fragment]{mudela}
895 a-^ % marcato, direction: default
896 %a^- % portato, direction: above note
897 a_. % staccato, direction: below note
898 a^\fermata % predefined identifier
899 c_"marcato" % add a text
904 If you want to define your own scripts refer to \file{init/script.ly} for
908 Dynamics can be put after the notename:
910 a4 \dynamic { 0 } % 0 = fff, 7 = ppp
913 Mudela defines the following dynamic identifiers:
916 ppp pp p mp mf f ff fff sfz fz fp
918 and the following abbreviations:
921 \> % start decrescendo
922 \! % end crescendo/decrescendo
925 \subsection{Defaults}
927 If omit the duration of a note, a default value is substituted. For
928 this default value mudela uses the last duration explicitly entered.
930 Thus the following inputs are equivalent
932 c4 c4 c16 c16 c16 s16 c4 c16
933 c4 c c16 c c c c4 c16
936 If you are typing music which does not lie in the "small" and "large"
937 octave, you can prevent having to type \verb+'+ all the time by using the
938 \verb+\octave+ command: These two lines have the same pitch.
940 c'' d'' e'' c d e c d e
941 \octave c''; c d e ''c ''d ''e \octave c; c d e
944 By default the setting of \verb+\octave+ is 0.
948 Lyrics in Mudela resemble Simple mudela a lot, with notes substituted
951 All syllables are entered separately, separated by whitespace
953 Twin-4 kle4 twin-4 kle4 ...
956 Two syllables or words that compose a single
957 duration entry are bound together using an underscore
962 \section{Composition: forming bigger structures}
964 The previous examples tacitly assumed that a sequence of notes is
965 printed in a left to right manner. This is not entirely correct, you
966 will get the bigger picture in this section.
968 In mathematics you can form expressions by combining expressions,
969 which are ultimately some kind of atom or terminal symbol. The same
970 goes for mudela: there are some basic building blocks, and by
971 combining those you create complex music.
973 You can combine music in three ways:
975 \item If you enclose a sequence of music-elements in braces ( \verb+{+
976 and \verb+}+ ), then you form another kind of music called (Voice) with those pieces.
977 The duration of the Voice is the sum of the durations of its elements
979 { c c g g a a g2 } % twinkle twinkle
980 { { c c g g} { a a g2 } }
982 \item You can stack music by enclosing a sequence of music elements
983 with \verb+<+ and \verb+>+. This is called a Chord. The duration of a Chord is
984 the union of the durations of its elements Example:
986 <a4 {cis8 cis8} e'4> % a-major chord
989 You can form music by transposing music:
992 d % from c to the d that's one octave down
993 { e4 f4 } % the horizontal music
997 Of course you can also combine these three mechanisms.
999 { c <c e> <c e g> <c e g \transpose d' dis > } % 4 increasing chords
1002 The basic building block in Mudela is called Request. Examples of
1003 Requests are: Timing (such as Meter), Rhythmic, Melodic, Note (which is a combination of
1004 Rhythmic and Melodic), Musicscript (put an accent over a note or
1005 rest), etc. For the actual up to date listing, you should consult the
1006 LilyPond source code: the Request types form a big class hierarchy.
1008 Normally you don't enter Requests directly, since that would be
1009 tedious. Mudela has standard abbreviations for the most common
1010 combination of Requests. If you enter \verb+c4+, this is an
1015 notename: 0 acc: 0 oct: -1
1024 The \verb+Request_chord+ is a special kind of chord which only allows
1025 Requests as its elements. The examples of the previous section were
1026 processed with \verb+{+ and \verb+}+ enclosing the input.
1028 \subsection{Durations}
1030 A duration always starts with the duration type (1,2,4 etc), and then
1031 any optional multipliers/dots. Old fashioned durations can be entered
1040 \subsection{Meters/groupings}
1042 A meter has this form:
1047 Rhythmic grouping is a concept closely associated with this. For
1048 example, in a 5/8 meter, the counts are grouped 2+3. In mudela this is
1053 You can start the piece with a partial measure, the command takes the
1054 same syntax as grouping:
1059 Make the piece start with a upstep [english translation?]
1060 lasting 1 3/4 quarter notes.
1062 These commands are also "voice elements", and constitute ``Music''
1063 (consisting of stuff with duration 0).
1066 \subsection{Voicegroups}
1071 If more than one "voice" is in a staff, then you have the option of
1072 putting the different voices into so called voicegroups: members of
1073 the same voicegroup share certain characteristics, among others:
1080 For the actual list, see the init file \file{init/register.ly}
1082 Putting different musical lines in to the same voicegroup effectively
1083 makes LilyPond try to form chords of all those lines. Putting
1084 different musical lines in to different voicegroups effectively makes
1085 LilyPond try to set those lines as independently as possible.
1087 [adsolete. Has to be fixed in lily]
1089 You can set the voicegroup of a voice with the command \verb+\group+, e.g.,
1100 oboeII = \melodic { \group "oboes";
1108 melodicregs \melodic{ oboeI }
1113 In this example, the two oboe voices share one staff and are initially
1114 in the voicegroup called "oboes". They will share beams, dynamics etc.
1115 After two quarter notes, oboeI "pushes" its group: a new voicegroup is
1116 created, called "oboes+solo". The \verb+\group "-"+ command makes the
1117 voice enter "oboes" again.
1119 Please do note that [] are voicegroup wide; the previous input is
1120 valid: the beam, started in oboeI, voicegroup "oboes" is also ended in
1121 voicegroup "oboes", albeit not in oboeI but oboeII
1123 This concept may seem contorted, but it allows you to set the separate
1124 oboe parts without changing the \verb+oboeI+ and \verb+oboeII+ (assuming that
1125 you edit the [] in the example.)
1129 < { .... } {......} >
1131 makes a chord (all horizontal parts are in the same voicegroup). The construct
1133 \multi 2 < { ....} { .... } >
1135 creates horizontal parts which behave independently. You will have to
1136 set voicegroup features by hand (\verb+\stem+ and \verb+\hshift+. See examples)
1140 \multi 3 < { ....} { .... } >
1142 creates a chord with each part in a different staff
1145 \subsection{Examples}
1147 Examples are included with the GNU LilyPond distribution. For the sake of
1148 maintenance no long examples are included in this document.
1153 This language has a number of roots. First and foremost, GNU
1154 LilyPond's predecessor mpp was the inspiration of the Note-mode input.
1155 Secondly, the hierarchical structure looks a lot like Rayce's (Rayce
1156 is a raytracer that I've written as a hobby project. ), which in turn
1157 owes a lot to POVRay.
1159 Now, we know, musictypesetting and raytracing do not necessarily
1160 require the same input format, and we know that a lot more ways exist
1161 to convert music to ASCII, but we did give this language some
1162 thoughts. As always suggestions are appreciated.