]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/mudela-man.doc
release: 0.1.20
[lilypond.git] / Documentation / mudela-man.doc
index 8e3d0de2eacf9b944db34439b28191449f16cf04..498ba8b756dc85f440c16570da989273114612bb 100644 (file)
@@ -24,7 +24,8 @@ effective language for defining music.  We call this language (rather
 arrogantly) The Musical Definition Language or Mudela, for
 short.\footnote{If anybody comes up with a better name, we'd gladly
   take this. Gourlay already uses Musical Description Language,
-  G-Sharp Score Definition Language. We're not being original here}
+  G-Sharp Score Definition Language.  ISO standard 10743 defines a
+  Standard Music Description Language.  We're not being original here}
 
 The first aim of Mudela is to define a piece of music, being complete
 from both from a musical typesetting, as from a musical performing
@@ -40,7 +41,10 @@ and up-to-date definition, see \file{lily/parser.y} and
 
 As a related note, you should take a look at the examples and the init
 files, as this document does not cover every aspect of mudela yet, and
-may be out of date.
+may be out of date.\footnote{Ok, I am being pessimistic here.  This
+  just is a disclaimer.  Docs usually are written after the program
+  itself.}  This document intends to give an idea of how it works, it
+is not a guide on how to use it.  
 
 
 \section{Basic elements}
@@ -48,7 +52,7 @@ may be out of date.
 \subsection{Files}
 
 The de-facto extension of Mudela is \file{.ly}. Files may be included by
-entering \verb+include+ at the start of a line:
+entering \verb+\include+ at the start of a line:
 
 \begin{verbatim}
 \include "a_file.ly"
@@ -87,8 +91,7 @@ alphabetic characters only.
 Identifiers in their normal form consist start with a backslash, a
 alpha character, followed by alpha-numerics. Identifiers can contain
 any characters (except whitespace, 
-\verb+$+ and \verb+%+), if you use this
-construct:
+ and \verb+%+), if you use this construct:
 
 \begin{verbatim}
 \$i'm_a_weird!!!identifier
@@ -98,6 +101,7 @@ construct:
 \verb+i'm_a_weird!!!identifier+).  \verb+$+ Takes any sequence of
 characters which are not whitespace, \verb+$+ and \verb+%+.
 \verb+$i'm_a_weird!!!string+
+\def\foobar{$} % silly fontlock mode 
 
 \subsection{Nesting characters}
 
@@ -122,15 +126,30 @@ When assigning identifiers you use
 
 \begin{verbatim}
 string = ...
-\oldidentifier = ..
 \end{verbatim}
 
+If you reuse identifiers, then the previous contents will be thrown
+away after the right hand is evaluated, eg
+\begin{verbatim}
+bla = \melodic { \bla }
+\end{verbatim}
+is legal
+
 When using identifiers they have to be escaped:
 
 \begin{verbatim}
 oboe = \melodic { ... }
 \score{ \melodic { \oboe }}
 \end{verbatim}
+
+The left-hand part of the assignment is really a string, so 
+\begin{verbatim}
+"Foo bar 4 2 " = \melodic { .. }
+\end{verbatim}
+
+is also a valid assignment (but you would have trouble referencing to it)
+
+
 \subsection{Hierarchical structures}
 
 The general structure consists of declarations:
@@ -170,33 +189,42 @@ and manipulating them) Mudela has a number of different input "modes":
 
 At the start of parsing, Mudela assumes normal mode.
 In Normal mode, a word is looked up in the following order:
-\begin{verbatim}
-word    string
-\word   keyword, identifier
-\end{verbatim}
-In normalmode, a word is assumed to start with an alphabetic
+\begin{description}
+\item{\verb+word+}    string
+\item{\verb|"string"|} string
+\item{\verb|\word|} keyword, identifier
+\end{description}
+In normal mode, a word is assumed to start with an alphabetic
 character, followed by alpha-numeric characters.
 
-\item[Note mode] 
-  Note mode (and thus Simple mudela) is introduced by
-  the keyword \verb+\melodic+.  In Note mode, a word is looked up in
-  the following order:
+\item[Note mode] Note mode is introduced by the keyword
+  \verb+\melodic+.  In Note mode, a word is looked up in the following
+  order:
+\begin{description}
+\item{\verb+word+} notename, string
+\item{\verb|"string"|} string
+\item{\verb|\word|} keyword, identifier
+\end{description}
 
-\begin{verbatim}
-word    notename, string
-\word   keyword, identifier
-\end{verbatim}
-In Note mode a word is considered to have alphabetic characters only.
+In Note mode a word is considered to have alphabetic characters only,
+so the underscore (\_) is illegal.  If you accidently mistype a
+notename, the parser will assume that you are entering a string (and
+it will most likely complain that you should be in \verb|\lyrics| mode to
+do lyrics)
 
