]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/mudela.doc
release: 0.1.59
[lilypond.git] / Documentation / mudela.doc
index 8c95b4d1f609f285340d7eb44e4216fcbad8df81..60d906ac77223afab6edcade439c3bdccece924d 100644 (file)
@@ -1,4 +1,4 @@
-% -*-latex-*-
+% -*-tex-*-
 
 % this document should be run through the mudela-book script after lilypond
 % has been installed.  The rules have been precooked into the
@@ -79,21 +79,22 @@ This chapter is a gentle introduction to using LilyPond to typeset
 simple music.
 
 LilyPond is a so called ``batch'' program.  This means, that you use a
-texteditor (such as emacs or vi) to create an input file.  When you
-are done editing your input file, you run LilyPond.  If Lily
-finds any errors in your input file she\footnote{ If computer programs
-could have gender, we're sure that LilyPond is a female computer
-program, so we will refer to the program as a she. This gender-bending
-is not to tease you, dear reader.  We do it in real life as well. In
-the past two years LilyPond has become sort of a baby daughter to us,
-keeping us awake at night, but also providing lots of joy.  We hope
-you do not mind our little aberration from computer-manual tradition.
+text editor (such as \texttt{emacs} or \texttt{vi}) to create an input
+file.  When you are done editing your input file, you save it, and you
+run LilyPond on the file.  If Lily finds any errors in your input file
+then she\footnote{ We're sure that if computer programs could have
+gender, LilyPond would be a female computer program.  So we will refer
+to the program as a she. This gender-bending is not to tease you, dear
+reader.  We do it in real life as well. In the past two years LilyPond
+has become sort of a baby daughter to us, keeping us awake at night,
+but also providing us lots of joy.  We hope you do not mind our little
+aberration from computer-manual tradition.
 % 
 % The name LilyPond is actually sort of a girl's name.  Can you guess which
 % one ?
 %
-} complain.  If everything is well, than she'll generate a file that
-you can process further to view or print it.
+} will complain.  If everything is well, than she'll generate a file, that
+you can process further to view or print.
 
 Using LilyPond to print or view some music is a procedure with four
 steps.  To get you started we'll run down the full procedure for you
@@ -105,19 +106,21 @@ Fire up your favourite editor (if you know none, try \texttt{joe silly.ly}),
 and key in the following text:
 \begin{verbatim}
 \score {
-       <
+        <
         \type Staff = aStaff \melodic { g'2 e'4 }
         \type Lyrics = yell \lyric { Air2 ball!4 }
         >
+        \paper {}
 }
 \end{verbatim}
 
-Save your file as \file{silly.ly}.  The input files for LilyPond have
-the default extension \file{.ly}.
+Save your file as \file{silly.ly}.
+
+%The input files for LilyPond have the default extension \file{.ly}.
 
 \item
 Run LilyPond on your newly created file: enter \verb+lilypond silly+.
-LilyPond will then print all kinds of mumbo jumbo that can safely
+LilyPond will then print all kinds of mumbo jumbo that can safely be
 ignored.  You might see something like this:
 \begin{verbatim}
 GNU LilyPond 0.1.55/FlowerLib 1.1.39
@@ -125,7 +128,7 @@ Parsing ... [/home/hanwen/musix/spacer/init/lily-init.ly[/home/hanwen/
 
         ... stuff left out here ...
 
-                               Documentation/silly.ly]
+                                Documentation/silly.ly]
 Interpreting music ...[1] (time: 0.04 seconds)
 Preprocessing elements... 
 Calculating column positions ... [2]
@@ -137,18 +140,16 @@ warning: Can not solve this casting problem exactly; revert to Word_wrap
 Postprocessing elements...
 TeX output to silly.tex ...
 \end{verbatim}
-  All has gone well; there were some warning but no errors.  The
-  output is a \file{TeX}\footnote{%
-    \file{TeX} is usually spelled as
-  \TeX.  It is batch program for typesetting text, developed by the
-  famous programmer and scientist Donald Knuth to typeset his famous The
-  Art of Computer Programming bookseries.  As you can see \TeX\ can be
-  adapted to do a lot more.  In fact, the document that you are
-  reading was also done with \TeX.} file, and it is called
-  \file{silly.tex}.
+All has gone well; there were some warning but no errors.  The output
+is a TeX file, and it is called \file{silly.tex}.  \file{TeX} is
+usually spelled as \TeX.  It is batch program for typesetting text,
+developed by the great programmer and scientist Donald Knuth to
+typeset his famous The Art of Computer Programming bookseries.  As you
+can see \TeX\ can be adapted to do a lot more.  In fact, the document
+that you are reading now was also done with \TeX.
 \item
   To do something useful with the output you have to run \TeX\ on it
