| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% basic def's -- taken from musixgen.mf % |
| 3 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4 |
|
| 5 |
pair pone, ptwo; |
| 6 |
transform t; |
| 7 |
path p; |
| 8 |
|
| 9 |
hlthick=.2pt; |
| 10 |
lthick=.4pt; |
| 11 |
|
| 12 |
pen line_pen, med_pen, coda_pen, thin_pen; |
| 13 |
med_pen:= pencircle scaled med; |
| 14 |
line_pen:= pencircle scaled lthick; |
| 15 |
coda_pen:= pencircle xscaled 1.25thick yscaled max(1,.75med); |
| 16 |
%thin_pen:= pencircle scaled max(1,.25pt); |
| 17 |
thin_pen:= pencircle scaled max(1,.4pt); |
| 18 |
|
| 19 |
apog_fact=.75; |
| 20 |
apog_nhw#=apog_fact*nhw#; |
| 21 |
|
| 22 |
picture save_pic, elem_pic; |
| 23 |
|
| 24 |
def savepic = save_pic:= currentpicture enddef; |
| 25 |
def save_elempic = elem_pic:= currentpicture enddef; |
| 26 |
def callpic = currentpicture:= save_pic enddef; |
| 27 |
|
| 28 |
def mirror (expr pone, ptwo) = |
| 29 |
currentpicture:=currentpicture reflectedabout(round(pone),round(ptwo)) |
| 30 |
enddef; |
| 31 |
|
| 32 |
def add_mirror (expr pone, ptwo) = |
| 33 |
addto currentpicture also currentpicture |
| 34 |
reflectedabout (round(pone), round(ptwo)) |
| 35 |
enddef; |
| 36 |
|
| 37 |
def call_mirror (expr pone, ptwo) = callpic; mirror (pone, ptwo) enddef; |
| 38 |
|
| 39 |
def add_shift (expr pone, ptwo) = |
| 40 |
addto currentpicture also currentpicture shifted (pone, ptwo) |
| 41 |
enddef; |
| 42 |
|
| 43 |
def call_add_shift (expr pone, ptwo) = |
| 44 |
callpic; add_shift (pone, ptwo) |
| 45 |
enddef; |
| 46 |
|
| 47 |
def add_elempic (expr pone, ptwo) = |
| 48 |
addto currentpicture also elem_pic shifted (pone, ptwo) |
| 49 |
enddef; |
| 50 |
|
| 51 |
def call_add_save_elempic (expr pone, ptwo) = |
| 52 |
callpic; add_elempic(pone, ptwo); savepic |
| 53 |
enddef; |
| 54 |
|
| 55 |
def shift_pic (expr pone, ptwo) = |
| 56 |
currentpicture:=currentpicture shifted (round(pone),round(ptwo)) |
| 57 |
enddef; |
| 58 |
|
| 59 |
def fill_circle (expr diameter, zshift) = |
| 60 |
fill fullcircle scaled diameter shifted zshift |
| 61 |
enddef; |
| 62 |
|
| 63 |
def fill_square (expr xwidth, ywidth, zshift) = |
| 64 |
fill unitsquare xscaled xwidth yscaled ywidth shifted zshift |
| 65 |
enddef; |
| 66 |
|
| 67 |
% |
| 68 |
|
| 69 |
def staff= |
| 70 |
for i=0 upto 4: |
| 71 |
pickup pencircle yscaled lthick; |
| 72 |
draw (-5nhw,i*nhh)--(5nhw,i*nhh); |
| 73 |
endfor |
| 74 |
enddef; |
| 75 |
|
| 76 |
def Staff= |
| 77 |
for i=0 upto 4: |
| 78 |
pickup pencircle yscaled lthick; |
| 79 |
draw (-5nhw,(i*nhh-.5nhh))--(5nhw,(i*nhh-.5nhh)); |
| 80 |
endfor |
| 81 |
enddef; |
| 82 |
|
| 83 |
def upstem= |
| 84 |
fill_square (lthick, 5nhh, (0,-5nhh)) |
| 85 |
enddef; |
| 86 |
|
| 87 |
def downstem= |
| 88 |
fill_square (lthick, 5nhh, (nhw-hlthick,0)) |
| 89 |
enddef; |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 94 |
% character definitions % |
| 95 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 96 |
|
| 97 |
% |
| 98 |
% so-called Miyoshi accent ...something like <> |
| 99 |
% (give me the true name of this!) |
| 100 |
% |
| 101 |
beginchar(30, 0, 2.25nhh#, 0); "upper Miyoshi accent"; |
| 102 |
pickup med_pen; |
| 103 |
draw (.15nhw, 1.9nhh)--(1.15nhw, 1.5nhh)--(.15nhw, 1.1nhh); |
| 104 |
add_mirror (origin, down); |
| 105 |
shift_pic (.5nhw, 0); |
| 106 |
savepic; |
| 107 |
endchar; |
| 108 |
|
| 109 |
beginchar(31, 0, 0, 2.25nhh#); "lower Miyoshi accent"; |
| 110 |
call_mirror (origin, right); |
| 111 |
endchar; |
| 112 |
|
| 113 |
% |
| 114 |
% size-balanced (a little large) sforzato |
| 115 |
% |
| 116 |
beginchar(20, 0, 2.25nhh#, 0); "upper sforzato (size-balanced)"; |
| 117 |
x1=-.05nhw; x2=.5nhw; x3=nhw-x1; x3=x4+.28nhw; x6=x1+med; |
| 118 |
y1=y6=y4=y3=nhh; y2=y1+1.4nhh; |
| 119 |
z5-z6=whatever*(z2-z1); |
| 120 |
z5-z4=whatever*(z2-z3); |
| 121 |
fill z1--z2--z3--z4--z5--z6--cycle; |
| 122 |
savepic; |
| 123 |
endchar; |
| 124 |
|
| 125 |
beginchar(21, 0, 0, 2.25nhh#); "lower sforzato (size-balanced)"; |
| 126 |
call_mirror (origin, right); |
| 127 |
endchar; |
| 128 |
|
| 129 |
% |
| 130 |
% coda with serif |
| 131 |
% |
| 132 |
beginchar(85, 0, 3.25nhh#, 0); "coda with serif"; |
| 133 |
mh:=3nhh; |
| 134 |
x2 = 2nhw-x4 = 1/6mh; y2 = y4 = 1/2mh; |
| 135 |
x3 = x5 = nhw; y3 = mh-y5 = 5/6mh; |
| 136 |
% pickup thin_pen; |
| 137 |
pickup thin_pen; |
| 138 |
draw (0,mh/2)--(2nhw,mh/2); |
| 139 |
draw (nhw-.3nhw,0 )--(nhw+.3nhw,0 ); |
| 140 |
draw (nhw-.3nhw,mh)--(nhw+.3nhw,mh); |
| 141 |
draw (nhw,0)--(nhw,mh); |
| 142 |
draw (0 ,mh/2-.3nhw)--(0 ,mh/2+.3nhw); |
| 143 |
draw (2nhw,mh/2-.3nhw)--(2nhw,mh/2+.3nhw); |
| 144 |
savepic; |
| 145 |
pickup coda_pen; |
| 146 |
draw z2..z3..z4..z5..cycle; |
| 147 |
shift_pic (-nhw, 0); |
| 148 |
labels (1,2,3,4); |
| 149 |
endchar; |
| 150 |
|
| 151 |
% |
| 152 |
% upright segno |
| 153 |
% |
| 154 |
beginchar(86, 0, 3.25nhh#, 0); "upright segno"; |
| 155 |
x1:= 0; y1:=0; |
| 156 |
x4:=-.69nhw; y4:=y1; |
| 157 |
x5:=.36nhw; y5:=.9nhh; |
| 158 |
x6:=-.28nhw; y6:=.97nhh; |
| 159 |
x7:=-x5; y7:=-y5; |
| 160 |
x8:=-x6; y8:=-y6; |
| 161 |
z1'= (x1+1,y1); |
| 162 |
penpos1'(.5nhh+blacker, 75); |
| 163 |
penpos6(max(1,thin), -45); |
| 164 |
penpos5(max(1,thin), -180); |
| 165 |
penpos8(max(1,thin), -45); |
| 166 |
penpos7(max(1,thin), -180); |
| 167 |
fill_circle (.45nhh, (x5-.15nhh, y5l-.12nhh)); |
| 168 |
fill_circle (.42nhh, (x4, y4)); |
| 169 |
% pickup thin_pen; |
| 170 |
pickup thin_pen; |
| 171 |
draw ( ( (x4-.2nhh)+(2x1-x5) )/2, y1-(y5l-y4)/2-.05nhh)--z1; |
| 172 |
addto currentpicture also currentpicture rotatedaround (z1, 180); |
| 173 |
penstroke z7e..{ne}z8e..z1'e{dir135}..{ne}z6e..z5e; |
| 174 |
% penlabels (1,4,5,6,7,8); |
| 175 |
shift_pic (.5nhw, 1.5nhh); |
| 176 |
endchar; |
| 177 |
|
| 178 |
% |
| 179 |
% V-shaped breath |
| 180 |
% |
| 181 |
beginchar(33, 0, 1.5nhh#, 0); "V-shaped breath (up)"; |
| 182 |
pickup thin_pen; |
| 183 |
draw (.1nhw, 1.5nhh)--(.5nhw, .05nhh); |
| 184 |
add_mirror ((.5nhw,0),(.5nhw,1)); |
| 185 |
savepic; |
| 186 |
endchar; |
| 187 |
beginchar(34, 0, 0, 1.5nhh#); "V-shaped breath (down)"; |
| 188 |
call_mirror (origin, right); |
| 189 |
endchar; |
| 190 |
|
| 191 |
|
| 192 |
%%%%%%% |
| 193 |
message ("<noteheads>"); |
| 194 |
%%%%%%% |
| 195 |
|
| 196 |
NHW=nhw+hlthick; |
| 197 |
|
| 198 |
beginchar(7, 0, .5nhh#, .5nhh#); "quarter note"; |
| 199 |
% makeshift, expedience |
| 200 |
corNHW=1.065*NHW; |
| 201 |
fill fullcircle xscaled corNHW yscaled 1.85h |
| 202 |
rotated 20 shifted (.5NHW, 0); |
| 203 |
endchar; |
| 204 |
|
| 205 |
beginchar(8, 0, .5nhh#, .5nhh#); "half note"; |
| 206 |
penpos1(max(1,2hlthick), 0); |
| 207 |
penpos3(max(1,2hlthick), 180); |
| 208 |
penpos2(thick,-90); |
| 209 |
penpos4(thick, 90); |
| 210 |
-x1l = .53NHW; |
| 211 |
x3l = .5NHW; |
| 212 |
x2 = x4 = y1 = y3 = 0; |
| 213 |
y2l =-y4l = h; |
| 214 |
penstroke (z1e{up}..z2e{right}..z3e{down}..z4e{left}..cycle) |
| 215 |
rotated 20 shifted (.5NHW, 0); |
| 216 |
endchar; |
| 217 |
|
| 218 |
beginchar(9, 0, .5nhh#, .5nhh#); "whole note"; |
| 219 |
x1= y1 = y3 = y5 = y7 = 0; |
| 220 |
x3= 2x2 = 2x4 = 2x6 = 2x8 = 5/4nhw; |
| 221 |
y2=-y4 = h; |
| 222 |
x5= x3-x7 = x1+.375nhw-blacker; |
| 223 |
y6=-y8 = y2-.1thin; |
| 224 |
fill z1{curl3}..z2..{curl3}z3{curl3}..z4..{curl3}cycle; |
| 225 |
unfill (z5..z6..z7..z8..cycle) rotatedaround ((x2,0), 45) shifted (.5,.5); |
| 226 |
%{{{ |
| 227 |
currentpen:= pencircle; |
| 228 |
draw rt z1{curl3}..bot z2..{curl3}lft z3{curl3}..top z4..{curl3}cycle; |
| 229 |
%}}} |
| 230 |
labels(range 1 thru 8); |
| 231 |
savepic; |
| 232 |
endchar; |
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
end. |