2 % parmesan-heads.mf -- implement ancient note heads
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2001--2002 Juergen Reuter <reuter@ipd.uka.de>
9 save black_notehead_width;
10 numeric black_notehead_width;
12 fet_begingroup ("noteheads")
14 noteheight#:=staff_space# + (1 + overdone_heads)*stafflinethickness#;
15 define_pixels(noteheight);
26 brevis_wid# := 2 staff_space#;
28 def draw_brevis(expr brevwid) =
29 save beamheight, head_width;
30 save holeheight, stem_width;
31 save serif_size, serif_protrude;
33 head_width# = brevwid;
34 holeheight = 3 stafflinethickness;
35 stem_width = 1.4 stafflinethickness;
38 define_pixels(head_width);
39 set_char_box(0, head_width#, noteheight#/2, noteheight#/2);
41 2 beamheight + holeheight = noteheight;
42 serif_size = (holeheight - stafflinethickness)/2;
43 serif_protrude = 1.5 serif_size;
44 penpos1(stem_width, 0);
45 penpos2(stem_width, 0);
46 penpos3(beamheight, 90);
47 penpos4(beamheight, 90);
48 penpos5(stem_width, 180);
51 z2l = (0, -stafflinethickness/2);
52 z3r = z2r + serif_size *(1,-1);
55 z5l = z3l + (-serif_size, -serif_protrude);
57 penlabels(1,2,3,4, 5);
58 fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
59 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
61 addto currentpicture also currentpicture yscaled -1;
63 addto currentpicture also currentpicture
64 shifted (-x4r,0) xscaled -1 shifted (x4l,0);
70 % Some sources (eg Musix/OpusTeX think that the appendage should be on
71 % the left, some say right. Right wins democratically.
73 def draw_longa (expr wid) =
80 z6 - z7 = (stem_width/2, -staff_space);
81 theta = angle(z6-z7)+ 90;
82 penpos7(stem_width, theta);
83 penpos6(1.2 stem_width, theta);
85 fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
90 % En wij presenteren U: de opvolgster van Emily
94 fet_beginchar("Maxima notehead", "-3mensural", "mensuralmaximahead");
95 draw_longa (1.3 brevis_wid#)
98 fet_beginchar("Longa notehead", "-2mensural", "mensurallongahead");
99 draw_longa (brevis_wid#)
102 fet_beginchar("Brevis notehead", "-1mensural", "mensuralbrevishead")
103 draw_brevis(brevis_wid#);
106 def draw_neo_mensural_black_head (expr wid) =
109 set_char_box (0, head_width#, noteheight#/2, noteheight#/2);
113 x2 = x4 = (x1 + x3) /2;
114 define_pixels (head_width);
115 pickup pencircle scaled blot_diameter;
121 filldraw z1 -- z2 -- z3 -- z4 -- cycle;
124 def draw_neo_mensural_open_head (expr wid)=
125 draw_neo_mensural_black_head (wid);
127 diamNW = length (z2 - z1) + blot_diameter;
128 diamSW = length (z4 - z1) + blot_diameter;
130 save hole_widthNW, hole_widthSW;
131 hole_widthNW = 0.34 diamNW ;
132 hole_widthSW + 2.6 stafflinethickness = diamSW;
134 (z7 + z5)/2 = (w/2, 0);
135 (z8 + z6)/2 = (w/2, 0);
136 (z6 - z5) = hole_widthNW * unitvector (z2 - z1);
137 (z7 - z6) = hole_widthSW * unitvector (z4 - z1);
139 labels (1,2,3,4,5,6,7,8);
141 unfill z5 -- z6 -- z7 -- z8 --cycle;
144 fet_beginchar("Neo-mensural open head","0neo_mensural","neomensuralminimhead")
145 draw_neo_mensural_open_head (staff_space#);
148 fet_beginchar("Neo-mensural open head","1neo_mensural","neomensuralsemiminimhead")
149 draw_neo_mensural_open_head (staff_space#);
152 fet_beginchar("Neo-mensural black head","2neo_mensural","neofusahead")
153 draw_neo_mensural_black_head (staff_space#);
157 def draw_mensural_head (expr wid, open) =
160 set_char_box (head_width#/2, head_width#/2,
161 noteheight#/2, noteheight#/2);
163 define_pixels(head_width, noteheight);
166 y1 = x2 = y3 = x4 = 0;
168 y2 = 1.4 noteheight/2;
172 xscaled 0.15 head_width
173 yscaled 0.30 head_width
176 % pencircle width correction
177 save zc, zd; pair zc, zd;
178 zc = (+0.150 head_width * sind(30), +0.150 head_width * cosd(30));
179 zd = (+0.075 head_width * sind(30), -0.075 head_width * cosd(30));
182 draw (z1+zc+zd) -- (z2-zc+zd) --
183 (z3-zc-zd) -- (z4+zc-zd) -- cycle;
185 filldraw (z1+zc+zd) -- (z2-zc+zd) --
186 (z3-zc-zd) -- (z4+zc-zd) -- cycle;
191 fet_beginchar("Mensural open head","0mensural","mensuralminimhead")
192 draw_mensural_head (staff_space#, true);
195 fet_beginchar("Mensural open head","1mensural","mensuralsemiminimhead")
196 draw_mensural_head (staff_space#, true);
199 fet_beginchar("Mensural black head","2mensural","fusahead")
200 draw_mensural_head (staff_space#, false);
207 % ledger (leger) lines
210 fet_beginchar("Ledger ending", "ledgerending", "ledgerending")
211 set_char_box (5/2 ledgerlinethickness#, 5/2 ledgerlinethickness#,
212 ledgerlinethickness#/2,ledgerlinethickness#/2);
213 pickup pencircle scaled 1.3 blot_diameter;
225 filldraw z1 --- z2 --- z3 --- z4 --- cycle ;
233 % EDITIO VATICANA (including solesmes extensions)
238 % parameterized punctum
239 def punctum_char (expr verbose_name, internal_name, mudela_name,
240 left_stem, right_stem, linea, cavum,
241 straight, auctum, direction_up, excentric, up_shift, mag) =
243 fet_beginchar(verbose_name, internal_name, mudela_name)
245 a_b := 1.54; % b_h*a_b/a_w = wd/ht
249 save a, beta, ht, wd;
250 ht# = noteheight# * mag;
254 set_char_box(0.50wd#, 0.10wd#, 0.5ht#, 0);
255 black_notehead_width# := wd#;
258 save direction, direction_sign;
265 direction_sign# = -1;
268 % convexity and excentricity
269 save u_convexity, u_excentricity;
271 u_convexity# = -0.01ht#;
272 u_excentricity# = 0.0ht#; % dummy
274 u_convexity# = -0.03ht#;
275 u_excentricity# = +0.25ht#;
277 u_convexity# = -0.05ht#;
278 u_excentricity# = 0.0ht#; % dummy
280 save convexity, excentricity;
281 convexity# = direction_sign# * u_convexity#;
282 excentricity# = direction_sign# * u_excentricity#;
292 define_pixels(convexity, excentricity, yoffs, ht, wd);
293 pickup pencircle scaled stafflinethickness;
296 save height, yoffs_bt;
297 define_pixels (height, yoffs_bt);
298 height# = max (0.5ht# - stafflinethickness#, 0);
299 yoffs_bt# = yoffs# - (height# - stafflinethickness#)/2 -
301 xpart z1a = xpart z1b;
302 xpart z2a = xpart z2b;
303 xpart z3a = xpart z3b;
304 ypart z1a + height = ypart z1b;
305 ypart z2a + height = ypart z2b;
306 ypart z3a + height = ypart z3b;
309 z1a = (0.00wd + stafflinethickness/2, yoffs_bt);
310 z2a = (0.20wd, yoffs_bt + 1.0*convexity);
311 z3a = (0.40wd - stafflinethickness/2,
312 yoffs_bt + 1.0*excentricity);
313 p = z1a .. {right}z2a .. {direction}z3a --
314 z3b{-direction} .. z2b{left} .. z1b -- cycle;
316 z1a = (0.00wd + stafflinethickness/2,
317 yoffs_bt - 1.0*convexity);
318 z2a = (0.08wd, yoffs_bt + 1.4*convexity);
319 z3a = (0.40wd - stafflinethickness/2, yoffs_bt);
320 p = z1a{direction} .. z2a{right} .. z3a --
321 z3b .. {left}z2b .. {-direction}z1b -- cycle;
323 z1a = (0.00wd + stafflinethickness/2, yoffs_bt);
324 z2a = (0.20wd, yoffs_bt + 1.0*convexity);
325 z3a = (0.40wd - stafflinethickness/2, yoffs_bt);
326 p = z1a .. z2a .. z3a --
327 z3b .. z2b .. z1b -- cycle;
337 pickup pencircle scaled stafflinethickness;
340 z5=(0.00wd + stafflinethickness/2, yoffs);
341 z6=(0.00wd + stafflinethickness/2, yoffs - 1.5ht);
346 z5=(0.40wd - stafflinethickness/2, yoffs);
347 z6=(0.40wd - stafflinethickness/2, yoffs - 1.5ht);
352 save linea_width, linea_height;
353 linea_width# = stafflinethickness#;
354 linea_height# = 0.85 ht#;
355 define_pixels (linea_width, linea_height);
356 draw_block ((-0.10wd - linea_width/2,
357 yoffs - linea_height/2),
358 (-0.10wd + linea_width/2,
359 yoffs + linea_height/2));
360 draw_block ((+0.50wd - linea_width/2,
361 yoffs - linea_height/2),
362 (+0.50wd + linea_width/2,
363 yoffs + linea_height/2));
368 % parameterized punctum inclinatum
369 def inclinatum_char(expr verbose_name, internal_name, mudela_name,
370 small, stropha, auctum) =
372 fet_beginchar(verbose_name, internal_name, mudela_name)
375 a_b := 1.54; % b_h*a_b/a_w = wd/ht
379 save a, beta, ht, wd;
384 set_char_box(0.3wd#, 0.3wd#, 0.5 ht#, 0.5 ht#);
385 black_notehead_width# := wd#;
387 save za, alpha, size;
390 define_pixels(ht, wd);
401 xscaled blot_diameter
402 yscaled size rotated -alpha;
403 za = (0, size - blot_diameter/2) / 2 rotated alpha;
409 yscaled size rotated alpha;
410 save za, off_angle; pair za;
412 za = (0, -size) / 2 rotated -(alpha + off_angle);
417 pickup pencircle scaled stafflinethickness;
420 za = ((0, -size) rotated -alpha) +
421 (0, stafflinethickness/2);
424 draw za{(0,-1) rotated alpha} ..
425 {(0,1) rotated -alpha}zb;
431 punctum_char("Ed. Vat. punctum", "0vaticana_punctum", "vatpunctumhead",
432 false, false, false, false, false,
433 false, false, false, false, 1.0);
435 % punctum cavum (for OpusTeX compatibility)
436 punctum_char("Ed. Vat. punctum cavum", "0vaticana_punctum_cavum",
437 "vatpunctumcavumhead",
438 false, false, false, true, false,
439 false, false, false, false, 1.0);
441 % linea punctum (for OpusTeX compatibility)
442 punctum_char("Ed. Vat. linea punctum", "0vaticana_linea_punctum",
443 "vatlineapunctumhead",
444 false, false, true, false, false,
445 false, false, false, false, 1.0);
447 % linea punctum cavum (for OpusTeX compatibility)
448 punctum_char("Ed. Vat. linea punctum cavum", "0vaticana_linea_punctum_cavum",
449 "vatlineapunctumcavumhead",
450 false, false, true, true, false,
451 false, false, false, false, 1.0);
454 inclinatum_char("Ed. Vat. inclinatum", "0vaticana_inclinatum",
456 false, false, false);
458 % virga (i.e. right stemmed punctum)
459 punctum_char("Ed. Vat. virga", "0vaticana_virga", "vatvirgahead",
460 false, true, false, false, false,
461 false, false, false, false, 1.0);
463 % left stemmed punctum as used in clivis (flexa) ligature
464 punctum_char("Ed. Vat. reverse virga", "0vaticana_rvirga", "vatrvirgahead",
465 true, false, false, false, false,
466 false, false, false, false, 1.0);
469 punctum_char("Ed. Vat. pes lower punctum", "0vaticana_lpes", "vatlpeshead",
470 false, false, false, false, true,
471 false, true, false, false, 1.0);
474 punctum_char("Ed. Vat. pes upper punctum", "0vaticana_upes", "vatupeshead",
475 false, false, false, false, true,
476 false, false, false, false, 1.0);
478 % pes upper punctum (shifted variation)
480 % Note: This note head is used instead of the regular pes upper
481 % punctum to avoid collision with the lower punctum note of the pes when
482 % the upper punctum sits directly on top of the lower punctum.
484 punctum_char("Ed. Vat. var pes upper punctum", "0vaticana_vupes",
486 false, false, false, false, true,
487 false, false, false, true, 1.0);
489 % small punctum as used in epiphonus/cephalicus
490 punctum_char("Ed. Vat. plica", "0vaticana_plica", "vatplicahead",
491 false, false, false, false, true,
492 false, false, false, false, 0.5);
494 % excentric punctum as used in epiphonus
495 punctum_char("Ed. Vat. epiphonus", "0vaticana_epiphonus", "vatepiphonushead",
496 false, false, false, false, false,
497 false, true, true, false, 1.0);
499 % excentric punctum as used in cephalicus
500 punctum_char("Ed. Vat. cephalicus", "0vaticana_cephalicus",
502 false, false, false, false, false,
503 false, false, true, false, 1.0);
506 fet_beginchar("Ed. Vat. quilisma", "0vaticana_quilisma", "vatquilismahead")
508 a_b:=1.54; % b_h*a_b/a_w = wd/ht
512 save a, beta, ht, wd;
517 set_char_box(0.4wd#, 0.00wd#, 0.5 ht#, 0.5 ht#);
518 black_notehead_width# := wd#;
520 define_pixels(ht, wd);
521 pickup pencircle xscaled stafflinethickness yscaled 0.4ht;
522 z1 = (0.00wd, -0.11ht);
523 z2 = (0.00wd, +0.06ht);
524 z3 = (0.10wd, -0.05ht);
525 z4 = (0.16wd, +0.11ht);
526 z5 = (0.24wd, -0.01ht);
527 z6 = (0.30wd, +0.15ht);
528 z7 = (0.40wd, +0.04ht);
529 z8 = (0.40wd, +0.21ht);
530 draw z1 -- z2 -- z3 -- z4 -- z5 -- z6 -- z7 -- z8;
533 % solesmes punctum inclinatum parvum
534 inclinatum_char("Solesmes punctum inclinatum parvum", "0solesmes_incl_parvum",
538 % solesmes punctum auctum ascendens
539 punctum_char("Solesmes punctum auctum ascendens", "0solesmes_auct_asc",
541 false, false, false, false, false,
542 true, true, false, false, 1.0);
544 % solesmes punctum auctum descendens
545 punctum_char("Solesmes punctum auctum descendens", "0solesmes_auct_desc",
547 false, false, false, false, false,
548 true, false, false, false, 1.0);
550 % solesmes punctum inclinatum auctum
551 inclinatum_char("Solesmes punctum incl. auctum", "0solesmes_incl_auctum",
552 "solpunctuminclinatumauctumhead",
556 inclinatum_char("Solesmes stropha", "0solesmes_stropha",
560 % solesmes stropha aucta
561 inclinatum_char("Solesmes stropha aucta", "0solesmes_stropha_aucta",
562 "solstrophaauctahead",
566 fet_beginchar("Solesmes oriscus", "0solesmes_oriscus",
569 a_b := 1.54; % b_h*a_b/a_w = wd/ht
573 save a, beta, ht, wd;
574 ht# = noteheight# * mag;
578 set_char_box(0.5wd#, 0.0wd#, 0.5ht#, 0.5ht#);
579 black_notehead_width# := wd#;
582 convexity# = +0.05ht#;
584 define_pixels(ht, wd, convexity);
585 pickup pencircle xscaled blot_diameter yscaled 0.50ht;
586 z1 = (0.00wd, -convexity);
587 z2 = (0.16wd, +convexity);
588 z3 = (0.33wd, -convexity);
589 z4 = (0.50wd, +convexity);
590 draw z1 .. z2 .. z3 .. z4;
603 fet_beginchar("Ed. Med. inclinatum", "0medicaea_inclinatum",
606 a_b := 1.54; % b_h*a_b/a_w = wd/ht
610 save a, beta, ht, wd;
615 set_char_box(wd#/2, wd#/2, 0.5 ht#, 0.5 ht#);
616 black_notehead_width# := wd#;
618 save za, alpha, size;
620 define_pixels(ht, wd);
624 xscaled blot_diameter
625 yscaled size rotated -alpha;
626 za = (0, size) / 2 rotated alpha;
631 % parametrized punctum
632 def punctum_char (expr verbose_name, internal_name, mudela_name,
633 left_up_stem, left_down_stem) =
635 fet_beginchar(verbose_name, internal_name, mudela_name)
637 save a, beta, ht, wd;
638 ht# = 2 staff_space#;
640 set_char_box(0.0, 0.4wd#, 0.5ht#, 0.5ht#);
641 black_notehead_width# := wd#;
643 define_pixels(ht, wd);
645 xscaled blot_diameter
647 z1 = (0.00wd + blot_diameter/2, 0);
648 z2 = (0.40wd - blot_diameter/2, 0);
652 xscaled stafflinethickness
653 yscaled blot_diameter;
656 z4=(0.00wd + stafflinethickness/2, blot_diameter/2);
657 z5=(0.00wd + stafflinethickness/2, - 1.25ht);
660 z4=(0.00wd + stafflinethickness/2, blot_diameter/2);
661 z5=(0.00wd + stafflinethickness/2, + 1.25ht);
669 punctum_char("Ed. Med. punctum", "0medicaea_punctum", "medpunctumhead",
672 % left up-stemmed punctum
673 punctum_char("Ed. Med. reverse virga", "0medicaea_rvirga", "medrvirgahead",
676 % virga (i.e. left down-stemmed punctum)
677 punctum_char("Ed. Med. virga", "0medicaea_virga", "medvirgahead",
690 % parametrized punctum
691 def punctum_char (expr verbose_name, internal_name, mudela_name,
694 fet_beginchar(verbose_name, internal_name, mudela_name)
696 a_b := 1.54; % b_h*a_b/a_w = wd/ht
700 save a, beta, ht, wd;
705 set_char_box(wd#/2, wd#/2, 0.5 ht#, 0.5 ht#);
706 black_notehead_width# := wd#;
708 save za, zb, zc, alpha, size;
710 define_pixels(ht, wd);
714 xscaled blot_diameter
715 yscaled size rotated -alpha;
716 za = (0, size) / 2 rotated alpha;
721 zc = (0.00wd, - 1.25ht);
728 punctum_char("Hufnagel punctum", "0hufnagel_punctum", "hufpunctumhead", false)
731 punctum_char("Hufnagel virga", "0hufnagel_virga", "hufvirgahead", true)
734 fet_beginchar("Hufnagel pes lower punctum", "0hufnagel_lpes", "huflpeshead")
736 a_b := 1.54; % b_h*a_b/a_w = wd/ht
740 save a, beta, ht, wd;
745 set_char_box(wd#, wd#, 0.7 ht#, 0.7 ht#);
746 black_notehead_width# := wd#;
748 save za, alpha, size;
750 define_pixels(ht, wd);
754 xscaled blot_diameter
755 yscaled size rotated -alpha;
760 fet_endgroup ("noteheads")