6 fet_begingroup("foobars")
10 save alpha, radius, crook_thinness, crook_fatness, dot_diam;
12 % [Wanske] and some Baerenreiter editions
13 % suggest ca 80 degrees iso half-circle
16 radius# = 1.5 interline#;
17 crook_thinness# = 1.5stafflinethickness#;
18 crook_fatness# = 4 stafflinethickness#;
20 radius# + crook_fatness#/2 = h#;
21 radius# + crook_thinness#/2 = w#;
22 set_char_box(w#, w#, crook_thinness#/2, h#);
24 define_pixels(radius, crook_thinness, crook_fatness);
25 dot_diam = 4/3 crook_fatness;
28 penpos1(crook_thinness, 0);
29 penpos2(crook_fatness, -90);
33 fill z1l{dir (-alpha-90)}..{dir (90-alpha)}z1r..
34 {right}z2r -- z2l{left} .. cycle;
36 addto currentpicture also
37 currentpicture xscaled -1;
39 pickup pencircle scaled dot_diam;
41 bot y4 = - crook_thinness/2;
45 fet_beginchar("fermata up", "ufermata", "ufermata")
50 fet_beginchar("fermata down", "dfermata", "dfermata")
52 currentpicture:=currentpicture yscaled -1 ;
53 set_char_box(w#, w#, h#, 0);
59 % FIXME: rounded endings
61 % `\accent' is TeX reserved.
62 fet_beginchar("> accent", "accent", "sforzatoaccent")
63 set_char_box(.9 interline#, .9 interline#, .5 interline#, .5 interline#);
64 save thickness, diminish;
66 thickness = 2 stafflinethickness;
68 % prevent blobs at crossing lines
74 y2 = .25 thickness* diminish;
78 z3 = whatever [z1, z4];
80 penpos2(thickness*(2 - diminish)/2 , 90);
81 penpos1(thickness, 90);
82 penpos3(thickness, 90);
84 penstroke z1e .. z3e .. z2e;
85 penstroke (z1e .. z3e .. z2e) yscaled -1;
90 fet_beginchar("staccato dot", "staccato", "staccato")
92 radius# = 1.25 stafflinethickness#;
93 define_pixels(radius);
94 pickup pencircle scaled 2 radius;
96 set_char_box(radius#, radius#, radius#, radius#);
99 def draw_staccatissimo =
101 height# = .8 interline#;
102 radius# = 2 stafflinethickness#;
103 define_pixels(radius, height);
105 draw_brush((0,0), blot_diameter, (0, height),2 radius);
106 set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
109 fet_beginchar("staccatissimo/martellato up", "ustaccatissimo",
115 % FIXEM: scale labels too.
117 fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
122 fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
124 thick# = 1.2 stafflinethickness#;
125 define_pixels(thick);
127 set_char_box(.9 interline#, .9 interline#, thick#/2,thick#/2);
128 pickup pencircle scaled thick;
137 save fatness, thinness;
138 set_char_box(interline#/2, interline#/2, 0, 1.1 interline#);
140 fatness = 3 stafflinethickness;
141 thinness = .8 stafflinethickness;
142 x2 - x1 + blot_diameter = fatness;
147 z2 - z3 = whatever * (charwd, -charht);
148 z1 - z4 = whatever * (charwd, -charht);
149 z3 - z4 = whatever * (charwd, charht);
151 draw_rounded_path(z1 -- z2 -- z3 -- z4 -- cycle, thinness);
153 pickup pencircle scaled thinness;
154 z3 - z5 = whatever* (z3 - z4);
159 fet_beginchar("marcato up", "umarcato", "umarcato")
166 % The down marcato char (not very much used).
167 % Contrary to what some MF/TeX `gurus' believe
168 % it is *point*-symmetric with the "up" version; (at least [Chlapik]
171 fet_beginchar("marcato down", "dmarcato", "dmarcato")
176 fet_beginchar("open (unstopped)", "open", "ouvert")
177 save thin, height, width, thick;
178 height# = 5/4 width#;
179 height# = 7/8 interline#;
180 thin = 1.2 stafflinethickness;
182 set_char_box(width#/2, width#/2, 0, height#);
189 penstroke z1e{up} .. {left}z2e;
190 addto currentpicture also currentpicture xscaled -1;
191 addto currentpicture also currentpicture reflectedabout((w,h/2), (0,h/2));
195 fet_beginchar("plus (stopped)", "stopped", "plusstop")
197 thick = 2 stafflinethickness;
198 size# = 1.1 interline#;
200 set_char_box(size#/2, size#/2, size#/2, size#/2);
201 pickup pencircle scaled thick;
208 draw (z1 .. z2) rotated 90;
214 fet_beginchar("Upbow", "upbow", "upbow")
217 thick = 1.4 stafflinethickness;
218 wd# = 1.3 interline#;
222 set_char_box(wd#/2, wd#/2, 0, ht#);
223 pickup pencircle scaled thick;
231 draw z2 -- z1 -- (z2 xscaled -1);
235 fet_beginchar("Downbow", "downbow", "downbow")
236 save stemthick, beamheight;
240 wd# = 7/4 interline#;
241 stemthick = 1.2 stafflinethickness;
243 set_char_box(wd#/2, wd#/2, 0, interline#);
248 pickup pencircle scaled blot_diameter;
249 top y2 - bot y1 = beamheight;
259 p := z1 -- z2 -- z3 -- z4 --cycle;
260 draw_rounded_path(p, blot_diameter);
261 pickup pencircle scaled stemthick;
267 labels(1, 2,3,4,5,6);
268 addto currentpicture also currentpicture xscaled -1;
272 % Inspired by a computer-set version of auf dem Strom by Baerenreiter.
275 fet_beginchar("Turn","turn","turn")
276 save thin, thick, ball_diam, darkness;
277 save wd, ht, thick_nibangle, ball_nib_thick;
281 wd# = 35/16 interline#;
282 ht# = 18/17 interline#;
283 darkness = 1.25 stafflinethickness;
285 set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
290 ball_nib_thick = 2.7 darkness;
291 ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
302 penpos1(1.1 thick, thick_nibangle);
303 penpos2(thick, thick_nibangle);
305 penpos4(ball_nib_thick, -90);
308 swoosh := z1l{curl 0} .. z2l .. z3l{up} .. {left}z4l
309 -- z4r .. z3r{down} .. z2r{left} ;
310 fill swoosh .. (swoosh scaled -1) .. cycle;
314 y5r = y4l - ball_diam /2;
317 penpos5(1.6 ball_diam/2, 10);
318 penpos6(ball_diam/2, 150);
320 ploop := z4l{left} .. z5l .. z6l -- cycle;
322 fill ploop scaled -1;
332 def draw_bulb(expr zl, zr, center_factor, radius_factor)=
338 z0 = center_factor [zr, zl];
339 rad = center_factor * length(zr-zl);
341 z1 = z0 + radius_factor* rad * dir(ang - 100);
342 z2 = z0 + rad * dir(ang - 270);
344 fill zr{dir (ang - 90)} .. z1 .. z2 -- cycle;
349 fet_beginchar("Trill (`tr')","utrill","utrill")
351 save start_angle, ascender_extra, ex, hair_thick, fatness,
352 slant_angle, slant, t_fatness, r_fatness, kerning;
355 define_pixels(ex, ascender_extra, ascender);
356 ascender_extra# = 1/2 ex#;
357 ascender# = ascender_extra# + ex#;
361 t_fatness = 8/10 fatness;
362 r_fatness = 8/10 fatness;
364 hair_thick = 2/3 blot_diameter;
370 penpos1(start_nib_wid, 25);
373 penpos2(start_nib_wid, 25);
375 z3l = (11/10 t_fatness, 0);
377 z4l = (13/6 t_fatness, 3/8 ex);
378 penpos4(hair_thick, 180);
380 1.9 [z3l, z3r] = z4r;
386 path t_p, krul_p, r_p;
389 t_p := z1l -- z2l{down} .. z3l{right} .. z4l{up} -- z4r{down}
390 .. z3r{left} .. z2r{up} .. z1r -- cycle;
395 pickup pencircle scaled hair_thick;
397 z5 = (t_fatness/2, 2/3 ex);
402 z7 = (2 t_fatness, ex);
404 krul_p := z4{up} .. tension 1.1 .. z5 .. {down}z6
405 .. tension 1.1 .. z5 --- z7;
408 penpos7(hair_thick, angle (z7-z5) + 90);
410 z8l = (2 t_fatness + 2 hair_thick, ex);
411 penpos8(2 hair_thick, 35);
415 penpos9(r_fatness, 0);
419 penpos10(r_fatness, 0);
421 r_p := z7l{z7-z5} .. z8l{right} .. z9l{down} --- z10l -- z10r
423 .. z8r{left} .. z7r{z5-z7} -- cycle;
425 set_char_box(0,2 interline#, 0,ascender#);
428 penpos11(1/4 r_fatness, -20);
431 z13 = (x9 + 2 r_fatness, y11 + 1/16 ex);
432 penpos13(r_fatness, 180);
433 fill z11r{dir 70} .. z13r{down} -- z13l{up} .. z11l{dir 250} -- cycle;
434 penlabels(range 1 thru 15);
436 draw_bulb(z13r, z13l, 0.5, 1.5);
439 fet_endgroup("foobars");