chiark / gitweb /
Merge branch 'arkkra' into shiny
[mup] / mup / docs / sample.mup
1
2
3 //**********************************************************************
4 // NOTE:
5 //
6 // This is a sample Mup input file. This file is intended to demonstrate
7 // lots of the features of Mup, including advanced features.
8 // In most cases, you'll probably only need to use a few basic features,
9 // so your input file will usually be a lot simpler.
10 //
11 //**********************************************************************
12
13
14 // header to go on first page
15 header
16         title (18) "Sample Song to Show What Mup Can Do"
17         title palatino ital (12) "This is a subtitle"
18         title "Text: Ann Onymous"  "Tune: Arthur Unknown"
19         title ""  "(1995)"
20
21 // header for subsequent pages
22 header2
23         title "Sample Songs" "This is the title" "page \% of \#"
24
25 // footer for first page
26 footer
27         // use a printing command other than "title" to show how others work
28         center nl "This is a sample of a Mup footer"
29         // leave a blank line
30         title (12) " "
31
32         title (11) "Published by Arkkra Enterprises" \
33                 "P. O. Box 315 Warrenville, IL 60555" \
34                 "http://www.arkkra.com"
35
36 // footer for subsequent pages
37 footer2
38         print nl "This is a sample remark at the bottom of the page"
39
40 // top/top2/bottom/bottom2 are like header/header2/footer/footer2 except
41 // they can be changed later; for example, you could use header/header2 for
42 // the whole song, but have a new top/top2 for each section of the song.
43
44 // to be printed right below the header on this page (the first page)
45 top
46         title (13) "First Movement"
47 // to be printed right below the header2 on later pages
48 top2
49         title "First movement"
50
51 // set some score-wide parameters
52 score
53         staffs = 9
54         key = c minor
55         time = 9/8
56
57         // beam things a dotted quarter at a time, and beam across rests
58         // have the main beams group together notes a dotted quarter at a
59         // time, but have subgroupings an 8th note at a time; also, beam
60         // across rests
61         beamstyle = (8,8,8), (8,8,8), (8,8,8) r
62
63         // put bracket to left of top 2 staffs, and bottom 2, with labels
64         bracket = 1-2 ("Choir", "Ch"), 7-8 ("Guitar", "Gtr")
65
66         // put brace on keyboard's staffs
67         brace = 5-6 ("keyboard", "Kbd")
68
69         // bar the staffs 5 and 6 together, and 7 and 8 together
70         barstyle = 5-6, 7-8
71
72         // put rehearsal marks in circles, instead of the default rectangles
73         rehstyle = circled
74
75         // make a little smaller than normal
76         scale = 0.77
77
78         // pack notes together
79         packexp = 0.7
80         packfact = 0.75
81
82         // set the margins, allowing choice depending on whether -DBIGMARGINS
83         // is used on the command line or not
84         ifdef BIGMARGINS
85                 topmargin = 1.0
86                 bottommargin = 1.1
87                 leftmargin = 1
88                 rightmargin = 1
89         else
90                 topmargin = 0.8
91                 bottommargin = 0.8
92                 leftmargin = 0.7
93                 rightmargin = 0.6
94         endif
95
96         // make sure chord marks are a ways away from staffs
97         chorddist = 4
98
99         // make sure other things are a ways away too
100         dist = 3
101
102         // spread scores and staffs apart more than normal
103         scoresep = 14, 24
104         scorepad = 5
105         staffsep = 14
106         staffpad = 2
107
108         // label endings above staffs that are grouped by brace or bracket
109         endingstyle = grouped
110
111         // use palatino fonts by default, in 14 point
112         fontfamily = palatino
113         font = rom
114         size = 14
115
116         // put lyrics in helvetica italics, 11 point
117         lyricsfontfamily = helvetica
118         lyricsfont = ital
119         lyricssize = 11
120
121         // print measure numbers at the beginning of each score
122         // in Helvetica italics
123         measnumfontfamily = helvetica
124         measnumfont = ital
125         measnumsize = 9
126         measnum = y
127
128         // When there are chords, print guitar grids with them.  To put them
129         // at the end of the song we would use gridsatend.  If we wanted
130         // to make them bigger or smaller, we could set "gridscale".
131         gridswhereused = y
132
133         // If the lowest fret used is 3 or more, use "N fr" notation instead
134         // of showing the whole guitar neck up to that point in the grid.
135         // The default value of this is 4, and it can be turned off.
136         gridfret = 3
137
138
139 //set some things for particular staffs
140 staff 2
141         clef = bass
142
143 staff 3
144         label = "foghorn\nin G\(smflat)"
145         staffscale = 0.8        // make this staff a little smaller
146         clef = baritone
147         transpose = down dim 5
148         // make staff 3 visible only when there is something on it
149         visible = whereused
150
151         // set different default octave
152         defoct = 4
153
154 staff 4
155         // make staff 4 a 1-line staff, with a "drum clef"
156         stafflines = 1 drum
157
158 staff 5
159         // Use three voices on staff 5.  Allow the stems of the top and bottom
160         // voices (1 and 2) to float to whichever way is appropriate.  (We
161         // could use 2o to force their stems to be in opposite directions.)
162         // Voice 3 is an extra voice, typically in the middle, whose stems can
163         // go either way.
164         vscheme = 3f
165
166 staff 6
167         clef = bass
168
169         // use dotted quarter for default time unit instead of
170         // the normal time signature denominator
171         timeunit = 4.
172
173 staff 7
174         vscheme = 2f
175
176 staff 8
177         // Make staff 8 a tablature staff for standard guitar.  This
178         // automatically makes the preceding staff (7) a "tabnote" staff,
179         // meaning its notes will be derived from staff 8 automatically,
180         // unless overriden.
181         stafflines = tab
182
183         // make fret numbers more readable by putting a white background there
184         tabwhitebox = y
185
186         vscheme = 2f    // allow two voices on this tab staff
187
188 staff 9
189         // On staff 9, use "shaped notes".  Each scale degree uses a different
190         // shape of note head.
191         label = "Soprano"
192         noteheads = "isostri semicirc diam righttri norm rect pie"
193
194 // define a macro to allow saying "DRUM" instead of "4:" for the 4th staff
195 define DRUM 4:  @
196
197 grids
198         // define grids to be printed with guitar chords
199         "Cm"    "- (3 5 5 4 3)"
200         "G:9 7" "3 x o o o 5"
201         "Go7"   "o 1 2 o 2 o"
202         "G"     "3 x o o o 3"
203
204 // now do musical data
205 music
206
207 // put a tempo mark above staffs 1 and 6, and set MIDI tempo to 92
208 // quarter notes per minute
209         rom above 1,6 : 1 "Andante";
210         midi all: 0 "tempo = 92";
211 // set the instruments to use for MIDI
212         midi 1-2: 0 "channel=5"; 0 "program=52"; 0 "onvelocity=92";
213         midi 3: 0 "channel=6"; 0 "program=109"; 0 "onvelocity=61";
214         midi 4: 0 "channel=10";         // percussion channel
215 // set onvelocity to accent the top note
216         midi 5-6: 0 "channel=11"; 0 "program=1"; 0 "onvelocity=104,88";
217         midi 5 2: 0 "channel=11";
218         midi 7: 0 "channel=14"; 0 "program=25"; 0 "onvelocity=83";
219
220 // Note that lines of input within a given measure can be entered in any order.
221 // It is usually a good idea to enter music data a staff at a time from top
222 // to bottom, just to make it easy to keep track of, although Mup makes no
223 // such requirement. You may choose to intersperse other things like lyrics
224 // and phrase marks, or do them all at once before or after the music data,
225 // or in whatever order you choose. 
226
227 // Also note that you can indent things any way you want in your Mup
228 // input file, and can put extra blank spaces almost anywhere
229 // except in the middle of a word.
230
231 // For MIDI purposes, the first two measures get played an extra time
232 // before the Coda, so put them inside a macro.
233 define FIRST2MEASURES
234
235 // staff 1, three dotted quarter notes, second chord same as the first
236         1 1: 4.ceg;;dfb;
237
238 // staff 2, dotted quarter, two eighths with a rest between, dotted quarter
239         2: 4.c;8c;r;e;4.f;
240
241 // phrase on staff 2 from beginning note to first count of next measure
242         phrase 2: 1 til 1m+1;
243
244 // two verses of lyrics between top two staffs
245 // use "|" to align the first syllables 8 points left of the notes' centers
246         lyrics between 1&2: 4.;;; "-8|These are the"; "-8|This is verse";
247
248 // a grace note and an accent on staff 3
249         3: [grace; slash 1]c#; [with >] 2.f#;4.r;
250
251 // measure rest for staff 4
252         DRUM mr;
253
254 // staff 5, voice 1, begins with duplet, also has a tied note
255         5 1:  {4c+;g;}2,4.; 4.c+;4f+~;16;;
256
257 // second voice for staff 5
258         5 2: 2.c;4.d;
259
260 // third voice for staff 5 starts with a "space", nothing printed; force
261 // horizontal offsets (ho) on two of the notes to fine tune their spacing
262         5 3: 4.s; [ho 3.5]8e;f;g; [ho 3]an; 4;
263
264 // staff 6, some notes an octave or two away from the default octave
265         6: 4.c-c--;;d-d--;
266
267 // put piano pedal mark at the bottom
268         pedal below 6: 1;6;
269
270 // show the fret numbers on guitar strings on the tablature staff
271         8: 4. a3d1g0; 8 a3; e'3; a3; 4. d0g2b3e1;
272
273 // Print music theory analysis symbols at counts 1 and 7.  The ":" makes the
274 // following space-separated items be stacked on top of each other.
275         rom analysis above 5: 1 "i"; 7 "VII:6 #5";
276
277 // print figured bass numbers below count 7; the slash goes through the "5"
278         rom figbass below 6: 7 "6 5/";
279
280         9: 4.c+; 8e+; c+; e+; 4.f+;
281         lyrics 9: 2.+4.; "ah_";
282
283 // ordinary bar line, with a reherasal letter
284         bar reh let
285
286
287
288 // next measure
289         1: 2.c+gc;4.r;
290         2: 2.ce;4.r;
291
292 // lyrics with an underscore
293         // This time, since the time values of the lyrics match those
294         // of the music, we'll let Mup derive the time values,
295         // rather than specifying them.  Notice that we are chanting multiple
296         // syllables on the last word, so we show that they are to be treated
297         // as one syllable by separating them by a special \(space) character
298         // instead of simple space.
299         lyrics between 1&2: [1] "words!_"; [2] "two\(space)oh\(space)yes.";
300
301 // include a note with a double flat
302         3: 2.f&&;4.r;
303
304 // you can specify a pitch for a 1-line staff, even though all notes will be
305 // placed on the line. The pitch will be used for MIDI output, if you use
306 // the -m option to Mup to get a MIDI file instead of printed output.
307         DRUM 4.f&;2.r;
308
309 // because of the beamstyle setting, the 16th notes here are joined in pairs
310 // by both beams, but only one beam joins all six
311         5 1: 2.c++;4.r;
312         5 2: 8e;g;e; 16g;e;g;e;g;e; 4.r;
313         6: 2.c- alt 2;c;4.r;
314         pedal below 6: 1;6*;
315
316 // print 3 tremelo slashes on this chord
317         8: [slash 3] 2. d1g0b1e3; 4.r;
318
319         9: 2.e+; 4.r;
320
321 // at count 9.9 (almost the dblbar), back up 19 stepsizes and print this coda
322 // indication, including the actual coda symbol; do this in italics of font
323 // size 13 (but turn off the italics for the symbol), and above all the staffs
324         ital(13) all: 9.9[-19] "To coda \f(TR)\(coda)";
325
326         // double bar
327         dblbar
328 @       // end the macro definition of the first measures
329 // Now call the macro for the first measures
330         FIRST2MEASURES
331
332
333
334 // start a new score. Normally, Mup will place things
335 // as best it can, but you can force things if you like.
336 newscore
337
338 // now more music data
339 music
340
341
342         // set location tags on the two notes, then draw a wavy line between
343         // them saying that it is a glissando
344         1: 2.c =h; 4.g =k;
345                 wavy line (h.e+3, h.y) to (k.w-3, k.y) with ital (11) "gliss."
346         2: 4.e; 8..; 32f;8g;4.c;
347
348 // a crescendo mark
349         < below 2: 3 til 7.5;
350
351 // trill the foghorn from count 1 to 7; put a "turn" symbol above the note
352 // at count 8. For MIDI, specify exactly how to play it.
353         ifndef MIDI
354                 3: 2..d&; 4d;
355                 mussym 3: 1 "tr" til 7; 8 "turn";
356         else
357                 3: 16d&;e;d;e;d;e;d;e;d;e;d;e;d;e; {d;e;d;c;d;}5;
358         endif
359
360         4: [slash 2] 2.c; [with .]4.c-;
361         5: 4.ceg;;;
362
363 // a dynamic mark
364         times boldital between 5&6: 7 "ff";
365
366 // roll up on first chord, down on second, default (up) on third
367         roll up   5: 1;
368         roll down 5: 4;
369         roll      5: 7;
370
371 // the <> indicates a slur
372         6: 2.c e?;8e<>;4c;
373
374 // For the second note, "bend" the previous note up 1/2 step by stretching
375 // the E string.  Then bend to a full step, and release back to normal.
376         8 1: 4.e5; e "1/2"; 8e "full"; 4e "";
377
378 // Put some notes in the second tab voice.  These will be translated to the
379 // the second voice of the tabnote staff above.
380         8 2: 4.g0; 4; 8; 4.;
381
382         9: 8c+; b; an; g; c; d; 4.e;
383
384 // chord symbols will be transposed if the music is transposed.
385 // In this particular example, transposition is not in effect
386         bold chord above all: 1 "Cm";
387
388         bar ending "1."
389
390
391
392 // two measures of rest
393         multirest 2
394         repeatend ending "2."
395
396
397 staff 4
398 // From now on, staff 4 (the one-line staff) will have two voices with stems
399 // that are always opposing.  Set it so that the notes will not be on the line
400 // but rather above and below it.
401         vscheme = 2o
402         ontheline = n
403 music
404         midi 4 2: 0 "channel=10";
405
406 // Define a macro with parameters for printing a chord name at a given count.
407 // Note that the chord name is passed in and then the ` ` cause it to be
408 // put in quotes.
409 define K(COUNT, NAME) bold chord all: COUNT `NAME`; @
410
411 // Define a "map" for chord-at-a-time input.  (By "chord" here we mean a group
412 // of notes, not the symbolic chord name as above.)  Since all the voices in
413 // the choir have the same rhythm from now on, it's convenient to use this
414 // method of input instead of the usual voice-at-a-time method.  Set it up
415 // to enter bass and tenor on staff 2, then alto and soprano on staff 1.
416 define M [ 2; 2; 1; 1 ] @
417
418
419         K(1,Cm)         // print a C minor chord at count 1
420
421 // assign all the notes for staffs 1 and 2, using the map.  Each goes to its
422 // proper octave according to defoct.
423         M: 4.cgce; ceeg; cgce;
424
425 // Put phrase marks on each staff, from count 1 until count 7 of the next
426 // measure.  We didn't specify "above" or "below", so Mup chooses the side.
427         phrase 1,2: 1 til 1m+7;
428
429 // Increase the size of the lyrics by 3 points.  This will carry forward to
430 // the end of the song unless changed again.  Also, use the non-ASCII
431 // character n-tilde, indicated by \(n~).  If you can type non-ASCII characters
432 // directly on your keyboard, you can do that instead of using this notation.
433         lyrics between 1&2: "\s(+3)Ma-\(n~)a-na";
434
435 // put the last note's accidental in parentheses, since it is just a
436 // reminder to the player that this accidental is still in force
437         3: 4.an; b; a(n);
438
439 // Use X-shaped notes on the top voice.  Use the "..." to show that this
440 // applies for the rest of this measure, not just the first chord.
441         4 1: [xnote]... 4.; ; 8;;;
442         4 2: 4.; ; ;
443
444 // Beam notes together across both staffs.  Set a location tag (=h) on the
445 // first note, for later use.
446         5: 4.s bm with staff below; ; 8c; e; g ebm;
447         6: 8c- =h bm with staff above; e-; g-; c; e; g; 4.s ebm;
448
449         8: 2. a3 d5 g5 b4 e3; 4. tie;
450
451         // For the last two notes, override the head shape to be a slash, to
452         // indicate repeating the first part of the measure.
453         9: 8g; e; ; [hs "slash"]... 4.b; ;
454         bar endending
455
456
457
458         ital all: 1 "\[A special note, on\ntwo lines, in a box.\]";
459         1: 4.ce; eg; ;
460         lyrics between 1&2: "am gr\(o:)\(ss)t-en,";     // non-ACSII chars
461         2: 4.cg; ce; ;
462
463 // draw a measure repeat sign
464         3: mrpt;
465
466         // put a text string in an ellipse
467         ital 4: 1 "\{mute\}";
468         4 1: [xnote]... 4.; ; 8;;;
469         4 2: 2.; 4.;
470
471         6: 8 with e+c++ above; c+ with g+ above; g with e+ above; ec+; g; e; \
472                         4.c =k; // set loc tag "k"
473         8: 4. a3 d5 g5 b4 e3; 2.;
474         9: mrpt;
475         bar
476
477 // Draw a curve, with endpoints based on the "=h" and "=k" location tags with
478 // vertical offsets of 11 and 8 stepsizes upwards.  The curve bulges upwards
479 // 20 and 23 stepsizes 1/3 and 2/3 of the way through it.
480         medium curve (h.x, h.y + 11) to (k.x, k.y + 8) bulge 20, 23;
481
482
483 // print the chord G97, with the 9 above the 7
484         K(1,G:9 7)
485
486         ital(15) all: 9.9[-20] "D.C. al Coda";
487
488 // use a C double sharp (cx) and B natural
489         1: 4.cxbn; 2.;
490         lyrics between 1&2: "tr\(e`)s bien!";   // another non-ASCII character
491         2: 4.g-f; 2.;
492         4 1: 4.r; c; ;  // the pitch is arbitrary except for MIDI on one-line
493         4 2: 4.; r; ;
494         5: 4.dfgbn; ; dfan;
495
496 // force first note stem to point upwards, which would by default have
497 // pointed down; change clef in the middle of the measure
498         6: [up] 4.d; c; <<staff clef = treble>> d+;
499
500 // The first note is a "prebend" (stretch the string before plucking).  On the
501 // last note, do a slide upwards after it that doesn't end at any specific note.
502         8: 4. a10 "full" b8 "full"; 4. a10 "" b8 ""; [grace] 16 e0; 4.e1 <n/>;
503         9: 2.+4.g;
504         lyrics 9: "oo_";
505         dblbar
506
507 // For MIDI, insert the D.C. al Coda fragment
508         ifdef MIDI
509                 FIRST2MEASURES
510         endif
511
512 // leave a gap and start all the staffs anew, showing clefs and key signatures
513         restart
514
515 staff 6
516         clef = bass     // change the clef back to bass
517
518 music
519 // override the "dist" parameter, and specify a minimum distance of 5 stepsizes
520 // from the staff for this coda sign
521         mussym(13) all dist 5: 0.5 "coda";
522         ital(15) all: 1 "Coda";
523
524 // at count 1 print G diminished 7 (the "o" is translated to a diminished
525 // symbol), and at count 7 print G
526         K(1,Go7)
527         K(7,G)
528
529 // Another duplet.  If we put "n" after the first number it would prevent the
530 // bracket from being printed.
531         1: 2.d&g; { 4gbn; ; }2,4.;
532
533 // Draw parentheses around the one D natural.  Force this duplet's bracket to
534 // be below; this one would have defaulted to above.
535         2: 2.b&f&; { 4d-n(dn)g; dbn; } below 2,4.;
536
537 // Print both keyboard hands on its top staff, using two voices.  Since the
538 // top notes are so high, set their stems to extend only 5 stepsizes instead
539 // of the usual 7 (octave).  Slur and tie the notes, using dashed or dotted
540 // rather than solid curves.
541         5 1: [len 5]... 2.g++b++d&+++f&+++ dashed slur; 4.g++bn++d+++g+++;
542         5 2: 2.gg+ dotted tie; 4.;
543
544 // leave staff 6 unspecified, so that it will default to a space
545
546         8: [slash 1] 2. e'0 a1 d2 g0 b2 e0; 4. e'3 d0 g0 b0 e3;
547
548         9: 2.g; 4.bn;
549         lyrics 9: "At the";
550         bar
551
552
553
554 score
555 // set a time signature that combines two simple time signatures
556         time = 2/4 + 3/8
557
558 music
559 // use shorthand to enter the same data for two staffs at once
560         1,2:  2egc+ tie; 4.;
561
562         4 1,2: mr;      // measure rest on both voices of staff 4
563         5-6: 2c tie; 4.;
564
565 // mark notes an octave lower than normal
566         octave below 6: 1 "8va" til 7.5;
567
568 // put a fermata above staffs 1, 2, and 4 to 6
569         mussym above 1,2,4-6: 5 "ferm";
570 // for MIDI, slow the tempo, to produce the fermata
571         midi all: 3 "tempo=50";
572         8: 2 e20~; 4.;
573         9: 2+4.c+;
574         lyrics 9: "end.";
575         K(1,Cm)
576         endbar