Debian Codegraph @

texmf-dist/fonts/source/public/musixtex-fonts/musixgen.mf

raw
1 %
2 % This file is part of MusiXTeX
3 %
4 % MusiXTeX is free software; you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published by
6 % the Free Software Foundation; either version 2, or (at your option)
7 % any later version.
8 %
9 % MusiXTeX is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License for more details.
13 %
14 % You should have received a copy of the GNU General Public License
15 % along with MusiXTeX; see the file COPYING. If not, write to
16 % the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 % Boston, MA 02111-1307, USA.
18 %
19 % next changes: - redesigning accidentals
20 % - new accents
21 % - new gregorian symbols
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 % this is musixgen.mf (c)
24 %
25 % Version T.102 [February 2001]
26 % - alternate longa symbol ||O||
27 %
28 % Version T.70 [March 97]
29 % - double shap corrected by Julian Gilbey (strange paths)
30 %
31 % Version T.59 [September 96]
32 % - added one more gregorian symbol (126)
33 %
34 % Version T.40 [September 95]
35 % - corrected gregorianFclef (123)
36 %
37 % Version 0.37 [March 95]
38 % - introduced reverseAllabreve (122)
39 %
40 % Version 0.25 [December 94]
41 % - some new chars
42 % - added the beamfonts at pos x+128 to save memory
43 % - changed coda to be centered
44 % - changed the flags
45 % - changed the position of some chars to save time
46 %
47 % ... - trouble shooting, minor changes
48 %
49 % Version 0.99b[April 94]
50 % - added the new signs from Daniel Taupin
51 %
52 % Version 0.99 [February 94]
53 % -'bravely' changed the tfm informations to save memory
54 % - redesigned chars 14, 15, 35, 36, 53, 71, 72, 80, 81, 86, 93
55 % - removed * 'never used' chars 37-39, 55-57, 69-70,
56 % 77-79, 91-99, 101-119
57 % * (de)crescendi 16-23 -> now in musixlin
58 % - introduced some new chars 0-11, 16-23, 37-39, 57, 77-79,
59 % 99-117
60 % - changed the position of some chars to save memory
61 %%%%%%%%%%
62 % this was musicgen.mf
63 %
64 % Version 4.89 [September 93] Andreas Egler
65 % - blacker influence now
66 % - redesigned chars 71, 72, 53, 123
67 %
68 % Version 4.88 [January 93] Ross Mitchell
69 % - redesigned chars 63, 64, 65, 66
70 %
71 % Version 4.87 [] Daniel Taupin
72 %
73 % Version 2.00 [] Daniel Taupin
74 %
75 % Version 1.00 [August 86] Angelika Schofer/Andrea Steinbach
76 %
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78
79 % free positions: 125-127, 188-191, 252-255
80 % heights : 0, 0.5, 1, 1.5, 2.25, 3.25, 4, 4.75, 5.25
81 % depths : 0, 0.5, 1, 1.5, 2.25
82
83 %{{{ This always indicates a lowres fix to avoid seperated points
84 %}}} and/or 'invisible' lines. It doesn't affect higher resolutions !!
85
86 pair pone, ptwo;
87 transform t;
88 path p;
89
90 hlthick=.2pt;
91 lthick=.4pt;
92
93 pen line_pen, med_pen, coda_pen, thin_pen;
94 med_pen:= pencircle scaled med;
95 line_pen:= pencircle scaled lthick;
96 coda_pen:= pencircle xscaled 1.25thick yscaled max(1,.75med);
97 thin_pen:= pencircle scaled max(1,.25pt);
98
99 apog_fact=.75;
100 apog_nhw#=apog_fact*nhw#;
101
102 picture save_pic, elem_pic;
103
104 %%%%%%%%%%%%%%%
105 % basic def's %
106 %%%%%%%%%%%%%%%
107
108 def savepic = save_pic:= currentpicture enddef;
109 def save_elempic = elem_pic:= currentpicture enddef;
110 def callpic = currentpicture:= save_pic enddef;
111
112 def mirror (expr pone, ptwo) =
113 currentpicture:=currentpicture reflectedabout(round(pone),round(ptwo))
114 enddef;
115
116 def add_mirror (expr pone, ptwo) =
117 addto currentpicture also currentpicture
118 reflectedabout (round(pone), round(ptwo))
119 enddef;
120
121 def call_mirror (expr pone, ptwo) = callpic; mirror (pone, ptwo) enddef;
122
123 def add_shift (expr pone, ptwo) =
124 addto currentpicture also currentpicture shifted (pone, ptwo)
125 enddef;
126
127 def call_add_shift (expr pone, ptwo) =
128 callpic; add_shift (pone, ptwo)
129 enddef;
130
131 def add_elempic (expr pone, ptwo) =
132 addto currentpicture also elem_pic shifted (pone, ptwo)
133 enddef;
134
135 def call_add_save_elempic (expr pone, ptwo) =
136 callpic; add_elempic(pone, ptwo); savepic
137 enddef;
138
139 def shift_pic (expr pone, ptwo) =
140 currentpicture:=currentpicture shifted (round(pone),round(ptwo))
141 enddef;
142
143 def fill_circle (expr diameter, zshift) =
144 fill fullcircle scaled diameter shifted zshift
145 enddef;
146
147 def fill_square (expr xwidth, ywidth, zshift) =
148 fill unitsquare xscaled xwidth yscaled ywidth shifted zshift
149 enddef;
150
151 %
152
153 def staff=
154 for i=0 upto 4:
155 pickup pencircle yscaled lthick;
156 draw (-5nhw,i*nhh)--(5nhw,i*nhh);
157 endfor
158 enddef;
159
160 def Staff=
161 for i=0 upto 4:
162 pickup pencircle yscaled lthick;
163 draw (-5nhw,(i*nhh-.5nhh))--(5nhw,(i*nhh-.5nhh));
164 endfor
165 enddef;
166
167 def upstem=
168 fill_square (lthick, 5nhh, (0,-5nhh))
169 enddef;
170
171 def downstem=
172 fill_square (lthick, 5nhh, (nhw-hlthick,0))
173 enddef;
174
175 % eobasicdefs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176
177 %%%%%%%
178 message ("<dots & par's>");
179 %%%%%%%
180
181 beginchar(0, 0, 0, 0); "duration dot"; % correct 3=>0 DT
182 fill_circle (1/3nhh+blacker, (1.5nhw, 0));
183 save_elempic;
184 savepic;
185 endchar;
186
187 beginchar(1, 0, 0, 0); "double duration dot";
188 call_add_shift (.5nhw, 0);
189 savepic;
190 endchar;
191
192 beginchar(2, 0, 0, 0); "triple duration dot";
193 callpic;
194 add_elempic (nhw, 0);
195 endchar;
196
197 beginchar(3, 0, nhh#, nhh#); "left parenthesis"; % correct 0=>3 DT
198 x11=x13=-.1nhw; y12=0; x12=-.3nhw; y11=-y13=-.75nhh;
199 pickup med_pen;
200 draw z11..z12..z13;
201 savepic;
202 endchar;
203
204 beginchar(4, 0, nhh#, nhh#); "right parenthesis";
205 call_mirror ((.5nhw,0),(.5nhw,1));
206 endchar;
207
208 beginchar(5, 0, nhh#, nhh#); "cautionary parentheses";
209 callpic;
210 add_mirror ((.3nhw, 0),(.3nhw, 1));
211 endchar;
212
213 beginchar(6, 0, nhh#, nhh#); "cautionary wide parentheses";% -> bb
214 callpic;
215 add_mirror ((.55nhw, 0),(.55nhw, 1));
216 endchar;
217
218 %%%%%%%
219 message("<accents>");
220 %%%%%%%
221
222 beginchar(120, 0, 1.5nhh#, 0); "harmonics";
223 pickup thin_pen;
224 draw fullcircle scaled .5nhw shifted (.5nhw, nhh);
225 endchar;
226
227 %beginchar(XX, 0, 1.5nhh#, 0); "???";
228 % x1=0; x2=.5nhw; x3=nhw-x1; x3=x4+.25nhw; x6=x1+med;
229 % y1=y6=y4=y3=nhh; y2=y1+nhh;
230 % z5-z6=whatever*(z2-z1);
231 % z5-z4=whatever*(z2-z3);
232 % fill z1--z2--z3--z4--z5--z6--cycle;
233 % fill_circle (thick, ((x5,y1+.5thick)));
234 % savepic;
235 %endchar;
236
237 beginchar(20, 0, 2.25nhh#, 0); "upper sforzato";
238 x1=1/12nhw; x2=.5nhw; x3=nhw-x1; x3=x4+.25nhw; x6=x1+med;
239 y1=y6=y4=y3=nhh; y2=y1+nhh;
240 z5-z6=whatever*(z2-z1);
241 z5-z4=whatever*(z2-z3);
242 fill z1--z2--z3--z4--z5--z6--cycle;
243 savepic;
244 endchar;
245
246 beginchar(21, 0, 0, 2.25nhh#); "lower sforzato";
247 call_mirror (origin, right);
248 endchar;
249
250 beginchar(22, 0, nhh#, 0); "downbow";
251 fill_square (thin, nhh, (-thin, .4nhh));
252 fill_square (.5nhw+thin+1, .8beamht+thin, (-thin, nhh));
253 add_mirror ((.5nhw,0),(.5nhw,1));
254 endchar;
255
256 beginchar(23, 0, 1.5nhh#, 0); "upbow";
257 pickup med_pen;
258 draw (.15nhw, 1.7nhh)--(.5nhw, .2nhh);
259 add_mirror ((.5nhw,0),(.5nhw,1));
260 endchar;
261
262 beginchar(24, 0, nhh#, 0); "upper staccato";
263 fill_circle (.275nhw+blacker, (.5nhw, nhh));
264 savepic;
265 endchar;
266
267 beginchar(25, 0, 0, nhh#); "lower staccato";
268 call_mirror (origin, right);
269 endchar;
270
271 beginchar(18, 0, nhh#, 0); "upper tenuto/staccato";
272 fill_square (nhw, 1.25med, (0, 1.2nhh-.625med));
273 fill_circle (.275nhw+blacker, (.5nhw, .9nhh));
274 savepic;
275 endchar;
276
277 beginchar(19, 0, 0, nhh#); "lower tenuto/staccato";
278 call_mirror (origin, right);
279 endchar;
280
281 beginchar(26, 0, nhh#, 0); "upper portato (tenuto)";
282 fill_square (nhw, 1.25med, (0, nhh-.625med));
283 savepic;
284 endchar;
285
286 beginchar(27, 0, 0, nhh#); "lower portato (tenuto)";
287 call_mirror (origin, right);
288 endchar;
289
290 beginchar(28, 0, 1.5nhh#, 0); "upper staccatissimo";
291 rayon:= thin+.125nhh;
292 x1=x3=x2+rayon=x4-rayon=.5nhw;
293 y2=y4=y1-rayon=y3+.5nhh=1.15nhh;
294 fill z3--z4{up}..z1..{down}z2--cycle;
295 savepic;
296 endchar;
297
298 beginchar(29, 0, 0, 1.5nhh#); "lower staccatissimo";
299 call_mirror (origin, right);
300 endchar;
301
302 beginchar(30, 0, 2.25nhh#, 0); "upper marcato";
303 pickup med_pen;
304 draw (-.2nhw, 1.9nhh)--(1.2nhw, 1.5nhh)--(-.2nhw, 1.1nhh);
305 savepic;
306 endchar;
307
308 beginchar(31, 0, 0, 2.25nhh#); "lower marcato";
309 call_mirror (origin, right);
310 endchar;
311
312 %%%%%%%
313 message ("<noteheads>");
314 %%%%%%%
315
316 NHW=nhw+hlthick;
317
318 beginchar(7, 0, .5nhh#, .5nhh#); "quarter note";
319 % makeshift, expedience
320 if pixels_per_inch=600:
321 if NHW>50: corNHW=1.04*NHW; else: corNHW=1.04*NHW+1; fi
322 fill fullcircle xscaled corNHW yscaled 1.85h
323 rotated 20 shifted (.5NHW-.5, 0);
324 else:
325 corNHW=1.065*NHW;
326 fill fullcircle xscaled corNHW yscaled 1.85h
327 rotated 20 shifted (.5NHW, 0);
328 fi
329 endchar;
330
331 beginchar(8, 0, .5nhh#, .5nhh#); "half note";
332 penpos1(max(1,2hlthick), 0);
333 penpos3(max(1,2hlthick), 180);
334 penpos2(thick,-90);
335 penpos4(thick, 90);
336 -x1l = .53NHW;
337 x3l = .5NHW;
338 x2 = x4 = y1 = y3 = 0;
339 y2l =-y4l = h;
340 penstroke (z1e{up}..z2e{right}..z3e{down}..z4e{left}..cycle)
341 rotated 20 shifted (.5NHW, 0);
342 endchar;
343
344 beginchar(9, 0, .5nhh#, .5nhh#); "whole note";
345 x1= y1 = y3 = y5 = y7 = 0;
346 x3= 2x2 = 2x4 = 2x6 = 2x8 = 5/4nhw;
347 y2=-y4 = h;
348 x5= x3-x7 = x1+.375nhw-blacker;
349 y6=-y8 = y2-.1thin;
350 fill z1{curl3}..z2..{curl3}z3{curl3}..z4..{curl3}cycle;
351 unfill (z5..z6..z7..z8..cycle) rotatedaround ((x2,0), 45) shifted (.5,.5);
352 %{{{
353 currentpen:= pencircle;
354 draw rt z1{curl3}..bot z2..{curl3}lft z3{curl3}..top z4..{curl3}cycle;
355 %}}}
356 labels(range 1 thru 8);
357 savepic;
358 endchar;
359
360 beginchar(56, 0, .5nhh#, .5nhh#); "whole note with | --> |O|";
361 callpic;
362 fill_square (.6thick, nhh, (-.55thick,-.5nhh));
363 fill_square (.6thick, nhh, (5/4nhw-.05thick,-.5nhh));
364 endchar;
365
366 beginchar(127, 0, .5nhh#, .5nhh#); "whole note with || --> ||O||";
367 callpic;
368 fill_square (.6thick, nhh, (-.55thick,-.5nhh));
369 fill_square (.6thick, nhh, (5/4nhw-.05thick,-.5nhh));
370 fill_square (.6thick, nhh, (-1/4nhw-.55thick,-.5nhh));
371 fill_square (.6thick, nhh, (6/4nhw-.05thick,-.5nhh));
372 endchar;
373
374 beginchar(32, 0, .5nhh#, .5nhh#); "brevis";% 2 whole notes
375 fill_square (5/4nhw, .25nhh, (0,.25nhh));
376 add_mirror (origin, right);
377 x1=x2=0; x3=x4=5/4nhw; y1=-y2=y3=-y4=.7nhh;
378 pickup line_pen;
379 draw z1--z2; draw z3--z4;
380 savepic;
381 endchar;
382
383 beginchar(39, 0, .5nhh#, .5nhh#); "longa";% 4 whole notes
384 callpic;
385 pickup line_pen;
386 draw (5/4nhw,-.7nhh)--(5/4nhw,-1.7nhh);
387 endchar;
388
389 beginchar(36, 0, .5nhh#, .5nhh#); "maxima";% 8 whole notes
390 fill_square (5/2nhw, .3nhh, (0,.2nhh));
391 add_mirror (origin, right);
392 pickup line_pen;
393 draw (0,.7nhh)--(0,-.7nhh); draw (5/2nhw,.7nhh)--(5/2nhw,-1.7nhh);
394 endchar;
395
396 beginchar(37, 0, .5nhh#, .5nhh#); "filled diamond";% -> triangle
397 fill unitsquare scaled (.5*sqrt(2)*NHW) rotated -45;
398 endchar;
399
400 def square (expr mw)=
401 fill_square (sqrt(2)*.5mw, max(1,thin), origin) rotated -45;
402 fill_square (sqrt(2)*.5mw, .15nhw, (0,-.15nhw)) rotated 45;
403 save_elempic;
404 mirror (origin,up);
405 mirror (origin,left);
406 shift_pic (mw+.5,0);
407 add_elempic(0,0);
408 % mirror (origin,right);% I've seen this too, somewhere ...
409 enddef;
410
411 beginchar(38, 0, .5nhh#, .5nhh#); "unfilled diamond";% -> rimshot
412 square (NHW);
413 endchar;
414
415 beginchar(99, 0, .5nhh#, .5nhh#); "oldstyle quarter notehead up";
416 x1=x4=0; x2=x3=NHW; y1=y2=-y3=-y4=h-hlthick;
417 fill z1{dir-10}..z2--z3{dir-170}..z4--cycle;
418 savepic;
419 endchar;
420
421 beginchar(100, 0, .5nhh#, .5nhh#); "oldstyle quarter notehead down";
422 call_mirror(origin, right);
423 endchar;
424
425 beginchar(101, 0, .5nhh#, .5nhh#); "oldstyle half notehead up";
426 pthick:=.2nhh;
427 x1=0; x2=NHW; y1=y2=h-.5pthick+hlthick;
428 pickup penrazor scaled pthick rotated 90;
429 draw z1{dir-10}..z2;
430 add_shift (0, -nhh+pthick);
431 fill_square (lthick, nhh-hlthick, (0, -h+hlthick));
432 fill_square (lthick, nhh-hlthick, (nhw-hlthick, -h+hlthick));
433 savepic;
434 endchar;
435
436 beginchar(102, 0, .5nhh#, .5nhh#); "oldstyle half notehead down";
437 call_mirror(origin, right);
438 endchar;
439
440 beginchar(111, 0, .5nhh#, .5nhh#); "cross"; % -> closed hihat
441 x1=0; x2=nhw; y1=-.5nhw; y2=-y1;
442 pickup med_pen;
443 draw top rt z1--bot lft z2;
444 add_mirror((.5nhw,0),(.5nhw,1));
445 savepic;
446 endchar;
447
448 beginchar(112, 0, .5nhh#, .5nhh#); "halfcircled cross";% -> halfclosed hihat
449 callpic;
450 pickup thin_pen;
451 draw halfcircle scaled nhw shifted (.5nhw,0);
452 endchar;
453
454 beginchar(113, 0, .5nhh#, .5nhh#); "circled cross";% -> open hihat
455 callpic;
456 pickup thin_pen;
457 draw fullcircle scaled nhw shifted (.5nhw,0);
458 endchar;
459
460 def doublesharp (expr mw, xshift)=
461 x1=y2=x3=0; y1=x2=y4=.5mw; y3=.5mw-x4=.1mw;
462 z4'=.925[z3,z4]; z3'=.925[z4,z3]; % ***
463 penpos2(max(1,thin),45);
464 %%% a 'nicer' look for 'high'res-printers gives
465 if pixels_per_inch > 500:
466 fill z1..{dir-125}z3'{dir35}..{se}z2l--z2r--(z1+(eps,0))--cycle;
467 fill z1..{dir35}z4'{dir-125}..{se}z2r--z2l--(z1-(eps,0))--cycle; % ***
468 else :
469 %%% but this causes 'strange path' on lower resolutions
470 fill z1..{dir-110}z3'{dir30}..{se}z2l--z2r--(z1+(eps,0))--cycle;
471 fill z1..{dir20}z4'{dir-120}..{se}z2r--z2l--(z1-(eps,0))--cycle; % ***
472 fi
473 %{{{
474 currentpen:= pencircle; draw z1--(x2+1,y2-1);% draw (x3'+1,y3'+1)--z5';
475 %}}}
476 % add_mirror ((0,.5mw),(.5mw,0)); % ***
477 add_mirror ((.5mw,-.5mw),(.5mw,.5mw));
478 add_mirror (origin, right);
479 shift_pic (xshift, 0);
480 enddef;
481
482 beginchar(114, 0, .5nhh#, .5nhh#); "doublesharp notehead";% -> ride cymbal
483 doublesharp (.95nhw,0.025nhw);
484 savepic;
485 endchar;
486
487 beginchar(115,0, .5nhh#, .5nhh#);"circled doublesharp notehead";%->crash cymbal
488 callpic;
489 pickup thin_pen;
490 draw fullcircle scaled nhw shifted (.5nhw,0);
491 endchar;
492
493 beginchar(116, 0, .5nhh#, .5nhh#); "triangle";% -> rattle
494 x1=y1=y2=0; x2=2x3=nhw; y3=.8h;
495 pickup med_pen;
496 draw z1--z2--z3--z1;
497 endchar;
498
499 beginchar(117, 0, .5nhh#, .5nhh#); "bongo cross";
500 pickup med_pen;
501 draw (0,0)--(nhw,0);
502 draw (0.5nhw,-0.5nhw) -- (0.5nhw,0.5nhw);
503 endchar;
504
505 beginchar(118, 0, .5nhh#, .5nhh#); "rhombus";% -> shaker
506 x1=x4=y2=y4=0; y1=-y3=-h; x2=x3=NHW;
507 fill z1--z2--z3--z4--cycle;
508 endchar;
509
510 beginchar(95, 0, .5nhh#, .5nhh#); "gregorian square";
511 x1=x4=0; x2=x3=gregwidth; y1=y2=-y3=-y4=.5gregwidth-lthick;
512 fill z1{dir 15}..z2--z3{dir 165}..z4--cycle;
513 shift_pic(0,-hlthick);
514 savepic;
515 endchar;
516
517 beginchar(96, 0, .5nhh#, .5nhh#); "gregorian square left";
518 callpic;
519 fill_square (med, 1.5nhh,(0, -1.5nhh));
520 endchar;
521
522 beginchar(97, 0, .5nhh#, .5nhh#); "gregorian square right";
523 callpic;
524 fill_square (med, 1.5nhh,(gregwidth-med, -1.5nhh));
525 savepic;
526 endchar;
527
528 beginchar(124, 0, .5nhh#, .5nhh#); "porrectus";
529 x1=x4=0; x2=x3=2.5*gregwidth; y1=-y4=.5gregwidth-lthick; y2=y1-nhh; y3=y4-nhh;
530 fill z1..{right}z2--z3{left}..z4--cycle; shift_pic(0,hlthick);
531 fill_square (med, 1.5nhh,(0, -1.5nhh));
532 endchar;
533
534 beginchar(125, 0, .5nhh#, .5nhh#); "quilisma";
535 qdecalage:=.12*gregwidth;
536 x1=x4=-0.2*gregwidth; x2=x3=1.2*gregwidth;
537 y1+qdecalage=y2-qdecalage=.5gregwidth-lthick;y1=-y3; y2=-y4;
538 fill z1--z2--z3--z4--cycle;
539 pickup med_pen;
540
541 draw z4--(z1+0.4*(z1-z4));
542 draw (0.667z4+0.333z3)--((0.667z1+0.333z2)+0.4*(z1-z4));
543 draw (0.333z4+0.667z3)--((0.333z1+0.667z2)+0.4*(z1-z4));
544 draw z3--(z2+0.4*(z1-z4));
545 shift_pic(0,-hlthick);
546 endchar;
547
548 beginchar(126, 0, .5nhh#, .5nhh#); "mirrored gregorian square";
549 x1=x4=0; x2=x3=gregwidth; y1=y2=-y3=-y4=-.5gregwidth+lthick;
550 fill z1{dir -15}..z2--z3{dir -165}..z4--cycle;
551 shift_pic(0,+hlthick);
552 endchar;
553
554
555
556 %%%%%%%
557 message ("<flags>");
558 %%%%%%%
559
560 flagw:=.8nhw;
561 flagthick:=nhh;
562 flagthin:=5thinwidth;
563
564 def flagshape
565 (expr contflag, width, height, flgthick, flgthin, shifty, flagsense) =
566 penpos1(flgthick+blacker, 90); % .1
567 penpos2(3.25flgthin+blacker, 70);%
568 x1 = 0; % .2
569 y1 = height+shifty-.5flgthick; %
570 x2 = 3/8width; % .3
571 y2 = y1-.45flgthick; %
572 x3 = width-flgthin/2; % .4(.4)
573 y3 = y1-1.5flgthick;
574
575 if contflag=1: x4 = x3-.4width; y4 = shifty;
576 else: x4 = x3; y4 = 2.5flagthick-2flgthick; fi
577 if flagsense>0: penpos3(1.15flgthin, 35);
578 else: penpos3(.8flgthin, 0); fi
579
580 penstroke z1e..z2e..z3e{down}..z4;
581 %{{{
582 currentpen:= pencircle; draw lft z1..z2..z3{down}..z4;
583 %}}}
584 penlabels(1,2,3,4)
585 enddef;
586
587 def mirror_flag(expr sense)= if sense<0: mirror((0,h/2),(1,h/2));fi enddef;
588
589 def cflag (expr sense) =
590 flagshape(1, flagw, 3nhh, flagthick, flagthin, 0, sense);
591 mirror_flag(sense);
592 savepic;
593 enddef;
594
595 def ccflag (expr sense) =
596 flagshape(5, flagw, 2.25nhh, 2/3flagthick, flagthin, flagthick, sense);
597 save_elempic;
598 clearxy;
599 flagshape(1, flagw, 2.5nhh, 2/3flagthick, flagthin, 0, sense);
600 savepic;
601 mirror_flag(sense);
602 enddef;
603
604 def addflag (expr sense, shifty) =
605 call_add_save_elempic (0, shifty*.75flagthick);
606 mirror_flag(sense);
607 enddef;
608
609 def cccflag (expr sense) = addflag(sense, 1) enddef;
610 def ccccflag (expr sense) = addflag(sense, 2) enddef;
611 def cccccflag (expr sense) = addflag(sense, 3) enddef;
612
613 beginchar(40, 0, 3.25nhh#, 0); "8th flag up";
614 cflag(1);
615 shift_pic (0, .5nhh+.5);
616 endchar;
617
618 beginchar(12, 0, 3.25nhh#, 0); "acciacaturra stem up";
619 callpic;
620 pickup med_pen;
621 x1=-.25nhw; y1=.2h; x2=1.1nhw; y2=y1+.6(x2-x1);
622 draw z1--z2;
623 shift_pic (0, .5nhh+.5);
624 endchar;
625
626 beginchar(41, 0, 3.25nhh#, 0); "16th flag up";
627 ccflag(1);
628 shift_pic (0, .25nhh);
629 endchar;
630
631 beginchar(42, 0, 4nhh#, 0); "32th flag up";
632 cccflag(1);
633 shift_pic (0, .25nhh);
634 endchar;
635
636 beginchar(43, 0, 4.75nhh#, 0); "64th flag up";
637 ccccflag(1);
638 shift_pic (0, .25nhh);
639 endchar;
640
641 beginchar(44, 0, 5.5nhh#, 0); "128th flag up";
642 cccccflag(1);
643 shift_pic (0, .25nhh);
644 endchar;
645
646 %%%
647 % flags up should be wider
648 %%%
649 flagw:=nhw;
650
651 beginchar(45, 0, 3.25nhh#, 0); "8th flag down";
652 cflag(-1);
653 shift_pic (0,-.5nhh-.5);
654 endchar;
655
656 beginchar(13, 0, 3.25nhh#, 0); "acciacaturra stem down";
657 callpic;
658 pickup med_pen;
659 x1=-.25nhw; y1=1.6nhh; x2=1.2nhw; y2=y1+.6(x2-x1);
660 draw z1--z2;
661 shift_pic (0,-.5nhh-.5);
662 endchar;
663
664 beginchar(46, 0, 3.25nhh#, 0); "16th flag down";
665 ccflag(-1);
666 shift_pic (0,-.25nhh);
667 endchar;
668
669 beginchar(47, 0, 4nhh#, 0); "32th flag down";
670 cccflag(-1);
671 shift_pic (0,-.25nhh);
672 endchar;
673
674 beginchar(48, 0, 4.75nhh#, 0); "64th flag down";
675 ccccflag(-1);
676 shift_pic (0,-.25nhh);
677 endchar;
678
679 beginchar(49, 0, 5.5nhh#, 0); "128th flag down";
680 cccccflag(-1);
681 shift_pic (0,-.25nhh);
682 endchar;
683
684 %%%%%%%
685 message("<accidentals>");
686 %%%%%%%
687
688 def flat (expr reduction, shiftx, flatsense) =
689 fthick:= reduction*thick;
690 penpos4(4/3fthick,0); % 1
691 penpos3(1/2fthick,-90); %
692 penpos6(4/7fthick,90); % 6
693 x1 = x2 = x3 = x5 = fthick; % / \
694 y1 = 6fthick; y2 = .5y4; % 2 4
695 y3l=-2fthick; y5 = y3r; % /
696 x4 = 3.6fthick; y4 = .1fthick; % 3,5
697 y6r= 2fthick; x6 = .5(x2+x4);
698 t:= identity shifted (round(shiftx),0);
699 p:= (z1--z5) transformed t;
700 pickup penrazor scaled max(1,(2sind40*thin)) rotated 40;
701 draw p;
702 penstroke (z2..{right}z6e..z4e{sw+down}..{sw}z3e) transformed t;
703 if flatsense<0: mirror (z5 transformed t, z1 transformed t); fi
704 penlabels (1,2,3,4,5,6)
705 enddef;
706
707 beginchar(50, nhw#, 1.5nhh#, .5nhh#); "flat";
708 flat (1, 0, 1);
709 savepic;
710 endchar;
711
712 beginchar(51, 1.7nhw#, 1.5nhh#, .5nhh#); "doubleflat";
713 call_add_shift (.7nhw, 0);
714 endchar;
715
716 def sharp (expr reduction, zshift) =
717 sthick:= .5reduction*thick;
718 nx:= reduction*1.5nhh;
719 ny:= reduction*.8nhw;
720 y1 =-y7= nx-1.5sthick; y2 =-y8 = .5sthick-nx;
721 x1 = x2 = y3 = -y6 = ny-x7 = ny-x8 = 2sthick;
722 y4 =-y5 = y3 + 3sthick;
723 x3 = x5 = 0; x4 = x6 = ny;
724 pickup penrazor scaled max(1,thin) rotated angle(z4-z3);
725 draw z1--z2; draw z8--z7;
726 pickup penrazor scaled 3sthick rotated 90;
727 draw z3--z4; draw z5--z6;
728 shift_pic (zshift, 0);
729 labels (range 1 thru 8)
730 enddef;
731
732 beginchar(52, nhw#, 1.5nhh#, 1.5nhh#); "sharp";
733 sharp (1, 0);
734 endchar;
735
736 beginchar(53, nhw#, .5nhh#, .5nhh#); "doublesharp";
737 doublesharp (w, -.1nhw);
738 endchar;
739
740 def natural (expr reduction, zshift) =
741 ny:= .8nhw*reduction;
742 nthick:= 3/4reduction*thick;
743 x1 = x2 = x3 = nthick+.5thin;
744 x5 = x6 = x4 = ny-x1;
745 y1 = -y6 = 1.5nhh*reduction;
746 y2 = -y5 = 1.6nthick;
747 y4 = -y3 = y2+4/3nthick;
748 pickup penrazor scaled max(1,thin) rotated angle(z4-z2);
749 draw lft z1--bot lft(x3,y3-nthick);
750 draw top rt(x4,y4+nthick)--rt z6;
751 pickup penrazor scaled 2nthick rotated 90;
752 draw (x2-.5,y2)--(x4+.5,y4);
753 draw (x3-.5,y3)--(x5+.5,y5);
754 shift_pic (zshift, 0);
755 labels(1,2,3,4,5,6)
756 enddef;
757
758 beginchar(54, nhw#, 1.5nhh#, 1.5nhh#); "natural";
759 natural (1, 0);
760 endchar;
761
762 beginchar(90, apog_nhw#, nhh#, .5nhh#); "small flat";
763 flat (apog_fact, -.05nhw, 1);
764 savepic;
765 endchar;
766
767 beginchar(91, 1.65apog_nhw#, nhh#, .5nhh#); "small doubleflat";
768 call_add_shift (.7apog_fact*nhw,0);
769 endchar;
770
771 beginchar(92, apog_nhw#, nhh#, nhh#); "small sharp";
772 sharp (apog_fact, 0);
773 endchar;
774
775 beginchar(93, apog_nhw#, .5nhh#, .5nhh#); "small doublesharp";
776 doublesharp (w, -.075nhw);
777 endchar;
778
779 beginchar(94, apog_nhw#, nhh#, nhh#); "small natural";
780 natural (apog_fact, 0);
781 endchar;
782
783 %%%%%%%
784 message ("<rests>");
785 %%%%%%%
786
787 beginchar(59, .5nhw#, 0, 0); "ddp";% doubledouble (4) pause
788 fill_square (.5nhw, 2nhh, (0, nhh));
789 endchar;
790
791 beginchar(58, .5nhw#, 0, 0); "dp";% double (2) pause
792 fill_square (.5nhw, nhh, (0, 2nhh));
793 savepic;
794 endchar;
795
796 beginchar(60, 5/4nhw#, .5nhh#, 0); "half rest";
797 fill_square (5/4nhw, .5nhh, (0, 0));
798 savepic;
799 endchar;
800
801 beginchar(10, 0, .5nhh#, 0); "half rest outside a staff";
802 callpic;
803 fill_square (2nhw, lthick, (-.375nhw, -hlthick));
804 savepic;
805 endchar;
806
807 beginchar(11, 0, 0, .5nhh#); "full rest outside a staff";
808 call_mirror(origin,right);
809 endchar;
810
811 beginchar(61, 5/4nhw#, 0, .5nhh#); "full rest";
812 fill_square (5/4nhw, .5nhh, (0, -.5nhh));
813 endchar;
814
815 beginchar(62, 0, 4nhh#, 0); "quarter rest";
816 rthin:= 1/8 nhh; % .1
817 rthick:= 2 thick+rthin; % .2
818 alpha:= -50; % .3
819 penpos1(rthin, 90+alpha); % .4
820 penpos5(rthin, alpha); % .5,10
821 penpos2(rthick, alpha); % .6
822 penpos4(rthick, alpha); %
823 penpos3(3/4rthick, alpha); % .7
824 penpos6(4/3thick, alpha);
825 penpos7(rthin, 45);
826 y1l = 4nhh - 1/2nhh;
827 x1l = 1/2nhh;
828 z2r = z1 +(nhh* right) rotated alpha;
829 z3 = 1/2[z2,z4];
830 z4 = (nhw,4nhh) scaled .55;
831 z5 = z4l+(nhh* right) rotated alpha;
832 x6l = x4l; y6r = 1.45nhh;
833 x7 = .9nhw; y7= nhh-1/8nhh;
834 z10 = z5r shifted (sqrt(2)*rthin/4,sqrt(2)*rthin/4);
835
836 pickup penrazor scaled rthin rotated 45;
837 draw z1--z2r; draw z4l--z10;
838 penstroke z2e..z3e..z4e;
839 penstroke z5e..z6e..z7e;
840 penlabels(1,2,3,4,5,6,7,10);
841 shift_pic (-.2nhw, 0);
842 endchar;
843
844 %%%
845 % Draw the crook needed for quaver rests and shorter.
846 % The crook extends left from the point z.i on the stem.
847 %%%
848 def crook(text i)=
849 forsuffixes $=i:
850 x3:=x.$-6.5fact; y3:=top y.$- 3fact;
851 x4:=x.$-6fact; y4:= y.$+.5fact;
852 draw z.${dir 240}..{dir 160}z3;
853 filldraw z3{dir 160}..z4{dir-20}..{dir 160}z3..cycle;
854 endfor
855 enddef;
856
857 beginchar(63, 0, 3.25nhh#, 0); "8th rest";
858 z1=(nhh,nhh);
859 z2-z1=whatever*dir 70; % Angle the stem at 70 degrees.
860 %%%
861 % Define the scaling factor `fact' implicitly.
862 % This value will be used for the shorter rests as well.
863 %%%
864 z2-z1=(5fact,1.7nhh);
865 pickup med_pen;
866 draw z1..z2;
867 crook(2);
868 shift_pic (-.35nhw, 0);
869 penlabels (1,2,3,4);
870 endchar;
871
872 beginchar(64, 0, 3.25nhh#, 0); "16th rest";
873 z1=(nhh,0);
874 z2-z1=whatever*dir 75; % Angle the stem at 75 degrees.
875 y2-y1=2.7nhh;
876 z5-z2=whatever*(z1-z2); y5=y2-nhh;
877 pickup med_pen;
878 draw z1..z2;
879 crook(2,5);
880 shift_pic (-.35nhw, 0);
881 penlabels (1,2,3,4,5);
882 endchar;
883
884 beginchar(65, 0, 4nhh#, 0); "32th rest";
885 z1=(nhh,0);
886 z2-z1=whatever*dir 80; % Angle the stem at 80 degrees.
887 y2-y1=3.7nhh;
888 z5-z2=whatever*(z1-z2); y5=y2-nhh;
889 z6-z2=whatever*(z1-z2); y6=y5-nhh;
890 pickup med_pen;
891 draw z1..z2;
892 crook(2,5,6);
893 shift_pic (-.35nhw, 0);
894 penlabels (1,2,3,4,5,6);
895 endchar;
896
897 beginchar(66, 0, 4.75nhh#, 0); "64th rest";
898 z1=(nhh,0);
899 z2-z1=whatever*dir 82; % Angle the stem at 82 degrees.
900 y2-y1=4.7nhh;
901 z5-z2=whatever*(z1-z2); y5=y2-nhh;
902 z6-z2=whatever*(z1-z2); y6=y5-nhh;
903 z7-z2=whatever*(z1-z2); y7=y6-nhh;
904 pickup med_pen;
905 draw z1..z2;
906 crook(2,5,6,7);
907 shift_pic (-.35nhw, 0);
908 penlabels (1,2,3,4,5,6,7);
909 endchar;
910
911 %%%%%%%
912 message ("<clefs>");
913 %%%%%%%
914
915 def violin(expr reduction) =
916 gx:=reduction*-nhw;
917 gy:=reduction*nhh;
918 gthick:=1.5reduction*thick;
919 gthin:=.75reduction*med;
920
921 x1=31/24gx+w; x4=23/24gx+w; x2=x10=3/4gx+w; x3r=w; x8l=15/16gx+w;
922 x5=x11r=15/8gx+w; x6=gx+w; x7=5/8gx+w; x9=5/4gx+w;
923 y1=5/8gy; y2r=y5r=2gy; y3=gy; y4r=0; y6=27/8gy;
924 y7l=5gy; y8l=11/2gy; y9=17/4gy; y10=y11=-7/8gy;
925 penpos1(gthin,160);
926 penpos2(gthick,90);
927 penpos3(gthick,0);
928 penpos4(5/4gthin,-90);
929 penpos5(3/2gthick,110);
930 penpos6(17/16gthick,130);
931 penpos7(gthin,-140);
932 penpos8(5/4gthick,-80);
933 penpos9(3/8gthick,0);
934 penpos10(gthin,0);
935 penpos11(1/2gthick,180);
936 penstroke z1e{nw}..z2e..z3e..z4e..z5e{up+ne}..z6e..{up+nw}z7e
937 ..z8e{sw}..{down}z9e{down}..{down}z10e..z11e;
938 %{{{
939 currentpen:= pencircle;
940 draw z1{nw}..z2..z3..z4..z5{up+ne}..z6..{up+nw}z7
941 ..z8{sw}..{down}z9{down}..{down}z10..z11;
942 %}}}
943 fill_circle ((3(x2-x4)), (x11+11/40gy, y11));
944 penlabels(range 1 thru 11)
945 enddef;
946
947 %beginchar(71, 8/3nhw#, 5.5nhh#, 1.5nhh#); "G-clef";
948 beginchar(71, 8/3nhw#, 4.5nhh#, 2.5nhh#); "G-clef";
949 violin(1);
950 % shift_pic (-.2nhw, 0); % T.59
951 shift_pic (-.2nhw, -nhh); % T.60
952 endchar;
953
954 %beginchar(72, 7/3nhw#, 3nhh#, 2nhh#); "small G-clef";
955 beginchar(72, 7/3nhw#, 3nhh#, 3nhh#); "small G-clef";
956 violin(.8);
957 % shift_pic (-.3nhw, 0); %T.59
958 shift_pic (-.3nhw, -nhh); %T.60
959 endchar;
960
961 def bass (expr reduction) =
962 fx:=reduction*nhw;
963 fy:=reduction*nhh;
964 fthick:=reduction*thick;
965
966 x2=.8fx; y2=3nhh;
967 x1=x2r+.26fx; y1=y2;
968 x3=x2+.71fx; y3r=y2+1fy;
969 x4=x3+.71fx; y4=y2-.2fy;
970 x6=x2-6reduction*thinwidth; y6=y2-2.2fy;
971 x7=x4+.50fx; y7=y2+.38fy;
972
973 penpos2(.6fthick,180);
974 penpos3(.6fthick, 90);
975 penpos4(2fthick,0);
976 penpos6(.4fthick,-10);
977
978 fill_circle (.35fx, z7);
979 add_mirror ((0,y2), (1,y2));
980 fill_circle ((2(x2r-x1)), z1);
981
982 penstroke z2e{up}..{right}z3e{right}..{down}z4e{down}..{left+.1down}z6e;
983 %{{{
984 currentpen:= pencircle;
985 draw z2{up}..{right}z3{right}..{down}z4{down}..{left+.1down}z6;
986 %}}}
987 penlabels(1,2,3,4,6)
988 enddef;
989
990 beginchar(73, 8/3nhw#, 4nhh#, 0); "F-clef";
991 bass(1);
992 % shift_pic (-.35nhw, 0); % T.59
993 shift_pic (-.35nhw, -3nhh); % T.60
994 endchar;
995
996 beginchar(74, 7/3nhw#, 4nhh#, 0); "small F-clef";
997 bass(.8);
998 % shift_pic (-4/15nhw, 0); % T.59
999 shift_pic (-4/15nhw, -3nhh); % T.59
1000 endchar;
1001
1002 def alt(expr reduction, yshift) =
1003 nh:=h*reduction;
1004 athick:=1/10nh;
1005 ahigh:=1/2nh;
1006 radius:=5/4thick*reduction;
1007
1008 x4=13/16nh+3thinwidth; x5=9/16nh;
1009 x6=1/2nh; x9=x10=2/3nh; x11=17/32nh;
1010 y4=yshift+31/50ahigh; y5=yshift+1/2ahigh;
1011 y6=yshift; y9=yshift+1/9ahigh;
1012 y10=yshift+ahigh; y11=yshift+11/14ahigh;
1013 penpos4(athick,180);
1014 penpos5(1/8athick,0);
1015 penpos6(athick,0);
1016 penpos9(1/3athick,90);
1017 penpos10(1/3athick,-90);
1018 penpos11(1/2athick,0);
1019
1020 penstroke z5e..{sw+down}z6e;
1021 penstroke z5e{se+3down}..{right}z9e{right}..{up}z4e{up}
1022 ..{left}z10e{left}..{sw+3down}z11e;
1023 fill_circle (2radius, (z11l+(radius, -.05nhh)));
1024 fill_square (athick, ahigh, (5/16nh-1/2athick,yshift));
1025 fill_square (.25athick, ahigh, (x6l-.25athick,yshift));
1026 add_mirror ((0,yshift),(1,yshift));
1027 penlabels(4,5,6,9,10,11)
1028 enddef;
1029
1030 beginchar(75, 8/3nhw#, 4nhh#, 0); "Alto clef";
1031 alt(1, 2nhh);
1032 % shift_pic (-.45nhw, 0); % T.59
1033 shift_pic (-.45nhw, -2nhh); % T.60
1034 endchar;
1035
1036 beginchar(76, 7/3nhw#, 4nhh#, 0); "small Alto clef";
1037 alt(.8 ,2nhh);
1038 % shift_pic (-.3nhw, 0); % T.59
1039 shift_pic (-.3nhw, -2nhh); % T.60
1040 endchar;
1041
1042 beginchar(77, 8/3nhw#, 4nhh#, 0); "drum clef";
1043 fill_square (.3nhw, .5h, (.85nhw,1nhh));
1044 add_mirror ((w/2,0),(w/2,1));
1045 % shift_pic (.2nhw, 0); % T.59
1046 shift_pic (.2nhw, -2nhh); % T.60
1047 endchar;
1048
1049 beginchar(103, 8/3nhw#, 4nhh#, nhh#); "oldstyle G-clef";
1050 def penslopeI= (.35nhh/cosd45)+blacker,45 enddef;
1051 def penslopeII= (.35nhh/cosd32.5)+blacker,32.5 enddef;
1052 def penslopeIII= (.4nhh/cosd32.5)+blacker,32.5 enddef;
1053 def penslopeIV= (max(1,lthick/cosd32.5)),122.5 enddef;
1054
1055 x1l=1.5nhw; x2l=x3l=x4r=x1l+2/5nhw;
1056 x1l-x5l=x3r-x1l; x6l=x15r=x5l; x7r=x1=x14r; x8=x2;
1057 y1l=y2l=1.45nhh; y3l=y4r;
1058 y4l=0; y5=y3r; y6l=y15r; y7l=y8r=3nhh; y14r=y7r;
1059 z15r-z14r=whatever*dir(180+32.5);
1060 penpos1(penslopeI);
1061 penpos2(penslopeI); % /7\ 6(15)
1062 penpos3(penslopeII); % 6 8 7(14)
1063 penpos4(penslopeIII); % |
1064 penpos5(penslopeII); % | 1-2
1065 penpos6(penslopeII); % | |
1066 penpos7(penslopeII); % 5 3
1067 penpos8(.35nhh,90); % \4/
1068 penpos14(penslopeIV);
1069 penpos15(penslopeIV);
1070 penstroke z1e--z2e--z3e;
1071 fill unitsquare xscaled (x3r-x4l) yscaled lthick
1072 shifted z4l rotatedaround (z4l,32.5);
1073 penstroke z4e--z5e{dir85}..z6e;
1074 penstroke z7e--z8e; penstroke z14e--z15e;
1075
1076 x9=x5l=x16-.25nhw; x10l=x1l; x11=x10-.1nhw; x12=x8;
1077 x17l=x2r+.05nhw; x13r=x2l-.1nhw;
1078 y9r=-nhh; y16l=y9l-.01nhh; y10=0;
1079 y11=3.5nhh; y12r=y8r; y17r=y8r+.2nhh; y13r=4nhh;
1080 % 13
1081 penpos12(2lthick,90); % / \
1082 penpos17(3hlthick,180); % 11 17
1083 penpos13(.35nhh+blacker,-90); % | 12
1084 penpos11(max(lthick,1),0); % |
1085 penpos10(max(lthick,1),0); % 10
1086 penpos16(.475nhh+blacker,-90); % /
1087 penpos9(.5nhh+blacker,-90); % 9-16
1088
1089 penstroke z12e..z17e{dir80}..z13e..{down}z11e..{down}z10e{down}..
1090 {left}z16e..z9e;
1091 shift_pic (-.25nhw,0);
1092 penlabels (range 1 thru 12);
1093 shift_pic (0, -nhh); % T.60
1094 endchar;
1095
1096 beginchar(98, 8/3nhw#, 3.25nhh#, 0); "gregorian C clef";
1097 x1=x4=0; x2=x3=gregwidth; y1=y2=-y3=-y4=.5gregwidth-lthick;
1098 fill z1{dir 15}..z2--z3{dir 165}..z4--cycle;
1099 save_elempic;
1100 pickup med_pen; draw bot rt z1..{down}(-.01nhw,-.5nhh);
1101 shift_pic(nhw,2.5nhh);
1102 add_mirror ((0,2nhh),(1,2nhh));
1103 savepic;
1104 shift_pic (0,-2nhh);
1105 endchar;
1106
1107 beginchar(122, 8/3nhw#, 4.25nhh#, 0); "gregorian F clef";
1108 callpic;
1109 add_elempic (.1nhw,2nhh);
1110 fill_square (med, 1.5nhh, (.75nhw,.8nhh));
1111 shift_pic (1/3nhw,-2nhh);
1112 endchar;
1113
1114 %%%%%%%
1115 message ("<special signs>");
1116 %%%%%%%
1117
1118 beginchar(14, 0, nhh#, 0); "song system limit up";
1119 x1=y1=0; x2=1.5nhw; y2=nhh;
1120 penpos1(thick, 90); penpos2(thin, 90);
1121 penstroke z1e{right}..{dir80}z2e;
1122 %{{{
1123 currentpen:=pencircle; draw z1{right}..{dir80}z2;
1124 %}}}
1125 savepic;
1126 endchar;
1127
1128 beginchar(15, 0, 0, nhh#); "song system limit down";
1129 call_mirror (origin, right);
1130 endchar;
1131
1132 beginchar(16, 0, 0, 0); "used for volta";
1133 fill_square (lthick, 2.5nhh, (0,-.5nhh));
1134 endchar;
1135
1136 beginchar(17, 0, 0, 0); "used for volta";
1137 fill_square (lthick, 2.5nhh, (0,-2.5nhh));
1138 endchar;
1139
1140 % 'polyrhythmik' {\meterfrac{3+2+3}8}, e.g. Bart\'ok
1141 beginchar(57, 2nhh#, 1.5nhh#, 0); "big plus sign";
1142 pickup pencircle scaled .3nhh;
1143 draw lft(.5nhh,.9nhh)..rt(1.5nhh,.9nhh);
1144 draw bot(nhh,.4nhh)..top(nhh,1.4nhh);
1145 endchar;
1146
1147 beginchar(79, 0, 4nhh#, 0); "caesura";% other breathmark
1148 pickup penrazor scaled thick;
1149 draw (.3nhw+thick, 3.4nhh)--(.7nhw+thick, 4.6nhh);
1150 endchar;
1151
1152 beginchar(80, 0, 2.25nhh#, 0); "fermata up";
1153 x1 = -.5nhw; x2=.5(x1+x3); x3 = 1.5nhw;
1154 y1 = y3 = nhh; y2 = 2.3nhh;
1155 penpos1(thinwidth,165);
1156 penpos2(.9beamht+thin,90);
1157 penpos3(thinwidth,15);
1158 penstroke z1e{dir75}..z2e..{dir-75}z3e;
1159 fill_circle (beamht, (x2, y1+.5beamht));
1160 %{{{
1161 currentpen:= pencircle; draw z1{dir 75}..z2..{dir-75}z3;
1162 add_mirror ((x2, 0),(x2, 1));
1163 %}}}
1164 savepic;
1165 penlabels(1,2,3);
1166 endchar;
1167
1168 beginchar(81, 0, 0, 2.25nhh#); "fermata down";
1169 call_mirror (origin, right);
1170 endchar;
1171
1172 beginchar(82, 5/3nhw#, 4nhh#, 0); "allabreve";
1173 fit:= .025nhw;
1174 2x2 = 2x4 = x1 + 1/2nhh = w;
1175 x3r = 0; 2y1 = 3y2 = y4r = 3nhh;
1176 y3r = 2nhh; x5 = w -1/2nhh; y5 = 3nhh -1/2nhh;
1177 z6r = z5r + (-1/40nhh, 1/20nhh);
1178 penpos1(max(1,med), 0);
1179 penpos2(max(1,med), -90);
1180 penpos3(1/4nhh+thick,180);
1181 penpos4(max(1,med), 90);
1182 penpos5(max(1,med), 0);
1183 penpos6(1/4nhh+med,45);
1184 penstroke z1e..z2e..z3e..z4e..z5e;
1185 fill rt z1r..lft z1l..cycle;
1186 fill_circle (.35nhw+blacker, (z6 + (-2fit, fit)));
1187 shift_pic (.5nhh,0);
1188 savepic;
1189
1190 pickup med_pen;
1191 draw (4/5nhw+.5nhh, y2r-3/8nhh)--(4/5nhw+.5nhh, y4r+3/8nhh);
1192 penlabels(1,2,3,4,5,6);
1193 save_elempic;
1194 shift_pic (0,-2nhh);
1195 endchar;
1196
1197 beginchar(83, 5/3nhw#, 3.25nhh#, 0); "C";
1198 callpic;
1199 shift_pic (0,-2nhh);
1200 endchar;
1201
1202 beginchar(84, 10/3nhw#, 3.25nhh#, 0); "reverseC";
1203 callpic;
1204 add_mirror ((11/6nhw,0),(11/6nhw,1));
1205 shift_pic (0,-2nhh);
1206 endchar;
1207
1208 beginchar(123, 5/3nhw#, 3.25nhh#, 0); "reverseallabreve";
1209 add_elempic (0,0);
1210 mirror ((13/12nhw,0),(13/12nhw,1));
1211 shift_pic (0,-2nhh);
1212 endchar;
1213
1214 beginchar(121, 0, 0, 0); "double thumb bracket";
1215 mh:=0.625nhh;
1216 fill_square (lthick, mh, origin);
1217 fill_square (.55nhw, lthick, origin);
1218 add_mirror ((0,mh),(1,mh));
1219 shift_pic (-.75nhw, -mh);
1220 endchar;
1221
1222 %%%%%%%
1223 message ("<repeat symbols>");
1224 %%%%%%%
1225
1226 beginchar(55, 0, 4nhh#, 0); "repeat colons";
1227 fill_circle (1/3nhw+blacker, (0, 3/2nhh));
1228 add_mirror ((0, 2nhh),(1, 2nhh));
1229 shift_pic(0,-2nhh);
1230 endchar;
1231
1232 beginchar(78, 0, 4nhh#, 0); "due volte";
1233 fill_circle ((1/3nhw+blacker),(-.75nhh,2.5nhh));
1234 addto currentpicture also currentpicture rotatedaround ((0,2nhh), 180);
1235 pickup penrazor scaled (1/3nhw+blacker);
1236 draw (-nhh, nhh)--(nhh, 3nhh);
1237 endchar;
1238
1239 beginchar(85, 0, 3.25nhh#, 0); "coda";
1240 mh:=3nhh;
1241 x2 = 2nhw-x4 = 1/6mh; y2 = y4 = 1/2mh;
1242 x3 = x5 = nhw; y3 = mh-y5 = 5/6mh;
1243 pickup thin_pen;
1244 draw (0,mh/2)--(2nhw,mh/2); draw (nhw,0)--(nhw,mh);
1245 savepic;
1246 pickup coda_pen;
1247 draw z2..z3..z4..z5..cycle;
1248 shift_pic (-nhw, 0);
1249 labels (1,2,3,4);
1250 endchar;
1251
1252 beginchar(105, 0, 3.25nhh#, 0); "coda II";
1253 mh:=3nhh;
1254 callpic;
1255 x2 = x5 = 1/6mh; y2 = y3 = 5/6mh;
1256 x3 = x4 = 2nhw-x2; y4 = y5 = 1/6mh;
1257 pickup coda_pen;
1258 draw z2--z3--z4--z5--cycle;
1259 shift_pic (-nhw, 0);
1260 labels (1,2,3,4);
1261 endchar;
1262
1263 beginchar(86, 0, 3.25nhh#, 0); "segno";
1264 x1= .5nhw; y1 = 1.75nhh; x4=-.5x1; y4=.4nhh;
1265 x5=.7x1; y5=y6=3.05nhh; x6=x5-x1;
1266 z1'= (x1+1,y1);
1267 penpos1'(.5nhh+blacker, 80);
1268 penpos5(max(1,thin), -110);
1269 penpos6(max(1,1.2thin), -70);
1270 fill_circle (.5nhh, (x5-.2nhh,y5l-.13nhh));
1271 fill_circle (thick+.1nhh, (x4, y4+.9nhh));
1272 penstroke z1'e{dir170}..{ne}z6e..z5e;
1273 pickup penrazor scaled max(1,thin);
1274 draw z4--z1;
1275 penlabels (1,5,6);
1276 addto currentpicture also currentpicture rotatedaround (z1, 180);
1277 endchar;
1278
1279 beginchar(110, 0, 5.5nhh#, 2nhh#); "segno II";
1280 mw:=2.5nhh;
1281 gamma:=36.9;
1282 dist:=1nhh+.75beamht;
1283 gthick:=beamht+blacker;
1284
1285 x1'=x3'=x7=x16=2x1=2x10=2x13=.5mw; x9=x14=x2; x3r=mw-.2nhh;
1286 x11=x5; x15=x3; mw-x8=x12=1/3nhh;
1287 y1'=dist; y3'=y1'-.5dist; y4'+dist=y9-2dist=y2; y10-2dist=y13+dist=y1;
1288 y11=y5+2dist; y14=y2-dist; y8=y6-.1dist+2dist; y12=y3+.1dist-dist;
1289 y15=y3-dist; y16r=-d; y7l=3.25nhh+2dist;
1290 z1-z1'=z1'-z2=whatever*dir-gamma;
1291 z3-z3'=whatever*dir-gamma; z2-z4=whatever*dir(-90-gamma);
1292 z2-z4'=whatever*dir-90; z4-z4'=whatever*dir-gamma;
1293 z5=z3 rotatedaround (z1',180); z6=z4 rotatedaround (z1',180);
1294
1295 penpos1(gthick, gamma); penpos2(gthick, gamma);
1296 penpos3(max(1,thin),-90+gamma); penpos4(.9gthick,-180+gamma);
1297 penpos5(max(1,thin),-90+gamma); penpos6(.9gthick,-180+gamma);
1298 penpos7(.3gthick,-90-gamma); penpos8(.5gthick,-180+gamma);
1299 penpos9(gthick, gamma); penpos10(gthick, gamma);
1300 penpos11(.5gthick,-90+gamma); penpos12(.5gthick,-180+gamma);
1301 penpos13(gthick, gamma); penpos14(gthick, gamma);
1302 penpos15(.5gthick,-90+gamma); penpos16(.3gthick+1,-90-gamma);
1303
1304 penstroke z6e{dir(180-gamma)}..z5e..z1e---z2e..z3e..{dir(180-gamma)}z4e;
1305 add_shift (0,2dist);
1306 add_shift (0,-dist);
1307 unfill (0,-nhh)--(mw,-nhh)--(mw,-d)--(0,-d)--cycle;
1308 unfill (0,5nhh)--(mw,5nhh)--(mw,6nhh)--(0,6nhh)--cycle; cullit;
1309
1310 penstroke z9e---z10e..z11e..z7e..z8e;
1311 penstroke z13e---z14e..z15e..z16e..z12e;
1312
1313 dotthick:=.65nhh+blacker; fit:=.15nhh;
1314 fill_circle(dotthick,(x8-fit,y8-.5dotthick+fit+.02nhh));
1315 fill_circle(dotthick,(x12+fit,y12+.5dotthick-fit-.02nhh));
1316
1317 pickup thin_pen;
1318 draw (3/8mw,1/3nhh)--(3/8mw,4nhh+1/3nhh);
1319 draw (5/8mw,-1/3nhh)--(5/8mw,4nhh-1/3nhh);
1320 penlabels (range 1 thru 16);
1321 shift_pic(-mw,0);
1322 endchar;
1323
1324 %%%%%%%
1325 message ("<trills>");
1326 %%%%%%%
1327
1328 beginchar (67, 0, nhh#, 0); "turn";
1329 x1=2nhw-x6=.4nhw; y1r=h; y6=h-y1;
1330 x2r=0; y2=.5h; x5=2nhw-x2; y5=h-y2;
1331 x3=.44nhw; y3r=0; x4=2nhw-x3; y4=h-y3;
1332 penpos1(med, 90);
1333 penpos2(med, 180);
1334 penpos3(thick,-40);
1335 penpos4(thick,-40);
1336 penpos5(med, 180);
1337 penpos6(med, 90);
1338 penstroke z1e..{down}z2e{down}..{right}z3e{right}
1339 ..{right}z4e{right}..{down}z5e{down}..z6e;
1340 fill_circle ((1/4nhh+thick), (x1,y1r-thick));
1341 fill_circle ((1/4nhh+thick), (x6,y6l+thick));
1342 shift_pic (-.5nhw, 0);
1343 penlabels(1,2,3,4,5,6);
1344 savepic;
1345 endchar;
1346
1347 beginchar (68, 0, nhh#, 0); "backturn";
1348 call_mirror ((.5nhw,0), (.5nhw,1));
1349 endchar;
1350
1351 def setpar =
1352 off:= .3nhw; x2=x1+off; x3=x2+off; x4=x3+off;
1353 y1= y3=.75nhh-y2=.75nhh-y4=.15nhh;
1354 enddef;
1355
1356 beginchar(87, 0, nhh#, 0); "shake";
1357 x1=-.15nhw; setpar;
1358 pickup pensquare xscaled (thick+.15nhh) yscaled med rotated 52;
1359 draw z1--z2--z3--z4;
1360 save_elempic;
1361 add_elempic (2off,0);
1362 savepic;
1363 endchar;
1364
1365 beginchar(88, 0, nhh#, 0); "(long or double) shake";
1366 callpic;
1367 add_elempic (2*2off,0);
1368 shift_pic (-.3nhw, 0);
1369 save_elempic;
1370 endchar;
1371
1372 beginchar(89, 0, nhh#, 0); "mordent";
1373 callpic;
1374 fill_square (med, 1.5nhh, (.5nhw,-.375nhh));
1375 endchar;
1376
1377 beginchar(119, 0, nhh#, 0); "(long or double) mordent";
1378 currentpicture:= elem_pic; savepic;
1379 fill_square (med, 1.5nhh, (.5nhw,-.375nhh));
1380 endchar;
1381
1382 beginchar(106, 0, 1.5nhh#, 0); "Pince with line";
1383 callpic;
1384 pickup med_pen;
1385 draw (-.55nhw, 0)--(-.55nhw, h);
1386 endchar;
1387
1388 beginchar(107, 0, 1.5nhh#, 0); "Pince with hook nw";
1389 callpic;
1390 x1=-.45nhw; setpar;
1391 pickup med_pen;
1392 z5=1.75[z3,z2]-(x3-x1,0); z6=z1 rotatedaround (z5,90);
1393 draw (z1..z5{z2-z3}..{z3-z2}z6) shifted -(.5thick, .15nhh);
1394 endchar;
1395
1396 beginchar(108, 0, nhh#, 0); "Pince with hook sw";
1397 callpic;
1398 x1=-.45nhw; setpar;
1399 pickup med_pen;
1400 z5=1.5[z2,z1]-.75(.5thick,.15nhh); z6=z2 rotatedaround (z5,-90);
1401 draw (z1..z5{z1-z2}..{z2-z1}z6);
1402 endchar;
1403
1404 beginchar(109, 0, 1.5nhh#, 0); "Pince with hook ne";
1405 callpic;
1406 x1=1.35nhw; setpar;
1407 pickup med_pen;
1408 z5=1.5[z1,z2]; z6=z1 rotatedaround (z5,-90);
1409 draw (z1..z5{z2-z1}..{z1-z2}z6);
1410 endchar;
1411
1412 beginchar(69, nhw#, .5nhh#, 0); "trille-element";
1413 x1=-1; y1=y2=y3=.5h; x3=2x2=nhw;
1414 pickup penrazor scaled 1.5thick rotated 50;
1415 draw z1{ne}..{se}z2{se}..{ne}z3;
1416 endchar;
1417
1418 beginchar(70, 0, nhh#, 0); "arpeggio-element";
1419 x1=x2=x3=.2nhw-1; y1=0; y3=2y2=nhh+1;
1420 pickup penrazor scaled (thick+.16nhh) rotated 45;
1421 draw z1{ne}..{nw}z2{nw}..{ne}z3;
1422 shift_pic (-nhw, 0);
1423 endchar;
1424
1425 %%%%%%%
1426 message ("<pedal signs>");
1427 %%%%%%%
1428
1429 def pedalstar (text rot)=
1430 x4=-x1=min(.05nhh,0.35pt); y1=y4=0; x3=-x2=.14nhh;
1431 y3=y2=2y5=2y6=.4nhh; x6=-x5=1.1x4;
1432 p:=(z1..z5..z2..z3..z6..z4--cycle) shifted (0, .2nhh);
1433 forsuffixes $=rot: fill p rotated $; endfor
1434 pickup med_pen;
1435 draw quartercircle scaled .4nhh;
1436 add_mirror (origin, up);
1437 add_mirror (origin, right);
1438 labels (1,2,3,4);
1439 shift_pic (.5nhw, .8nhh);
1440 enddef;
1441
1442 beginchar(33, 0, 1.5nhh#, 0); "pedal (release) star I";
1443 pedalstar (0,60);
1444 endchar;
1445
1446 beginchar(104, 0, 1.5nhh#, 0); "pedal star II";
1447 pedalstar (0,45,90);
1448 endchar;
1449
1450 beginchar(34, 0, 1.5nhh#, 0); "pedal I";
1451 mw:= 1.25nhw; mh:=1.7nhh;
1452
1453 x1=.425mw; y1=4/18mh;
1454 x2=.2mw; y2=4/18mh;
1455 x3=x1; y3r=0;
1456 x4=.65mw; y4=.35mh;
1457 x5=.475mw; y5=.83mh;
1458 penpos1(.75thin,0); penpos4(.275nhh+thin,60);
1459 penpos2(.15nhh+thin,135); penpos5(.025nhh+med,0);
1460 penpos3(.025nhh+med,-90);
1461
1462 penstroke z1e{up}..z2e..z3e..z4e..{up+.5right}z5e;
1463
1464 fill lft z1l{up+ne}..{down+se}rt z1r{down+sw}..{up+nw}cycle;
1465 fill rt z5l{up+ne}..{down+se}lft z5r{down+sw}..{up+nw}cycle;
1466 %{{{
1467 currentpen:= pencircle; draw z1{up}..z2..z3..z4..{up+.5right}z5;
1468 %}}}
1469
1470 x6=mw-x12; y6=.75mh;
1471 x7=mw-x11; y7=.65mh;
1472 x8=.25mw; y8=y10;
1473 x9=x8+(x10-x8)/2; y9r=mh;
1474 x10=.8mw; y10=.9mh;
1475 x11=.88mw; y11=y7;
1476 x12=.7mw; y12=.7mh;
1477 penpos6(thin,-80); penpos10(1.2med,90);
1478 penpos7(.25nhh+thin,-110); penpos11(.25nhh+thin,-70);
1479 penpos8(med,90); penpos12(thin,-100);
1480 penpos9(.9med,90);
1481
1482 penstroke z6e..z7e..z8e..z9e..z10e..z11e..z12e;
1483 %{{{
1484 currentpen:=pencircle; draw z6..z7..z8..z9..z10..z11..z12;
1485 %}}}
1486 penlabels (range 1 thru 12);
1487 savepic;
1488 shift_pic (-.125nhw, 0);
1489 endchar;
1490
1491 beginchar(35, 0, 1.5nhh#, 0); "pedal II";
1492 callpic; %%% ->P
1493 mw:=3nhw; mh:=1.7nhh;
1494 fill_circle (.15mh, (.945mw-.15mh/2, .15mh/2));%%% ->.
1495
1496 x1=.5mw; y1=.9mh;
1497 x2=.77mw; y2=.58mh;
1498 x3=.815mw; y3=.2mh;
1499 x4= x2; y4r=0;
1500 x5=.63mw; y5=.22mh;
1501 x6= x2; y6=y2;
1502 penpos1(.75med,90); penpos4(.025nhh+med,-90);
1503 penpos2(.1125nhh+med,30); penpos5(.1125nhh+thin,-135);
1504 penpos3(.05nhh+med,0); penpos6(med,100);
1505
1506 penstroke (z1e{right}..z2e..z3e..z4e..z5e{dir 110}..z6e);%%% ->d
1507 fill lft z1l{ne}..{nw}rt z1r{sw}..{se}cycle;
1508
1509 x7=x5; y7=y5;
1510 x8=.55mw; y8r=0;
1511 x9=x1; y9=.56mh;
1512 x10=x11+.1mw; y10=y11+.1mh;
1513 x11=.375mw; y11r=0;
1514 x12=.28mw; y12=.25mh;
1515 penpos7(thin,-75); penpos10(1.2thin,-45);
1516 penpos8(.05nhh+med,-90); penpos11(.225nhh,-100);
1517 penpos9(.0625nhh+thin,80); penpos12(thin,-125);
1518
1519 penstroke z7e..z8e..z9e & z9e{dir-30}..{dir-150}z10e..z11e;%%% ->e
1520 penstroke z12e..z11e;
1521 penlabels (range 1 thru 12);
1522 shift_pic (-(.125nhw+.25nhw), 0);
1523 endchar;
1524
1525 %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1526
1527 %%%%%%%
1528 message ("<beam elements>");
1529 %%%%%%%
1530
1531 pen beam_pen;
1532 beam_pen:= penrazor scaled beamht rotated 90;
1533
1534 for LOOP=0 upto 9:
1535 longueur:= 2;
1536 for loop=0 upto 5:
1537 beginchar(LOOP*6+loop+128, longueur, 0, 0);
1538 pickup beam_pen;
1539 draw origin--(lft w, w*(.05*(LOOP+1)));
1540 savepic;
1541 endchar;
1542
1543 beginchar(LOOP*6+loop+64+128, longueur, 0, 0);
1544 call_mirror (origin,right);
1545 endchar;
1546
1547 longueur:= 2*longueur;
1548 endfor
1549 endfor;
1550 end