chiark / gitweb /
Merge branch 'arkkra' into shiny
[mup] / mup / docs / uguide / altinp.html
CommitLineData
69695f33
MW
1<HTML>
2<HEAD><TITLE>
3Chord-at-a-time input style
4</TITLE></HEAD>
5<BODY>
6<P>
7&nbsp;&nbsp;&nbsp;<A HREF="tuplets.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="bars.html">next page --&gt;</A>
10</P>
11
12<H2>
13Chord-at-a-time input style
14</H2>
15<P>
16There is an alternate input style, in which you enter music
17a chord at a time, rather than a voice at a time. In this style, the
18specification before the colon gives one or more patterns that tells
19how to map notes to staffs and voices.
20</P>
21<P>
22Suppose you want to print some
23music in a style which is common for many traditional hymns:
24it is to be printed on two staffs, each staff will always have
25exactly two notes, and the rhythm is exactly the same for all voices.
26With chord at a time input, you specify, for each note in a chord,
27which staff and voice to map that note. Since there are four notes in
28each chord, there will be four mappings listed. You want the bottom
29two notes to get mapped to staff 2, and the top two notes to staff 1.
30This is shown as
31<BR><PRE>
32// Bass to staff 2 voice 1
33// | Tenor to staff 2 voice 1
34// | | Alto to staff 1 voice 1
35// | | | Soprano to staff 1 voice 1
36[ 2 1; 2 1; 1 1; 1 1 ]
37</PRE><BR>
38Each item in the semicolon-separated list tells how to map one note.
39So the first note in each chord will get mapped to staff 2 voice 1.
40The second note in each chord will also get mapped to staff 2 voice 1.
41The third and fourth notes will get mapped to staff 1 voice 1.
42</P>
43<P>
44Since voice 1 is, as always, the default, this could be written more
45compactly as just:
46<BR><PRE>
47[ 2; 2; 1; 1 ]
48</PRE><BR>
49If you wanted to input notes from top to bottom instead
50(in soprano-alto-tenor-bass order, rather than bass-tenor-alto-soprano order),
51you could use:
52<BR><PRE>
53// Soprano
54// Alto
55// Tenor
56// Bass
57[ 1; 1; 2; 2 ]
58</PRE><BR>
59If you wanted to use two separate voices on each staff (going
60back to bottom-to-top order), you could specify:
61<BR><PRE>
62// Bass to staff 2 voice 2
63// | Tenor to staff 2 voice 1
64// | | Alto to staff 1 voice 2
65// | | | Soprano to staff 1 voice 1
66[ 2 2; 2 1; 1 2; 1 1 ]
67</PRE><BR>
68</P>
69<P>
70Now let's put these mappings with music data.
71<BR><PRE>
72score
73 staffs=2
74 vscheme=2f
75staff 2
76 clef=bass
77
78music
79
80[ 2; 2; 1; 1 ] : facf;dgfb;2cgec+;
81bar
82
83[ 1 1; 1 2; 2 1; 2 2 ] : fcaf;bfgd;2c+egc;
84bar
85</PRE><BR>
86<IMG SRC="mugex31.gif" ALT="Picture of Mup output"><BR>
87In the first measure, the first two notes listed in each chord are mapped
88to staff 2, voice 1, while the third and fourth notes listed in each chord
89are mapped to staff 1 voice 1. In the second measure, two voices are
90used and notes are entered in descending order. Note that each note takes
91on the correct default octave for whichever staff it is mapped to.
92</P>
93<P>
94It is also possible to use rests or spaces for some of the voices.
95<BR><PRE>
96score
97 key=3&amp;
98 vscheme=2f
99
100music
101
102[ 1 2; 1 1 ]: rb; eg; ca; gr;
103bar
104
105[ 1 2; 1 1 ]: er; sr; 8sf; se; 4sg;
106bar
107</PRE><BR>
108<IMG SRC="mugex32.gif" ALT="Picture of Mup output"><BR>
109</P>
110<P>
111Chord attributes and interchord attributes (like tie, slur, xnote,
112len, and alt) can be specified just like
113for voice-at-a-time input. Note attributes (like ? and ~) apply to
114the note wherever it gets mapped, and items that apply to the chord as
115a whole will be applied to all the notes.
116<BR><PRE>
117[1 2; 1 1] : [cue; xnote; len 6] b-e; [with &gt; ] ce&amp; slur; dg~; c?g;
118</PRE><BR>
119<IMG SRC="mugex33.gif" ALT="Picture of Mup output"><BR>
120</P>
121<P>
122It is possible to map a note to more than one place by using ranges,
123and/or by giving a list of staffs and voices,
124separated by ampersands. This may be useful,
125for example, if several voices are in unison.
126In the next example, the first note in each chord will be mapped to voice
1271 of staffs 1 through 3, as well as to voice 2 of staff 1, while the
128second note in each chord will be mapped to voice 2 of staffs 2 and 3.
129<BR><PRE>
130[ 1-3 1 &amp; 1 2; 2-3 2 ] : ec;fd;ge;af;
131</PRE><BR>
132<IMG SRC="mugex34.gif" ALT="Picture of Mup output"><BR>
133</P>
134<P>
135It is also possible to specify more than one bracketed mapping.
136Each must include a mapping for a different number of notes.
137So, for example, if some chords in a measure have two notes and
138others have three, you can define two maps: one for two notes,
139and one for three. The example below demonstrates placing alto
140and soprano as two voices on one staff, but sometimes the alto
141part splits.
142<BR><PRE>
143// For chords with two notes,
144// map the first to staff 1 voice 2 (alto),
145// and the second to staff 1 voice 1 (soprano).
146// For chords with three notes,
147// map the first two notes to staff 1 voice 2
148// (first and second alto part),
149// and the third to staff 1 voice 1 (soprano).
150[ 1 2; 1 1 ] [ 1 2; 1 2; 1 1 ]: cec+;df;eg;a-fc+;
151</PRE><BR>
152<IMG SRC="mugex35.gif" ALT="Picture of Mup output"><BR>
153If mappings of different chords need to vary by something other than
154the number of notes in the chord, then you will have to use
155the voice-at-a-time input style.
156</P>
157<P>
158Since the mapping specifications can get rather complex,
159and they may be used many times during a song,
160it is usually best to define
161<A HREF="macros.html">macros</A>
162for them, and possibly even put the macro definitions in
163<A HREF="include.html">an "include" file.</A>
164</P>
165<P>
166You can use the different input styles in different measures of a single
167song, and use different mappings in different measures.
168You can even mix the two input styles within a measure,
169but a given staff/voice
170can only appear on one line of input per measure. So, for example,
171you could choose to input staffs 1 and 2 of a song in chord-at-a-time
172input style, and staff 3 in voice-at-a-time style.
173</P>
174<HR><P>
175&nbsp;&nbsp;&nbsp;<A HREF="tuplets.html">&lt;-- previous page</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="bars.html">next page --&gt;</A>
176</P>
177</BODY></HTML>