]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-schrift.mf
release: 1.5.41
[lilypond.git] / mf / feta-schrift.mf
1 % -*- Fundamental -*-  (emacs-20 mf mode mucks
2 % feta-schrift.mf --  implement scripts
3
4 % source file of the Feta (defintively not an abbreviation for Font-En-Tja)
5 % music font
6
7 % (c) 1997 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 %       Jan Nieuwenhuizen <janneke@gnu.org>
9
10
11
12 fet_begingroup("scripts")
13
14 def draw_fermata =
15   save alpha, radius, crook_thinness, crook_fatness, dot_radius;
16   
17         % [Wanske] and some  Baerenreiter editions
18         % suggest ca 80 degrees iso half-circle
19   alpha := 10;
20
21   radius# = 1.25 staff_space#;
22   crook_thinness# = 1.5stafflinethickness#;
23   crook_fatness# = 4 stafflinethickness#;
24
25   radius# + crook_fatness#/2 = h#;
26   radius# + crook_thinness#/2 = w#;
27   set_char_box(w#, w#, crook_thinness#/2, h#);
28   
29   define_pixels(radius, crook_thinness, crook_fatness);
30   dot_radius = round (4/6 crook_fatness);
31
32
33   penpos1(crook_thinness, 0);
34   penpos2(crook_fatness, -90);
35   z1 = (-radius,0);
36   z2 = (0, radius);
37
38   fill z1l{dir (-alpha-90)}..{dir (90-alpha)}z1r..
39   {right}z2r -- z2l{left} .. cycle;
40
41   addto currentpicture also 
42   currentpicture xscaled -1;
43
44   pickup pencircle scaled 2dot_radius;
45   x4 =0;
46   bot y4 = - crook_thinness/2;
47   drawdot z4;
48 enddef;
49
50 fet_beginchar("fermata up", "ufermata", "ufermata")
51         draw_fermata;   
52         penlabels(1,2,4);
53 fet_endchar;
54
55 fet_beginchar("fermata down", "dfermata", "dfermata")
56         draw_fermata;
57         y_mirror_char;
58 fet_endchar;
59
60 %
61 % Thumbs are used in cello music.
62 % TODO : thumbs should look like the finger-font and should be placed in
63 % the same way in the score.
64 %
65
66 fet_beginchar("Thumb", "thumb", "thumb")
67         save thin, height, width, thick;
68         height# = 5/4 width#;
69         height# = staff_space#;
70         thin = 1.2 stafflinethickness;
71         thick =  2 thin;
72         set_char_box(width#/2, width#/2, height#/2, height#/2);
73         
74         penpos1(thick, 0);
75         penpos2(thin, 90);
76         z1r = (w, 0);
77         z2r = (0, h);
78         penlabels(1,2);
79         penstroke z1e{up} .. {left}z2e;
80         addto currentpicture also currentpicture xscaled -1;
81         addto currentpicture also currentpicture yscaled -1;
82
83         z3 = (0, -h);
84         z4 = (0, -1.5h);
85         penlabels(3,4);
86         draw_brush(z3,1.4*thin, z4,0.9*thick);
87 fet_endchar;
88
89 %
90 % FIXME: rounded endings
91 %
92 % `\accent' is TeX reserved.
93 fet_beginchar("> accent", "sforzato", "sforzatoaccent")
94         set_char_box(.9 staff_space#, .9 staff_space#, .5 staff_space#, .5 staff_space#);
95         save thickness, diminish;
96
97         thickness = 3/2 stafflinethickness;
98         pickup pencircle scaled thickness;
99
100         % prevent blobs at crossing lines
101         diminish = .75;
102
103         top y1 = h;
104         lft x1 = -b;
105         rt x2 = w;
106         y2 = .25 thickness* diminish;
107
108         rt z4 = (w,0);
109         x3 =0;
110         z3 = whatever [z1, z4];
111
112         penpos2(thickness*(2 - diminish)/2 , 90);
113         penpos1(thickness, 90);
114         penpos3(thickness, 90);
115
116         draw z1 .. z3;
117         draw (z1 .. z3) yscaled -1;
118         draw z4;
119         penstroke z3e .. z2e;
120         penstroke (z3e .. z2e) yscaled -1;
121
122         penlabels(1,2,3);
123         labels(4);
124 fet_endchar;
125
126 % Hmm, changed 1.5 to 1.4 to avoid problems with "random" placement of
127 % the dots because of quantization effects for almost integer values. /MB
128
129
130 %
131 % Hmm. Should not meddle with darkness of font. Check out the 
132 % correct value for radius. Maybe we'd better change padding --hwn
133 %
134 fet_beginchar("staccato dot", "staccato", "staccato")
135         save radius;
136         radius# = 1.4 stafflinethickness#;
137         define_whole_pixels(radius);
138         pickup pencircle scaled 2 radius;
139         drawdot (0,0);
140         set_char_box(radius#, radius#, radius#, radius#);
141 fet_endchar;
142
143 def draw_staccatissimo =
144         save radius, height;
145         height# = .8 staff_space#;
146         radius# = 2 stafflinethickness#;
147         define_whole_pixels(radius);
148         define_pixels(height);
149
150         draw_brush((0,0), stafflinethickness, (0, height),2 radius);
151         set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
152 enddef;
153
154 fet_beginchar("staccatissimo/martellato up", "ustaccatissimo", 
155                 "ustaccatissimo")
156         draw_staccatissimo;
157 fet_endchar;
158
159 %
160 % FIXEM: scale labels too.
161 %
162 fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
163         draw_staccatissimo;
164         y_mirror_char;
165 fet_endchar;
166
167 fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
168         save thick;
169         thick# = 1.4 stafflinethickness#;
170         define_whole_pixels(thick);
171
172         set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,thick#/2);
173         pickup pencircle scaled thick;
174         draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
175 fet_endchar;
176
177
178 %
179 % Portato by Heikki Junes <heikki.junes@hut.fi>
180 %
181
182 def draw_portato = 
183         save thick, radius;
184         thick# = 1.4 stafflinethickness#;
185         radius# = 1.4 stafflinethickness#;
186         define_whole_pixels(thick,radius);
187         
188         set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,.5 staff_space#+ radius#);
189         draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
190
191         pickup pencircle scaled 2 radius;
192         drawdot (0,h);
193 enddef;
194
195
196 fet_beginchar("portato/tenuto with staccato", "uportato", 
197                 "uportato")
198         draw_portato;
199 fet_endchar;
200
201
202 fet_beginchar("portato/tenuto with staccato", "dportato", 
203                 "dportato")
204         draw_portato;
205         y_mirror_char
206 fet_endchar;
207
208
209 def draw_marcato = 
210         save fat_factor, thinness;
211         set_char_box(staff_space#/2, staff_space#/2, 0, 1.1 staff_space#);
212
213         fat_factor = .3;
214         thinness =  stafflinethickness;
215
216         pickup pencircle scaled thinness;
217         rt x2 = w;
218         lft x5 = -b;
219         bot y5 = 0;
220         top y3 = h;
221         y1 = y2 = y5;
222
223         x3 =0;
224         z1 - z4 = whatever * (charwd, -charht);
225         z4 = fat_factor [z3, z5];
226
227         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
228         draw z3 .. z5;
229 enddef;
230
231 fet_beginchar("marcato up", "umarcato", "umarcato")
232         draw_marcato;
233         labels(1,2,3,4,5);
234 fet_endchar;
235
236
237 %
238 % The down marcato char (not very much used). 
239 % Contrary to what some MF/TeX `gurus' believe
240 % it is *point*-symmetric with the "up" version
241 fet_beginchar("marcato down", "dmarcato", "dmarcato")
242         draw_marcato;
243         xy_mirror_char;
244 fet_endchar;
245  
246
247 %
248 % used in french horn music todo
249 %
250 % TODO: too light at 20pt
251 fet_beginchar("open (unstopped)", "open", "ouvert")
252         save thin, height, width, thick;
253         height# = 5/4 width#;
254         height# = staff_space#;
255         thin = 1.2 stafflinethickness;
256         thick =  1.4 thin;
257         set_char_box(width#/2, width#/2, height#/2, height#/2);
258         
259         penpos1(thick, 0);
260         penpos2(thin, 90);
261         z1r = (w, 0);
262         z2r = (0, h);
263         penlabels(1,2);
264         penstroke z1e{up} .. {left}z2e;
265         addto currentpicture also currentpicture xscaled -1;
266         addto currentpicture also currentpicture yscaled -1;
267 fet_endchar;
268
269
270 fet_beginchar("plus (stopped)", "stopped", "plusstop")
271         save thick, size;
272         thick = 2 stafflinethickness;
273         size# = 1.1 staff_space#;
274
275         set_char_box(size#/2, size#/2, size#/2, size#/2);
276         draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
277         addto currentpicture also currentpicture rotated 90;
278 fet_endchar;
279
280 %
281 % FIXME: blotting 
282 %
283 fet_beginchar("Upbow", "upbow", "upbow")
284         save ht, wd, thick;
285
286         thick = 1.4 stafflinethickness;
287         wd# = 1.3 staff_space#;
288         ht# = 1.6 wd#; 
289
290         
291         set_char_box(wd#/2, wd#/2, 0, ht#);
292         pickup pencircle scaled thick;
293
294         x1 = 0;
295         bot y1 = 0;
296         rt x2 =  w;
297         top y2 = h;
298
299         labels(1,2);
300         draw z2 -- z1 -- (z2 xscaled -1);
301 fet_endchar;
302
303
304 fet_beginchar("Downbow", "downbow", "downbow")
305         save stemthick, beamheight;
306         save wd,round;
307         define_pixels(wd)
308
309         wd# = 1.5 staff_space#;
310         stemthick = 1.2 stafflinethickness;
311         set_char_box(wd#/2, wd#/2, 0, 4/3 staff_space#);
312
313         beamheight = 4/10 h;
314
315         draw_rounded_block((-b,h-beamheight),(w,h),blot_diameter);
316         draw_rounded_block((-b,-d),(-b+stemthick,h-stemthick),stemthick);
317         addto currentpicture also currentpicture xscaled -1;
318 fet_endchar;
319
320 %
321 % Inspired by a computer-set version of Auf dem Strom by Baerenreiter. 
322 %
323
324 def draw_turn =
325         save thin, thick, ball_diam, darkness;
326         save wd, ht, thick_nibangle, ball_nib_thick;
327         save turndir;
328         pair turndir;
329
330         wd# = 35/16 staff_space#;
331         ht# = 18/17 staff_space#;
332         darkness = 1.20 stafflinethickness;
333
334         set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);       
335
336         thick_nibangle = 60;
337         thick = 3 darkness;
338         thin = darkness;
339         ball_nib_thick = 2.7 darkness;
340         ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
341
342         
343         x3l = w;
344         y3 = 0;
345         y4l = h;
346         x4 = x2;
347         x2l = w/2;
348         y2l = -d;
349         z1 = (0,0);
350
351         penpos1(1.1 thick, thick_nibangle);
352         penpos2(thick, thick_nibangle);
353         penpos3(thin, 180);
354         penpos4(ball_nib_thick, -90);
355
356         path swoosh, ploop;
357         swoosh :=  z1l{curl 0} .. z2l .. z3l{up} .. {left}z4l 
358           -- z4r .. z3r{down} .. z2r{left} ;
359         fill swoosh .. (swoosh scaled -1) .. cycle;
360
361         x5r = x4;
362         y5r = y4l - ball_diam /2;
363         z6r = z5r;
364
365         penpos5(1.6 ball_diam/2, 10);
366         penpos6(ball_diam/2, 150);
367
368         ploop := z4l{left} .. z5l .. z6l -- cycle;
369         fill ploop;
370         fill ploop scaled -1;
371
372
373 enddef;
374
375 fet_beginchar("Reverse turn","reverseturn","reverseturn")
376         draw_turn;
377         currentpicture := currentpicture yscaled -1;
378         penlabels(5,6,7);
379         penlabels(2,3,4);
380 fet_endchar;
381
382
383 fet_beginchar("Turn","turn","turn")
384         draw_turn;
385                 
386         penlabels(5,6,7);
387         penlabels(1,2,3,4);
388 fet_endchar;
389
390
391
392 %
393 % Inspired by a (by now) PD edition of Durand & C'ie edition of 
394 % Saint-Saens' Celloconcerto no. 1 
395 %
396 % FIXME take out hardcoded vars.
397 % FIXME the two loops on the `t' should be smoother (and the left one bigger).
398 % FIXME generic macros for serifs: top of the t and bottom of r
399 %
400
401
402 fet_beginchar("Trill (`tr')","trill","trill")
403         
404         save start_nib_angle,  ascender_extra, ex, hair_thick, fatness,
405           slant_angle, slant, t_fatness, r_fatness, kerning, t_overshoot, 
406           uitschieter, bulb_size;
407         ;
408         pair slant_vec;
409
410         ascender_extra# = 1/2 ex#;
411         ascender# = ascender_extra# + ex#;
412         ex# = 1.4 staff_space#;
413         kerning# = .60 ex#;
414         start_nib_angle = 20;
415         bulb_size = 0.47;
416         define_pixels(ex, ascender_extra, ascender, kerning);
417
418         t_overshoot = 0.03 ex;
419         fatness = 12/40 ex;
420         t_fatness = 8/10 fatness;
421         r_fatness = .75 fatness;
422         uitschieter = 21/40 ex;
423         hair_thick =  blot_diameter;
424
425         slant = .2;
426
427         local_copy(transform)(currenttransform);
428         currenttransform := currenttransform slanted slant shifted (- staff_space, 0)  ;
429
430         y1 = ascender;
431         x1l = 0;
432         x1r = t_fatness;
433         penpos1(start_nib_wid, start_nib_angle);
434         
435         z2 = (x1, 7/18 ex);
436         penpos2(start_nib_wid, start_nib_angle);
437
438         z3l = (11/10 t_fatness, - t_overshoot);
439
440         z4l = (13/6 t_fatness, 5/16 ex);
441         penpos4(hair_thick, 180);
442
443         1.9 [z3l, z3r] = z4r;
444         z3 = .5 [z3l, z3r];
445         
446         save t_p, krul_p;
447         path t_p, krul_p, r_p;
448
449
450         t_p := simple_serif (z1r, z1l, -30) -- z2l {down} .. tension (1 + .5 slant)
451                 .. z3l{right} 
452                 
453                 .. z4l{up} -- z4r{down} 
454                 .. z3r{left} .. z2r{up} .. z1r -- cycle;
455         fill t_p ;
456
457         krul_ang = 32;
458
459         pickup pencircle scaled hair_thick;
460
461         z5 = (t_fatness/2, 2/3 ex);
462         
463         lft x6 = - uitschieter;
464         y6 =  y5 ; % - 1/20 ex;
465
466         z7 = z5 + whatever*dir krul_ang;
467         up_angle = krul_ang;
468         % angle (z7-z5)
469         x7 = 5/10 kerning + x5;
470         
471         penpos7(hair_thick, up_angle + 90);
472
473         
474         x8l = .7 [x9r, x7r];
475         y8l = y7l;
476         penpos8(2 hair_thick, (up_angle +90)/2);
477
478         y9 = 3/4 ex;
479         x9 = x1 + kerning;
480         penpos9(r_fatness, 0);
481
482         x10 = x9;
483         y10 =  -0.3 stafflinethickness;
484         penpos10(r_fatness, 0);
485
486         krul_p := z4{up} .. tension 1.1  .. z5 
487                 .. tension 1 and .75 .. z6
488                 .. tension .85 and 1.1 .. z5 --- z7;
489         draw krul_p;
490         r_p := z7l{z7-z5} .. z9l{down} --- simple_serif (z10l, z10r, -30)
491                 --- z9r{up} 
492                 ..  z8r{left} ..  z7r{z5-z7} -- cycle;
493         fill r_p;
494         set_char_box(staff_space# , staff_space#, 0,ascender#);
495
496
497         penpos11(1/4 r_fatness, -20);
498         z11r = z9r;
499         
500         z13 = (x9 + 2 r_fatness, y11 );
501         penpos13(r_fatness, 180);
502         fill z11r{dir 70} .. z13r{down} -- z13l{up} .. z11l{dir 250} -- cycle;
503         penlabels(range 1 thru 15);
504
505
506         draw_bulb(-1, z13r, z13l, bulb_size * r_fatness, 1.5);
507 fet_endchar;
508
509
510 def draw_heel =
511         save radius, thickness, wall;
512
513         radius# := .5 staff_space#;
514
515         define_pixels(radius);
516         set_char_box(radius#, radius#, radius#, 2/3 staff_space#);
517
518         thickness := 1.5 stafflinethickness;    
519         pickup pencircle scaled thickness;
520         rt x1 = b;
521         top y1 = h;
522         
523         x2 =x1;
524         y2 = 0;
525
526         x3 = 0;
527         bot y3 = -d;
528
529         draw z1{down} .. z2{down} .. z3{left};
530         addto currentpicture also currentpicture xscaled -1;
531         
532 enddef;
533
534
535 fet_beginchar("left heel", "upedalheel", "upedalheel")
536         draw_heel;
537         labels(1,2,3);
538 fet_endchar;
539
540 fet_beginchar("right heel", "dpedalheel", "dpedalheel")
541         draw_heel;
542         y_mirror_char;
543 fet_endchar;
544
545 def draw_toe =
546         save ht,wd;
547
548         thickness := 1.5 stafflinethickness;
549         ht# := 1.5 staff_space#;
550         wd# := 1/3 ht#;
551         define_pixels(ht,wd);
552
553
554         set_char_box(wd#, wd#, 0, ht#);
555         
556         pickup pencircle scaled thickness;
557         lft x1 = -b;
558         bot y1 = 0;
559         x2 =0;
560         top y2 = h;
561         z3 = z1 xscaled -1;
562
563
564         draw z1 -- z2 -- z3;
565
566 enddef;
567         
568 fet_beginchar("left toe", "upedaltoe", "upedaltoe")
569         draw_toe;
570         labels(1,2,3);
571 fet_endchar;
572 fet_beginchar("right toe", "dpedaltoe", "dpedaltoe")
573         draw_toe;
574         y_mirror_char;
575 fet_endchar;
576
577 fet_beginchar("Flageolet", "flageolet", "flageolet")
578         save height,width,thickness;
579         height#=4/15 staffsize#;
580         width#=height#;
581         thickness#=blot_diameter#;
582         define_pixels(height,width,thickness);
583         set_char_box(width#/2,width#/2,height#/2,height#/2);
584         
585         pickup pencircle scaled thickness;
586         x1= .5 [x2, x4];
587         x1 = 0;
588         top y1=height/2;
589         rt x4  - lft x2 =width; 
590         y2 = 0;
591         y4=y2;
592         x3=x1;
593         bot y3=-height/2;
594
595         penlabels(1,2,3,4);
596         draw z1..z2..z3..z4..cycle;
597 fet_endchar;
598
599 fet_beginchar("Segno", "segno", "segno")
600         save thin, thick, ball_diam, darkness, pointheight;
601         save wd, ht, thick_nibangle, ball_nib_thick;
602         save turndir;
603         pair turndir;
604
605         ht# = 3 staff_space#;
606         wd# = 2 staff_space#;
607         darkness = 1.20 stafflinethickness;
608
609         set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);       
610
611         thick_nibangle = 30;
612         thick = 3 darkness;
613         thin = darkness;
614         ball_nib_thick = 2.7 darkness;
615         ball_diam = ball_nib_thick + (w - ball_nib_thick) / 10;
616         pointheight = 2 stafflinethickness;
617         
618         y3l = h;
619         2 x3 = x2 + x4;
620         x4 = 0;
621         y4 = y2;
622         y2l = .6 h;
623         x2l = -b;
624         z1 = (0,0);
625
626         penpos1(thick, 2 thick_nibangle);
627         penpos2(thick, thick_nibangle);
628         penpos3(thin, -90);
629         penpos4(ball_nib_thick, 180-thick_nibangle);
630
631         path swoosh, ploop;
632         swoosh :=  z1l{curl 0} .. z2l .. z3l{right} .. {down}z4l 
633           -- z4r .. z3r{left} .. z2r{down} ;
634         fill swoosh .. (swoosh scaled -1) .. cycle;
635         penlabels(1,2,3,4);
636
637         y5r = y4;
638         x5r = x4l - ball_diam /2;
639         z6r = z5r;
640
641         penpos5(1.6 ball_diam/2, 100);
642         penpos6(ball_diam/2, 240);
643
644         ploop := z4l{down} .. z5l .. z6l -- cycle;
645         fill ploop;
646         fill ploop scaled -1;
647         penlabels(4,5,6);
648
649         penpos7(2 thin,0);
650         z7l=(-b,-d);
651         penpos8(2 thin,0);
652         z8r=(w,h);
653         filldraw z7l--z8l{right}--z8r{down}--z7r{right}--cycle;
654         pickup pencircle scaled 2 thin;
655         draw (-x2r,pointheight);
656         draw (x2r,-pointheight);
657 fet_endchar;
658
659 fet_beginchar("Coda", "coda", "coda")
660         save thin, thick, codawidth, codaheight;
661         thin# = 1.2 stafflinethickness#;
662         thick# = 3.5 stafflinethickness#;
663         codawidth# = 2/3 staff_space#;
664         codaheight# = 1 staff_space#;
665         define_pixels(thin, thick, codawidth, codaheight);
666
667         set_char_box(codawidth#+thick#, codawidth#+thick#,
668                 codaheight#+thick#, codaheight#+thick#);
669
670         penpos1(thick,0);
671         penpos2(thin,-90);
672         penpos3(thick,180);
673         x1l=-codawidth;
674         y2l=codaheight;
675         y1=0;
676         x2=0;
677         z3 = - z1;
678         penlabels(1,2,3);
679
680         path halfcoda;
681         halfcoda := z1l{up} .. z2l{right} .. z3l{down} -- 
682                 z3r{up} .. z2r{left} .. z1r{down} .. cycle;
683         fill halfcoda;
684         fill (halfcoda scaled -1);
685
686         draw_gridline((0,-h),(0,h),thin);
687         draw_gridline((-w,0),(w,0),thin);
688
689 fet_endchar;
690
691 def draw_comma = 
692         save alpha, thick, thin, ht;
693         alpha:=35;
694         thin# = 1.2 stafflinethickness#;
695         thick# = 3 stafflinethickness#;
696         ht# = .6staff_space#;
697         define_pixels(thin, thick,ht);
698         set_char_box(0, .5staff_space#, ht#, ht#);
699
700         penpos1(thick, alpha);
701         penpos2(thick, alpha+90);
702         penpos3(thin, 180-alpha);
703         penpos4(thin, 90-alpha);
704         x3r=0;
705         x1l=x3l;
706         y2r=-y4l=h;
707         z1=z2;
708         z3=z4;
709         penlabels(1,2,3,4);
710         fill z1l{dir (alpha+90)} .. z2r{dir alpha} .. z1r{dir (alpha-90)} .. 
711         z3l{dir (270-alpha)} .. z4l{dir (alpha+180)} .. 
712         z3r{dir (90-alpha)} .. cycle;
713 enddef;
714
715 fet_beginchar("Right Comma","rcomma","rcomma");
716         draw_comma;
717 fet_endchar;
718
719 fet_beginchar("Left Comma","lcomma","lcomma");
720         draw_comma;
721         xy_mirror_char;
722 fet_endchar;
723
724 thick#:=1/24designsize;
725 define_blacker_pixels(thick);
726
727 rthin:=1/8*staff_space;
728 rthick:=2thick+rthin;
729
730 def draw_arpeggio =
731         save alpha;
732         alpha:=-40;
733         save ne,nw,se,sw; pair ne,nw,se,sw;
734         save x,y;
735         
736         se=dir alpha; nw=dir (alpha+180);
737         ne=dir (alpha+90); sw=dir (alpha-90);
738         penpos1(rthin,alpha+90);
739         penpos2(5/4rthick,alpha);
740         penpos4(5/4rthick,alpha);
741         penpos5(rthin,alpha+90);
742         penpos3(3/4rthick,alpha);
743
744         z1=(width/2, height) - overshoot*se;
745         z2=2[z4,(width/2,height/2)];
746         z3=1/2[z2,z4];
747         x4=2/8staff_space;
748         y4=rthin;
749
750         z5=2[z1,(width/2,height/2)];
751         z6=z2l+1/2rthin*sw;
752         z7=z4l+1/2rthin*sw+1/2rthin*se;
753         z8=2[z6,(width/2,height/2)];
754         z9=2[z7,(width/2,height/2)];
755         
756         fill z1l{se}..{se}z6..z3l..z7{se}..{se}z5l..z5r{nw}..{nw}z8..z3r..z9{nw}..{nw}z1r.. cycle;
757         penlabels(1,2,3,4,5,6,7,8,9);
758         enddef;
759
760 fet_beginchar("Arpeggio","arpeggio","arpeggio");
761         %draw_staff (-2, 2, 0.0);       
762         save height, overshoot, width;
763         height# = staff_space#;
764         width# = 0.8height#;
765         overshoot# = 0.25 staff_space#;
766         define_pixels (height,overshoot,width);
767         set_char_box(0, width#, 0, height#);
768         draw_arpeggio;
769         fet_endchar;
770
771 % Extendable Trill symbol.
772 % Not yet used
773 % Rename me to Trill, rename Trill to Tr?
774 fet_beginchar("Trill-element","trill-element","trill-element");
775         save height, overshoot;
776         height# = staff_space#;
777         width# = 0.8height#;
778         overshoot# = 0.25 staff_space#;
779         define_pixels (height,overshoot,width);
780         set_char_box(0, height#, 0, width#);
781         draw_arpeggio;
782         currentpicture := currentpicture shifted -(width/2, height/2);
783         currentpicture := currentpicture rotated 90;
784         currentpicture := currentpicture shifted (height/2, width/2);
785         fet_endchar;
786
787
788
789 %
790 % Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
791 %
792
793 def draw_arpeggio_arrow =
794         save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
795         pair ne, nw, se, sw;
796         height# = staff_space#;
797         width# = 0.8height#;
798         overshoot# = 0.25 staff_space#;
799         define_pixels (height,overshoot,width);
800         set_char_box(0, width#, 0, height#);
801         alpha := -40;
802         nw = dir (alpha+180);
803         sw = dir (alpha-90); se = dir alpha;
804
805         penpos1(rthin,     alpha+90);
806         penpos2(5/4 rthick, alpha);
807         penpos3(5/4 rthick,     0);
808
809         z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
810         z2 = 2[z4,(width/2,height/2)];
811         z3 = (0.5 width, 0.5 height);
812         z4 = (0.25 staff_space, rthin);
813         z6 = z2l + 1/2rthin*sw;
814         z9 = (width/2, height) + overshoot*se;
815         fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
816
817         bot z10 = ( 0.5w,  0   );
818         lft z11 = (-0.3w,  0.8h);
819         rt z12  = ( 1.3w,  0.8h);
820         pickup pencircle scaled 0.5 rthin;
821         filldraw z3 -- z12 {dir -130} ..  {dir -110} z10 {dir 110} ..  {dir 130} z11 -- cycle;
822 enddef;
823
824 fet_beginchar("Arpeggio arrow down", "arpeggio-arrow--1", "arpeggioarrowdown");
825         draw_arpeggio_arrow;
826 fet_endchar;
827
828
829 fet_beginchar("Arpeggio arrow up", "arpeggio-arrow-1", "arpeggioarrowup");
830         draw_arpeggio_arrow;
831         currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space);
832 fet_endchar;
833
834
835
836
837 % Hmm
838 input feta-slag;
839
840
841
842 fet_endgroup("scripts");
843