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