6 fet_begingroup("scripts")
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.25 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")
57 % FIXME: rounded endings
59 % `\accent' is TeX reserved.
60 fet_beginchar("> accent", "sforzato", "sforzatoaccent")
61 set_char_box(.9 interline#, .9 interline#, .5 interline#, .5 interline#);
62 save thickness, diminish;
64 thickness = 2 stafflinethickness;
65 pickup pencircle scaled thickness;
67 % prevent blobs at crossing lines
73 y2 = .25 thickness* diminish;
77 z3 = whatever [z1, z4];
79 penpos2(thickness*(2 - diminish)/2 , 90);
80 penpos1(thickness, 90);
81 penpos3(thickness, 90);
84 draw (z1 .. z3) yscaled -1;
87 penstroke (z3e .. z2e) yscaled -1;
93 fet_beginchar("staccato dot", "staccato", "staccato")
95 radius# = 1.5 stafflinethickness#;
96 define_pixels(radius);
97 pickup pencircle scaled 2 radius;
99 set_char_box(radius#, radius#, radius#, radius#);
102 def draw_staccatissimo =
104 height# = .8 interline#;
105 radius# = 2 stafflinethickness#;
106 define_pixels(radius, height);
108 draw_brush((0,0), stafflinethickness, (0, height),2 radius);
109 set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
112 fet_beginchar("staccatissimo/martellato up", "ustaccatissimo",
118 % FIXEM: scale labels too.
120 fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
125 fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
127 thick# = 1.2 stafflinethickness#;
128 define_pixels(thick);
130 set_char_box(.9 interline#, .9 interline#, thick#/2,thick#/2);
131 pickup pencircle scaled thick;
140 save fat_factor, thinness;
141 set_char_box(interline#/2, interline#/2, 0, 1.1 interline#);
144 thinness = stafflinethickness;
146 pickup pencircle scaled thinness;
154 z1 - z4 = whatever * (charwd, -charht);
155 z4 = fat_factor [z3, z5];
157 filldraw z1 -- z2 -- z3 -- z4 -- cycle;
161 fet_beginchar("marcato up", "umarcato", "umarcato")
168 % The down marcato char (not very much used).
169 % Contrary to what some MF/TeX `gurus' believe
170 % it is *point*-symmetric with the "up" version; (at least [Chlapik] and
171 % and [Wanske] agree with us)
173 fet_beginchar("marcato down", "dmarcato", "dmarcato")
178 fet_beginchar("open (unstopped)", "open", "ouvert")
179 save thin, height, width, thick;
180 height# = 5/4 width#;
181 height# = interline#;
182 thin = 1.2 stafflinethickness;
184 set_char_box(width#/2, width#/2, height#/2, height#/2);
191 penstroke z1e{up} .. {left}z2e;
192 addto currentpicture also currentpicture xscaled -1;
193 addto currentpicture also currentpicture yscaled -1;
197 fet_beginchar("plus (stopped)", "stopped", "plusstop")
199 thick = 2 stafflinethickness;
200 size# = 1.1 interline#;
202 set_char_box(size#/2, size#/2, size#/2, size#/2);
203 pickup pencircle scaled thick;
210 draw (z1 .. z2) rotated 90;
216 fet_beginchar("Upbow", "upbow", "upbow")
219 thick = 1.4 stafflinethickness;
220 wd# = 1.3 interline#;
224 set_char_box(wd#/2, wd#/2, 0, ht#);
225 pickup pencircle scaled thick;
233 draw z2 -- z1 -- (z2 xscaled -1);
237 fet_beginchar("Downbow", "downbow", "downbow")
238 save stemthick, beamheight;
242 wd# = 1.5 interline#;
243 stemthick = 1.2 stafflinethickness;
245 set_char_box(wd#/2, wd#/2, 0, 4/3 interline#);
250 pickup pencircle scaled blot_diameter;
251 top y2 - bot y1 = beamheight;
261 p := z1 -- z2 -- z3 -- z4 --cycle;
262 draw_rounded_path(p, blot_diameter);
263 pickup pencircle scaled stemthick;
269 labels(1, 2,3,4,5,6);
270 addto currentpicture also currentpicture xscaled -1;
274 % Inspired by a computer-set version of Auf dem Strom by Baerenreiter.
276 fet_beginchar("Turn","turn","turn")
277 save thin, thick, ball_diam, darkness;
278 save wd, ht, thick_nibangle, ball_nib_thick;
282 wd# = 35/16 interline#;
283 ht# = 18/17 interline#;
284 darkness = 1.20 stafflinethickness;
286 set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
291 ball_nib_thick = 2.7 darkness;
292 ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
303 penpos1(1.1 thick, thick_nibangle);
304 penpos2(thick, thick_nibangle);
306 penpos4(ball_nib_thick, -90);
309 swoosh := z1l{curl 0} .. z2l .. z3l{up} .. {left}z4l
310 -- z4r .. z3r{down} .. z2r{left} ;
311 fill swoosh .. (swoosh scaled -1) .. cycle;
315 y5r = y4l - ball_diam /2;
318 penpos5(1.6 ball_diam/2, 10);
319 penpos6(ball_diam/2, 150);
321 ploop := z4l{left} .. z5l .. z6l -- cycle;
323 fill ploop scaled -1;
333 def draw_bulb(expr zl, zr, center_factor, radius_factor)=
339 z0 = center_factor [zr, zl];
340 rad = center_factor * length(zr-zl);
342 z1 = z0 + radius_factor* rad * dir(ang - 100);
343 z2 = z0 + rad * dir(ang - 270);
345 fill zr{dir (ang - 90)} .. z1 .. z2 -- cycle;
351 % Inspired by a (by now) PD edition of Durand & C'ie edition of
352 % Saint-Saens' Celloconcerto no. 1
354 % FIXME take out hardcoded vars.
355 % FIXME the two loops on the `t' should be smoother (and the left one bigger).
356 % FIXME generic macros for serifs: top of the t and bottom of r
360 fet_beginchar("Trill (`tr')","trill","trill")
362 save start_nib_angle, ascender_extra, ex, hair_thick, fatness,
363 slant_angle, slant, t_fatness, r_fatness, kerning, t_overshoot,
364 uitschieter, bulb_size;
368 ascender_extra# = 1/2 ex#;
369 ascender# = ascender_extra# + ex#;
370 ex# = 1.5 interline#;
372 start_nib_angle = 20;
374 define_pixels(ex, ascender_extra, ascender, kerning);
376 t_overshoot = 0.03 ex;
378 t_fatness = 8/10 fatness;
379 r_fatness = .75 fatness;
380 uitschieter = 21/40 ex;
381 hair_thick = blot_diameter;
385 local_copy(transform)(currenttransform);
386 currenttransform := currenttransform slanted slant;
391 penpos1(start_nib_wid, start_nib_angle);
394 penpos2(start_nib_wid, start_nib_angle);
396 z3l = (11/10 t_fatness, - t_overshoot);
398 z4l = (13/6 t_fatness, 5/16 ex);
399 penpos4(hair_thick, 180);
401 1.9 [z3l, z3r] = z4r;
405 path t_p, krul_p, r_p;
408 t_p := z1l -- z2l{down} .. tension (1 + .5 slant)
411 .. z4l{up} -- z4r{down}
412 .. z3r{left} .. z2r{up} .. z1r -- cycle;
417 pickup pencircle scaled hair_thick;
419 z5 = (t_fatness/2, 2/3 ex);
421 lft x6 = - uitschieter;
424 z7 = z5 + whatever*dir krul_ang;
427 x7 = 5/10 kerning + x5;
429 penpos7(hair_thick, up_angle + 90);
434 penpos8(2 hair_thick, (up_angle +90)/2);
438 penpos9(r_fatness, 0);
442 penpos10(r_fatness, 0);
444 krul_p := z4{up} .. tension 1.1 .. z5
445 .. tension 1 and .75 .. {down}z6
446 .. tension .85 and 1.1 .. z5 --- z7;
448 r_p := z7l{z7-z5} .. z8l{right} .. z9l{down} --- z10l -- z10r
450 .. z8r{left} .. z7r{z5-z7} -- cycle;
452 set_char_box(0,2 interline#, 0,ascender#);
455 penpos11(1/4 r_fatness, -20);
458 z13 = (x9 + 2 r_fatness, y11 );
459 penpos13(r_fatness, 180);
460 fill z11r{dir 70} .. z13r{down} -- z13l{up} .. z11l{dir 250} -- cycle;
461 penlabels(range 1 thru 15);
463 draw_bulb(z13r, z13l, bulb_size, 1.5);
466 fet_beginchar("organ-heel", "pedalheel", "pedalheel")
467 save radius, thickness, wall;
469 radius# := .5 interline#;
471 define_pixels(radius);
472 set_char_box(radius#, radius#, radius#, 2/3 interline#);
474 thickness := 1.5 stafflinethickness;
475 pickup pencircle scaled thickness;
485 draw z1{down} .. z2{down} .. z3{left};
486 addto currentpicture also currentpicture xscaled -1;
490 fet_beginchar("organ-toe", "pedaltoe", "pedaltoe")
493 thickness := 1.5 stafflinethickness;
494 ht# := 1.5 interline#;
496 define_pixels(ht,wd);
499 set_char_box(wd#, wd#, 0, ht#);
501 pickup pencircle scaled thickness;
516 fet_endgroup("scripts");