chiark / gitweb /
Merge branch 'arkkra' into shiny
[mup] / mup / docs / uguide / basics.html
CommitLineData
69695f33
MW
1<HTML>
2<HEAD><TITLE>
3"Mup Basics"
4</TITLE></HEAD>
5<BODY>
6<P>
7&nbsp;&nbsp;&nbsp;<A HREF="intro.html">&lt;-- previous page</A>
8
9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="running.html">next page --&gt;</A>
10</P>
11
12<H1>
13MUP BASICS
14</H1>
15<P>
16This section introduces the Mup language, giving some simple examples to
17give you the flavor of a Mup input file.
18Subsequent sections will go into greater detail.
19</P>
20<H2>
21Notes and chords
22</H2>
23<P>
24Music is described one measure at a time. Each note is specified by its pitch
25value, &quot;a&quot; to &quot;g.&quot; As an example, the first measure of &quot;Three Blind
26Mice&quot; can be described like this:
27<BR><PRE>
281: 4e; 4d; 2c;
29</PRE><BR>
30<IMG SRC="mugex2.gif" ALT="Picture of Mup output"><BR>
31The &quot;1:&quot; at the beginning of the line tells Mup that we are describing
32the notes on staff number 1. In this very simple example, we only have one
33staff, but later we'll do songs with more than one.
34Each staff of each measure is normally put on a separate line.
35</P>
36<P>
37The first three notes of &quot;Three Blind Mice&quot; are E, D, and C. For Mup
38input, these pitches are given in lower case to avoid having to use the shift
39key. No octave information was specified in this simple example, so Mup
40would use its default, which in this case would be the octave beginning
41with middle C.
42</P>
43<P>
44The first two notes are quarter notes, and the last note is a half
45note. Time values of notes are given as shown in the example. A quarter
46note is marked by a 4, a half note by 2, a sixteenth note by a 16, etc.
47</P>
48<P>
49A semicolon is used to separate chords. In this simple example, each chord
50has only a single note in it, but it is possible to have lots of notes in one
51<A HREF="chordinp.html">chord.</A>
52</P>
53<P>
54At the end of each measure, we have to tell Mup what kind of
55<A HREF="bars.html">bar line</A>
56to draw. The standard bar line is just called &quot;bar.&quot; So a complete
57description of the first measure would be:
58<BR><PRE>
591: 4e; 4d; 2c;
60bar
61</PRE><BR>
62</P>
63<P>
64To save typing, Mup allows a lot of shortcuts. One such shortcut is that
65it assumes that unless you tell it otherwise, each note in the measure is
66like the note before. You can leave out the second 4, because if you
67don't specify a time value, Mup will assume the note is the same length
68as the previous note.
69</P>
70<P>
71The same sort of idea works with pitches. The third measure of &quot;Three Blind
72Mice&quot; could be stated like this:
73<BR><PRE>
741: 4g;8f;;2e;
75bar
76</PRE><BR>
77<IMG SRC="mugex3.gif" ALT="Picture of Mup output"><BR>
78The third note has no information given at all in this example--there is
79only a semicolon. In this case, Mup will get both pitch and time value from
80the previous note, so the actual third note in this measure would be an
81eighth note with pitch F.
82</P>
83<P>
84You may have noticed that this example doesn't have spaces between chords.
85There are only a few places where the Mup language requires you to put spaces.
86However, you can always put some in other places to make things easier to read.
87</P>
88<H2>
89Parameters
90</H2>
91<P>
92Printed music contains a lot more than just notes and bar lines. Among other
93things, each staff normally begins with a clef, key signature, and time
94signature. Mup provides default values for these, which you can then
95override if you want something different. In the examples so far, we didn't
96override anything, so Mup would assume its default values, which are
97treble clef, a key signature with no sharps or flats, and a time signature
98of 4/4.
99</P>
100<P>
101There is a long
102<A HREF="param.html">list of "parameters" that can be set.</A>
103Things like clef
104and key signature are among them. Parameters can be changed with a line of the
105form:
106<BR><PRE>
107<I>parameter_name</I>=<I>value</I>
108</PRE><BR>
109For example, suppose we have a song written in 6/8 time in the key of D major.
110We can convey this information to Mup like this:
111<BR><PRE>
112score
113 time=6/8
114 key=2#
115
116music
117 1: 4d;8e;4f;8d;
118 bar
119</PRE><BR>
120<IMG SRC="mugex4.gif" ALT="Picture of Mup output"><BR>
121</P>
122<P>
123Note that in this example, the key was specified as two sharps.
124You can also specify the key by name:
125<BR><PRE>
126 key = d major
127</PRE><BR>
128</P>
129<P>
130These parameters give a very different sort of information than the notes of
131a measure, so they go in a separate section of the input file.
132Each section of the file describes information for a specific
133<A HREF="contexts.html">"context."</A>
134Information about musical notes is given in &quot;music&quot; context,
135while things that apply in general to the whole
136score are given in &quot;score&quot; context.
137Once you start a measure in music context, you have to complete that measure
138before switching to another context, but otherwise you can pretty much
139change from one context to another as necessary.
140Each new context section is headed by its name (e.g.,
141&quot;music&quot; or &quot;score&quot;).
142At the beginning of input, music context is assumed.
143</P>
144<P>
145Here is a more complicated example:
146<BR><PRE>
147score
148 staffs=2
149 key=3&amp;
150 time=2/4
151
152music
1531: ceg;;
1542: 2c;
155bar
156</PRE><BR>
157<IMG SRC="mugex5.gif" ALT="Picture of Mup output"><BR>
158This example starts by setting some parameters. First it states that this
159piece of music should be printed with two staffs, instead of the default of
160only one. Then it gives a key signature. Since there is no &quot;flat&quot; symbol
161on a standard computer keyboard, Mup uses the &quot;&amp;&quot; symbol for flat.
162The time signature is then set to 2/4.
163</P>
164<P>
165Next we find the keyword &quot;music,&quot; which indicates the end of parameters
166and the beginning of the music. Data is given for both staff 1 and staff 2.
167Staff 1 has two chords in the measure. The first is a C minor triad (it's
168minor since the key is three flats). No time value is specified for this
169chord. Since it is the very first chord of the piece, Mup cannot use the
170previous chord's time value, because there is no previous chord.
171In this case, Mup falls back to using the denominator (bottom number)
172of the time signature,
173so the chord is a quarter note. Incidentally, if Mup has to back up to
174previous notes to deduce pitch and/or time values, it only goes back as far
175as the beginning of the current measure. That means the default time value
176for the first chord of every measure in this piece would be quarter note.
177The second chord on staff 1 is the same as the first, since only a semicolon
178is specified.
179</P>
180<P>
181Staff 2 has only a single chord, consisting of a half note with pitch C.
182Mup checks to make sure the time values on each staff add up to the time
183signature--no more or less--and will print an error message if they don't.
184If you have something like a &quot;pickup&quot; measure, which doesn't add up to the
185time signature, you can specify &quot;space&quot; rather than a chord,
186to account for the rest of the time.
187</P>
188<P>
189Some parameters can be set on a per-staff basis as well as for the entire
190score. Mup also allows for
191<A HREF="param.html#vscheme">up to three independent voices on each staff,</A>
192and each voice can have parameters
193set that apply to only that voice. To get the
194value of a parameter, Mup always starts at the most specific place it could
195be defined and works toward the most general. In other words, it will first
196see if the parameter is set for the current voice. If not, it will see if
197it is set for the current staff. If not, it will use the value set for the
198entire score. Staff parameters are set in &quot;staff&quot; context, and voice parameters
199are set in &quot;voice&quot; context.
200As an example:
201<BR><PRE>
202score
203 staffs=3
204 key=1&amp;
205staff 2
206 key=2&amp;
207 clef=bass
208music
2091: 2f;a;
2102: 2c;f;
2113: 1f;
212bar
213</PRE><BR>
214<IMG SRC="mugex6.gif" ALT="Picture of Mup output"><BR>
215Staff 2 will have two flats, whereas the other staffs will have one flat.
216Staff 2 will use the bass clef, whereas the other staffs will use treble
217clef (since that is the default when none is specified).
218<A HREF="param.html">The complete list of Mup parameters</A>
219includes
220information about whether they can be set for an individual staff
221or voice, or just for the score as a whole.
222</P>
223<H2>
224Page headers and footers
225</H2>
226<P>
227Mup allows you to specify a
228<A HREF="headfoot.html">header and/or footer</A>
229to put on the first page,
230as well as a header and/or footer to use on subsequent pages. These can
231include a page number that will be incremented automatically as pages are
232printed. The headers and footers can be customized as you like, with
233different fonts and sizes of text and items centered or left or right
234justified. There is also a shortcut
235<A HREF="prnttext.html">"title" command</A>
236that can be used to create a canned format title. For example:
237<BR><PRE>
238title &quot;Three Blind Mice&quot;
239</PRE><BR>
240will create a centered title. You can also get left and right justified titles.
241</P>
242<H2>
243Lyrics
244</H2>
245<P>
246You can specify
247<A HREF="lyrics.html">lyrics</A>
248for as many verses as you like. They are specified
249somewhat like notes. As an example:
250<BR><PRE>
2511: 4e;d;2c;
252lyrics 1: 4;;2; &quot;Three blind mice,&quot;;
253bar
254</PRE><BR>
255<IMG SRC="mugex7.gif" ALT="Picture of Mup output"><BR>
256This example describes the lyrics to go with staff 1. There are three lyric
257syllables, having time values of quarter note, quarter note, and half note.
258The actual syllables are given inside the double quotes.
259Incidentally, since in this example the time values for the lyrics
260are the same as those of the notes, the time values don't actually need to
261be specified; if no lyrics time values are given, Mup assumes they
262match the note time values.
263</P>
264<H2>
265Miscellaneous
266</H2>
267<P>
268Mup provides a way to
269<A HREF="textmark.html">print arbitrary text</A>
270(like &quot;allegro&quot;) and
271<A HREF="mussym.html">musical symbols</A>
272(like a fermata). It can also print
273<A HREF="phrase.html">phrase marks,</A>
274<A HREF="pedal.html">piano pedal marks,</A>
275etc. The placement of these items is specified in terms
276of &quot;counts&quot; into the measure. For example:
277<BR><PRE>
278boldital below 1: 3 &quot;mf&quot;;
279</PRE><BR>
280<IMG SRC="mugex8.gif" ALT="Picture of Mup output"><BR>
281tells Mup to print &quot;mf&quot; in bold-italics below staff 1, at count 3 of the
282measure.
283You can also print
284<A HREF="chrdattr.html#withlist">marks associated with specific chords.</A>
285All of these facilities are described in detail in following sections.
286</P>
287<H2>
288Displaying, printing, and playing music
289</H2>
290<P>
291Once you have an input file, you can run Mup on it to get the printed
292version of the music. Entering:
293<BR><PRE>
294mup <I>myfile</I>
295</PRE><BR>
296from a command line prompt or selecting Run &gt; Display from Mupmate
297will cause Mup to read <I>myfile</I>, which should contain text in the Mup
298input language. If there are no errors in <I>myfile</I>, PostScript output
299will be produced, which can be displayed on the screen or printed via
300Mupmate or other programs. Mup can also produce
301<A HREF="midi.html">MIDI output,</A>
302which can then be played on your speakers.
303</P>
304<P>
305If you are using Ghostscript, but without Mupmate,
306two utility programs are included with Mup
307for
308<A HREF="utilpgms.html">displaying and printing music</A>
309using Ghostscript.
310These are described in more detail in the next section.
311</P>
312<HR><P>
313&nbsp;&nbsp;&nbsp;<A HREF="intro.html">&lt;-- previous page</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="running.html">next page --&gt;</A>
314</P>
315</BODY></HTML>