-\item[Lyric mode]
-Lyrics mode (and thus Simple mudela)  is introduced by the keyword \verb+\lyrics+.
 
-In Lyrics mode, a word is looked up in the following order:
+\item[Lyric mode] Lyrics mode (and thus Simple mudela) is introduced
+  by the keyword \verb+\lyrics+.  Because of the various control
+  characters that can appear in lyrics, eg, ``foreign language''
+  accents, the inputting a string containing these has been made very
+  easy.
 
-\begin{verbatim}
-word    string
-\word   keyword, identifier
-\end{verbatim}
+In Lyrics mode, a word is looked up in the following order:
+\begin{description}
+\item{\verb+word+}    string (thus a lyric)
+\item{\verb|"string"|} string
+\item{\verb|\word|} keyword, identifier
+\end{description}
 
 In Lyric mode every sequence of non-digit and non-white characters
 starting with an alphabetic character or the \_ is considered a word.
@@ -218,28 +246,28 @@ meaning of \verb+_+ and the resolution of words
 You enter a note by giving the name and the reciprocal of the duration:
 
 \begin[fragment,verbatim]{mudela}
-a'4     % dutch names
+a'4     % Dutch names
 \end{mudela}
 
-is a A-1 pitched quaver. The ' signifies an octave change.  A-1 is 440
+is a A-1 pitched crotchet. The ' signifies an octave change.  A-1 is 440
 Hz concert-pitch. \verb+c'+ is also known as the central c. More examples:
 
 \begin[fragment,verbatim]{mudela}
-'a      % 110
+        'a      % 110
         a       % 220
         A       % 110, uppercase octavates down
         a'      % 440
-a''     % 880
-'as4.*2/3
+        a''     % 880
+        'as4.*2/3
 \end{mudela}
 
 The last one  is an A flat, (just below 110 Hz concert-pitch). The \verb+*2/3+
 signifies that this note is part of a triplet (3 in stead of 2). The
-duration is one and a half quaver (\verb+4.+) times 2/3.
+duration is one and a half quarter note (\verb+4.+) times 2/3.
 
 Notenames are just a special kind of identifiers, and can be declared
 for any language appropriate (see \file{init/dutch.ly}).  The default language
-for notenames is defined to be dutch. In dutch, the notenames are
+for notenames is defined to be Dutch. In Dutch, the notenames are
 a,b,c,d,e,f and g. Sharps are formed by adding the extension "is",
 flats by adding ``es''
 
@@ -276,10 +304,10 @@ Music is able to express more. generally speaking, the other
 requests) or attached to notes (eg. accents). The former are
 implemented as START and STOP stop features and then attached to the note.
 
-\begin{verbatim}
-[]      START/STOP a beam
-()      START/STOP a slur
-\end{verbatim}
+\begin{description}
+\item{[ and ]}      start and stop a beam
+\item{( and )}      start and stop a slur
+\end{description}
 
 example: 
 \begin[verbatim,fragment]{mudela}
@@ -290,8 +318,8 @@ example:
 \end{mudela}
 
 Please note that these two characters do \emph{not} necessarrily nest,
-they should attached to the note \verb+[ <c4 c4>]+ will generate a parse
-error for this reason. 
+they should be attached to the note.  For this reason, the construct
+\verb+[ <c4 c4>]+ will generate a parse error.
   
 \subsection{Slurs and Ties}
 
@@ -313,13 +341,13 @@ a'4(  )a''4
 Symbols which can be put at either side (above or below) of a staff
 are entered as follows:
 \begin[verbatim,fragment]{mudela}
-a-^     % marcato, direction: default
-        a^-     % portato, direction: above note
+        a-^     % marcato, direction: default
+        %a^-     % portato, direction: above note
         a_.     % staccato, direction: below note
         a^\fermata      % predefined identifier
         c_"marcato"     % add a text
         c^"marcato"
-c-"marcato"
+        c-"marcato"
 \end{mudela}
 
 If you want to define your own scripts refer to \file{init/script.ly} for
@@ -334,7 +362,7 @@ a4 \dynamic { 0 } % 0 = fff, 7 = ppp
 Mudela defines the following dynamic identifiers:
 
 \begin{verbatim}
-ppp pp p mp mf df ff fff        % df iso f, f is a notename.
+ppp pp p mp mf f ff fff sfz fz fp
 \end{verbatim}
 and the following abbreviations:
 \begin{verbatim}
