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