]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-heads.mf
* mf/parmesan-custodes.mf, mf/parmesan-heads.mf,
[lilypond.git] / mf / parmesan-heads.mf
1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-heads.mf -- implement ancient note heads
3
4 % source file of LilyPond's pretty-but-neat music font
5
6 % (c)  2001--2003 Juergen Reuter <reuter@ipd.uka.de>
7
8 % Neo-mensural heads originally by
9 % Christian Mondrup and Mats Bengtsson
10
11
12 save black_notehead_width;
13 numeric black_notehead_width;
14
15 fet_begingroup ("noteheads")
16
17 %
18 % character aligment:
19 %
20 %   The head is assumed to be vertically centered around (0, 0).
21 %   The left-most edge of the head should touch the vertical line
22 %   that goes though the point (0, 0).
23 %
24 % set_char_box() conventions:
25 %
26 % * breapth: Ignored (as far as I know).  Should be set to 0.
27 %
28 % * width: Should match the head's width.
29 %
30 % * depth: Should match the bottom edge of the head.  Affects vertical
31 %   collision handling.
32 %
33 % * height: Should match the top edge of the head.  Affects vertical
34 %   collision handling.
35 %
36
37 noteheight#:=staff_space# + (1 + overdone_heads)*stafflinethickness#;
38 define_pixels(noteheight);
39
40
41 %%%%%%%%
42 %
43 %
44 %
45 % MENSURAL NOTATION
46 %
47 %
48 %
49 brevis_wid# := 2 staff_space#;
50
51 def draw_neo_brevis(expr brevwid) =
52         save beamheight, head_width;
53         save holeheight, stem_width;
54         save serif_size, serif_protrude;
55
56         head_width# = brevwid;
57         holeheight = 3 stafflinethickness;
58         stem_width = 1.4 stafflinethickness;
59
60
61         define_pixels(head_width);
62         set_char_box(0, head_width#, noteheight#/2, noteheight#/2);
63         
64         2 beamheight + holeheight = noteheight;
65         serif_size = (holeheight - stafflinethickness)/2;
66         serif_protrude = 1.5 serif_size;
67         penpos1(stem_width, 0);
68         penpos2(stem_width, 0);
69         penpos3(beamheight, 90);
70         penpos4(beamheight, 90);
71         penpos5(stem_width, 180);
72
73         z1l = (0, 0);
74         z2l = (0, -stafflinethickness/2);
75         z3r = z2r + serif_size *(1,-1);
76         y4r = y3r;
77         x4r = head_width/2;
78         z5l = z3l + (-serif_size, -serif_protrude);
79
80         penlabels(1,2,3,4, 5);
81         fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
82                 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
83
84         addto currentpicture also currentpicture yscaled -1;
85         show z4r; show z4l;
86         addto currentpicture also currentpicture 
87                 shifted (-x4r,0) xscaled -1 shifted (x4l,0);
88
89 enddef;
90
91
92 def draw_neo_left_stemmed_head (expr wid) =
93         draw_neo_brevis(wid);
94
95         x6 = x7 = head_width - stem_width/2;
96         y6 = y5;
97         y7 = y5 - 2.25staff_space;
98         pickup pencircle scaled stem_width;
99         draw z6 .. z7;
100 enddef;
101
102 fet_beginchar("Left stemmed notehead", "lneo_mensural", "mensuralleftstemmedhead");
103         draw_neo_left_stemmed_head (brevis_wid#)
104 fet_endchar;
105
106 %
107 % Some sources (eg Musix/OpusTeX think that the appendage should be on
108 % the left, some say right. Right wins democratically.
109 %
110 def draw_neo_longa (expr wid) =
111         draw_neo_brevis(wid);
112         save theta;
113
114         x7r = head_width;
115         y7 = y5;
116 %       z7 = z5;
117         z6 - z7 = (stem_width/2, -staff_space);
118         theta = angle(z6-z7)+ 90;
119         penpos7(stem_width, theta);
120         penpos6(1.2 stem_width, theta);
121         
122         fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
123         penlabels(6,7);
124 enddef;
125
126 %
127 % En wij presenteren U: de opvolgster van Emily
128 %
129 % (ze is wel breed)
130
131 fet_beginchar("Maxima notehead", "-3neo_mensural", "mensuralmaximahead");
132         draw_neo_longa (1.3 brevis_wid#)
133 fet_endchar;
134
135 fet_beginchar("Longa notehead", "-2neo_mensural", "mensurallongahead");
136         draw_neo_longa (brevis_wid#)
137 fet_endchar;
138
139 fet_beginchar("Brevis notehead", "-1neo_mensural", "mensuralbrevishead")
140         draw_neo_brevis(brevis_wid#);
141 fet_endchar;
142
143 def draw_neo_mensural_black_head (expr wid) =
144         save head_width;
145         head_width# = wid;
146         set_char_box (0, head_width#, noteheight#/2, noteheight#/2);
147
148
149         y3 = y1 =0;
150         x2 = x4 = (x1 + x3) /2;
151         define_pixels (head_width);
152         pickup pencircle scaled blot_diameter;
153         top y2 = h;
154         bot y4 = -d;
155         lft x1 = 0;
156         rt x3 = w;
157
158         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
159 enddef;
160
161 def draw_neo_mensural_open_head (expr wid)=
162         draw_neo_mensural_black_head (wid);
163         save diamNW, diamSW;
164         diamNW = length (z2 - z1) + blot_diameter;
165         diamSW = length (z4 - z1) + blot_diameter;
166         
167         save hole_widthNW, hole_widthSW;
168         hole_widthNW = 0.34 diamNW ;
169         hole_widthSW + 2.6 stafflinethickness = diamSW;
170
171         (z7 + z5)/2 = (w/2, 0);
172         (z8 + z6)/2 = (w/2, 0);
173         (z6 - z5) = hole_widthNW * unitvector (z2 - z1);
174         (z7 - z6) = hole_widthSW * unitvector (z4 - z1);
175
176         labels (1,2,3,4,5,6,7,8);
177
178         unfill z5 -- z6 -- z7 -- z8 --cycle;
179 enddef;
180
181 fet_beginchar("Neo-mensural open head","0neo_mensural","neomensuralsemibrevishead")
182       draw_neo_mensural_open_head (staff_space#);
183 fet_endchar;
184
185 fet_beginchar("Neo-mensural open head","1neo_mensural","neomensuralminimahead")
186       draw_neo_mensural_open_head (staff_space#);
187 fet_endchar;
188
189 fet_beginchar("Neo-mensural black head","2neo_mensural","neomensuralsemiminimahead")
190       draw_neo_mensural_black_head (staff_space#);
191 fet_endchar;
192
193
194 brevis_wid# := 1 staff_space#;
195
196 def draw_brevis (expr wid) =
197         % TODO.  For the moment, fall back to draw_neo_brevis.
198         draw_neo_brevis(wid);
199 enddef;
200
201 def draw_left_stemmed_head (expr wid) =
202         draw_brevis(wid);
203         save theta;
204
205         x6 = x7 = stem_width/2;
206         y6 = y5;
207         y7 = y5 - 2.25staff_space;
208         pickup pencircle scaled stem_width;
209         draw z6 .. z7;
210 enddef;
211
212 fet_beginchar("Left stemmed notehead", "lmensural", "mensuralleftstemmedhead");
213         draw_left_stemmed_head (brevis_wid#)
214 fet_endchar;
215
216 def draw_longa (expr wid) =
217         draw_brevis(wid);
218
219         x6 = x7 = head_width - stem_width/2;
220         y6 = y5;
221         y7 = y5 - 2.25staff_space;
222         pickup pencircle scaled stem_width;
223         draw z6 .. z7;
224 enddef;
225
226 fet_beginchar("Maxima notehead", "-3mensural", "mensuralmaximahead");
227         draw_longa (2.0 brevis_wid#)
228 fet_endchar;
229
230 fet_beginchar("Longa notehead", "-2mensural", "mensurallongahead");
231         draw_longa (brevis_wid#)
232 fet_endchar;
233
234 fet_beginchar("Brevis notehead", "-1mensural", "mensuralbrevishead")
235         draw_brevis(brevis_wid#);
236 fet_endchar;
237
238 def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
239       save head_width, head_height;
240       head_height# = head_h;
241       head_width# / head_height# = tand(angle);
242       define_pixels(head_width, head_height);
243
244       set_char_box (0, head_width#,
245                     head_height#/2, head_height#/2);
246
247       pickup pencircle
248              xscaled (min(blot_diameter, pen_w * head_width))
249              yscaled (min(blot_diameter, pen_h * head_width))
250              rotated -angle;
251
252       %% FIXME: replace "xpart (top z2)" (and, analogously,
253       %% "ypart (rt z3)") with an expression that really delivers the
254       %% x coordinate of the uppermost pixel that is drawn with respect
255       %% to the pencircle (this requires some elliptical computations).
256       %% MF obviously interprets "xpart (top z2)" as "top (xpart z2)",
257       %% i.e. "top x2", which is not what we want.
258
259       xpart (top z2) = ypart (rt z3) = 0;
260       top y2 = head_height/2;
261       rt x3 = head_width/2;
262       z2 = - z4;
263       z3 = - z1;
264
265       if open:
266               draw z1 -- z2 -- z3 -- z4 -- cycle;
267       else:
268               filldraw z1 -- z2 -- z3 -- z4 -- cycle;
269       fi;
270
271       currentpicture := currentpicture shifted (head_width/2, 0);
272
273 enddef;
274
275
276 fet_beginchar("Mensural open head","0mensural","mensuralsemibrevishead")
277         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
278 fet_endchar;
279
280 fet_beginchar("Mensural open head","1mensural","mensuralminimahead")
281         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
282 fet_endchar;
283
284 fet_beginchar("Mensural black head","2mensural","mensuralsemiminimahead")
285         draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
286 fet_endchar;
287
288
289 %%%%%%%%
290 %
291 %
292 %
293 % EDITIO VATICANA (including solesmes extensions)
294 %
295 %
296 %
297
298 % parameterized punctum
299 def punctum_char (expr verbose_name, internal_name, ly_name,
300                   left_stem, right_stem, linea, cavum,
301                   straight, auctum, direction_up, excentric, up_shift, down_shift, mag) =
302
303         fet_beginchar(verbose_name, internal_name, ly_name)
304                 save b_h, a_w;
305                 a_b := 1.54; % b_h*a_b/a_w = wd/ht
306                 b_h := 0.85;
307                 a_w := 1.09;
308
309                 save a, beta, ht, wd;
310                 ht# = noteheight# * mag;
311                 2beta# = ht# * b_h;
312                 a# = beta# * a_b;
313                 wd# = 2a# / a_w;
314                 black_notehead_width# := wd#;
315
316                 % direction
317                 save direction, direction_sign;
318                 pair direction;
319                 if direction_up:
320                         direction = up;
321                         direction_sign# = 1;
322                 else:
323                         direction = down;
324                         direction_sign# = -1;
325                 fi;
326
327                 % convexity and excentricity
328                 save u_convexity, u_excentricity;
329                 if straight:
330                         u_convexity# = -0.01ht#;
331                         u_excentricity# = 0.0ht#; % dummy
332                 elseif auctum:
333                         u_convexity# = -0.03ht#;
334                         u_excentricity# = +0.25ht#;
335                 else:
336                         u_convexity# = -0.05ht#;
337                         u_excentricity# = 0.0ht#; % dummy
338                 fi;
339                 save convexity, excentricity;
340                 convexity# = direction_sign# * u_convexity#;
341                 excentricity# = direction_sign# * u_excentricity#;
342
343                 % y shift offset
344                 save yoffs;
345                 if up_shift:
346                         yoffs# = 0.08ht#;
347                 elseif down_shift:
348                         yoffs# = -0.11ht#;
349                 else:
350                         yoffs# = 0.00ht#;
351                 fi
352
353                 define_pixels(convexity, excentricity, yoffs, ht, wd);
354                 pickup pencircle scaled stafflinethickness;
355
356                 path p;
357                 save height, yoffs_bt;
358                 define_pixels (height, yoffs_bt);
359                 height# = 0.47ht#;
360                 yoffs_bt# = yoffs# - 0.5*height# - 0.25*convexity#;
361                 xpart z1a = xpart z1b;
362                 xpart z2a = xpart z2b;
363                 xpart z3a = xpart z3b;
364                 ypart z1a + height = ypart z1b;
365                 ypart z2a + height = ypart z2b;
366                 ypart z3a + height = ypart z3b;
367
368                 save box_top, box_bt;
369
370                 if auctum:
371                         z1a = (0.00wd + stafflinethickness/2, yoffs_bt);
372                         z2a = (0.21wd, yoffs_bt + 1.0*convexity);
373                         z3a = (0.42wd - stafflinethickness/2,
374                                yoffs_bt + 1.0*excentricity);
375                         box_top# = height# + yoffs_bt# +
376                                 max(0, 1.0*convexity#, 1.0*excentricity#);
377                         box_bt# = yoffs_bt# +
378                                 min(0, 1.0*convexity#, 1.0*excentricity#);
379                         p = z1a .. {right}z2a .. {direction}z3a --
380                             z3b{-direction} .. z2b{left} .. z1b -- cycle;
381                 elseif excentric:
382                         z1a = (0.00wd + stafflinethickness/2,
383                                yoffs_bt - 1.0*convexity);
384                         z2a = (0.08wd, yoffs_bt + 1.4*convexity);
385                         z3a = (0.42wd - stafflinethickness/2,
386                                yoffs_bt - 1.0*convexity);
387                         box_top# = height# + yoffs_bt# +
388                                 max(-1.0*convexity#, 1.4*convexity#, 0);
389                         box_bt# = yoffs_bt# +
390                                 min(-1.0*convexity#, 1.4*convexity#, 0);
391                         p = z1a{direction} .. z2a{right} .. z3a --
392                             z3b .. {left}z2b .. {-direction}z1b -- cycle;
393                 else:
394                         z1a = (0.00wd + stafflinethickness/2, yoffs_bt);
395                         z2a = (0.21wd, yoffs_bt + 1.0*convexity);
396                         z3a = (0.42wd - stafflinethickness/2, yoffs_bt);
397                         box_top# = height# + yoffs_bt# +
398                                 max(0, 1.0*convexity#);
399                         box_bt# = yoffs_bt# +
400                                 min(0, 1.0*convexity#);
401                         p = z1a .. z2a .. z3a --
402                             z3b .. z2b .. z1b -- cycle;
403                 fi;
404
405                 if cavum:
406                         draw p;
407                 else:
408                         filldraw p;
409                 fi;
410
411                 pickup pencircle scaled 0.6stafflinethickness;
412
413                 save stem_bt;
414
415                 if left_stem:
416                         z5=(0.00wd + 0.6stafflinethickness/2, yoffs);
417                         z6=(0.00wd + 0.6stafflinethickness/2, yoffs - 1.1ht);
418                         draw z5 -- z6;
419                         stem_bt# = yoffs# - 1.1ht#;
420                 elseif right_stem:
421                         z5=(0.42wd - 0.6stafflinethickness/2, yoffs);
422                         z6=(0.42wd - 0.6stafflinethickness/2, yoffs - 1.5ht);
423                         draw z5 -- z6;
424                         stem_bt# = yoffs# - 1.5ht#;
425                 else:
426                         stem_bt# = 0;
427                 fi;
428
429                 set_char_box(0.00wd#, 0.42wd#,
430                              max(0, -box_bt#, -stem_bt#) + stafflinethickness#/2,
431                              max(0, box_top#) + stafflinethickness#/2);
432
433                 if linea:
434                         save linea_width, linea_height;
435                         linea_width# = 0.6 stafflinethickness#;
436                         linea_height# = 0.7 ht#;
437                         define_pixels (linea_width, linea_height);
438                         draw_block ((-0.10wd - linea_width/2,
439                                      -linea_height/2),
440                                     (-0.10wd + linea_width/2,
441                                      +linea_height/2));
442                         draw_block ((+0.52wd - linea_width/2,
443                                      -linea_height/2),
444                                     (+0.52wd + linea_width/2,
445                                      +linea_height/2));
446                         set_char_box(0,
447                                      0.62wd# + linea_width#,
448                                      linea_height#/2,
449                                      linea_height#/2);
450                         currentpicture := currentpicture
451                                 shifted (0.10wd + linea_width/2, 0);
452                 fi;
453         fet_endchar;
454 enddef;
455
456 % parameterized punctum inclinatum
457 def inclinatum_char(expr verbose_name, internal_name, ly_name,
458                     small, stropha, auctum) =
459
460         fet_beginchar(verbose_name, internal_name, ly_name)
461                 save ht, alpha;
462                 alpha# = 35;
463                 if small:
464                         ht# = 0.50 noteheight#;
465                 else:
466                         ht# = 0.80 noteheight#;
467                 fi;
468
469                 draw_diamond_head (ht#, 0, 0, alpha#, false);
470
471                 if stropha:
472                         pickup pencircle
473                                 xscaled (0.25*head_height)
474                                 yscaled (0.55*head_height)
475                                 rotated alpha#;
476                         save za, off_angle; pair za;
477                         off_angle := 15;
478                         za = (0, -0.25*head_height)
479                                 rotated -(alpha# + off_angle)
480                                 shifted (0.48 head_width, -0.02 head_width);
481                         undraw za;
482                 fi;
483
484                 if auctum:
485                         pickup pencircle scaled stafflinethickness;
486                         save za, zb, zc;
487                         pair za, zb, zc;
488                         za = (0, -0.5 head_height + stafflinethickness);
489                         zb = 0.6 (za + zc);
490                         zc = za + (0.52 head_width, 0);
491                         draw za{(0,-1) rotated alpha#} .. {right}zb{right} ..
492                              {(0,1) rotated -alpha#}zc;
493                 fi;
494         fet_endchar;
495 enddef;
496
497 % punctum
498 punctum_char("Ed. Vat. punctum", "vaticana_punctum", "vatpunctumhead",
499              false, false, false, false, false,
500              false, false, false, false, false, 1.0);
501
502 % punctum cavum (for OpusTeX compatibility)
503 punctum_char("Ed. Vat. punctum cavum", "vaticana_punctum_cavum",
504              "vatpunctumcavumhead",
505              false, false, false, true, false,
506              false, false, false, false, false, 1.0);
507
508 % linea punctum (for OpusTeX compatibility)
509 punctum_char("Ed. Vat. linea punctum", "vaticana_linea_punctum",
510              "vatlineapunctumhead",
511              false, false, true, false, false,
512              false, false, false, false, false, 1.0);
513
514 % linea punctum cavum (for OpusTeX compatibility)
515 punctum_char("Ed. Vat. linea punctum cavum", "vaticana_linea_punctum_cavum",
516              "vatlineapunctumcavumhead",
517              false, false, true, true, false,
518              false, false, false, false, false, 1.0);
519
520 % punctum inclinatum
521 inclinatum_char("Ed. Vat. inclinatum", "vaticana_inclinatum",
522                 "vatinclinatumhead",
523                 false, false, false);
524
525 % pes lower punctum
526 punctum_char("Ed. Vat. pes lower punctum", "vaticana_lpes", "vatlpeshead",
527              false, false, false, false, true,
528              false, true, false, false, false, 1.0);
529
530 % pes lower punctum
531 punctum_char("Ed. Vat. pes var lower punctum", "vaticana_vlpes", "vatvlpeshead",
532              false, false, false, false, true,
533              false, true, false, false, true, 1.0);
534
535 % pes upper punctum
536 punctum_char("Ed. Vat. pes upper punctum", "vaticana_upes", "vatupeshead",
537              false, false, false, false, true,
538              false, false, false, false, false, 1.0);
539
540 % pes upper punctum (shifted variation)
541 %
542 % This note head is used instead of the regular pes upper punctum to
543 % avoid collision with the lower punctum note of the pes when the upper
544 % punctum sits directly on top of the lower punctum.
545 %
546 punctum_char("Ed. Vat. var pes upper punctum", "vaticana_vupes",
547              "vatvupeshead",
548              false, false, false, false, true,
549              false, false, false, true, false, 1.0);
550
551 % small punctum as used in epiphonus
552 punctum_char("Ed. Vat. plica", "vaticana_plica", "vatplicahead",
553              false, false, false, false, false,
554              false, false, false, false, false, 0.6);
555
556 % excentric punctum as used in epiphonus
557 punctum_char("Ed. Vat. epiphonus", "vaticana_epiphonus", "vatepiphonushead",
558              false, false, false, false, false,
559              false, true, true, false, false, 1.0);
560
561 % excentric punctum as used in epiphonus (shifted variation)
562 %
563 % This note head is used instead of the regular epiphonus punctum to
564 % avoid collision with the plica head when the plica sits directly on
565 % top of the lower head.
566 %
567 punctum_char("Ed. Vat. var epiphonus", "vaticana_vepiphonus", "vatvepiphonushead",
568              false, false, false, false, false,
569              false, true, true, false, true, 1.0);
570
571 % small punctum as used in cephalicus
572 punctum_char("Ed. Vat. rev. plica", "vaticana_reverse_plica", "vatrplicahead",
573              false, false, false, false, false,
574              false, true, false, false, false, 0.6);
575
576 % excentric punctum as used in cephalicus; without left stem
577 punctum_char("Ed. Vat. cephalicus", "vaticana_inner_cephalicus",
578              "vatinnercephalicushead",
579              false, false, false, false, false,
580              false, false, true, false, false, 1.0);
581
582 % excentric punctum as used in cephalicus; with left stem
583 punctum_char("Ed. Vat. cephalicus", "vaticana_cephalicus",
584              "vatcephalicushead",
585              true, false, false, false, false,
586              false, false, true, false, false, 1.0);
587
588 % quilisma
589 fet_beginchar("Ed. Vat. quilisma", "vaticana_quilisma", "vatquilismahead")
590         save b_h,a_w;
591         a_b:=1.54; % b_h*a_b/a_w = wd/ht
592         b_h:=0.85;
593         a_w:=1.09;
594
595         save a, beta, ht, wd;
596         ht# = noteheight#;
597         2beta# = ht#*b_h;
598         a# = beta#*a_b;
599         wd# = 2a# / a_w;
600         set_char_box(0, 0.42wd#, 0.28 ht#, 0.36 ht#);
601         black_notehead_width# := wd#;
602
603         define_pixels(ht, wd);
604         pickup pencircle xscaled stafflinethickness yscaled 0.44ht;
605         lft x1 = 0.00wd; bot y1 = -0.28ht;
606         x2 = 0.11wd;     y2 = -0.14ht;
607         x3 = 0.12wd;     y3 = +0.03ht;
608         x4 = 0.25wd;     y4 = -0.09ht;
609         x5 = 0.26wd;     y5 = +0.08ht;
610         x6 = 0.40wd;     y6 = -0.04ht;
611         rt x7 = 0.42wd;  top y7 = +0.36ht;
612         draw z1 .. z2 -- z3 .. z4 -- z5 .. z6 -- z7;
613 fet_endchar;
614
615 % solesmes punctum inclinatum parvum
616 inclinatum_char("Solesmes punctum inclinatum parvum", "solesmes_incl_parvum",
617                 "solinclparvumhead",
618                 true, false, false);
619
620 % solesmes punctum auctum ascendens
621 punctum_char("Solesmes punctum auctum ascendens", "solesmes_auct_asc",
622              "solauctaschead",
623              false, false, false, false, false,
624              true, true, false, false, false, 1.0);
625
626 % solesmes punctum auctum descendens
627 punctum_char("Solesmes punctum auctum descendens", "solesmes_auct_desc",
628              "solauctdeschead",
629              false, false, false, false, false,
630              true, false, false, false, false, 1.0);
631
632 % solesmes punctum inclinatum auctum
633 inclinatum_char("Solesmes punctum incl. auctum", "solesmes_incl_auctum",
634                 "solpunctuminclinatumauctumhead",
635                 false, false, true);
636
637 % solesmes stropha
638 inclinatum_char("Solesmes stropha", "solesmes_stropha",
639                 "solstrophahead",
640                 false, true, false);
641
642 % solesmes stropha aucta
643 inclinatum_char("Solesmes stropha aucta", "solesmes_stropha_aucta",
644                 "solstrophaauctahead",
645                 false, true, true);
646
647 % solesmes oriscus
648 fet_beginchar("Solesmes oriscus", "solesmes_oriscus",
649         "soloriscushead")
650         save b_h, a_w;
651         a_b := 1.54; % b_h*a_b/a_w = wd/ht
652         b_h := 0.85;
653         a_w := 1.09;
654
655         save a, beta, ht, wd;
656         ht# = noteheight#;
657         2beta# = ht# * b_h;
658         a# = beta# * a_b;
659         wd# = 2a# / a_w;
660         black_notehead_width# := wd#;
661
662         save convexity;
663         convexity# = +0.05ht#;
664
665         define_pixels(ht, wd, convexity);
666         pickup pencircle xscaled blot_diameter yscaled 0.50ht;
667         lft x1 = 0.00wd; y1 = -convexity;
668         x2 = 0.16wd;     y2 = +convexity;
669         x3 = 0.33wd;     y3 = -convexity;
670         rt x4 = 0.50wd;  y4 = +convexity;
671         draw z1 .. z2 .. z3 .. z4;
672         set_char_box(0.00wd#, 0.50wd#,
673                      0.25ht# + convexity#, 0.25ht# + convexity#);
674 fet_endchar;
675
676 %%%%%%%%
677 %
678 %
679 %
680 % EDITIO MEDICAEA
681 %
682 %
683 %
684
685 % inclinatum
686 fet_beginchar("Ed. Med. inclinatum", "medicaea_inclinatum",
687         "medinclinatumhead")
688         draw_diamond_head (1.2staff_space#, 0, 0, 35, false);
689 fet_endchar;
690
691 % parametrized punctum
692 def punctum_char (expr verbose_name, internal_name, ly_name,
693         left_up_stem, left_down_stem) =
694
695         fet_beginchar(verbose_name, internal_name, ly_name)
696
697                 save a, beta, ht, wd;
698                 ht# = 2 staff_space#;
699                 wd# = ht#;
700                 black_notehead_width# := wd#;
701
702                 define_pixels(ht, wd);
703                 pickup pencircle
704                         xscaled blot_diameter
705                         yscaled 0.50ht;
706                 z1 = (0.00wd + blot_diameter/2, 0);
707                 z2 = (0.4wd - blot_diameter/2, 0);
708                 draw z1 .. z2;
709
710                 pickup pencircle
711                         xscaled stafflinethickness
712                         yscaled blot_diameter;
713
714                 if left_down_stem:
715                         z4=(0.00wd + stafflinethickness/2, blot_diameter/2);
716                         z5=(0.00wd + stafflinethickness/2, - 1.25ht);
717                         draw z4 .. z5;
718                         set_char_box(0.0, 0.4wd#, 1.25ht#, 0.25ht#);
719                 elseif left_up_stem:
720                         z4=(0.00wd + stafflinethickness/2, blot_diameter/2);
721                         z5=(0.00wd + stafflinethickness/2, + 1.25ht);
722                         draw z4 .. z5;
723                         set_char_box(0.0, 0.4wd#, 0.25ht#, 1.25ht#);
724                 else:
725                         set_char_box(0.0, 0.4wd#, 0.25ht#, 0.25ht#);
726                 fi;
727
728         fet_endchar;
729 enddef;
730
731 % punctum
732 punctum_char("Ed. Med. punctum", "medicaea_punctum", "medpunctumhead",
733         false, false);
734
735 % left up-stemmed punctum
736 punctum_char("Ed. Med. reverse virga", "medicaea_rvirga", "medrvirgahead",
737         true, false);
738
739 % virga (i.e. left down-stemmed punctum)
740 punctum_char("Ed. Med. virga", "medicaea_virga", "medvirgahead",
741         false, true);
742
743 %%%%%%%%
744 %
745 %
746 %
747 % HUFNAGEL
748 %
749 %
750 %
751
752 % punctum
753 % parametrized punctum
754 def punctum_char (expr verbose_name, internal_name, ly_name,
755         down_stem) =
756         fet_beginchar(verbose_name, internal_name, ly_name)
757                 save alpha;
758                 alpha# = 55;
759                 draw_diamond_head (staff_space#, 0, 0, alpha#, false);
760                 if down_stem:
761                         pickup pencircle
762                                 xscaled blot_diameter
763                                 yscaled (0.7*staff_space)
764                                 rotated -alpha#;
765                         save za, zb; pair za, zb;
766                         za = (head_width/2, 0);
767                         bot zb = (head_width/2, -1.5staff_space);
768                         draw za -- zb;
769                         set_char_box (0, head_width#,
770                                       1.5staff_space#, head_height#/2);
771                 fi;
772         fet_endchar;
773 enddef;
774
775 % punctum
776 punctum_char("Hufnagel punctum", "hufnagel_punctum", "hufpunctumhead", false)
777
778 % virga
779 punctum_char("Hufnagel virga", "hufnagel_virga", "hufvirgahead", true)
780
781 % pes lower punctum
782 fet_beginchar("Hufnagel pes lower punctum", "hufnagel_lpes", "huflpeshead")
783         save width, height, alpha;
784         width# = 2*staff_space#;
785         height# = 0.7*staff_space#;
786         alpha# = 35;
787
788         set_char_box(0, width#, height#/2, height#/2);
789
790         pickup pencircle scaled stafflinethickness;
791         define_pixels(width, height);
792
793         rt x3 = -lft x1 = width/2;
794         y2 = y3 = height/2;
795         y1 = y4 = -height/2;
796         tand(alpha#) * (y2 - y1) = x2 - x1 = x3 - x4;
797
798         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
799
800         currentpicture := currentpicture shifted (width/2, 0);
801 fet_endchar;
802
803 fet_endgroup ("noteheads")