1 % Feta (not the Font-En-Tja) music font -- ancient note heads
2 % This file is part of LilyPond, the GNU music typesetter.
4 % Copyright (C) 2001--2012 Juergen Reuter <reuter@ipd.uka.de>
6 % Neo-mensural heads originally by
7 % Christian Mondrup and Mats Bengtsson
9 % LilyPond is free software: you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation, either version 3 of the License, or
12 % (at your option) any later version.
14 % LilyPond is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % GNU General Public License for more details.
19 % You should have received a copy of the GNU General Public License
20 % along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
22 save black_notehead_width;
23 numeric black_notehead_width;
25 fet_begingroup ("noteheads");
30 % The head is assumed to be vertically centered around (0, 0).
31 % The left-most edge of the head should touch the vertical line
32 % that goes though the point (0, 0).
34 % set_char_box() conventions:
36 % * breapth: Ignored (as far as I know). Should be set to 0.
38 % * width: Should match the head's width.
40 % * depth: Should match the bottom edge of the head. Affects vertical
43 % * height: Should match the top edge of the head. Affects vertical
46 % TODO: should depth/height include appendages/stems?
48 save overdone_heads, noteheight;
51 noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
52 define_pixels (noteheight);
59 % NEO-MENSURAL NOTATION
64 def draw_neomensural_brevis (expr brevwid, holeheight, open, full) =
65 save beamheight, head_width, head_height;
66 save stem_width, serif_size, serif_protrude;
68 head_width# := brevwid;
69 head_height# := noteheight#;
70 stem_width := 1.3 linethickness;
72 define_pixels (head_width, head_height);
74 set_char_box (0, head_width#,
75 head_height# / 2, head_height# / 2);
77 2 beamheight + holeheight = head_height;
78 serif_size := blot_diameter;
79 serif_protrude := .15 head_height;
82 z2l = (0, - (holeheight - 2 serif_size) / 2);
83 z3r = z2r + serif_size * (1, -1);
86 z5l = z3l + (-serif_size, -serif_protrude);
88 penpos1 (stem_width, 0);
89 penpos2 (stem_width, 0);
90 penpos3 (beamheight, 90);
91 penpos4 (beamheight, 90);
92 penpos5 (stem_width, 180);
103 -- reverse pat_out yscaled -1;
105 -- reverse pat_out shifted (-x4r, 0)
120 -- reverse pat_in yscaled -1;
123 -- reverse pat_in shifted (-x4r, 0)
132 penlabels (1, 2, 3, 4, 5);
137 % Some sources (eg. Musix/OpusTeX) think that the appendage should be on
138 % the left, some say right. Right wins democratically.
140 def draw_neomensural_longa (expr wid, holeheight, direction) =
141 draw_neomensural_brevis (wid, holeheight, true, true);
146 x7 = head_width - stem_width / 2;
148 z6 - z7 = (stem_width / 2, -dir * staff_space);
149 theta = dir * angle (z6 - z7) + 90;
151 penpos7 (stem_width, 0);
152 penpos6 (1.2 stem_width, theta);
154 z7' = find_tangent (z6l, pat_out,
155 (x7l + 0.5 stem_width, y7l),
156 (x7l - 0.5 stem_width, y7l));
169 def draw_neomensural_black_head (expr width, height) =
170 save head_width, head_height, stem_width;
171 save ne, nw, ne_dist, nw_dist;
172 pair ne, nw, ne_dist, nw_dist;
174 head_width# := width;
175 head_height# := height;
176 stem_width# := 1.3 linethickness#;
178 set_char_box (0, head_width#,
179 head_height# / 2, head_height# / 2);
181 charwx := head_width# / 2;
182 charwy := head_height# / 2 - 2 stem_width#;
185 x2 = x4 = 1/2 [x1, x3];
187 pickup pencircle scaled blot_diameter;
194 ne := unitvector (z2 - z1);
195 nw_dist := (ne rotated 90) * blot_diameter / 2;
196 nw := unitvector (z2 - z3);
197 ne_dist := (nw rotated -90) * blot_diameter / 2;
217 def draw_neomensural_open_head (expr width, height)=
218 draw_neomensural_black_head (width, height);
220 save headNW, headSW, stem_width;
222 headNW = length (z2 - z1) + blot_diameter;
223 headSW = length (z4 - z1) + blot_diameter;
224 stem_width = 1.3 linethickness;
226 save hole_widthNW, hole_widthSW;
228 hole_widthNW = .25 headNW;
229 hole_widthSW + 2 stem_width = headSW;
231 (rt z7 + lft z5) / 2 = (w / 2, 0);
232 (bot z8 + top z6) / 2 = (w / 2, 0);
233 z6 - z5 = (hole_widthNW - blot_diameter) * unitvector (z2 - z1);
234 z7 - z6 = (hole_widthSW - blot_diameter) * unitvector (z4 - z1);
255 % Neo-mensural maxima/longa/brevis
257 % En wij presenteren U: de opvolgster van Emily
262 save nm_maxima_width, nm_longa_width, nm_brevis_width;
263 save nm_holeheight, nm_red_holeheight;
265 nm_maxima_width := 2.6 staff_space#;
266 nm_longa_width := 2 staff_space#;
267 nm_brevis_width := nm_longa_width;
268 nm_holeheight := 4 linethickness;
269 nm_red_holeheight := 2.5 linethickness;
271 fet_beginchar ("Neo-mensural maxima notehead (up)", "uM3neomensural");
272 draw_neomensural_longa (nm_maxima_width, nm_holeheight, 1);
275 fet_beginchar ("Neo-mensural maxima notehead (down)", "dM3neomensural");
276 draw_neomensural_longa (nm_maxima_width, nm_holeheight, -1);
279 fet_beginchar ("Neo-mensural longa notehead (up)", "uM2neomensural");
280 draw_neomensural_longa (nm_longa_width, nm_holeheight, 1);
283 fet_beginchar ("Neo-mensural longa notehead (down)", "dM2neomensural");
284 draw_neomensural_longa (nm_longa_width, nm_holeheight, -1);
287 fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural");
288 draw_neomensural_brevis (nm_brevis_width, nm_holeheight, true, true);
291 fet_beginchar ("Neo-mensural maxima notehead (up, reduced hole)", "urM3neomensural");
292 draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, 1);
295 fet_beginchar ("Neo-mensural maxima notehead (down, reduced hole)", "drM3neomensural");
296 draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, -1);
299 fet_beginchar ("Neo-mensural longa notehead (up, reduced hole)", "urM2neomensural");
300 draw_neomensural_longa (nm_longa_width, nm_red_holeheight, 1);
303 fet_beginchar ("Neo-mensural longa notehead (down, reduced hole)", "drM2neomensural");
304 draw_neomensural_longa (nm_longa_width, nm_red_holeheight, -1);
307 fet_beginchar ("Neo-mensural brevis notehead (reduced hole)", "srM1neomensural");
308 draw_neomensural_brevis (nm_brevis_width, nm_red_holeheight, true, true);
313 % Neo-mensural semibrevis/minima/semiminima
316 save nm_height, nm_width;
317 nm_height := noteheight#;
318 nm_width := staff_space#;
319 fet_beginchar ("Neo-mensural semibrevis head", "s0neomensural");
320 draw_neomensural_open_head (nm_width, nm_height);
323 fet_beginchar ("Neo-mensural minima head", "s1neomensural");
324 draw_neomensural_open_head (nm_width, nm_height);
327 fet_beginchar ("Neo-mensural semiminima head", "s2neomensural");
328 draw_neomensural_black_head (nm_width, nm_height);
341 % WL says the thin lines should be thinner.
344 fet_beginchar ("Harmonic notehead (Neo-mensural open)", "s0harmonic");
345 draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
346 charwx := head_width#;
350 fet_beginchar ("Harmonic notehead (Neo-mensural black)", "s2harmonic");
351 draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#);
352 charwx := head_width#;
361 % MENSURAL/PETRUCCI NOTATIONS
366 def draw_mensural_brevis (expr wid, holeheight, open, full) =
367 % TODO. For the moment, fall back to draw_neomensural_brevis.
368 draw_neomensural_brevis (wid, holeheight, open, full);
372 def draw_mensural_longa (expr wid, holeheight, open, full, direction, ligature) =
373 draw_mensural_brevis (wid, holeheight, open, full);
378 x6 = x7 = head_width - stem_width / 2;
380 y7 = dir * y5 -1.75 dir * staff_space;
382 z17 = (x7, y7 - dir * stem_width / 2);
384 penpos6 (stem_width, 0);
386 penpos7 (stem_width, 0);
388 penpos7 (1.5 stem_width, 0);
403 def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
404 save head_width, head_height;
405 save ellipse, ellipse_r;
406 path ellipse, ellipse_r, diamond_shape;
408 head_height# = head_h;
409 head_width# / head_height# = tand (angle);
411 set_char_box (0, head_width#,
412 head_height# / 2, head_height# / 2);
414 charwx := head_width# / 2;
415 charwy := head_height# / 2 - 2 linethickness#;
417 define_pixels (head_width, head_height);
419 ellipse := reverse fullcircle
420 xscaled (max (blot_diameter, pen_w * head_width))
421 yscaled (max (blot_diameter, pen_h * head_width))
424 z1 = find_tangent_shift (((0, h) -- (0, -h)), ellipse,
426 z2 = find_tangent_shift (((0, h) -- (w, h)), ellipse,
427 (w / 2, h), (w / 2, 0));
428 z3 = find_tangent_shift (((w, h) -- (w, -h)), ellipse,
430 z4 = find_tangent_shift (((0, -h) -- (w, -h)), ellipse,
431 (w / 2, -h), (w / 2, 0));
433 diamond_shape := get_subpath (ellipse, z1 - z4, z2 - z1, z1)
434 -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
435 -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
436 -- get_subpath (ellipse, z4 - z3, z1 - z4, z4)
444 l12 := (directionpoint (z1 - z2) of ellipse) shifted z1
445 -- (directionpoint (z1 - z2) of ellipse) shifted z2;
446 l23 := (directionpoint (z2 - z3) of ellipse) shifted z2
447 -- (directionpoint (z2 - z3) of ellipse) shifted z3;
448 l34 := (directionpoint (z3 - z4) of ellipse) shifted z3
449 -- (directionpoint (z3 - z4) of ellipse) shifted z4;
450 l41 := (directionpoint (z4 - z1) of ellipse) shifted z4
451 -- (directionpoint (z4 - z1) of ellipse) shifted z1;
453 unfill l12 intersectionpoint l23
454 -- l23 intersectionpoint l34
455 -- l34 intersectionpoint l41
456 -- l41 intersectionpoint l12
465 % Mensural/Petrucci maxima/longa/brevis
468 save m_maxima_width, m_longa_width, m_brevis_width,
469 m_holeheight, m_red_holeheight;
470 m_maxima_width := 2.0 staff_space#;
471 m_longa_width := staff_space#;
472 m_brevis_width := m_longa_width;
473 m_holeheight := nm_holeheight;
474 m_red_holeheight := nm_red_holeheight;
476 fet_beginchar ("Mensural maxima notehead (up)", "uM3mensural");
477 draw_mensural_longa (m_maxima_width, m_holeheight, true, true, 1, false);
480 fet_beginchar ("Mensural maxima notehead (down)", "dM3mensural");
481 draw_mensural_longa (m_maxima_width, m_holeheight, true, true, -1, false);
484 fet_beginchar ("Mensural maxima notehead (ligature)", "sM3ligmensural");
485 draw_mensural_brevis (m_maxima_width, m_holeheight, true, true);
488 fet_beginchar ("Mensural longa notehead (up)", "uM2mensural");
489 draw_mensural_longa (m_longa_width, m_holeheight, true, true, 1, false);
492 fet_beginchar ("Mensural longa notehead (down)", "dM2mensural");
493 draw_mensural_longa (m_longa_width, m_holeheight, true, true, -1, false);
496 fet_beginchar ("Mensural longa notehead (ligature)", "sM2ligmensural");
497 draw_mensural_longa (m_longa_width, m_holeheight, true, true, -1, true);
500 fet_beginchar ("Mensural brevis notehead", "sM1mensural");
501 draw_mensural_brevis (m_brevis_width, m_holeheight, true, true);
504 fet_beginchar ("Mensural maxima notehead (up, reduced hole)", "urM3mensural");
505 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, 1, false);
508 fet_beginchar ("Mensural maxima notehead (down, reduced hole)", "drM3mensural");
509 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, -1, false);
512 fet_beginchar ("Mensural maxima notehead (ligature, reduced hole)", "srM3ligmensural");
513 draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, true);
516 fet_beginchar ("Mensural longa notehead (up, reduced hole)", "urM2mensural");
517 draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, 1, false);
520 fet_beginchar ("Mensural longa notehead (down, reduced hole)", "drM2mensural");
521 draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, -1, false);
524 fet_beginchar ("Mensural longa notehead (ligature, reduced hole)", "srM2ligmensural");
525 draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, -1, true);
528 fet_beginchar ("Mensural brevis notehead (reduced hole)", "srM1mensural");
529 draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, true);
534 % Semi-colored mensural/Petrucci maxima/longa/brevis
537 fet_beginchar ("Semi-colored mensural maxima notehead (up)", "uM3semimensural");
538 draw_mensural_longa (m_maxima_width, m_holeheight, true, false, 1, false);
541 fet_beginchar ("Semi-colored mensural maxima notehead (down)", "dM3semimensural");
542 draw_mensural_longa (m_maxima_width, m_holeheight, true, false, -1, false);
545 fet_beginchar ("Semi-colored mensural maxima notehead (ligature)", "sM3semiligmensural");
546 draw_mensural_brevis (m_maxima_width, m_holeheight, true, false);
549 fet_beginchar ("Semi-colored mensural longa notehead (up)", "uM2semimensural");
550 draw_mensural_longa (m_longa_width, m_holeheight, true, false, 1, false);
553 fet_beginchar ("Semi-colored mensural longa notehead (down)", "dM2semimensural");
554 draw_mensural_longa (m_longa_width, m_holeheight, true, false, -1, false);
557 fet_beginchar ("Semi-colored mensural longa notehead (ligature)", "sM2semiligmensural");
558 draw_mensural_longa (m_longa_width, m_holeheight, true, false, -1, true);
561 fet_beginchar ("Semi-colored mensural brevis notehead", "sM1semimensural");
562 draw_mensural_brevis (m_brevis_width, m_holeheight, true, false);
565 fet_beginchar ("Semi-colored mensural maxima notehead (up, reduced hole)", "urM3semimensural");
566 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, 1, false);
569 fet_beginchar ("Semi-colored mensural maxima notehead (down, reduced hole)", "drM3semimensural");
570 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, -1, false);
573 fet_beginchar ("Semi-colored mensural maxima notehead (ligature, reduced hole)", "srM3semiligmensural");
574 draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, false);
577 fet_beginchar ("Semi-colored mensural longa notehead (up, reduced hole)", "urM2semimensural");
578 draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, 1, false);
581 fet_beginchar ("Semi-colored mensural longa notehead (down, reduced hole)", "drM2semimensural");
582 draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, -1, false);
585 fet_beginchar ("Semi-colored mensural longa notehead (ligature, reduced hole)", "srM2semiligmensural");
586 draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, -1, true);
589 fet_beginchar ("Semi-colored mensural brevis notehead (reduced hole)", "srM1semimensural");
590 draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, false);
595 % Black mensural/Petrucci maxima/longa/brevis
598 fet_beginchar ("Black mensural maxima notehead (up)", "uM3blackmensural");
599 draw_mensural_longa (m_maxima_width, 0, false, false, 1, false);
602 fet_beginchar ("Black mensural maxima notehead (down)", "dM3blackmensural");
603 draw_mensural_longa (m_maxima_width, 0, false, false, -1, false);
606 fet_beginchar ("Black mensural maxima notehead (ligature)", "sM3blackligmensural");
607 draw_mensural_brevis (m_maxima_width, 0, false, false);
610 fet_beginchar ("Black mensural longa notehead (up)", "uM2blackmensural");
611 draw_mensural_longa (m_longa_width, 0, false, false, 1, false);
614 fet_beginchar ("Black mensural longa notehead (down)", "dM2blackmensural");
615 draw_mensural_longa (m_longa_width, 0, false, false, -1, false);
618 fet_beginchar ("Black mensural longa notehead (ligature)", "sM2blackligmensural");
619 draw_mensural_longa (m_longa_width, 0, false, false, -1, true);
622 fet_beginchar ("Black mensural brevis notehead", "sM1blackmensural");
623 draw_mensural_brevis (m_brevis_width, 0, false, false);
628 % Mensural semibrevis/minima/semiminima
631 fet_beginchar ("Mensural semibrevis head", "s0mensural");
632 draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
635 fet_beginchar ("Mensural minima head", "s1mensural");
636 draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
639 fet_beginchar ("Mensural semiminima head", "s2mensural");
640 draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
645 % Black mensural semibrevis/minima/semiminima
648 fet_beginchar ("Black mensural semibrevis head", "s0blackmensural");
649 draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
654 % Petrucci semibrevis/minima/semiminima
656 % These values can be measured in several sources.
657 % I used "Modulis ex sacris literis delecti, Liber primus"
658 % Josquin Desprez, BNF
660 save petrucci_width, petrucci_height;
661 petrucci_height := 1.4 noteheight#;
662 petrucci_width := .72 petrucci_height;
664 fet_beginchar ("Petrucci semibrevis head", "s0petrucci");
665 draw_neomensural_open_head (petrucci_width, petrucci_height);
668 fet_beginchar ("Petrucci minima head", "s1petrucci");
669 draw_neomensural_open_head (petrucci_width, petrucci_height);
672 fet_beginchar ("Petrucci semiminima head", "s2petrucci");
673 draw_neomensural_black_head (petrucci_width, petrucci_height);
678 % Black Petrucci semibrevis/minima/semiminima
681 fet_beginchar ("Petrucci colored semibrevis head", "s0blackpetrucci");
682 draw_neomensural_black_head (petrucci_width, petrucci_height);
685 fet_beginchar ("Petrucci colored minima head", "s1blackpetrucci");
686 draw_neomensural_black_head (petrucci_width, petrucci_height);
689 fet_beginchar ("Petrucci colored semiminima head", "s2blackpetrucci");
690 draw_neomensural_black_head (petrucci_width, petrucci_height);
698 % EDITIO VATICANA (including solesmes extensions)
703 def vat_punctum_char (expr verbose_name, internal_name,
704 linea, cavum, straight, auctum,
705 d_up, up_shift, down_shift, mag) =
706 fet_beginchar (verbose_name, "s" & internal_name);
709 a_b := 1.54; % b_h * a_b / a_w = wd / ht
713 save a, beta, ht, wd;
715 ht# = noteheight# * mag;
719 black_notehead_width# := wd#;
733 % convexity and eccentricity
734 save u_convexity, u_eccentricity;
737 u_convexity# := -0.01 ht#;
738 u_eccentricity# := 0.0 ht#; % dummy
740 u_convexity# := -0.03 ht#;
741 u_eccentricity# := +0.25 ht#;
743 u_convexity# := -0.05 ht#;
744 u_eccentricity# := 0.0 ht#; % dummy
747 save convexity, eccentricity;
749 convexity# := d_sign * u_convexity#;
750 eccentricity# := d_sign * u_eccentricity#;
763 define_pixels (convexity, eccentricity, yoffs, ht, wd);
765 pickup pencircle scaled linethickness;
767 save height, yoffs_bt, p, circle, circle_r;
768 path p, circle, circle_r;
771 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
773 define_pixels (height, yoffs_bt);
775 circle := fullcircle scaled linethickness;
784 save box_top, box_bt;
787 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
788 z2 = (0.21 wd, yoffs_bt + convexity);
789 z3 = (0.42 wd - linethickness/ 2,
790 yoffs_bt + eccentricity);
791 box_top# = height# + yoffs_bt# +
792 max (0, convexity#, eccentricity#);
793 box_bt# = yoffs_bt# +
794 min (0, convexity#, eccentricity#);
803 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
804 z2 = (0.21 wd, yoffs_bt + convexity);
805 z3 = (0.42 wd - linethickness / 2, yoffs_bt);
806 box_top# = height# + yoffs_bt# + max (0, convexity#);
807 box_bt# = yoffs_bt# + min (0, convexity#);
817 labels (1, 2, 3, 4, 5, 6);
822 dirs12 := direction (0 + epsilon) of p;
823 dirs2 := direction 1 of p;
824 dirs32 := direction (2 - epsilon) of p;
825 dirs45 := direction (3 + epsilon) of p;
826 dirs5 := direction 4 of p;
827 dirs65 := direction (5 - epsilon) of p;
829 fill get_subpath (circle, down, dirs12, z1)
831 .. get_subpath (circle, dirs32, up, z3)
832 -- get_subpath (circle, up, dirs45, z4)
834 .. get_subpath (circle, dirs65, down, z6)
842 pat123 := ((directionpoint -dirs12 of circle)
845 .. {dirs32}((directionpoint -dirs32 of circle)
849 pat456 := ((directionpoint -dirs45 of circle)
852 .. {dirs65}((directionpoint -dirs65 of circle)
857 t61 := ypart (pat61 intersectiontimes pat123);
858 t12 := xpart (pat123 intersectiontimes pat34);
859 t34 := ypart (pat34 intersectiontimes pat456);
860 t45 := xpart (pat456 intersectiontimes pat61);
862 unfill subpath (t61, t12) of pat123
863 -- subpath (t34, t45) of pat456
867 set_char_box (0.00 wd#, 0.42 wd#,
868 max (0, -box_bt#) + linethickness# / 2,
869 max (0, box_top#) + linethickness# / 2);
872 save linea_width, linea_height;
874 linea_width# = 0.6 linethickness#;
875 linea_height# = 0.7 ht#;
877 define_pixels (linea_width, linea_height);
879 pickup pencircle scaled 0.6 linethickness;
881 draw_rounded_block ((-0.10 wd - linea_width / 2,
883 (-0.10 wd + linea_width / 2,
886 draw_rounded_block ((+0.52 wd - linea_width / 2,
888 (+0.52 wd + linea_width / 2,
892 set_char_box (0, 0.62 wd# + linea_width#,
896 currentpicture := currentpicture
897 shifted (0.10 wd + linea_width / 2, 0);
903 def plica_char (expr verbose_name, internal_name,
905 fet_beginchar (verbose_name, "s" & internal_name);
908 a_b := 1.54; % b_h * a_b / a_w = wd / ht
912 save a, beta, ht, wd;
914 ht# = noteheight# * mag;
918 black_notehead_width# := wd#;
932 % convexity and eccentricity
933 save convexity, eccentricity;
935 convexity# := d_sign * -0.10 ht#;
936 eccentricity# := d_sign * -0.12 ht#;
943 define_pixels (convexity, eccentricity, yoffs, ht, wd);
945 pickup pencircle scaled linethickness;
947 save height, yoffs_bt, p, circle, circle_r;
948 path p, circle, circle_r;
951 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
953 define_pixels (height, yoffs_bt);
955 circle := fullcircle scaled linethickness;
964 save box_top, box_bt;
966 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
967 z2 = (0.21 wd, yoffs_bt + convexity);
968 z3 = (0.42 wd - linethickness/ 2, yoffs_bt + eccentricity);
969 box_top# = height# + yoffs_bt# +
970 max (0, convexity#, eccentricity#);
971 box_bt# = yoffs_bt# +
972 min (0, convexity#, eccentricity#);
981 labels (1, 2, 3, 4, 5, 6);
986 dirs12 := direction (0 + epsilon) of p;
987 dirs2 := direction 1 of p;
988 dirs32 := direction (2 - epsilon) of p;
989 dirs45 := direction (3 + epsilon) of p;
990 dirs5 := direction 4 of p;
991 dirs65 := direction (5 - epsilon) of p;
993 fill get_subpath (circle, down, dirs12, z1)
995 .. get_subpath (circle, dirs32, up, z3)
996 -- get_subpath (circle, up, dirs45, z4)
998 .. get_subpath (circle, dirs65, down, z6)
1001 pickup pencircle scaled 0.6 linethickness;
1005 set_char_box (0.00 wd#, 0.42 wd#,
1006 max (0, -box_bt#) + linethickness# / 2,
1007 max (0, box_top#) + linethickness# / 2);
1013 def epiphonus_char (expr verbose_name, internal_name,
1014 left_stem, d_up, down_shift, mag) =
1015 fet_beginchar (verbose_name, "s" & internal_name);
1018 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1022 save a, beta, ht, wd;
1024 ht# = noteheight# * mag;
1028 black_notehead_width# := wd#;
1042 % convexity and eccentricity
1045 convexity# := d_sign * -0.05ht#;
1051 yoffs# := -0.11 ht#;
1056 define_pixels (convexity, yoffs, ht, wd);
1058 pickup pencircle scaled linethickness;
1060 save height, yoffs_bt, p, circle, circle_r;
1061 path p, circle, circle_r;
1064 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
1066 define_pixels (height, yoffs_bt);
1068 circle := fullcircle scaled linethickness;
1077 save box_top, box_bt;
1079 z1 = (0.00 wd + linethickness / 2, yoffs_bt - 2.5 convexity);
1080 z2 = (0.06 wd, yoffs_bt + 1.4 convexity);
1081 z3 = (0.42 wd - linethickness / 2, yoffs_bt - 1.0 convexity);
1082 box_top# = height# + yoffs_bt# +
1083 max (-1.0 convexity#, 1.4 convexity#, 0);
1084 box_bt# = yoffs_bt# +
1085 min (-1.0 convexity#, 1.4 convexity#, 0);
1087 .. {curl 1}z2{right}
1094 labels (1, 2, 3, 4, 5, 6);
1099 dirs12 := direction (0 + epsilon) of p;
1100 dirs21 := direction (1 - epsilon) of p;
1101 dirs23 := direction (1 + epsilon) of p;
1102 dirs32 := direction (2 - epsilon) of p;
1103 dirs45 := direction (3 + epsilon) of p;
1104 dirs54 := direction (4 - epsilon) of p;
1105 dirs56 := direction (4 + epsilon) of p;
1106 dirs65 := direction (5 - epsilon) of p;
1108 fill get_subpath (circle, down, dirs12, z1)
1109 .. get_subpath (circle, dirs21, dirs23, z2)
1110 .. get_subpath (circle, dirs32, up, z3)
1111 -- get_subpath (circle, up, dirs45, z4)
1112 .. get_subpath (circle, dirs54, dirs56, z5)
1113 .. get_subpath (circle, dirs65, down, z6)
1119 pickup pencircle scaled 0.6 linethickness;
1121 lft x11 = x1 - linethickness / 2;
1122 bot y11 = yoffs - 1.1 ht - linethickness / 2;
1126 draw_rounded_block (bot lft z11, top rt z12,
1128 stem_bt# = yoffs# - 1.1 ht#;
1135 set_char_box (0.00 wd#, 0.42 wd#,
1136 max (0, -box_bt#, -stem_bt#) + linethickness# / 2,
1137 max (0, box_top#) + linethickness# / 2);
1142 def inclinatum_char (expr verbose_name, internal_name,
1143 small, stropha, auctum) =
1144 fet_beginchar (verbose_name, "s" & internal_name);
1150 ht# = 0.50 noteheight#;
1152 ht# = 0.80 noteheight#;
1155 draw_diamond_head (ht#, 0, 0, alpha, false);
1159 off_angle := alpha + 15;
1161 save stropha_ellipse, auctum_hook, circle;
1162 path stropha_ellipse, auctum_hook, circle;
1164 circle := reverse fullcircle scaled linethickness;
1166 stropha_ellipse := fullcircle xscaled 0.25 head_height
1167 yscaled 0.55 head_height
1171 + linethickness / 2 * dir (180 - off_angle)
1172 - directionpoint dir (90 - off_angle)
1174 z12 = directionpoint -dir (90 - off_angle) of diamond_shape +
1175 linethickness / 2 * dir (180 - off_angle);
1176 z13 = (0, -0.5 head_height + linethickness);
1178 auctum_hook := z12{-dir (90 - off_angle)}
1179 .. {dir (90 + alpha)}z13;
1183 if (stropha and not auctum):
1188 t_in := xpart ((stropha_ellipse shifted z11)
1190 get_subpath (diamond_shape,
1193 t_out := xpart ((stropha_ellipse shifted z11)
1195 get_subpath (diamond_shape,
1199 % the addition or subtraction of `1' is necessary
1200 % so that we get the right starting point
1201 fill get_subpath_i (diamond_shape,
1202 dir (angle (z2 - z1) - 1),
1203 dir (angle (z1 - z4) + 1),
1205 -- get_subpath (stropha_ellipse,
1206 direction t_in of stropha_ellipse,
1207 direction t_out of stropha_ellipse,
1214 if (auctum and not stropha):
1217 fill get_subpath (diamond_shape,
1219 -dir (90 - off_angle),
1221 .. get_subpath (circle,
1225 .. get_subpath (circle,
1226 dir (90 - off_angle),
1234 if (auctum and stropha):
1239 t := xpart ((stropha_ellipse shifted z11)
1241 get_subpath (diamond_shape, up, right,
1244 % the addition or subtraction of `1' is necessary
1245 % so that we get the right starting point
1246 fill get_subpath_i (diamond_shape,
1247 dir (angle (z2 - z1) - 1),
1248 -dir (90 - off_angle),
1250 .. get_subpath (circle,
1254 .. get_subpath (stropha_ellipse,
1255 dir (90 - off_angle),
1256 direction t of stropha_ellipse,
1267 vat_punctum_char ("Ed. Vat. punctum", "vaticana.punctum",
1268 false, false, false, false,
1269 false, false, false, 1.0);
1272 % punctum cavum (for OpusTeX compatibility)
1273 vat_punctum_char ("Ed. Vat. punctum cavum", "vaticana.punctum.cavum",
1274 false, true, false, false,
1275 false, false, false, 1.0);
1278 % linea punctum (for OpusTeX compatibility)
1279 vat_punctum_char ("Ed. Vat. linea punctum", "vaticana.linea.punctum",
1280 true, false, false, false,
1281 false, false, false, 1.0);
1284 % linea punctum cavum (for OpusTeX compatibility)
1285 vat_punctum_char ("Ed. Vat. linea punctum cavum", "vaticana.linea.punctum.cavum",
1286 true, true, false, false,
1287 false, false, false, 1.0);
1290 % punctum inclinatum
1291 inclinatum_char ("Ed. Vat. inclinatum", "vaticana.inclinatum",
1292 false, false, false);
1296 vat_punctum_char ("Ed. Vat. pes lower punctum", "vaticana.lpes",
1297 false, false, true, false,
1298 true, false, false, 1.0);
1302 vat_punctum_char ("Ed. Vat. pes var lower punctum", "vaticana.vlpes",
1303 false, false, true, false,
1304 true, false, true, 1.0);
1308 vat_punctum_char ("Ed. Vat. pes upper punctum", "vaticana.upes",
1309 false, false, true, false,
1310 false, false, false, 1.0);
1313 % pes upper punctum (shifted variation)
1315 % This note head is used instead of the regular pes upper punctum to
1316 % avoid collision with the lower punctum note of the pes when the upper
1317 % punctum sits directly on top of the lower punctum.
1319 vat_punctum_char ("Ed. Vat. var pes upper punctum", "vaticana.vupes",
1320 false, false, true, false,
1321 false, true, false, 1.0);
1324 % small punctum as used in epiphonus
1325 vat_punctum_char ("Ed. Vat. plica", "vaticana.plica",
1326 false, false, false, false,
1327 false, false, false, 0.6);
1330 % small punctum as used in epiphonus
1331 plica_char ("Ed. Vat. var plica", "vaticana.vplica",
1335 % eccentric punctum as used in epiphonus
1336 epiphonus_char ("Ed. Vat. epiphonus", "vaticana.epiphonus",
1337 false, true, false, 1.0);
1340 % eccentric punctum as used in epiphonus (shifted variation)
1342 % This note head is used instead of the regular epiphonus punctum to
1343 % avoid collision with the plica head when the plica sits directly on
1344 % top of the lower head.
1346 epiphonus_char ("Ed. Vat. var epiphonus", "vaticana.vepiphonus",
1347 false, true, true, 1.0);
1350 % small punctum as used in cephalicus
1351 vat_punctum_char ("Ed. Vat. rev. plica", "vaticana.reverse.plica",
1352 false, false, false, false,
1353 true, false, false, 0.6);
1356 % small punctum as used in cephalicus
1357 plica_char ("Ed. Vat. rev. var plica", "vaticana.reverse.vplica",
1361 % eccentric punctum as used in cephalicus; without left stem
1362 epiphonus_char ("Ed. Vat. inner cephalicus", "vaticana.inner.cephalicus",
1363 false, false, false, 1.0);
1366 % eccentric punctum as used in cephalicus; with left stem
1367 epiphonus_char ("Ed. Vat. cephalicus", "vaticana.cephalicus",
1368 true, false, false, 1.0);
1372 fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma");
1375 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1379 save a, beta, ht, wd;
1386 set_char_box (0, 0.42 wd#, 0.28 ht#, 0.36 ht#);
1388 black_notehead_width# := wd#;
1390 define_pixels (ht, wd);
1396 T := identity xscaled linethickness
1398 pickup pencircle transformed T;
1399 ellipse := reverse fullcircle transformed T;
1401 z1 = (rt 0.00 wd, top -0.28 ht);
1402 z2 = (0.11 wd, -0.14 ht);
1403 z3 = (0.12 wd, +0.03 ht);
1404 z4 = (0.25 wd, -0.09 ht);
1405 z5 = (0.25 wd, +0.08 ht);
1406 z6 = (lft 0.42 wd, -0.04 ht);
1407 z7 = (lft 0.40 wd, bot +0.36 ht);
1409 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
1410 -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
1412 fill get_subpath (ellipse, z3 - z4, z4 - z3, z3)
1413 -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
1415 fill get_subpath (ellipse, z5 - z6, z6 - z5, z5)
1416 -- point 0 of get_subpath (ellipse, z6 - z5, z5 - z6, z6)
1417 -- get_subpath (ellipse, z7 - z6, z6 - z7, z7)
1418 -- get_subpath (ellipse, z6 - z7, z5 - z6, z6)
1421 labels (1, 2, 3, 4, 5, 6, 7);
1425 % solesmes punctum inclinatum parvum
1426 inclinatum_char ("Solesmes punctum inclinatum parvum", "solesmes.incl.parvum",
1427 true, false, false);
1430 % solesmes punctum auctum ascendens
1431 vat_punctum_char ("Solesmes punctum auctum ascendens", "solesmes.auct.asc",
1432 false, false, false, true,
1433 true, false, false, 1.0);
1436 % solesmes punctum auctum descendens
1437 vat_punctum_char ("Solesmes punctum auctum descendens", "solesmes.auct.desc",
1438 false, false, false, true,
1439 false, false, false, 1.0);
1442 % solesmes punctum inclinatum auctum
1443 inclinatum_char ("Solesmes punctum incl. auctum", "solesmes.incl.auctum",
1444 false, false, true);
1448 inclinatum_char ("Solesmes stropha", "solesmes.stropha",
1449 false, true, false);
1452 % solesmes stropha aucta
1453 inclinatum_char ("Solesmes stropha aucta", "solesmes.stropha.aucta",
1458 fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus");
1461 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1465 save a, beta, ht, wd;
1471 black_notehead_width# := wd#;
1475 convexity# = +0.05 ht#;
1477 define_pixels (ht, wd, convexity);
1479 set_char_box (0.00 wd#, 0.50 wd#,
1480 0.25 ht# + convexity#, 0.25 ht# + convexity#);
1482 z1 = (0.00 wd + blot_diameter / 2, -convexity);
1483 z2 = (1/6 wd, +convexity);
1484 z3 = (2/6 wd, -convexity);
1485 z4 = (0.50 wd - blot_diameter / 2, +convexity);
1490 height = 2 ypart (directionpoint right of (z1
1499 T := identity xscaled blot_diameter
1500 yscaled (h + d - height);
1501 pickup pencircle transformed T;
1502 ellipse := fullcircle transformed T;
1504 % Adjust vertical coordinates to touch bounding box.
1511 d_ := direction 0 of (z1
1516 fill get_subpath (ellipse, -d_, d_, z1)
1519 .. get_subpath (ellipse, d_, -d_, z4)
1524 labels (1, 2, 3, 4);
1538 fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum");
1539 draw_diamond_head (1.2 staff_space#, 0, 0, 35, false);
1543 def med_punctum_char (expr verbose_name, internal_name,
1544 left_up_stem, left_down_stem) =
1545 fet_beginchar (verbose_name, "s" & internal_name);
1548 ht# = 2 staff_space#;
1550 black_notehead_width# := wd#;
1552 define_pixels (ht, wd);
1557 ellipse := fullcircle xscaled blot_diameter
1560 z1 = (0.00 wd + blot_diameter / 2, 0);
1561 z2 = (0.4 wd - blot_diameter / 2, 0);
1565 pickup pencircle scaled linethickness;
1568 z4 = (0.00 wd + linethickness / 2, -1.25 ht);
1570 fill get_subpath (ellipse, left, down, z1)
1574 -- (rt x4, -.5 ht / 2)
1575 -- get_subpath (ellipse, right, left, z2)
1580 set_char_box (0.0, 0.4 wd#, 1.25 ht#, 0.25 ht#);
1581 elseif left_up_stem:
1582 z4 = (0.00 wd + linethickness / 2, +1.25 ht);
1584 fill get_subpath (ellipse, down, right, z1)
1585 -- get_subpath (ellipse, right, left, z2)
1586 -- (rt x4, .5 ht / 2)
1594 set_char_box (0.0, 0.4 wd#, 0.25 ht#, 1.25 ht#);
1596 fill get_subpath (ellipse, left, right, z1)
1597 -- get_subpath (ellipse, right, left, z2)
1600 set_char_box (0.0, 0.4 wd#, 0.25 ht#, 0.25 ht#);
1608 med_punctum_char ("Ed. Med. punctum", "medicaea.punctum",
1612 % left up-stemmed punctum
1613 med_punctum_char ("Ed. Med. reverse virga", "medicaea.rvirga",
1617 % virga (i.e. left down-stemmed punctum)
1618 med_punctum_char ("Ed. Med. virga", "medicaea.virga",
1631 def huf_punctum_char (expr verbose_name, internal_name,
1633 fet_beginchar (verbose_name, "s" & internal_name);
1638 draw_diamond_head (staff_space#, 0, 0, alpha, false);
1641 set_char_box (0, head_width#,
1642 1.5 staff_space#, head_height# / 2);
1647 ellipse := reverse fullcircle xscaled blot_diameter
1648 yscaled 0.7 staff_space
1651 z11 = (head_width / 2, 0);
1652 z12 = find_tangent_shift (((0, -d) -- (w, -d)), ellipse,
1653 (w / 2, -d), (w / 2, 0));
1655 fill get_subpath (ellipse, up, down, z11)
1656 -- get_subpath (ellipse, down, up, z12)
1666 huf_punctum_char ("Hufnagel punctum", "hufnagel.punctum", false)
1670 huf_punctum_char ("Hufnagel virga", "hufnagel.virga", true)
1674 fet_beginchar ("Hufnagel pes lower punctum", "shufnagel.lpes")
1675 save width, height, alpha;
1677 width# = 2 * staff_space#;
1678 height# = 0.7 * staff_space#;
1681 set_char_box (0, width#, height# / 2, height# / 2);
1683 define_pixels (width, height);
1688 circle := reverse fullcircle scaled linethickness;
1690 pickup pencircle scaled linethickness;
1692 rt x3 = -lft x1 = width / 2;
1693 y2 = y3 = height / 2;
1694 y1 = y4 = -height / 2;
1696 tand (alpha) * (y2 - y1) = x2 - x1 = x3 - x4;
1698 fill get_subpath (circle, left, z2 - z1, z1)
1699 -- get_subpath (circle, z2 - z1, right, z2)
1700 -- get_subpath (circle, right, z4 - z3, z3)
1701 -- get_subpath (circle, z4 - z3, left, z4)
1704 currentpicture := currentpicture shifted (width/2, 0);
1706 % labels (1, 2, 3, 4);
1710 fet_endgroup ("noteheads");