-  first.  type \verb+tex silly+.  The output should resemble this:
+  first.  Run the command \verb+tex silly+.  The output should resemble this:
 \begin{verbatim}
 This is TeX, Version 3.14159 (C version 6.1)
 (silly.tex
@@ -162,17 +163,17 @@ Output written on silly.dvi (1 page, 3084 bytes).
 Transcript written on silly.log.
 \end{verbatim}
   The human translation is ``everything went OK, the result is one
-  page long, and I put it in \file{silly.dvi}''.
+  page long, and I put it in \file{silly.dvi}.''
 
 \item The \file{silly.dvi} file is a description of how a piece of
 text looks when it is printed.  You can view it, or print it.  If you
-are using a Unix system equipped with X-Windows, issue the command
-\file{xdvi silly} to view the result.  If this is not the case,
-consult your local \TeX\ guru on printing and viewing DVI files.  What
-is in your window should look like this:
+are using a Unix system equipped with X-Windows, then you can issue
+the command \file{xdvi silly} to view the result.  If this is not the
+case, consult your local \TeX\ guru on printing and viewing DVI files.
+What is in your window should look like this:
 \begin{mudela}
 \score {
-       <
+        <
         \type Staff = aStaff \melodic { g'2 e'4 }
         \type Lyrics = yell \lyric { Air2 ball!4 }
         >
@@ -185,20 +186,20 @@ about LilyPond.  What you entered into your text editor in step~1. and
 fed to LilyPond is a special kind of file composed of notenames,
 special words and punctation.  The remainder of this document explains
 how to combine these elements to express a piece of music in the
-language that LilyPond understands.  So we try to explain how to use
-LilyPond, and not how LilyPond works; the input language of LilyPond
-is the subject of the document.  For want of a better name we call
-this language Mudela (short for Music Description Language).
+language that LilyPond understands.  In other words, we try to explain
+how to use LilyPond, and not how LilyPond works.  For want of a better
+name we call this language Mudela (short for Music Description
+Language).
 
 This document does not cover all of Mudela.  Due to technical details,
 the precise working of Mudela is coupled to the innards of LilyPond.
 If you really want to know all the details, your best bet would be to
-get the sources to LilyPond and read the parser and scanner
-source\footnote{ They are in \file{lilypond-x.y.z/lily/parser.y},
-\file{lilypond-x.y.z/lily/lexer.l}.  Of course, it would be even
+get the sources to LilyPond and read the parser and scanner source.
+They are in \file{lilypond-x.y.z/lily/parser.y},
+\file{lilypond-x.y.z/lily/lexer.l\footnote{Of course, it would be even
 better if you would improve LilyPond and send the resulting diffs to
-us.  But that would a really different ballpark (And we
-haven't  started with the programming guide yet.)}
+us.  But that would a really different ballpark (And we haven't
+started with the programming guide yet.)}
 
 In the following sections the basic elements of Mudela are presented.
 We don't want to bore you too much with details, so we will leave-out
@@ -215,22 +216,24 @@ right just as it was produced by LilyPond.
 
 For the remainder we will assume that you can carry out steps 1 to 4
 from the above instruction.  We will also assume that you know how
-music notation works, and that you are familiar with terms such as
-``note'', ``clef'', ``slur'' etc.
+music notation works.  If you are not familiar with the English terms
+for music notation, then you should consult XXXX [FIXME], it contains
+a glossary of musical terms.
 
 \section{Music copying versus music definition}
 
 If you have done music copying before, then using LilyPond may seem
-awkward to you in the beginning.  The purpose of LilyPond is usually
+awkward to you in the beginning.  The purpose of LilyPond is informally
 explained by the term ``music typesetter.''
 
-This may give the impression that the program lets you control
-precisely how the music is formatted.  This is not the case: not only
-does the program print musical symbols, LilyPond also tries to make
-esthetic decisions---to be precise, we programmed her to do what we
-find pretty.  You do not have complete control over what is happening.
-On the other hand, good engraving is a very complex trade, so it is a
-Good Thing that you do not have to worry about what is happening.
+This may give the impression that the program is like a drawing tool
+that lets you control precisely how the music is formatted.  This is
+not the case: not only does the program print musical symbols,
+LilyPond also tries to make esthetic decisions---to be precise, we
+programmed her to do what we find pretty.  You do not have complete
+control over what is happening.  On the other hand, good engraving is
+a very complex trade, so it is a Good Thing that you do not have to
+worry about what is happening.
 
 Secondly, LilyPond operates on musical definitions.  This really is
 something different from graphical definitions.  If you copy music by
@@ -239,19 +242,19 @@ means; you just copy the symbols.  With LilyPond such a thing is not
 possible: we expect you to enter the meaning of the score, not the
 score itself.  If put more concretely: you do not enter ``black
 notehead without flag, fourth staff line'', but ``a quarter note,
-pitch $d^2$''.  LilyPond will figure out from the musical info what
+pitch d$^2$''.  LilyPond will figure out from the musical info what
 kind of graphic presentation is needed.
 
 This has some drawbacks: most notably, it is difficult to enter sheet
 music that you cannot read.  On the other hand, any piece of music
-that you enter can be played and transposed automatically.
+once entered can be played and transposed automatically.
 
 
 \section{When you know the notes to print\ldots}
 
 The basic building block of music is the note.  You can have LilyPond
 print a note by specifying its pitch and the duration.  The pitch of
-the central C, also know as c$^1$ is written as \verb+c'+.  A quarter
+the central C, also known as c$^1$, is written as \verb+c'+.  A quarter
 note duration is written as \verb+4+.  So, to print quarter note with
 central C pitch, you enter the following
 \begin[fragment,verbatim,center]{mudela}
@@ -262,11 +265,16 @@ name, and one part for the octave.  The number of apostrophes
 specifies the octave to use, and the letter which note name to use.
 The note names simply are the letters \verb+a+ to \verb+g+.
 
+For example,
+\begin[fragment,verbatim]{mudela}
+  c'4 d'4 e'4 c'4 c''4 d''4 e''4 f''4 g''4 a''4 b''4 c'''4
+\end{mudela}
+
 The duration of a note is specified as a number: a whole note is
 denoted by 1, the half note by 2, the quarter by 4, and so on.  Here
 are some random notes to show how it works
 \begin[fragment,verbatim]{mudela}
-'c8 c8 c'16 c''16 d''64 b'64 c1 c'4 d'4 e'4 f'4 g'4 a'4
+'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
 \end{mudela}
 
 This gives us already enough material to make simple songs:
@@ -280,31 +288,42 @@ This gives us already enough material to make simple songs:
 There is only one part about pitches that we haven't told you:
 chromatically altered pitches.  The names ``a'' to ``g'' for typing
 pitches are convenient: they are short, pronounceable and they
-resemble the normal vocabulary for pitches.  Enter flats and sharps.
-In english there is no standard terse word for C sharp or C flat.  For
-this reason, we implemented a different, non-english convention for
-entering altered pitches, see table~\ref{notename-tab}: one makes a note sharp by adding the suffix
---is to the name, one makes the a note flat by adding the suffix
---es.  For a double sharp you simply add another --is suffix.  
-
-\begin{table}\caption{Note names}\label{notename-tab}
-\begin{tabular}{ll}
-english        &LilyPond\\
-\hline\\
-c double flat  &ceses\\
-c flat         &ces\\
-c natural      &c\\
-c sharp                &cis\\
-c double sharp &cisis\\
-\end{tabular}
+resemble the normal vocabulary for pitches.
+
+Enter flats and sharps.  In English there is no standard terse word
+for C sharp or C flat.  For this reason, we implemented a different,
+non-english convention for entering altered pitches, see
+table~\ref{notename-tab}: one makes a note sharp by adding the suffix
+``--is'' to the name, one makes the a note flat by adding the suffix
+``--es.''  For a double sharp you simply add another ``--is'' suffix,
+flats ditto.
+
+
+\begin{table}[h]
+  \begin{center}
+    \caption{Defaults note names}\label{notename-tab}
+    \begin{tabular}{ll}
+      english         &LilyPond\\
+      \hline\\
+      c double flat   &ceses\\
+      c flat          &ces\\
+      c natural       &c\\
+      c sharp         &cis\\
+      c double sharp  &cisis\\
+    \end{tabular}
+    
+  \end{center}
 \end{table}
 
-Variations on this convention\footnote{LilyPond actually defaults to
-dutch notenames, with aes, aeses, ees and eeses added} are used in a
-number of germanic languages, notably dutch, german, swedish,
-norwegian.  If you are not comfortable with these names, you can make
-your own names.  Check out the example initialisation files.  A number
-of languages are included.
+Variations on this convention are used in a number of germanic
+languages, notably Dutch, German, Swedish, and Norwegian.  To be
+precise, LilyPond actually defaults to dutch notenames, with aes,
+aeses, ees and eeses added for consistency.
+
+If you are not comfortable with these names, you can make your own
+names.  Included with the example initialisation files are note names
+for different languages, among others English (C sharp is abbreviated
+to cs), Italian, Swedish, Norwegian
 
 \section{Hairy rhythms}
 
@@ -508,10 +527,10 @@ A Mudela file needs some red tape
 \begin[verbatim,center]{mudela}
 \score{
         \melodic {
-               \octave c';
-               c d e c |
-               c d e c |
-               e f g2 |
+                \octave c';
+                c d e c |
+                c d e c |
+                e f g2 |
         }
 }
 \end{mudela}
@@ -521,18 +540,18 @@ A Mudela file needs some red tape
 \begin[verbatim,center]{mudela}
 \score{
         < 
-               \melodic{ 
-                       \octave c'; 
-                       c d e c | c d e c |
-                       e f g2 | e4 f g2
-                       \bar "|.";
-               }
-               \type Lyrics \lyric{ 
-                       Fr\`e-4 re Ja- que
-                       Fr\`e- re Ja- que
-                       Dor- mez vous?2
-                       Dor-4 mez vous?2
-               }
+                \melodic{ 
+                        \octave c'; 
+                        c d e c | c d e c |
+                        e f g2 | e4 f g2
+                        \bar "|.";
+                }
+                \type Lyrics \lyric{ 
+                        Fr\`e-4 re Ja- que
+                        Fr\`e- re Ja- que
+                        Dor- mez vous?2
+                        Dor-4 mez vous?2
+                }
         >
 }
 \end{mudela}