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")
179 % used in french horn music todo
181 % TODO: too light at 20pt
182 fet_beginchar("open (unstopped)", "open", "ouvert")
183 save thin, height, width, thick;
184 height# = 5/4 width#;
185 height# = interline#;
186 thin = 1.2 stafflinethickness;
188 set_char_box(width#/2, width#/2, height#/2, height#/2);
195 penstroke z1e{up} .. {left}z2e;
196 addto currentpicture also currentpicture xscaled -1;
197 addto currentpicture also currentpicture yscaled -1;
201 fet_beginchar("plus (stopped)", "stopped", "plusstop")
203 thick = 2 stafflinethickness;
204 size# = 1.1 interline#;
206 set_char_box(size#/2, size#/2, size#/2, size#/2);
207 pickup pencircle scaled thick;
214 draw (z1 .. z2) rotated 90;
220 fet_beginchar("Upbow", "upbow", "upbow")
223 thick = 1.4 stafflinethickness;
224 wd# = 1.3 interline#;
228 set_char_box(wd#/2, wd#/2, 0, ht#);
229 pickup pencircle scaled thick;
237 draw z2 -- z1 -- (z2 xscaled -1);
241 fet_beginchar("Downbow", "downbow", "downbow")
242 save stemthick, beamheight;
246 wd# = 1.5 interline#;
247 stemthick = 1.2 stafflinethickness;
249 set_char_box(wd#/2, wd#/2, 0, 4/3 interline#);
254 pickup pencircle scaled blot_diameter;
255 top y2 - bot y1 = beamheight;
265 filldraw z1 -- z2 -- z3 -- z4 --cycle;
267 pickup pencircle scaled stemthick;
273 labels(1, 2,3,4,5,6);
274 addto currentpicture also currentpicture xscaled -1;
278 % Inspired by a computer-set version of Auf dem Strom by Baerenreiter.
280 fet_beginchar("Turn","turn","turn")
281 save thin, thick, ball_diam, darkness;
282 save wd, ht, thick_nibangle, ball_nib_thick;
286 wd# = 35/16 interline#;
287 ht# = 18/17 interline#;
288 darkness = 1.20 stafflinethickness;
290 set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
295 ball_nib_thick = 2.7 darkness;
296 ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
307 penpos1(1.1 thick, thick_nibangle);
308 penpos2(thick, thick_nibangle);
310 penpos4(ball_nib_thick, -90);
313 swoosh := z1l{curl 0} .. z2l .. z3l{up} .. {left}z4l
314 -- z4r .. z3r{down} .. z2r{left} ;
315 fill swoosh .. (swoosh scaled -1) .. cycle;
319 y5r = y4l - ball_diam /2;
322 penpos5(1.6 ball_diam/2, 10);
323 penpos6(ball_diam/2, 150);
325 ploop := z4l{left} .. z5l .. z6l -- cycle;
327 fill ploop scaled -1;
337 % Inspired by a (by now) PD edition of Durand & C'ie edition of
338 % Saint-Saens' Celloconcerto no. 1
340 % FIXME take out hardcoded vars.
341 % FIXME the two loops on the `t' should be smoother (and the left one bigger).
342 % FIXME generic macros for serifs: top of the t and bottom of r
346 fet_beginchar("Trill (`tr')","trill","trill")
348 save start_nib_angle, ascender_extra, ex, hair_thick, fatness,
349 slant_angle, slant, t_fatness, r_fatness, kerning, t_overshoot,
350 uitschieter, bulb_size;
354 ascender_extra# = 1/2 ex#;
355 ascender# = ascender_extra# + ex#;
356 ex# = 1.5 interline#;
358 start_nib_angle = 20;
360 define_pixels(ex, ascender_extra, ascender, kerning);
362 t_overshoot = 0.03 ex;
364 t_fatness = 8/10 fatness;
365 r_fatness = .75 fatness;
366 uitschieter = 21/40 ex;
367 hair_thick = blot_diameter;
371 local_copy(transform)(currenttransform);
372 currenttransform := currenttransform slanted slant;
377 penpos1(start_nib_wid, start_nib_angle);
380 penpos2(start_nib_wid, start_nib_angle);
382 z3l = (11/10 t_fatness, - t_overshoot);
384 z4l = (13/6 t_fatness, 5/16 ex);
385 penpos4(hair_thick, 180);
387 1.9 [z3l, z3r] = z4r;
391 path t_p, krul_p, r_p;
394 t_p := z1l -- z2l{down} .. tension (1 + .5 slant)
397 .. z4l{up} -- z4r{down}
398 .. z3r{left} .. z2r{up} .. z1r -- cycle;
403 pickup pencircle scaled hair_thick;
405 z5 = (t_fatness/2, 2/3 ex);
407 lft x6 = - uitschieter;
410 z7 = z5 + whatever*dir krul_ang;
413 x7 = 5/10 kerning + x5;
415 penpos7(hair_thick, up_angle + 90);
420 penpos8(2 hair_thick, (up_angle +90)/2);
424 penpos9(r_fatness, 0);
428 penpos10(r_fatness, 0);
430 krul_p := z4{up} .. tension 1.1 .. z5
431 .. tension 1 and .75 .. {down}z6
432 .. tension .85 and 1.1 .. z5 --- z7;
434 r_p := z7l{z7-z5} .. z8l{right} .. z9l{down} --- z10l -- z10r
436 .. z8r{left} .. z7r{z5-z7} -- cycle;
438 set_char_box(0,2 interline#, 0,ascender#);
441 penpos11(1/4 r_fatness, -20);
444 z13 = (x9 + 2 r_fatness, y11 );
445 penpos13(r_fatness, 180);
446 fill z11r{dir 70} .. z13r{down} -- z13l{up} .. z11l{dir 250} -- cycle;
447 penlabels(range 1 thru 15);
449 draw_bulb(-1, z13r, z13l, bulb_size, 1.5);
452 fet_beginchar("organ-heel", "pedalheel", "pedalheel")
453 save radius, thickness, wall;
455 radius# := .5 interline#;
457 define_pixels(radius);
458 set_char_box(radius#, radius#, radius#, 2/3 interline#);
460 thickness := 1.5 stafflinethickness;
461 pickup pencircle scaled thickness;
471 draw z1{down} .. z2{down} .. z3{left};
472 addto currentpicture also currentpicture xscaled -1;
476 fet_beginchar("organ-toe", "pedaltoe", "pedaltoe")
479 thickness := 1.5 stafflinethickness;
480 ht# := 1.5 interline#;
482 define_pixels(ht,wd);
485 set_char_box(wd#, wd#, 0, ht#);
487 pickup pencircle scaled thickness;
502 fet_endgroup("scripts");