chiark / gitweb /
Merge branch 'arkkra' into shiny
[mup] / mup / docs / uguide / bars.html
1 <HTML>
2 <HEAD><TITLE>
3 Bar Lines
4 </TITLE></HEAD>
5 <BODY>
6 <P>
7 &nbsp;&nbsp;&nbsp;<A HREF="altinp.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="multirst.html">next page --&gt;</A>
10 </P>
11          
12 <H2>
13 Bar lines
14 </H2>
15 <P>
16 Each measure must be ended with a &quot;bar&quot; of some kind. There are several kinds:
17 <TABLE BORDER=4>
18 <TR>
19 <TD><B>Keyword</B></TD> <TD><B>Meaning</B></TD>
20 </TR>
21 <TR>
22 <TD>bar</TD>    <TD>ordinary bar line</TD>
23 </TR>
24 <TR>
25 <TD>dblbar</TD> <TD>double bar</TD>
26 </TR>
27 <TR>
28 <TD>repeatstart</TD>    <TD>beginning of repeated section</TD>
29 </TR>
30 <TR>
31 <TD>repeatboth</TD>     <TD>end of one repeated section and beginning of another</TD>
32 </TR>
33 <TR>
34 <TD>repeatend</TD>      <TD>end of repeated section</TD>
35 </TR>
36 <TR>
37 <TD>endbar</TD> <TD>heavy double bar line used at end of song</TD>
38 </TR>
39 <TR>
40 <TD>invisbar</TD>       <TD>no bar line printed</TD>
41 </TR>
42 <TR>
43 <TD>restart</TD>        <TD>end staffs and begin anew</TD>
44 </TR>
45 </TABLE>
46
47 </P>
48 <P>
49 In addition, the bar and dblbar types can be preceded
50 by the word &quot;dashed&quot; or &quot;dotted&quot; to produce dashed or dotted bar lines.
51 </P>
52 <P>
53 <BR><PRE>
54 1: mr;
55 bar
56 1: mr;
57 dblbar
58 1: mr;
59 dashed bar
60 1: mr;
61 dotted dblbar
62 1: mr;
63 repeatstart
64 1: mr;
65 repeatboth
66 1: mr;
67 repeatend
68 1: mr;
69 endbar
70 </PRE><BR>
71 <IMG SRC="mugex36.gif" ALT="Picture of Mup output"><BR>
72 </P>
73 <P>
74 When a repeatstart would end up at the end of a score,
75 it will automatically get moved to the beginning of the following score.
76 In that case, it isn't clear what kind of bar line you would like to
77 have put at the end of the original score. By default, Mup will use
78 an ordinary bar, but in some cases--like if the repeatstart begins
79 a new section, or there is also a key change--you might want to have
80 a dblbar instead. You can get a dblbar there by specifying dblbar in
81 parentheses before the repeatstart:
82 <BR><PRE>
83 (dblbar) repeatstart
84 </PRE><BR>
85 Actually, you are allowed to specify any bar type in the parentheses,
86 but dblbar or possibly invisbar are probably the only ones likely to be useful.
87 If the repeatstart ends up in the middle of a score, so that it doesn't
88 need to get moved to the beginning of the next score, the parenthesized
89 bar type is not needed, so it is just ignored.
90 </P>
91 <P>
92 Sometimes music is printed without bar lines. The &quot;invisbar&quot; can be used in
93 this case, to fulfill Mup's requirement to specify some sort of bar after
94 every measure without actually printing bar lines.
95 </P>
96 <P>
97 <A NAME="restart">The restart is a special kind of bar. It follows immediately after another</A>
98 bar line without any intervening music data. (That is, you can't have
99 any notes. You can use score or staff context things, like changing time or
100 key signature.) It would be most commonly used for something like a short coda.
101 <BR><PRE>
102 score
103         staffs=2
104         brace=1-2
105 staff 2
106         clef=bass
107 music
108
109 1-2: c;d;e;f;
110 rom above 1: 3 &quot;D.C. al Coda&quot;;
111 dblbar
112
113 // The restart follows a bar
114 // without any music data in between.
115 restart
116
117 rom above 1: 1 &quot;Coda&quot;;
118 1-2: f;e;d;c;
119 endbar
120 </PRE><BR>
121 <IMG SRC="mugex37.gif" ALT="Picture of Mup output"><BR>
122 </P>
123 <P>
124 There are several optional directives that can follow the bar line keyword.
125 They can be specified in any order and are described below.
126 </P>
127 <H3>
128 Bar line padding
129 </H3>
130 <P>
131 <A NAME="bpad">One optional directive is padding.</A>
132 It can be used to force Mup to place extra white space to
133 the left of the bar line. It is specified by the keyword &quot;pad&quot; followed
134 by a number of stepsizes of padding to add. For example:
135 <BR><PRE>
136 dblbar pad 3
137 </PRE><BR>
138 would add 3 stepsizes of padding.
139 </P>
140 <H3>
141 Bar line location tag
142 </H3>
143 <P>
144 <A NAME="btag">It is also possible to associate a</A>
145 <A HREF="tags.html">location tag</A>
146 with a bar line.
147 For example:
148 <BR><PRE>
149 // Associate tag &quot;_bar6&quot; with bar line
150 bar =_bar6
151
152 // Do double bar with an extra stepsize of
153 // padding, and associate tag &quot;q&quot;
154 // with the bar line
155 dblbar pad 1 =q
156 </PRE><BR>
157 </P>
158 <P>
159 The y coordinate of a bar line is not very useful. Special rules apply if
160 a bar line happens to be placed at the end of a score. Any locations taken
161 relative to the bar that would be to the right of the bar are treated as
162 if the bar line were at the beginning of the following score,
163 just beyond the clef and time and key signatures, if any.
164 </P>
165 <H3>
166 Endings
167 </H3>
168 <P>
169 <A NAME="endings">First and second endings, etc. can be designated at bar lines.</A>
170 This is done with the keyword &quot;ending,&quot; followed by a
171 quoted string to use as the label for the ending that should begin at the
172 bar line. An ending will span bars until either another ending is specified,
173 the piece ends, or the
174 special keyword &quot;endending&quot; is used. Examples:
175 <BR><PRE>
176 bar ending &quot;1.&quot;
177 repeatend ending &quot;2-3&quot;
178 endbar endending
179 </PRE><BR>
180 </P>
181 <P>
182 The ending label will always be
183 forced into 12 point times roman font. If you change font or size or include
184 special characters in the ending label,
185 the output is not likely to be aligned properly.
186 </P>
187 <P>
188 <A HREF="param.html#endingst">The "endingstyle" parameter</A>
189 controls where endings are placed.
190 Endings cannot start at or cross over a restart bar.
191 </P>
192 <H3>
193 Rehearsal marks
194 </H3>
195 <P>
196 <A NAME="reh">Rehearsal letters or numbers</A>
197 can be specified on any bar line. There are four formats:
198 <BR>
199 <B>rehearsal let</B>
200 <BR>
201 <B>rehearsal num</B>
202 <BR>
203 <B>rehearsal mnum</B>
204 <BR>
205 <B>rehearsal &quot;</B><I>label</I><B>&quot;</B>
206 </P>
207 <P>
208 In the first example, a rehearsal letter will be placed on the bar. The
209 first occurrence of this will become rehearsal &quot;A&quot;, the next &quot;B&quot;, and so
210 forth. The second format works in a similar fashion except that numbers are
211 used rather than letters. With the third format, the current measure
212 number is used. With the last format, any arbitrary string
213 within the quotes will be used. The keyword &quot;rehearsal&quot; can be
214 abbreviated to &quot;reh&quot; if you wish. Only one rehearsal mark is allowed on
215 any one bar, but the types can be mixed throughout the composition.
216 (Note that mixing &quot;num&quot; with &quot;mnum&quot; is likely to be very confusing, however.)
217 The rehearsal marks can be intermixed with other bar options:
218 <BR><PRE>
219 1: 1c;
220 dblbar reh num ending &quot;1&quot;
221 1: 1e;
222 repeatend pad 1 =_xyz reh let ending &quot;2.&quot;
223 1: 1g;
224 bar rehearsal &quot;Duet&quot;
225 1: 1ce;
226 endbar endending
227 </PRE><BR>
228 <IMG SRC="mugex38.gif" ALT="Picture of Mup output"><BR>
229 </P>
230 <P>
231 The rehearsal marks are normally put directly above the bar
232 line. However, if the bar line falls at the end of a score, the rehearsal
233 mark will be placed at the beginning of the following score, after the
234 <A HREF="param.html#clef">clef,</A>
235 <A HREF="param.html#key">key signature,</A>
236 and
237 <A HREF="param.html#time">time signature.</A>
238 <A HREF="param.html#endingst">The "endingstyle" parameter</A>
239 is used to determine which staffs get rehearsal marks.
240 <A HREF="param.html#rehstyle">The "rehstyle" parameter</A>
241 specifies whether to put rehearsal marks inside a box or a circle
242 or leave them plain.
243 </P>
244 <P>
245 The rehearsal keyword may be followed by a specification for <I>fontfamily</I>,
246 <I>font</I>, and/or <B>(</B><I>size</I><B>)</B>.
247 Once specified, these remain in effect
248 for any future rehearsal marks, until explictly changed. Some examples:
249 <BR><PRE>
250 bar rehearsal helvetica bold (14) let
251 repeatend reh newcentury num
252 invisbar reh rom (10) mnum
253 </PRE><BR>
254 </P>
255 <P>
256 After all the options listed above, you may specify &quot;dist <I>N</I>&quot; where
257 <I>N</I> is some number of stepsizes. This will override the
258 <A HREF="param.html#dist">dist parameter</A>
259 for determining how close to the staff to place the rehearsal mark.
260 If the number is followed by a &quot;!&quot; Mup will place the mark exactly
261 that far from the top of the staff, even if it overwrites other things;
262 otherwise the value specifies a minimum distance.
263 <BR><PRE>
264 rehearsal num dist 5     // at least 5 stepsizes away
265 reh bold &quot;A1&quot; dist 2 !   // exactly 2 stepsizes away
266 </PRE><BR>
267 </P>
268 <H3>
269 Setting the measure number
270 </H3>
271 <P>
272 <A NAME="setmnum">Mup keeps track of</A>
273 <A HREF="param.html#measnum">measure numbers</A>
274 automatically, but sometimes you may want
275 to override this to set the current measure number to some specific value.
276 This is done by adding mnum=<I>number</I> on a bar line,
277 which will set the current measure number to the given <I>number</I>.
278 <BR><PRE>
279 // Set the current measure number to 50
280 dblbar mnum=50
281 </PRE><BR>
282 </P>
283 <H3>
284 Setting rehearsal letter or number
285 </H3>
286 <P>
287 <A NAME="setreh">If you are using the "rehearsal let" or "rehearsal num" styles,</A>
288 you can set those to specific values too, similarly to how mnum can be set.
289 This might be useful, for example, if you have a single input file that
290 contains multiple songs or movements, and you want the rehearsal marks
291 to start over at the beginning of each song or movement.
292 </P>
293 <P>
294 The rehearsal number can be set on any bar line using num=<I>N</I>, where
295 <I>N</I> is a number, typically 1.
296 <BR><PRE>
297 bar num=1
298 </PRE><BR>
299 The rehearsal letter can be set in a similar way, using let=&quot;<I>X</I>&quot; where
300 <I>X</I> is either a single upper case letter, A to Z, or two upper case
301 letters, AA to ZZ.
302 <BR><PRE>
303 dblbar let=&quot;A&quot; reh let
304 </PRE><BR>
305 </P>
306 <H3>
307 Hiding time/key signature and clef changes
308 </H3>
309 <P>
310 <A NAME="hide">Generally in printed music, when a</A>
311 <A HREF="param.html#time">time signature</A>
312 <A HREF="param.html#key">or key signature</A>
313 change occurs at the beginning of a score, these changes are also printed at
314 the very end of the previous score,
315 to make it clear there is a change coming up.
316 Mup normally does this, but occasionally you may not want that behavior.
317 Sometimes you may want to make a new score appear like the beginning
318 of a new piece. If you wish to suppress the printing of time signature,
319 key signature, and clef
320 changes at the end of the preceding score,
321 you can use the &quot;hidechanges&quot;
322 keyword on the bar line at which the changes occur.
323 Hidechanges cannot be used on a restart bar.
324 <BR><PRE>
325 1: c;d;e;f;
326 bar
327 // change time/key with normal treatment
328
329 newscore
330 score time=5/4 ; key = 1&amp;
331 music
332 1: d;e;f;2g;
333 // don't show changes at end of previous score
334 bar hidechanges 
335
336 newscore
337
338 score time=6/4 ; key = 2#
339 music
340 1: d;e;f;2.g;
341 bar
342 </PRE><BR>
343 <IMG SRC="mugex39.gif" ALT="Picture of Mup output"><BR>
344 </P>
345 <HR><P>
346 &nbsp;&nbsp;&nbsp;<A HREF="altinp.html">&lt;-- previous page</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="multirst.html">next page --&gt;</A>
347 </P>
348 </BODY></HTML>