@@ -446,9 +474,42 @@ The \verb+Request_chord+ is a special kind of chord which only allows
 Requests as its elements.  The examples of the previous section were
 processed with \verb+{+ and \verb+}+ enclosing the input.
 
+\subsection{Durations}
+
+A duration always starts with the duration type (1,2,4 etc), and then
+any optional multipliers/dots
+
+\subsection{Meters/groupings}
+
+A meter has this form:
+\begin{verbatim}
+\meter 3/4 ;
+\end{verbatim}
+
+Rhythmic grouping is  a concept closely associated with this. For
+example, in a 5/8 meter, the counts are grouped 2+3. In mudela this is
+entered as
+\begin{verbatim}
+\grouping  8*2 8*3 ;
+\end{verbatim}
+You can start the piece with a partial measure, the command takes the
+same syntax as grouping: 
+\begin{verbatim}
+\partial 16*3 4;
+\end{verbatim}
+
+Make the piece start with a upstep [english translation?]
+lasting 1 3/4 quarter notes.
+
+These commands are also "voice elements", and constitute ``Music''
+(consisting of stuff with duration 0).
+
 
 \subsection{Voicegroups}
 
+
+[OUTDATED]
+
 If more than one "voice" is in a staff, then you have the option of
 putting the different voices into so called voicegroups: members of
 the same voicegroup share certain characteristics, among others:
@@ -468,6 +529,7 @@ LilyPond try to set those lines as independently as possible.
 [adsolete. Has to be fixed in lily]
 
 You can set the voicegroup of a voice with the command \verb+\group+, e.g.,
+
 \begin{verbatim}        
         oboeI = \melodic { 
                 \group "oboes"; 
@@ -492,7 +554,7 @@ You can set the voicegroup of a voice with the command \verb+\group+, e.g.,
 
 In this example, the two oboe voices share one staff and are initially
 in the voicegroup called "oboes". They will share beams, dynamics etc.
-After two quavers, oboeI "pushes" its group: a new voicegroup is
+After two quarter notes, oboeI "pushes" its group: a new voicegroup is
 created, called "oboes+solo". The \verb+\group "-"+ command makes the
 voice enter "oboes" again.
 
@@ -510,48 +572,18 @@ The construct
 \end{verbatim}
 makes a chord (all horizontal parts are in the same voicegroup). The construct
 \begin{verbatim}
-< \multi 2; { ....} { .... } >
+\multi 2 < { ....} { .... } >
 \end{verbatim}
 creates horizontal parts which behave independently. You will have to
 set voicegroup features by hand (\verb+\stem+ and \verb+\hshift+. See examples)
 
 The construct
 \begin{verbatim}
-< \multi 3; { ....} { .... } >
+\multi 3 < { ....} { .... } >
 \end{verbatim}
 creates  a chord with each part in a different staff
 
 
-\subsection{Durations}
-
-A duration always starts with the duration type (1,2,4 etc), and then
-any optional multipliers/dots
-
-\subsection{Meters/groupings}
-
-A meter has this form:
-\begin{verbatim}
-\meter 3/4 ;
-\end{verbatim}
-
-Rhythmic grouping is  a concept closely associated with this. For
-example, in a 5/8 meter, the counts are grouped 2+3. In mudela this is
-entered as
-\begin{verbatim}
-\grouping  8*2 8*3 ;
-\end{verbatim}
-You can start the piece with a partial measure, the command takes the
-same syntax as grouping: 
-\begin{verbatim}
-\partial 16*3 4;
-\end{verbatim}
-
-Make the piece start with a partial measure [english translation?]
-lasting 1 3/4 quaver.
-
-These commands are also "voice elements", and constitute simple mudela
-(consisting of stuff with duration 0).
-
 \subsection{Examples}
 
 Examples are included with the GNU LilyPond distribution. For the sake of
@@ -560,11 +592,11 @@ maintenance no long examples are included in this document.
 
 \section{History}
 
-This language has a number of roots. First and foremost, GNU LilyPond's
-predecessor mpp was the inspiration of simple Mudela.  Secondly, the
-hierarchical structure looks a lot like Rayce's (Rayce is a raytracer
-that I've written as a hobby project. ), which in turn owes a lot to
-POVRay.
+This language has a number of roots. First and foremost, GNU
+LilyPond's predecessor mpp was the inspiration of the Note-mode input.
+Secondly, the hierarchical structure looks a lot like Rayce's (Rayce
+is a raytracer that I've written as a hobby project. ), which in turn
+owes a lot to POVRay.
 
 Now, we know, musictypesetting and raytracing do not necessarily
 require the same input format, and we know that a lot more ways exist