chiark / gitweb /
Import upstream version 5.3.
[mup] / mup / docs / uguide / linecurv.html
CommitLineData
69695f33
MW
1<HTML>
2<HEAD><TITLE>
3Lines and curves
4</TITLE></HEAD>
5<BODY>
6<P>
7&nbsp;&nbsp;&nbsp;<A HREF="prnttext.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="newscore.html">next page --&gt;</A>
10</P>
11
12<H2>
13Lines and curves
14</H2>
15<P>
16The &quot;line&quot; statement is used for drawing lines. Its format is:
17<BR><PRE>
18<I>linetype</I> <B>line (</B><I>X1, Y1</I><B>) to (</B><I>X2, Y2</I><B>)</B>
19</PRE><BR>
20The <I>linetype</I> can be &quot;wide,&quot; &quot;medium,&quot; &quot;wavy,&quot; &quot;dotted,&quot; &quot;dashed,&quot;
21or it can be omitted, which means narrow.
22The wavy line could be used for glissandos. It could also be used
23for manually drawing rolls and trills, although it should rarely if ever
24be necessary to resort to this, since the
25<A HREF="roll.html">roll</A>
26and
27<A HREF="mussym.html">mussym</A>
28statements will usually suffice and are much easier to use.
29Narrow, dashed, or dotted lines would typically be used for voice crossings.
30The medium line is about twice as wide as a
31narrow line, and a wide line is about twice as wide as a medium line.
32</P>
33<P>
34The X and Y coordinates are specified as was described
35in the section on
36<A HREF="tags.html">"Location tags."</A>
37<BR><PRE>
38score
39 vscheme=2f
40 staff2 clef=bass
41
42music
431 1: c+ =c;e =e;g;c+;
441 2: e =_e;g =_g;c =_c;s;
452 1: 2.s;4g =_gg;
462 2: 1ce;
47line (c.e + 2, c.y) to (e.w - 2, e.y)
48line (_e.e + 2, _e.y) to (_g.w - 2, _g.y)
49dashed line (_c.e + 1, _c.y) to (_gg.w - 1, _gg.y)
50bar
51</PRE><BR>
52<IMG SRC="mugex83.gif" ALT="Picture of Mup output"><BR>
53</P>
54<P>
55It is possible to print a text string by the line by adding
56<BR><PRE>
57<B>with </B><I>fontfamily font </I><B>(</B><I>size</I><B>) &quot;</B><I>string</I><B>&quot;</B>
58</PRE><BR>
59at the end of the &quot;line&quot; statement. Only the keyword &quot;with&quot; and the
60text string itself are required; the font and size information is optional.
61As usual, the
62<A HREF="param.html#fontfam">fontfamily,</A>
63<A HREF="param.html#font">font,</A>
64and
65<A HREF="param.html#size">size</A>
66parameter values are used to get values if the optional items are
67omitted. The most common usage for printing a string with a line is probably
68for glissandos.
69<BR><PRE>
701: 2d =n; g+ =m;
71wavy line (n.e + 1.5, n.y) to (m.w - 1.5, m.y) with ital (9) &quot;gliss.&quot;
72bar
73</PRE><BR>
74<IMG SRC="mugex84.gif" ALT="Picture of Mup output"><BR>
75</P>
76<P>
77Arbitrary curves can be drawn using the &quot;curve&quot; statement:
78<BR><PRE>
79<I>linetype</I> <B>curve (</B><I>X1,Y1</I><B>) to (</B><I>X2,Y2</I><B>) to (</B><I>X3,Y3</I><B>)</B> <I>...</I>
80</PRE><BR>
81When using this form of the &quot;curve&quot; statement,
82at least three coordinates must be specified; more are permitted.
83The <I>linetype</I> can be &quot;medium,&quot; &quot;wide,&quot; &quot;dashed,&quot;
84or &quot;dotted,&quot; or omitted.
85A curve will be drawn through the specified points in the specified order.
86<BR><PRE>
87score
88staffs=2
89
90staff 2
91 clef=bass
92
93music
941: 4.s;[=c] 8e; [=d] g; [=e] e;4s;
952: [=a] 8c;g; [=b] c+;4.s; [=f] 8c+; [=g] c;
96medium curve (a.x, a.n+1) to (b.x, b.n+15) to (c.x, c.n+4) \
97 to (d.x, d.n+3) to (e.x, e.n+3) \
98 to (f.x, f.n+11) to (g.x, g.n+1)
99bar
100</PRE><BR>
101<IMG SRC="mugex85.gif" ALT="Picture of Mup output"><BR>
102</P>
103<P>
104An alternative way to specify a curve is to only specify the two endpoints,
105along one or more &quot;bulge&quot; values, given in stepsizes.
106Suppose a single bulge value <I>n</I> is given. To find the midpoint of
107the resulting curve, imagine a line is drawn between the two endpoints,
108then from the midpoint of that line, move perpendicular to the line for
109<I>n</I> stepsizes.
110A positive <I>n</I> will cause the curve to bulge
111to the left as you move from the start point to the end point,
112while a negative <I>n</I> will make it bulge to the right.
113If two bulge values are given, bulges are calculated from the 1/3 and
1142/3 point of the line between the endpoints; with three points, at 1/4,
1151/2, and 3/4, and so forth. Multiple bulge values are separated by commas.
116<BR><PRE>
1171: c =_c1; f; f; d =_d1;
118medium curve (_c1.x, _c1.y + 8) to (_d1.x, _d1.y + 10) bulge 3
119bar
120
1211: g =_g1; e+; d+; a =_a1;
122dotted curve (_g1.x, _g1.y - 2) to (_a1.x, _a1.y - 2) bulge -4.3
123bar
124
1251: g =_g2; a; d+; c+ =_c2;
126curve (_g2.x, _g2.y - 2) to (_c2.x, _c2.y + 2) bulge -2.5, 4
127bar
128</PRE><BR>
129<IMG SRC="mugex86.gif" ALT="Picture of Mup output"><BR>
130</P>
131<HR><P>
132&nbsp;&nbsp;&nbsp;<A HREF="prnttext.html">&lt;-- previous page</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="newscore.html">next page --&gt;</A>
133</P>
134</BODY></HTML>