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