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