chiark / gitweb /
Import upstream version 5.3.
[mup] / mup / docs / uguide / gensyn.html
CommitLineData
69695f33
MW
1<HTML>
2<HEAD><TITLE>
3Mup General Syntax
4</TITLE></HEAD>
5<BODY>
6<P>
7&nbsp;&nbsp;&nbsp;<A HREF="utilpgms.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="contexts.html">next page --&gt;</A>
10</P>
11
12<H1>
13MUP FILE STRUCTURE
14</H1>
15<P>
16Mup files do not have to follow any naming convention,
17although on systems that use file name suffixes to associate a file
18with an application, it is traditional to use .mup for the suffix.
19It can also be useful to put a special &quot;magic string&quot;
20on the first line of Mup files.
21This magic string is completely optional, but having it there
22makes it easy for both people
23and programs to identify the file as Mup input.
24The standard recommended value for this string is:
25<BR><PRE>
26//!Mup-Arkkra
27</PRE><BR>
28with exactly that spacing and capitalization.
29If the file uses features of newer versions of Mup, and thus would
30not work with older versions, you can add a dash and
31the minimim version number the file requires, as in:
32<BR><PRE>
33//!Mup-Arkkra-5.3
34</PRE><BR>
35</P>
36<H2>
37Mup General Syntax
38</H2>
39<P>
40Any number of spaces and tabs can be put in
41almost anywhere except in the middle of a word.
42Each statement goes on a separate line.
43If for some reason you wish to split a statement onto several lines,
44each but the last must end with a &quot;\&quot; (backslash) character, to
45tell Mup to treat the next line as a continuation of the current line.
46Blank lines can be put between statements to make things easier to read.
47</P>
48<P>
49Comments begin with two slashes and continue to end of line. All comments
50will be totally ignored by Mup, and are for your own use to remind yourself
51of something. For example:
52<BR><PRE>
53// Note: in some early manuscripts, this chord had an accent
54</PRE><BR>
55</P>
56<P>
57Staffs are numbered from top to bottom, starting at staff 1.
58</P>
59<P>
60Several different units are used for distances. One is inches or
61centimeters. (There is a
62<A HREF="param.html#units">units parameter</A>
63that is used to select which you want to use.) Another
64is &quot;stepsizes.&quot; One stepsize is half the distance between two staff lines.
65In the horizontal dimension, &quot;counts&quot; are sometimes used. A &quot;count&quot;
66refers to the musical duration of a note with a duration of the denominator
67(bottom number) of the time signature.
68The actual distance on the page will vary depending
69on how Mup determines notes should be placed.
70When you use a
71<A HREF="param.html#time">time signature</A>
72with two or more fractions added together,
73as in 3/4 + 3/8, the &quot;count&quot; is the largest denominator, which would be
748 in the example just given.
75</P>
76<P>
77Upper and lower case letters are not interchangeable. Thus, for example,
78&quot;SCORE&quot; is not the same as &quot;score.&quot;
79</P>
80<P>
81Most lines of input end with a semicolon. There are some kinds of input that
82do not require an ending semicolon, but Mup will allow semicolons on those
83too, so that if you can't
84remember if a given command requires a semicolon or not, you can just use one
85anyway. For the examples in this User's Guide, semicolons are not used when
86they are not necessary.*
87<HR>
88* The commands on which the ending semicolon is optional are:
89<A HREF="bars.html">bar,</A>
90<A HREF="multirst.html">multirest,</A>
91<A HREF="param.html">setting of parameters,</A>
92<A HREF="prnttext.html">print, left, right, center, title,</A>
93<A HREF="newscore.html">newscore, newpage,</A>
94<A HREF="linecurv.html">line, and curve.</A>
95Semicolons are not allowed after commands that indicate entering a new
96<A HREF="contexts.html">context (header, footer, music, staff, grids, etc.).</A>
97A newline after those commands is optional,
98although often a good idea for readability.
99</P>
100<P>
101In
102<A HREF="music.html">music context,</A>
103newlines are required to separate commands: music data, bar lines, rolls,
104commands to print strings, dynamic marks, lyrics, etc. all must each
105end with a newline. In
106<A HREF="textmark.html#grids">grids context</A>
107and
108<A HREF="shaped.html#hdshape">headshape context,</A>
109each pair of strings must end with a newline.
110In other contexts, there are a few cases where newlines between commands
111are optional, although you may wish to use them anyway to improve readability.
112</P>
113<P>
114Mup supports
115<A HREF="macros.html">macros and conditionals (like 'if' and 'ifdef')</A>
116that can be placed anywhere in input, except in the middle of words,
117numbers, or strings; they needn't be on separate lines.
118</P>
119<P>
120In a number of statements, Mup expects a text string. All strings must be
121enclosed in double quotes. For example:
122<BR><PRE>
123&quot;This is a string.&quot;
124&quot;Allegro&quot;
125</PRE><BR>
126</P>
127<P>
128A string can contain any combination of letters, numbers, spaces,
129and punctuation.
130It can also contain various things that will cause printing of special music
131characters, change font and size, and so forth. Those things are covered in
132<A HREF="textstr.html">the chapter on text strings.</A>
133</P>
134<HR><P>
135&nbsp;&nbsp;&nbsp;<A HREF="utilpgms.html">&lt;-- previous page</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="contexts.html">next page --&gt;</A>
136</P>
137</BODY></HTML>