<-- previous page Table of Contents Index next page -->

# MUP FILE STRUCTURE

Mup files do not have to follow any naming convention, although on systems that use file name suffixes to associate a file with an application, it is traditional to use .mup for the suffix. It can also be useful to put a special "magic string" on the first line of Mup files. This magic string is completely optional, but having it there makes it easy for both people and programs to identify the file as Mup input. The standard recommended value for this string is:

    //!Mup-Arkkra

with exactly that spacing and capitalization. If the file uses features of newer versions of Mup, and thus would not work with older versions, you can add a dash and the minimim version number the file requires, as in:

    //!Mup-Arkkra-5.5

## Mup General Syntax

Any number of spaces and tabs can be put in almost anywhere except in the middle of a word. Each statement goes on a separate line. If for some reason you wish to split a statement onto several lines, each but the last must end with a "\" (backslash) character, to tell Mup to treat the next line as a continuation of the current line. Blank lines can be put between statements to make things easier to read.

Comments begin with two slashes and continue to end of line. All comments will be totally ignored by Mup, and are for your own use to remind yourself of something. For example:

    // Note: in some early manuscripts, this chord had an accent

Staffs are numbered from top to bottom, starting at staff 1.

Several different units are used for distances. One is inches or centimeters. (There is a units parameter that is used to select which you want to use.) Another is "stepsizes." One stepsize is half the distance between two staff lines. In the horizontal dimension, "counts" are sometimes used. A "count" refers to the musical duration of a note with a duration of the denominator (bottom number) of the time signature. The actual distance on the page will vary depending on how Mup determines notes should be placed. When you use a time signature with two or more fractions added together, as in 3/4 + 3/8, the "count" is the largest denominator, which would be 8 in the example just given.

Upper and lower case letters are not interchangeable. Thus, for example, "SCORE" is not the same as "score."

Most lines of input end with a semicolon. There are some kinds of input that do not require an ending semicolon, but Mup will allow semicolons on those too, so that if you can't remember if a given command requires a semicolon or not, you can just use one anyway. For the examples in this User's Guide, semicolons are not used when they are not necessary.*

* The commands on which the ending semicolon is optional are: bar, multirest, setting of parameters, print, left, right, center, title, newscore, newpage, line, and curve. Semicolons are not allowed after commands that indicate entering a new context (header, footer, music, staff, grids, etc.). A newline after those commands is optional, although often a good idea for readability.

In music context, newlines are required to separate commands: music data, bar lines, rolls, commands to print strings, dynamic marks, lyrics, etc. all must each end with a newline. In grids context and headshape context, each pair of strings must end with a newline. In other contexts, there are a few cases where newlines between commands are optional, although you may wish to use them anyway to improve readability.

Mup supports macros and conditionals (like 'if' and 'ifdef') that can be placed anywhere in input, except in the middle of words, numbers, or strings; they needn't be on separate lines.

In a number of statements, Mup expects a text string. All strings must be enclosed in double quotes. For example:

    "This is a string."
    "Allegro"

A string can contain any combination of letters, numbers, spaces, and punctuation. It can also contain various things that will cause printing of special music characters, change font and size, and so forth. Those things are covered in the chapter on text strings.

<-- previous page Table of Contents Index next page -->