MUP BASICS

This section introduces the Mup language, giving some simple examples to give you the flavor of a Mup input file.

Notes and chords

Music is described one measure at a time. Each note is specified by its pitch value, "a" to "g." As an example, the first measure of "Three Blind Mice" can be described like this:

1:    4e; 4d; 2c;

Picture of Mup output
The "1:" at the beginning of the line tells Mup that we are describing the notes on staff number 1. In this very simple example, we only have one staff, but later we'll do songs with more than one. Each staff of each measure is normally put on a separate line.

The first three notes of "Three Blind Mice" are E, D, and C. For Mup input, these pitches are given in lower case to avoid having to use the shift key. No octave information was specified in this simple example, so Mup would use its default, which in this case would be the octave beginning with middle C.

The first two notes are quarter notes, and the last note is a half note. Time values of notes are given as shown in the example. A quarter note is marked by a 4, a half note by 2, a sixteenth note by a 16, etc.

A semicolon is used to separate chords. In this simple example, each chord has only a single note in it, but it is possible to have lots of notes in one chord.

At the end of each measure, we have to tell Mup what kind of bar line to draw. The standard bar line is just called "bar." So a complete description of the first measure would be:

1:    4e; 4d; 2c;
bar

To save typing, Mup allows a lot of shortcuts. One such shortcut is that it assumes that unless you tell it otherwise, each note in the measure is like the note before. You can leave out the second 4, because if you don't specify a time value, Mup will assume the note is the same length as the previous note.

The same sort of idea works with pitches. The third measure of "Three Blind Mice" could be stated like this:

1: 4g;8f;;2e;
bar

Picture of Mup output
The third note has no information given at all in this example--there is only a semicolon. In this case, Mup will get both pitch and time value from the previous note, so the actual third note in this measure would be an eighth note with pitch F.

You may have noticed that this example doesn't have spaces between chords. There are only a few places where the Mup language requires you to put spaces. However, you can always put some in other places to make things easier to read.

Parameters

Printed music contains a lot more than just notes and bar lines. Among other things, each staff normally begins with a clef, key signature, and time signature. Mup provides default values for these, which you can then override if you want something different. In the examples so far, we didn't override anything, so Mup would assume its default values, which are treble clef, a key signature with no sharps or flats, and a time signature of 4/4.

There is a long list of "parameters" that can be set. Things like clef and key signature are among them. Parameters can be changed with a line of the form:

parameter_name=value

For example, suppose we have a song written in 6/8 time in the key of D major. We can convey this information to Mup like this:
score
  time=6/8
  key=2#

music
  1: 4d;8e;4f;8d;
  bar

Picture of Mup output

These parameters give a very different sort of information than the notes of a measure, so they go in a separate section of the input file. Each section of the file describes information for a specific "context." Information about musical notes is given in "music" context, while things that apply in general to the whole score are given in "score" context. Once you start a measure in music context, you have to complete that measure before switching to another context, but otherwise you can pretty much change from one context to another as necessary. Each new context section is headed by its name (e.g., "music" or "score"). At the beginning of input, music context is assumed.

Here is a more complicated example:

score
	staffs=2
	key=3&
	time=2/4

music
1: ceg;;
2: 2c;
bar

Picture of Mup output
This example starts by setting some parameters. First it states that this piece of music should be printed with two staffs, instead of the default of only one. Then it gives a key signature. Since there is no "flat" symbol on a standard computer keyboard, Mup uses the "&" symbol for flat. The time signature is then set to 2/4.

Next we find the keyword "music," which indicates the end of parameters and the beginning of the music. Data is given for both staff 1 and staff 2. Staff 1 has two chords in the measure. The first is a C minor triad (it's minor since the key is three flats). No time value is specified for this chord. Since it is the very first chord of the piece, Mup cannot use the previous chord's time value, because there is no previous chord. In this case, Mup falls back to using the denominator (bottom number) of the time signature, so the chord is a quarter note. Incidentally, if Mup has to back up to previous notes to deduce pitch and/or time values, it only goes back as far as the beginning of the current measure. That means the default time value for the first chord of every measure in this piece would be quarter note. The second chord on staff 1 is the same as the first, since only a semicolon is specified.

Staff 2 has only a single chord, consisting of a half note with pitch C. Mup checks to make sure the time values on each staff add up to the time signature--no more or less--and will print an error message if they don't. If you have something like a "pickup" measure, which doesn't add up to the time signature, you can specify "space" rather than a chord, to account for the rest of the time.

Some parameters can be set on a per-staff basis as well as for the entire score. Mup also allows for up to three independent voices on each staff, and each voice can have parameters set that apply to only that voice. To get the value of a parameter, Mup always starts at the most specific place it could be defined and works toward the most general. In other words, it will first see if the parameter is set for the current voice. If not, it will see if it is set for the current staff. If not, it will use the value set for the entire score. Staff parameters are set in "staff" context, and voice parameters are set in "voice" context. As an example:

score
	staffs=3
	key=1&
staff 2
	key=2&
	clef=bass
music
1: 2f;a;
2: 2c;f;
3: 1f;
bar

Picture of Mup output
Staff 2 will have two flats, whereas the other staffs will have one flat. Staff 2 will use the bass clef, whereas the other staffs will use treble clef (since that is the default when none is specified). The complete list of Mup parameters includes information about whether they can be set for an individual staff or voice, or just for the score as a whole.

Page headers and footers

Mup allows you to specify a header and/or footer to put on the first page, as well as a header and/or footer to use on subsequent pages. These can include a page number that will be incremented automatically as pages are printed. The headers and footers can be customized as you like, with different fonts and sizes of text and items centered or left or right justified. There is also a shortcut "title" command that can be used to create a canned format title. For example:

title "Three Blind Mice"

will create a centered title. You can also get left and right justified titles.

Lyrics

You can specify lyrics for as many verses as you like. They are specified somewhat like notes. As an example:

1: 4e;d;2c;
lyrics 1: 4;;2; "Three blind mice,";
bar

Picture of Mup output
This example describes the lyrics to go with staff 1. There are three lyric syllables, having time values of quarter note, quarter note, and half note. The actual syllables are given inside the double quotes. Incidentally, since in this example the time values for the lyrics are the same as those of the notes, the time values don't actually need to be specified; if no lyrics time values are given, Mup assumes they match the note time values.

Miscellaneous

Mup provides a way to print arbitrary text (like "allegro") and musical symbols (like a fermata). It can also print phrase marks, piano pedal marks, etc. The placement of these items is specified in terms of "counts" into the measure. For example:

boldital below 1: 3 "mf";

Picture of Mup output
tells Mup to print "mf" in bold-italics below staff 1, at count 3 of the measure. You can also print marks associated with specific chords. All of these facilities are described in detail in following sections.

Printing or displaying music

Once you have an input file, you can run Mup on it to get the printed version of the music. Entering:

mup myfile

will cause Mup to read myfile, which should contain text in the Mup input language. If there are no errors in myfile, PostScript output will be produced, which can then be directed to any PostScript compatible printer or viewed on a screen via a program for displaying PostScript output.

If you are using Ghostscript, two utility programs are included with Mup for displaying and printing music using Ghostscript.


Mup User's Guide Table of Contents