chiark / gitweb /
Import upstream version 5.3.
[mup] / mup / docs / uguide / brackmac.html
CommitLineData
69695f33
MW
1<HTML>
2<HEAD><TITLE>
3Bracketing notes across staffs
4</TITLE></HEAD>
5<BODY>
6<P>
7&nbsp;&nbsp;&nbsp;<A HREF="manual.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="crossbar.html">next page --&gt;</A>
10</P>
11
12<H2>
13Bracketing notes across staffs
14</H2>
15<P>
16In keyboard music, sometimes a bracket is drawn to indicate that
17notes from two staffs are to be played
18with the same hand. The bracket is really just a vertical line with short
19horizontal lines at each end. But if you need to make lots of brackets,
20a macro with parameters can be very helpful.
21<BR><PRE>
22score
23 staffs=2
24
25staff 2
26 clef=bass
27 vscheme=2f
28
29// Define a macro to draw a bracket to show that notes on two
30// different staffs are to be played with the same hand.
31// The parameters are location tags for the top and bottom notes
32// to be included in the bracket.
33define BRACK(TOP, BOT)
34// Draw a short horizontal line 0.5 stepsizes above the top note
35line (TOP.w - 2, TOP.n + 0.5) to (TOP.w - 1, TOP.n + 0.5)
36// Draw a vertical line from 0.5 stepsizes above the top note
37// to 0.5 stepsizes below the bottom note.
38// Do all the 'x' coordinates relative to the same note (in
39// this case the top), so that if the top and bottom chord happen
40// to be different widths, the line will still be vertical.
41line (TOP.w - 2, TOP.n + 0.5) to (TOP.w - 2, BOT.s - 0.5)
42// Draw short horizontal line just below and left of the bottom note.
43line (TOP.w - 2, BOT.s - 0.5) to (TOP.w - 1, BOT.s - 0.5)
44@
45
46music
47
48// For each chord that is to get a bracket, add some padding to
49// make sure there is enough room, and set a location tag
50// on the top and bottom notes.
511: [pad 2] ce =a;[] df =b; [] d =c; [] ce =d;
522: [pad 2] g =e; [] a =f; [] af =g; [] g =h;
532 2: 2cc-; 4g-; cc-;
54// Now draw the brackets, using the tags as parameters
55BRACK (a, e)
56BRACK (b, f)
57BRACK (c, g)
58BRACK (d, h)
59bar
60</PRE><BR>
61<IMG SRC="mugex92.gif" ALT="Picture of Mup output"><BR>
62</P>
63<P>
64Note that Mup supports
65<A HREF="crossst.html">cross-staff stems, which is another way to notate a chord that is split</A>
66across two staffs, and may often be a better choice.
67</P>
68<HR><P>
69&nbsp;&nbsp;&nbsp;<A HREF="manual.html">&lt;-- previous page</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="crossbar.html">next page --&gt;</A>
70</P>
71</BODY></HTML>