1 % feta-klef.mf -- implement Clefs -*-Fundamental-*-
3 % part of LilyPond's pretty-but-neat music font
5 % source file of the Feta (not the Font-En-Tja) music font
7 % (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>,
8 % Jan Nieuwenhuizen <janneke@gnu.org>,
9 % Juergen Reuter <reuterj@ira.uka.de>
12 fet_begingroup("clefs");
15 % [Ross] says that clefs take 1 staff_space space on the left and right
17 def set_horizontal_spacing =
18 save left_space ,right_space;
24 % [Wanske] says the bulbs should be positioned about 1/4 right of the
26 def draw_c_clef (expr reduction) =
27 save hair, norm, reduced_il, right_edge;
28 reduced_il#=staff_space#*reduction;
29 norm#:=2/3reduced_il#;
32 set_horizontal_spacing;
33 right_edge# = 15/4norm#+2hair#;
35 set_char_box (left_space#, right_edge# + right_space#,
36 2 reduced_il#, 2 reduced_il#);
37 define_pixels (hair,norm,reduced_il, right_edge);
39 draw_block ((0,-d), (3/4norm+1/2hair,h));
40 draw_block ((3/4norm+2hair,-d),
46 z1l=(xoff+norm+hair,h);
47 penpos2(norm-3/2hair,180);
50 z3=(((right_edge -xoff)/2)+xoff,2hair);
53 z4=(xoff+1/2norm+1/2hair,reduced_il-hair);
58 penpos6(norm-hair,90);
66 p = z5l..z4l{up}..z4r{down}..z3r{right}..tension t..z2r{up}
67 ..tension t..z1r{left}..z1l{right}..tension t..z2l{down}
68 ..z3l{left}..z6r..z5r{down};
69 pickup pencircle scaled 1pt#;
70 filldraw p..(reverse p yscaled -1)..cycle;
71 penlabels (1,2,3,4,5,6);
73 % ugh, should be bulb, not flare?
74 draw_flare(z1l,180,90,hair,norm-1/2hair);
75 draw_flare(z7r,180,-90,hair,norm-1/2hair);
78 fet_beginchar ("C clef", "C", "altoclef")
80 draw_staff (-2,2, 0.0);
85 fet_beginchar ("C clef", "C_change", "caltoclef")
87 draw_staff (-2,2, 0.0);
93 % Inspired by Baerenreiter and Breitkopf
96 % FIXME: right vertical tangent seems to be lower than the F-line
97 % FIXME: bulb curve smoothly into "long curve" on the inside
100 % [Wanske] says that the extreme x point should be exactly between
101 % the dots, but her picture shows that the extreme is ~ 0.2 ss lower
103 def draw_bass_clef(expr exact_center, reduction) =
104 save reduced_il, left_tilt, left_thick, ball_to_right;
105 reduced_il# = staff_space# * reduction;
107 set_horizontal_spacing;
108 ball_to_right# = 2.1 reduced_il#;
109 set_char_box(left_space# +
110 - xpart exact_center,
112 xpart exact_center + ball_to_right# + 7/12 reduced_il#,
113 - ypart exact_center + 2.5 reduced_il#,
114 ypart exact_center +reduced_il#);
116 define_pixels(reduced_il, ball_to_right);
118 left_thick = .25 reduced_il;
120 x1r - x1l = left_thick;
121 z1l = (hround_pixels(xpart exact_center),
122 vround_pixels(ypart exact_center));
126 x3l - x1l = ball_to_right;
128 x3l - x3r = .48 reduced_il;
129 y3l = -0.05 staff_space;
130 x4 = x1l - stafflinethickness;
131 y4 = -2.2 reduced_il;
132 z5 = (x3l + 1/3 reduced_il, .5 reduced_il);
134 penpos1(whatever, left_tilt);
135 penpos2(1.2 stafflinethickness, -90);
136 penpos3(whatever, 185);
137 penpos4(stafflinethickness, 135);
139 draw_bulb(1, z1r, z1l, .45 reduced_il, 1.0);
142 fill z1r{up} .. z2r{right} .. tension 1.0 .. z3r{down} .. {curl 0}
143 simple_serif(z4r, z4l, 90) {curl 0}
144 .. z3l{up} .. tension 0.9 .. z2l{left}
145 .. z1l{dir (-90 + left_tilt)} -- cycle;
150 2 dot_diam = reduction* (staff_space - stafflinethickness);
151 pickup pencircle scaled dot_diam;
158 fet_beginchar("F clef ", "F", "bassclef")
160 draw_staff(-3,1, 0.0);
162 draw_bass_clef((.5 staff_space#, 0), 1.0);
164 fet_beginchar("F clef (reduced)", "F_change", "cbassclef")
165 draw_bass_clef((.4 staff_space#, 0),0.8);
171 % Inspired by Baerenreiter
173 % FIXME bulb should curve (see bass clef)
174 % FIXME start (inside) should be little thinner
178 % Beste lezers, kijk,
180 % Een bolletje hebben we bij toeval allemaal wel eens getekend, maar begint u
181 % toch eenvoudig. Eerst een eenvoudig kruis of herstellingsteken
182 % en via de dubbelslag naar een voorzichtig vlaggetje, en heb geduld!
183 % Ikzelf heb bijvoorbeeld over mijn eerste gave G-sleutel
184 % 35 kilobyte metafont, 12 patchlevels, 0 vriendinnen en 45 dagen gedaan
186 % -- vrij naar Van Kooten & De Bie
189 def draw_gclef (expr exact_center, reduction)=
190 save reduced_il, downstroke_dir, downstroke_angle, hair, center;
191 save breapth_factor, inner_thick_end, thinness, thickness, thinnib;
192 save inner_start_angle, thinness, thinpen;
193 reduced_il# = staff_space# * reduction;
194 define_pixels(reduced_il);
195 pair downstroke_dir, center;
197 center := (hround_pixels(xpart exact_center),
198 vround_pixels(ypart exact_center));
200 hair = .3 stafflinethickness;
201 thinness = 1.3 stafflinethickness;
202 downstroke_dir = (14, -75);
203 breapth_factor = 11/7;
204 inner_thick_end = 45;
205 inner_start_angle = downstroke_angle - 43;
206 thickness = .4 reduced_il - hair;
208 thinnib = thinness - hair;
210 set_horizontal_spacing;
214 -xpart exact_center + 1.0 * breapth_factor* reduced_il#,
216 xpart exact_center + .66 breapth_factor* reduced_il#,
217 -ypart exact_center + 3 * reduced_il#,
218 ypart exact_center + 5 * reduced_il#);
220 pickup pencircle scaled hair;
221 downstroke_angle = angle downstroke_dir;
223 z1 = center + whatever * dir (inner_start_angle);
224 x1 = xpart center -.28 reduced_il;
226 top z2r = center + (0,reduced_il + stafflinethickness/2);
228 x4 = xpart center - .1 reduced_il;
229 bot y4r = -(reduced_il + .5 stafflinethickness);
231 z3 = (z4 - center) rotated inner_thick_end + center;
233 z5r = (- breapth_factor, .37)* reduced_il + center;
234 penpos5(thickness, 135);
236 z6 = center + whatever * downstroke_dir;
237 y6 = ypart center + 2 reduced_il;
239 z7l - z6 = whatever *(z5- z6) ;
240 y7l = 3.5 reduced_il;
241 z8r = .4 [z9r, z7r] + 1.5 stafflinethickness * dir 52;
244 top y9l = 5 reduced_il;
247 y11 = -11/7 reduced_il;
249 y12 = ypart center - 18.5/7 reduced_il;
250 x12 = x11 - 5 /7 reduced_il;
252 z13 = z12 + .6 reduced_il*(-1,1);
254 (z10r - z10l) dotprod (unitvector downstroke_dir rotated 90) =
257 center - z10= whatever * downstroke_dir;
258 center - z11 = whatever * downstroke_dir;
259 center - z14 = .8 (center - z11);
260 penpos1(thinnib, inner_start_angle);
261 penpos2(thickness, 90);
262 penpos3(thinnib, -90 + inner_thick_end);
263 penpos4(thinnib, -90);
266 penpos7(thickness, 135);
267 penpos8(1.5 thinnib, - 70 + angle downstroke_dir);
268 penpos9(1.4 thickness, -80); % ugh
269 penpos10(whatever, downstroke_angle + 10);
270 penpos11(thinnib, downstroke_angle + 90);
271 penpos14(thinnib, downstroke_angle + 90);
272 penpos12(thinnib, -90);
273 penpos13(3 thinnib, 180);
275 filldraw z2l{right} .. z3l.. z4l{left} .. z5l{up} .. z7l{up}
279 {downstroke_dir}z10l --- z11l -- z11r --- z10r{- downstroke_dir}
281 .. z9r & z9r{dir (downstroke_angle+ 40)} % ugh
283 .. z7r{down} .. z5r{down} .. z4r{right}
284 .. z3r .. z2r{left} ..
287 .. tension 0.85 ..cycle;
289 filldraw simple_serif(z1r, z1l, 90) -- cycle;
291 filldraw z12r{left} .. z13r{up} -- z13l{down} .. z12l{right} .. cycle;
293 draw_bulb(-1, z13l, lft z13r, 6/14 reduced_il, 1.0);
295 pickup pencircle scaled (thinpen);
296 draw z10 --- z14 .. z11 .. tension 0.85 .. z12{left};
298 penlabels(range 1 thru 15);
302 fet_beginchar("G clef", "G", "trebleclef")
304 draw_staff(-1,3, 0.0);
306 draw_gclef((1.7 staff_space#,0), 1.0);
308 fet_beginchar("G clef", "G_change", "ctrebleclef")
309 draw_gclef((1.3 staff_space#,0), .8);
320 def draw_vaticana_do_clef(expr exact_center, reduction) =
323 reduced_il# = staff_space# * reduction;
325 set_char_box(0.4reduced_il#, 0.4reduced_il#, 0, reduced_il#);
327 define_pixels(reduced_il);
329 pickup pencircle xscaled stafflinethickness yscaled 0.6reduced_il;
331 save za, zb, zc, zd, ze, zf;
332 pair za, zb, zc, zd, ze, zf;
334 za = exact_center + (-0.0reduced_il, -.45reduced_il);
335 zb = exact_center + (-0.2reduced_il, -.50reduced_il);
336 zc = exact_center + (-0.4reduced_il, -.25reduced_il);
337 zd = exact_center + (-0.4reduced_il, +.25reduced_il);
338 ze = exact_center + (-0.2reduced_il, +.50reduced_il);
339 zf = exact_center + (-0.0reduced_il, +.45reduced_il);
340 draw za .. zb .. zc -- % lower punctum
341 zd .. ze .. zf; % upper punctum
345 fet_beginchar("Ed. Vat. do clef", "vaticana_do", "vatdoclef")
347 draw_staff(-1,3, 0.0);
349 draw_vaticana_do_clef((0,0), 1.0);
351 fet_beginchar("Ed. Vat. do clef", "vaticana_do_change", "vatcdoclef")
352 draw_vaticana_do_clef((0,0), 1.0); % no reduction
356 def draw_vaticana_fa_clef(expr exact_center, reduction) =
359 reduced_il# = staff_space# * reduction;
360 define_pixels(reduced_il);
362 save za, zb, zc, zd, ze;
363 pair za, zb, zc, zd, ze;
366 pickup pencircle scaled stafflinethickness;
367 xpart za = xpart zb =
368 xpart exact_center + 0.4reduced_il;
369 ypart za = ypart exact_center = ypart zb + 1.5reduced_il;
373 pickup pencircle xscaled stafflinethickness yscaled 0.5reduced_il;
375 (+0.4reduced_il, -0.05reduced_il);
377 (+0.2reduced_il, +0.05reduced_il);
379 (+0.0reduced_il, +0.00reduced_il);
382 %right-handed puncta as in do clef
383 draw_vaticana_do_clef(
385 (+0.8reduced_il + 1.25stafflinethickness, 0),
388 set_char_box(0.5reduced_il#, 1.5reduced_il#, 0, reduced_il#);
392 fet_beginchar("Ed. Vat. fa clef", "vaticana_fa", "vatfaclef")
394 draw_staff(-1,3, 0.0);
396 draw_vaticana_fa_clef((0,0), 1.0);
398 fet_beginchar("Ed. Vat. fa clef", "vaticana_fa_change", "vatcfaclef")
399 draw_vaticana_fa_clef((0,0), 1.0); % no reduction
410 def draw_medicaea_do_clef(expr exact_center, reduction) =
411 save reduced_il, reduced_slt;
412 reduced_il# = staff_space# * reduction;
413 reduced_slt# = stafflinethickness# * reduction;
414 define_pixels(reduced_il);
415 define_pixels(reduced_slt);
418 flag_height# = 0.5 reduced_il#;
419 define_pixels(flag_height);
424 pickup pencircle xscaled reduced_slt yscaled flag_height;
426 = xpart za + 0.5 reduced_il
427 = xpart zb - 0.5 reduced_il;
428 ypart za = ypart exact_center - 0.5 flag_height
429 - 0.5 (staff_space - reduced_il);
430 ypart zb = ypart za - reduced_il + flag_height;
436 pickup pencircle xscaled reduced_slt yscaled flag_height;
438 = xpart za + 0.5 reduced_il
439 = xpart zb - 0.5 reduced_il;
440 ypart za = ypart exact_center - 0.5 flag_height
441 - 0.5 (staff_space - reduced_il)
443 ypart zb = ypart za - reduced_il + flag_height;
449 pickup pencircle scaled reduced_slt;
450 xpart za = xpart zb = xpart exact_center - 0.5 reduced_il;
452 = ypart za + 1.5 reduced_il
453 = ypart zb - 1.5 reduced_il;
456 set_char_box(0.5reduced_il#, 1.5reduced_il#,
457 1.5reduced_il#, 1.5reduced_il#);
461 fet_beginchar("Ed. Med. do clef", "medicaea_do", "meddoclef")
463 draw_staff(-1,3, 0.0);
465 draw_medicaea_do_clef((0,0), 1.0);
467 fet_beginchar("Ed. Med. do clef", "medicaea_do_change", "cmeddoclef")
468 draw_medicaea_do_clef((0,0), .8);
472 def draw_medicaea_fa_clef(expr exact_center, reduction) =
473 % inspired by Regensburger Edition of Medicaea (1885/86), in:
474 % MGG, volume 2, col. 1327 ("Choralreform"), fig. 2.
476 save reduced_il, reduced_slt;
477 reduced_il# = staff_space# * reduction;
478 reduced_slt# = stafflinethickness# * reduction;
479 define_pixels(reduced_il);
480 define_pixels(reduced_slt);
482 save za, zb, zc, zd, ze;
483 pair za, zb, zc, zd, ze;
486 pickup pencircle scaled stafflinethickness;
487 xpart za = xpart zb =
488 xpart exact_center + 0.4reduced_il;
489 ypart za = ypart exact_center = ypart zb + 1.5reduced_il;
493 pickup pencircle xscaled reduced_slt yscaled reduced_il;
500 %right-handed puncta as in do clef
501 draw_medicaea_do_clef(
503 (+1.1reduced_il + 1.25stafflinethickness, 0),
506 set_char_box(reduced_il#/2, 2.6reduced_il#, 0, reduced_il#);
510 fet_beginchar("Ed. Med. fa clef", "medicaea_fa", "medfaclef")
512 draw_staff(-1,3, 0.0);
514 draw_medicaea_fa_clef((0,0), 1.0);
516 fet_beginchar("Ed. Med. fa clef", "medicaea_fa_change", "cmedfaclef")
517 draw_medicaea_fa_clef((0,0), .8);
529 brevis_wid# := 2 staff_space#;
531 def draw_brevis(expr exact_center, reduction, small_width, small_height) =
533 % inspired by function draw_brevis of
536 save reduced_slt, reduced_nht;
537 save stem_width, head_width;
538 save serif_size, serif_protrude;
539 save holeheight, beamheight;
541 reduced_slt# = stafflinethickness# * reduction;
542 reduced_nht# = noteheight# * reduction;
543 stem_width# = 1.4 reduced_slt#;
545 head_width# = 0.5brevis_wid# * reduction;
547 head_width# = brevis_wid# * reduction;
550 serif_size# = 0.64 reduced_slt#;
551 serif_protrude# = 0.96 serif_size#;
552 holeheight# = 3 reduced_slt#;
553 beamheight# = 0.32(reduced_nht# - holeheight#);
555 serif_size# = 1.0 reduced_slt#;
556 serif_protrude# = 1.5 serif_size#;
557 holeheight# = 3 reduced_slt#;
558 beamheight# = 0.5(reduced_nht# - holeheight#);
560 define_pixels(reduced_slt);
561 define_pixels(stem_width);
562 define_pixels(head_width);
563 define_pixels(serif_size);
564 define_pixels(serif_protrude);
565 define_pixels(beamheight);
567 penpos1(stem_width, 0);
568 penpos2(stem_width, 0);
569 penpos3(beamheight, 90);
570 penpos4(beamheight, 90);
571 penpos5(stem_width, 180);
574 z2l = z1l + (0, -reduced_slt/2);
575 z3r = z2r + serif_size*(1,-1);
577 x4l = x1l + head_width/2;
578 z5l = z3l + (-serif_size, -serif_protrude);
580 penlabels(1,2,3,4,5);
581 fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
582 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
586 def draw_neo_mensural_c_clef(expr exact_center, reduction) =
587 draw_brevis(exact_center, reduction, false, false);
589 save reduced_il, reduced_slt;
592 reduced_il# = staff_space# * reduction;
593 reduced_slt# = stafflinethickness# * reduction;
594 stem_width# = 1.4 reduced_slt#;
596 define_pixels(reduced_il);
597 define_pixels(reduced_slt);
598 define_pixels(stem_width);
600 penpos6(stem_width, 0);
601 penpos7(stem_width, 0);
603 z7l = z6l + (0, -2reduced_il);
604 fill z6l -- z7l -- z7r -- z6r -- cycle;
605 penpos8(stem_width, 0);
606 penpos9(stem_width, 0);
607 z8l = z6l + (-3reduced_slt, 0);
608 z9l = z8l + (0, -2reduced_il);
609 fill z8l -- z9l -- z9r -- z8r -- cycle;
611 addto currentpicture also currentpicture
612 yscaled -1 shifted (0, 2*(ypart exact_center));
613 addto currentpicture also currentpicture
614 xscaled -1 shifted (2x4l,0);
616 set_char_box(0, 2head_width#,
617 6reduced_slt#*reduction, 6reduced_slt#*reduction);
621 fet_beginchar("neo-mensural c clef", "neo_mensural_c", "neomenscclef")
623 draw_staff(-1,3, 0.0);
625 draw_neo_mensural_c_clef((0,0), 1.0);
627 fet_beginchar("neo-mensural c clef", "neo_mensural_c_change", "cneomenscclef")
628 draw_neo_mensural_c_clef((1.3 staff_space#,0), .8);
632 def draw_petrucci_c_clef(expr exact_center, reduction) =
633 % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
634 % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
635 draw_brevis(exact_center, reduction, true, true);
637 save reduced_il, reduced_slt;
638 save stem_width, interline;
640 reduced_il# = staff_space# * reduction;
641 reduced_slt# = stafflinethickness# * reduction;
642 stem_width# = 1.4 reduced_slt#;
643 interline# = staff_space#;
645 define_pixels(reduced_il);
646 define_pixels(reduced_slt);
647 define_pixels(stem_width);
648 define_pixels(interline);
650 addto currentpicture also currentpicture
651 yscaled -1 shifted (0, 2*(ypart exact_center) - interline);
653 penpos6(stem_width, 0);
654 penpos7(stem_width, 0);
655 z6l = exact_center + (0, 0);
656 z7l = z6l + (0, -2.2reduced_il);
657 fill z6l -- z7l -- z7r -- z6r -- cycle;
659 addto currentpicture also currentpicture
660 xscaled -1 shifted (2x4l,0);
662 penpos8(stem_width, 0);
663 penpos9(stem_width, 0);
664 z8l = exact_center + (0, 0);
665 z9l = z8l + (0, -3.2reduced_il);
666 fill z8l -- z9l -- z9r -- z8r -- cycle;
668 addto currentpicture also currentpicture
669 yscaled -1 shifted (0, 4*(ypart exact_center));
671 set_char_box(0, 2head_width#,
672 noteheight#*4*reduction, noteheight#*4*reduction);
676 fet_beginchar("petrucci c clef", "petrucci_c", "petruccicclef")
678 draw_staff(-1,3, 0.0);
680 draw_petrucci_c_clef((0,0), 1.0);
682 fet_beginchar("petrucci c clef", "petrucci_c_change", "cpetruccicclef")
683 draw_petrucci_c_clef((1.3 staff_space#,0), .8);
687 def draw_mensural_c_clef(expr exact_center, reduction) =
688 % inspired by Ockeghem, "Missa Prolationum", in: MGG, volume
690 draw_petrucci_c_clef(exact_center, reduction);
692 addto currentpicture also currentpicture
693 shifted (0, -interline);
695 set_char_box(0, 2head_width#,
696 noteheight#*6*reduction, noteheight#*6*reduction);
700 fet_beginchar("mensural c clef", "mensural_c", "menscclef")
702 draw_staff(-1,3, 0.0);
704 draw_mensural_c_clef((0,0), 1.0);
706 fet_beginchar("mensural c clef", "mensural_c_change", "cmenscclef")
707 draw_mensural_c_clef((0,0), .8);
710 def draw_diamond(expr exact_center, reduction) =
711 save stem_width, reduced_il, reduced_nht, holeheight, beamheight;
712 save rh_height, rh_width;
714 stem_width# = 1.4 reduced_slt#;
715 reduced_il# = staff_space# * reduction;
716 reduced_nht# = noteheight# * reduction;
717 holeheight# = 3 reduced_slt#;
718 beamheight# = 0.4(reduced_nht# - holeheight#);
720 rh_height# = 1.2reduced_il#;
721 rh_width# / rh_height# = 0.58; % tan(30)
723 define_pixels(beamheight);
724 define_pixels(stem_width);
725 define_pixels(rh_height);
726 define_pixels(rh_width);
734 exact_center + (-rh_width/2, 0) --
735 exact_center + (0, rh_height/2) --
736 exact_center + (+rh_width/2, 0) --
737 exact_center + (0, -rh_height/2) --
741 def draw_petrucci_f_clef(expr exact_center, reduction) =
742 % inspired by L'homme arme super voces musicales in Misse
743 % Josquin, 1502, Petrucci, in: MGG, volume 7, col. 200; also
744 % inspired by Gaspar van Weerbeke, "Virgo Maria" (1502), in:
745 % MGG, volume 9, col. 653 ("Motette"), fig. 3.; also by Andr'e
746 % Campra, "Entr'ee des s'er'enades" (1710), in: MGG, volume 2,
747 % col. 1649 ("Contredanse"), fig. 2.
749 draw_brevis(exact_center, reduction, true, false);
751 save reduced_il, reduced_slt;
752 save stem_width, interline;
754 reduced_il# = staff_space# * reduction;
755 reduced_slt# = stafflinethickness# * reduction;
756 stem_width# = 1.4 reduced_slt#;
757 interline# = staff_space#;
759 define_pixels(reduced_il);
760 define_pixels(reduced_slt);
761 define_pixels(stem_width);
762 define_pixels(interline);
764 addto currentpicture also currentpicture
765 yscaled -1 shifted (0, 2*(ypart exact_center));
766 addto currentpicture also currentpicture
767 xscaled -1 shifted (2x4l,0);
769 penpos6(stem_width, 0);
770 penpos7(stem_width, 0);
771 z6r = exact_center + (2x4l, 0);
772 z7r = z6r + (0, -4reduced_il);
773 fill z6l -- z7l -- z7r -- z6r -- cycle;
775 draw_diamond(exact_center +
776 (1.6interline*reduction, interline/2), reduction);
779 penpos8(stem_width, 0);
780 penpos9(stem_width, 0);
781 z8l = exact_center + (1.6interline*reduction, interline*reduction);
782 z9l = z8l + (0, 1.5interline*reduction);
783 fill z8l -- z9l -- z9r -- z8r -- cycle;
785 draw_diamond(exact_center +
786 (1.6interline*reduction, -interline/2), reduction);
787 penpos10(stem_width, 0);
788 penpos11(stem_width, 0);
789 z10r = exact_center + (1.6interline*reduction, -interline*reduction);
790 z11r = z10r + (0, -3.5interline*reduction);
791 fill z10l -- z11l -- z11r -- z10r -- cycle;
793 set_char_box(0, 3head_width#,
794 3.5noteheight#*reduction, 1.5noteheight#*reduction);
798 fet_beginchar("petrucci f clef", "petrucci_f", "petruccifclef")
800 draw_staff(-1,3, 0.0);
802 draw_petrucci_f_clef((0,0), 1.0);
804 fet_beginchar("petrucci f clef", "petrucci_f_change", "cpetruccifclef")
805 draw_petrucci_f_clef((0,0), .8);
809 def draw_mensural_f_clef(expr exact_center, reduction) =
811 % inspired by Philippe le Duc, "Dite Signori" (1590), in: MGG,
812 % volume 3, col. 848 ("Duc"); also by John Dowland, "The First
813 % Booke of Songes" (1597), in: MGG, volume 3, col. 721
814 % ("Dowland"), fig. 3.
816 save reduced_slt, stem_width, reduced_nht, holeheight, beamheight;
818 reduced_slt# = stafflinethickness# * reduction;
819 stem_width# = 1.4 reduced_slt#;
820 reduced_nht# = noteheight# * reduction;
821 holeheight# = 3 reduced_slt#;
822 beamheight# = 0.4(reduced_nht# - holeheight#);
824 define_pixels(beamheight, stem_width, staff_space);
832 exact_center + (1.0 staff_space, 0.6 staff_space) --
833 exact_center + (1.25 staff_space, 0.4 staff_space);
836 exact_center + (1.0 staff_space, -0.4 staff_space) --
837 exact_center + (1.25 staff_space, -0.6 staff_space);
839 draw halfcircle scaled 1.2 staff_space rotated -90
840 shifted (-exact_center + (+0.1 staff_space, 0));
842 set_char_box(0, 3staff_space#, 3staff_space#, 0);
845 fet_beginchar("mensural f clef", "mensural_f", "mensfclef")
847 draw_staff(-1,3, 0.0);
849 draw_mensural_f_clef((0,0), 1.0);
851 fet_beginchar("mensural f clef", "mensural_f_change", "cmensfclef")
852 draw_mensural_f_clef((0,0), .8);
856 def draw_mensural_g_clef(expr exact_center, reduction) =
858 % inspired by Francisco Guerrero, "Lib. 1. Missarum" (1566),
859 % in: MGG, volume 3, col. 858 ("Ducis"); also by Stefano
860 % Fabri, "Quam speciosa veteranis" (1611), in: MGG, volume 3,
861 % col. 1698 ("Fabri"); also by Philippus Dulichius,
862 % "Fasciculus novus ..." (1598), in: MGG, volume 3, col. 919
863 % ("Dulichius"), fig. 1; also by Noe Faignient, "Ic sal de
864 % Heer myn God gebenedye" (1568), in: MGG, volume 3, col. 1735
867 % Metafont code partially inspired by Schwabacher 'G' of yswab
870 save reduced_il, stem_width, height, width, apex_o, hair;
872 reduced_il#=staff_space#*reduction;
874 set_char_box(0.5reduced_il#, 1.5reduced_il#,
875 1.5reduced_il#, 1.5reduced_il#);
877 stem_width# = 0.17 reduced_il#;
878 height# = 1.5 reduced_il#;
879 width# = 1.13 reduced_il#;
880 apex_o# = 0.02 reduced_il#;
881 hair# = 3 stafflinethickness#;
882 define_pixels(reduced_il, stem_width, height, width, apex_o, hair);
884 penpos1(2 stem_width, -142);
885 z1l = (0.715 width, 0.742 height);
888 penpos2(1.179 stem_width, -142);
889 z2l = (width, 0.466 height);
891 z3 = (0.764 width, 0.067 height);
892 z4 = (0.59 width, -apex_o);
893 penpos5(1.179 stem_width, 32);
894 z5l=(0, 0.457 height);
895 penpos6(hair, -56.5);
896 z7 = (x4 - 0.843 stem_width, height + apex_o);
897 z7 - z6l = whatever * dir33.5;
898 penpos8(1.286 stem_width, -130);
899 z8r = (0.715 width, 0.742 height) + (-apex_o, apex_o);
900 z6r - z8r = whatever * (z7 - z8l);
902 z1'r{dir45} .. z2r{down} .. z3r{dir207} .. z5r{up} ..
903 z6r{z7-z6l} & z6r -- z8r -- z8l -- z7 --- z6l ...
904 z5l{down} .. z4{right} .. z3l{dir27} .. z2l{up} ..
905 z1l{1/3[z6l,z7]-z1l} & z1l -- z1r -- z1'r & cycle
906 shifted (-exact_center + (0, -0.75reduced_il));
908 penpos9(stem_width, 0);
909 x9r = x4; y9 = 0.3 height;
914 draw z9 -- (z9 + (0, -0.4reduced_il))
915 shifted (-exact_center + (0, -0.75reduced_il));
923 scaled 0.5 reduced_il
926 shifted (0, 0.25reduced_il)
927 shifted (-exact_center + (0, -0.75reduced_il));
930 scaled 0.4 reduced_il
932 shifted (z8 + (0, 0.45 reduced_il))
933 shifted (0, 0.25reduced_il)
934 shifted (-exact_center + (0, -0.75reduced_il));
938 fet_beginchar("mensural g clef", "mensural_g", "mensgclef")
940 draw_staff(-1,3, 0.0);
942 draw_mensural_g_clef((0,0), 1.0);
944 fet_beginchar("mensural g clef", "mensural_g_change", "cmensgclef")
945 draw_mensural_g_clef((0,0), .8);
950 def draw_petrucci_g_clef(expr exact_center, reduction) =
951 % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
952 % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
954 set_char_box(0.6 staff_space#, 0.8 staff_space#, 0.6 staff_space#,
957 save reduced_il, reduced_slt;
959 reduced_il# = staff_space# * reduction;
960 reduced_slt# = stafflinethickness# * reduction;
961 define_pixels(reduced_il, reduced_slt);
963 save za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
964 pair za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
967 xscaled 0.50 reduced_slt
968 yscaled 0.22 reduced_il
971 za = exact_center + (+0.00 reduced_il, +0.00 reduced_il);
972 zb = exact_center + (+0.20 reduced_il, +1.20 reduced_il);
973 zc = exact_center + (-0.10 reduced_il, +2.00 reduced_il);
974 zd = exact_center + (-0.50 reduced_il, +3.00 reduced_il);
975 ze = exact_center + (+0.00 reduced_il, +3.70 reduced_il);
976 zf = exact_center + (+0.20 reduced_il, +3.00 reduced_il);
977 zg = exact_center + (-0.20 reduced_il, +2.00 reduced_il);
978 zh = exact_center + (-0.50 reduced_il, +1.70 reduced_il);
979 zi = exact_center + (-0.80 reduced_il, +0.75 reduced_il);
980 zj = exact_center + (-0.60 reduced_il, +0.60 reduced_il);
982 draw za{-1,2} .. zb .. zc .. zd .. ze .. zf .. zg .. zh .. zi .. zj;
984 save za, zb, zc, zd, ze, zf;
985 pair za, zb, zc, zd, ze, zf;
988 xscaled 0.75 reduced_slt
989 yscaled 0.33 reduced_il
992 za = exact_center + (+0.25 reduced_il, +0.45 reduced_il);
993 zb = exact_center + (-0.25 reduced_il, +0.45 reduced_il);
994 zc = exact_center + (-0.25 reduced_il, -0.45 reduced_il);
995 zd = exact_center + (+0.25 reduced_il, -0.45 reduced_il);
996 ze = exact_center + (+0.30 reduced_il, +0.00 reduced_il);
997 zf = exact_center + (+0.00 reduced_il, +0.00 reduced_il);
999 draw za .. zb .. zc .. zd .. {up}ze -- zf;
1003 fet_beginchar("petrucci g clef", "petrucci_g", "petruccigclef")
1005 draw_staff(-1,3, 0.0);
1007 draw_petrucci_g_clef((0,0), 1.0);
1009 fet_beginchar("petrucci g clef", "petrucci_g_change", "cpetruccigclef")
1010 draw_petrucci_g_clef((0,0), .8);
1023 def draw_hufnagel_do_clef(expr exact_center, reduction) =
1025 % inspired by Graduale of Friedrich Zollner (1442), in: MGG,
1026 % volume 9, col. 1413 ("Neustift"), fig. 1.
1030 reduced_il# = staff_space# * reduction;
1032 define_pixels(reduced_il);
1035 xscaled (0.60reduced_il)
1036 yscaled (0.10reduced_il)
1038 save za, zb, zc, zd, ze, zf;
1039 pair za, zb, zc, zd, ze, zf;
1041 za = exact_center + (+0.30reduced_il, +.45reduced_il);
1042 zb = exact_center + (+0.20reduced_il, +.45reduced_il);
1043 zc = exact_center + (-0.10reduced_il, +.60reduced_il);
1044 zd = exact_center + (-0.40reduced_il, +.45reduced_il);
1045 ze = exact_center + (-0.40reduced_il, -.45reduced_il);
1046 zf = exact_center + (-0.20reduced_il, -.55reduced_il);
1047 draw za .. zb .. zc -- zd -- ze -- zf;
1049 set_char_box(0.5reduced_il#, 0.5reduced_il#, 0, reduced_il#);
1053 fet_beginchar("Hufnagel do clef", "hufnagel_do", "hufnageldoclef")
1055 draw_staff(-1,3, 0.0);
1057 draw_hufnagel_do_clef((0,0), 1.0);
1059 fet_beginchar("Hufnagel do clef", "hufnagel_do_change", "chufnageldoclef")
1060 draw_hufnagel_do_clef((1.3 staff_space#,0), .8);
1064 def draw_hufnagel_fa_clef(expr exact_center, reduction) =
1066 % inspired by Bamberger Manuscript (15th century), in:
1067 % MGG, volume 2, table 59.
1071 reduced_il# = staff_space# * reduction;
1073 define_pixels(reduced_il);
1076 xscaled (0.60reduced_il)
1077 yscaled (0.10reduced_il)
1079 save za, zb, zc, zd, ze, zf;
1080 pair za, zb, zc, zd, ze, zf;
1082 za = exact_center + (+0.30reduced_il, +0.70reduced_il);
1083 zb = exact_center + (+0.20reduced_il, +0.70reduced_il);
1084 zc = exact_center + (-0.10reduced_il, +0.85reduced_il);
1085 zd = exact_center + (-0.40reduced_il, +0.70reduced_il);
1086 ze = exact_center + (-0.40reduced_il, -1.10reduced_il);
1087 draw za .. zb .. zc -- zd -- ze;
1089 save zg, zh, zi, zj;
1090 pair zg, zh, zi, zj;
1092 zg = exact_center + (+0.30reduced_il, -0.05reduced_il);
1093 zh = exact_center + (+0.20reduced_il, -0.05reduced_il);
1094 zi = exact_center + (-0.10reduced_il, +0.10reduced_il);
1095 zj = exact_center + (-0.40reduced_il, -0.05reduced_il);
1096 draw zg .. zh .. zi -- zj;
1098 set_char_box(0.5reduced_il#, 0.5reduced_il#, 0, reduced_il#);
1102 fet_beginchar("Hufnagel fa clef", "hufnagel_fa", "hufnagelfaclef")
1104 draw_staff(-1,3, 0.0);
1106 draw_hufnagel_fa_clef((0,0), 1.0);
1108 fet_beginchar("Hufnagel fa clef", "hufnagel_fa_change", "chufnagelfaclef")
1109 draw_hufnagel_fa_clef((0,0), .8);
1113 def draw_hufnagel_do_fa_clef(expr exact_center, reduction) =
1114 draw_hufnagel_do_clef(exact_center, reduction);
1115 draw_hufnagel_fa_clef(exact_center + (0, -2staff_space), reduction);
1119 fet_beginchar("Hufnagel do/fa clef", "hufnagel_do_fa", "hufnageldofaclef")
1121 draw_staff(-1,3, 0.0);
1123 draw_hufnagel_do_fa_clef((0,0), 1.0);
1125 fet_beginchar("Hufnagel do/fa clef", "hufnagel_do_fa_change",
1126 "chufnageldofaclef")
1127 draw_hufnagel_do_fa_clef((0,0), .8);
1130 def draw_percussion_clef(expr reduction) =
1132 reduced_il# = staff_space# * reduction;
1133 define_pixels(reduced_il);
1134 set_char_box(-.67reduced_il#,2.0reduced_il#,reduced_il#,reduced_il#);
1135 razt := 0.45reduced_il;
1136 pickup penrazor scaled razt;
1137 draw (-b+razt/2,h) -- (-b+razt/2,-d);
1138 draw (w-razt/2,h) -- (w-razt/2,-d);
1141 fet_beginchar("percussion clef", "percussion", "percussionclef")
1142 draw_percussion_clef(1.0);
1145 fet_beginchar("percussion clef", "percussion_change", "cpercussionclef")
1146 draw_percussion_clef(.8);
1149 def draw_tab_clef(expr reduction) =
1151 reduced_il# = staff_space# * reduction;
1152 define_pixels(reduced_il);
1153 set_char_box(-.5reduced_il#,1.8reduced_il#,2.25reduced_il#,2.25reduced_il#);
1154 bs := -d+0.65reduced_il;
1156 xp := 0.32 reduced_il;
1157 yp := 0.25reduced_il;
1158 pickup pensquare xscaled xp yscaled yp;
1160 draw (-b,h) -- (w,h);
1161 draw (cx,h) -- (cx,h-1.2reduced_il);
1163 pickup penrazor scaled yp rotated 90;
1164 draw (-0.85b+0.15w,-0.25reduced_il) -- (-0.15b+0.85w,-0.25reduced_il);
1165 pickup penrazor scaled xp;
1166 draw (-b,-0.6reduced_il-yp/2) -- (cx,0.6reduced_il+yp/2) -- (w,-0.6reduced_il-yp/2);
1169 pickup pensquare xscaled xp yscaled yp;
1170 draw (-b,-d+1.2reduced_il) -- (-b,-d);
1171 pickup pencircle xscaled xp yscaled yp;
1172 draw (-b,-d) --- (cx,-d) .. (w,0.5(bs-d)) .. (cx,bs) --- (-b,bs) --- (cx,bs)
1173 .. (0.3cx+0.7w,0.5(bs-d+1.2reduced_il)) .. (cx,-d+1.2reduced_il) --- (-b,-d+1.2reduced_il)
1176 fet_beginchar("tab clef", "tab", "tabclef")
1180 fet_beginchar("tab clef", "tab_change", "ctabclef")
1184 fet_endgroup("clefs");