]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-noteheads.mf
Imported Upstream version 2.16.0
[lilypond.git] / mf / feta-noteheads.mf
1 % Feta (not the Font-En-Tja) music font -- implement noteheads
2 % This file is part of LilyPond, the GNU music typesetter.
3 %
4 % Copyright (C) 1997--2012 Jan Nieuwenhuizen <janneke@gnu.org>
5 % & Han-Wen Nienhuys <hanwen@xs4all.nl>
6 % & Juergen Reuter <reuter@ipd.uka.de>
7 %
8 %
9 % LilyPond is free software: you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation, either version 3 of the License, or
12 % (at your option) any later version.
13 %
14 % LilyPond is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 % GNU General Public License for more details.
18 %
19 % You should have received a copy of the GNU General Public License
20 % along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
21
22 test_outlines := 0;
23
24
25 save remember_pic;
26 picture remember_pic;
27
28
29 % Most beautiful noteheads are pronounced, not circular,
30 % and not even symmetric.
31 % These examples are inspired by [Wanske]; see literature list.
32
33
34
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 % NOTE HEAD VARIABLES
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38
39 save half_notehead_width, whole_notehead_width;
40 save solfa_noteheight;
41
42 numeric whole_notehead_width;
43 numeric half_notehead_width;
44
45 fet_begingroup ("noteheads");
46
47
48 %
49 % solfa heads should not overlap on chords.
50 %
51 solfa_noteheight# := staff_space# - stafflinethickness#;
52
53 def undraw_inside_ellipse (expr ellipticity, tilt, superness, clearance) =
54 begingroup
55         save pat;
56         path pat;
57
58         pat := superellipse ((ellipticity, 0), (0, 1.0),
59                              (-ellipticity, 0), (0, -1.0),
60                              superness);
61         pat := pat rotated tilt;
62
63         save top_point, right_point;
64         pair top_point, right_point;
65
66         top_point := directionpoint left of pat;
67         right_point := directionpoint up of pat;
68
69         save height, scaling;
70
71         height# = staff_space# + stafflinethickness# - clearance;
72         scaling# = height# / (2 ypart (top_point));
73         define_pixels (scaling);
74         pat := pat scaled scaling shifted (w / 2, .5 (h - d));
75
76         if test_outlines = 1:
77                 draw pat;
78         else:
79                 unfill pat;
80         fi
81 endgroup;
82 enddef;
83
84
85 def draw_longa (expr up) =
86         save stemthick, fudge;
87
88         stemthick# = 2 stafflinethickness#;
89         define_whole_blacker_pixels (stemthick);
90
91         % Longas of smaller design sizes should have their lines farther
92         % apart (the overlap with notehead ellipsoid should be smaller).
93         fudge = hround (blot_diameter
94                         * min (max (-0.15,
95                                     (0.9
96                                      - (20 / (design_size + 4)))),
97                                0.3));
98
99         draw_outside_ellipse (1.80, 0, 0.707, 0);
100         undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
101
102         set_char_box (stemthick#,
103                       width# + stemthick#,
104                       noteheight# / 2,
105                       noteheight# / 2);
106
107         pickup pencircle scaled stemthick;
108
109         % Longas of smaller design sizes should have their lines longer.
110         line_length := min (max (0.7, (64/60 - (design_size / 60))), 0.85);
111
112         % Line lengths between 0.72 and 0.77 are not nice
113         % because they are neither separate nor connected
114         % when there is an interval of fourth.
115         if line_length < 0.75:
116                 quanted_line_length := min (0.72, line_length);
117         else:
118                 quanted_line_length := max (0.77, line_length);
119         fi;
120
121         final_line_length := quanted_line_length * staff_space;
122
123         if up:
124                 bot y1 = -final_line_length;
125                 top y2 = final_line_length;
126                 rt x1 - fudge = 0;
127                 x1 = x2;
128
129                 fudge + lft x3 = width;
130                 x4 = x3;
131                 top y4 = h + 3.0 staff_space;
132                 y3 = y1;
133         else:
134                 bot y1 = -d - 3.0 staff_space;
135                 top y2 = final_line_length;
136                 rt x1 - fudge = 0;
137                 x1 = x2;
138
139                 fudge + lft x3 = width;
140                 x4 = x3;
141                 y4 = y2;
142                 bot y3 = -final_line_length;
143         fi;
144
145         draw_gridline (z1, z2, stemthick);
146         draw_gridline (z3, z4, stemthick);
147
148         labels (1, 2, 3, 4);
149 enddef;
150
151
152 fet_beginchar ("Longa notehead", "uM2");
153         draw_longa (true);
154
155         draw_staff (-2, 2, 0);
156 fet_endchar;
157
158
159 fet_beginchar ("Longa notehead", "dM2");
160         draw_longa (false);
161
162         draw_staff (-2, 2, 0);
163 fet_endchar;
164
165
166 if test > 0:
167         fet_beginchar ("Longa notehead", "uM2");
168                 draw_longa (true);
169
170                 draw_staff (-2, 2, 0.5);
171         fet_endchar;
172
173
174         fet_beginchar ("Longa notehead", "dM2");
175                 draw_longa (false);
176
177                 draw_staff (-2, 2, 0.5);
178         fet_endchar;
179 fi;
180
181
182 def draw_brevis (expr linecount, line_thickness_multiplier) =
183         save stemthick, fudge, gap;
184
185         stemthick# = line_thickness_multiplier * 2 * stafflinethickness#;
186         define_whole_blacker_pixels (stemthick);
187
188         % double-lined breves of smaller design sizes should have
189         % bigger gap between the lines.
190         gap# := (0.95 - 0.008 * design_size) * stemthick#;
191
192         % Breves of smaller design sizes should have their lines farther
193         % apart (the overlap with notehead ellipsoid should be smaller).
194         fudge = hround (blot_diameter
195                         * min (max (-0.15,
196                                     (0.8
197                                      - (20 / (design_size + 4))
198                                      + .1 linecount)),
199                                0.3));
200
201         draw_outside_ellipse (1.80, 0, 0.707, 0);
202         undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
203
204         set_char_box (stemthick# * linecount + gap# * (linecount - 1),
205                       width# + stemthick# * linecount + gap# * (linecount - 1),
206                       noteheight# / 2,
207                       noteheight# / 2);
208
209         define_pixels (gap);
210         pickup pencircle scaled stemthick;
211
212         % Breves of smaller design sizes should have their lines longer.
213         line_length := min (max (0.7, (64/60 - (design_size / 60))), 0.85);
214
215         % Line lengths between 0.72 and 0.77 are not nice
216         % because they are neither separate nor connected
217         % when there is an interval of fourth.
218         if line_length < 0.75:
219                 quanted_line_length := min (0.72, line_length);
220         else:
221                 quanted_line_length := max (0.77, line_length);
222         fi;
223
224         bot y1 = -quanted_line_length * staff_space;
225         top y2 = quanted_line_length * staff_space;
226         rt x1 - fudge = 0;
227         x1 = x2;
228
229         fudge + lft x3 = width;
230         x4 = x3;
231         y4 = y2;
232         y3 = y1;
233
234         for i := 0 step 1 until linecount - 1:
235                 line_distance := i * (gap + stemthick);
236                 draw_gridline (z1 - (line_distance, 0),
237                                z2 - (line_distance, 0),
238                                stemthick);
239                 draw_gridline (z3 + (line_distance, 0),
240                                z4 + (line_distance, 0),
241                                stemthick);
242         endfor;
243 enddef;
244
245
246 fet_beginchar ("Brevis notehead", "sM1");
247         draw_brevis (1, 1);
248
249         draw_staff (-2, 2, 0);
250 fet_endchar;
251
252
253 if test > 0:
254         fet_beginchar ("Brevis notehead", "sM1");
255                 draw_brevis(1, 1);
256
257                 draw_staff (-2, 2, 0.5);
258         fet_endchar;
259 fi;
260
261
262 fet_beginchar ("Double-lined brevis notehead", "sM1double");
263         draw_brevis (2, 0.8);
264
265         draw_staff (-2, 2, 0);
266 fet_endchar;
267
268
269 if test > 0:
270         fet_beginchar ("Double-lined brevis notehead", "sM1double");
271                 draw_brevis (2, 0.8);
272
273                 draw_staff (-2, 2, 0.5);
274         fet_endchar;
275 fi;
276
277
278 fet_beginchar ("Whole notehead", "s0");
279         draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0, 0.707, 0);
280         undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
281                                0.68, 2 stafflinethickness#);
282
283         whole_notehead_width# := charwd;
284
285         draw_staff (-2, 2, 0);
286 fet_endchar;
287
288
289 if test > 0:
290         fet_beginchar ("Whole notehead", "s0");
291                 draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0,
292                                       0.707, 0);
293                 undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
294                                        0.68, 2 stafflinethickness#);
295
296                 draw_staff (-2, 2, 0.5);
297         fet_endchar;
298 fi;
299
300
301 fet_beginchar ("Half notehead", "s1");
302         draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17);
303         undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#);
304
305         half_notehead_width# := charwd;
306
307         draw_staff (-2, 2, 0);
308 fet_endchar;
309
310
311 if test > 0:
312         fet_beginchar ("Half notehead", "s1");
313                 draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34,
314                                       0.66, 0.17);
315                 undraw_inside_ellipse (3.25, 33, 0.81,
316                                        2.5 stafflinethickness#);
317
318                 draw_staff (-2, 2, 0.5);
319         fet_endchar;
320 fi;
321
322
323 fet_beginchar ("Quarter notehead", "s2");
324         draw_quarter_path;
325         draw_staff (-2, 2, 0);
326 fet_endchar;
327
328
329 if test > 0:
330         fet_beginchar ("Quarter notehead", "s2");
331                 draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31,
332                                       0.707, 0);
333
334                 draw_staff (-2, 2, 0.5);
335         fet_endchar;
336 fi;
337
338
339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340
341
342 fet_beginchar ("Whole diamondhead", "s0diamond");
343         draw_outside_ellipse (1.80, 0, 0.495, 0);
344         undraw_inside_ellipse (1.30, 125, 0.6,
345                                .4 staff_space# + stafflinethickness#);
346
347         draw_staff (-2, 2, 0);
348 fet_endchar;
349
350
351 if test > 0:
352         fet_beginchar ("Whole diamondhead", "s0diamond");
353                 draw_outside_ellipse (1.80, 0, 0.495, 0);
354                 undraw_inside_ellipse (1.30, 125, 0.6,
355                                        .4 staff_space# + stafflinethickness#);
356
357                 draw_staff (-2, 2, 0.5);
358         fet_endchar;
359 fi;
360
361
362 fet_beginchar ("Half diamondhead", "s1diamond");
363         draw_outside_ellipse (1.50, 34, 0.49, 0.17);
364         undraw_inside_ellipse (3.5, 33, 0.80,
365                                .3 staff_space# + 1.5 stafflinethickness#);
366
367         draw_staff (-2, 2, 0);
368 fet_endchar;
369
370
371 if test > 0:
372         fet_beginchar ("Half diamondhead", "s1diamond");
373                 draw_outside_ellipse (1.50, 34, 0.49, 0.17);
374                 undraw_inside_ellipse (3.5, 33, 0.80,
375                                        .3 staff_space#
376                                        + 1.5 stafflinethickness#);
377
378                 draw_staff (-2, 2, 0.5);
379         fet_endchar;
380 fi;
381
382
383 fet_beginchar ("Quarter diamondhead", "s2diamond");
384         draw_outside_ellipse (1.80, 35, 0.495, -0.25);
385
386         draw_staff (-2, 2, 0);
387 fet_endchar;
388
389
390 if test > 0:
391         fet_beginchar ("Quarter diamondhead", "s2diamond");
392                 draw_outside_ellipse (1.80, 35, 0.495, -0.25);
393
394                 draw_staff (-2, 2, 0.5);
395         fet_endchar;
396 fi;
397
398
399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
400
401
402 vardef penposx@# (expr d) =
403 begingroup;
404         save pat;
405         path pat;
406
407         pat = top z@#
408               .. lft z@#
409               .. bot z@#
410               .. rt z@#
411               .. cycle;
412         z@#l = pat intersectionpoint (z@# -- infinity * dir (d + 180));
413         z@#r = pat intersectionpoint (z@# -- infinity * dir (d));
414 endgroup
415 enddef;
416
417
418 %
419 % UGH: xs not declared as argument.
420 %
421 def define_triangle_shape (expr stemdir) =
422         save triangle_a, triangle_b, triangle_c;
423         save triangle_out_a, triangle_out_b, triangle_out_c;
424         save triangle_in, triangle_out;
425         save width, depth, height;
426         save origin, left_up_dir;
427         save exact_left_point, exact_right_point, exact_down_point;
428
429         path triangle_a, triangle_b, triangle_c;
430         path triangle_out_a, triangle_out_b, triangle_out_c;
431         path triangle_in, triangle_out;
432         pair origin, left_up_dir;
433         pair exact_down_point, exact_left_point, exact_right_point;
434
435         save pen_thick;
436         pen_thick# = stafflinethickness# + .1 staff_space#;
437         define_pixels (llap);
438         define_blacker_pixels (pen_thick);
439
440         left_up_dir = llap# * dir (90 + tilt);
441
442         xpart (left_up_dir) * xs - (pen_thick# * xs) / 2 + xpart origin = 0;
443         ypart origin = 0;
444
445         exact_left_point := origin + (left_up_dir xscaled xs);
446         exact_down_point := origin + (left_up_dir rotated 120 xscaled xs);
447         exact_right_point := origin + (left_up_dir rotated 240 xscaled xs);
448
449         height# = ypart (exact_left_point + origin) + pen_thick# / 2;
450         depth# = -ypart (exact_down_point + origin) + pen_thick# / 2;
451         width# = xpart (exact_right_point - exact_left_point)
452                  + pen_thick# * xs;
453
454         set_char_box (0, width#, depth#, height#);
455
456         % Formerly, the shape has simply been drawn with an elliptical pen
457         % (`scaled pen_thick xscaled xs'), but the envelope of such a curve
458         % is of 6th degree.  For the sake of mf2pt1, we approximate it.
459
460         pickup pencircle scaled pen_thick xscaled xs;
461
462         z0 = (hround_pixels (xpart origin), 0);
463
464         z1 = z1' = z0 + llap * dir (90 + tilt) xscaled xs;
465         z2 = z2' = z0 + llap * dir (90 + tilt + 120) xscaled xs;
466         z3 = z3' = z0 + llap * dir (90 + tilt + 240) xscaled xs;
467
468         z12 = caveness [.5[z1, z2], z3];
469         z23 = caveness [.5[z2, z3], z1];
470         z31 = caveness [.5[z3, z1], z2];
471
472         triangle_a = z1 .. z12 .. z2;
473         triangle_b = z2 .. z23 .. z3;
474         triangle_c = z3 .. z31 .. z1;
475
476         penposx1 (angle (direction 0 of triangle_a) - 90);
477         penposx2 (angle (direction 0 of triangle_b) - 90);
478         penposx3 (angle (direction 0 of triangle_c) - 90);
479
480         penposx1' (angle (direction infinity of triangle_c) + 90);
481         penposx2' (angle (direction infinity of triangle_a) + 90);
482         penposx3' (angle (direction infinity of triangle_b) + 90);
483
484         penposx12 (angle (z12 - z0));
485         penposx23 (angle (z23 - z0));
486         penposx31 (angle (z31 - z0));
487
488         z10 = (z0 -- z1) intersectionpoint (z1l .. z12l .. z2'r);
489         z20 = (z0 -- z2) intersectionpoint (z2l .. z23l .. z3'r);
490         z30 = (z0 -- z3) intersectionpoint (z3l .. z31l .. z1'r);
491
492         triangle_in = z10
493                       .. z12l
494                       .. z20
495                       & z20
496                       .. z23l
497                       .. z30
498                       & z30
499                       .. z31l
500                       .. z10
501                       & cycle;
502
503         triangle_out_a = z1r .. z12r .. z2'l;
504         triangle_out_b = z2r .. z23r .. z3'l;
505         triangle_out_c = z3r .. z31r .. z1'l;
506
507         triangle_out = top z1
508                        .. lft z1
509                        .. z1r{direction 0 of triangle_out_a}
510                        & triangle_out_a
511                        & {direction infinity of triangle_out_a}z2'l
512                        .. lft z2
513                        .. bot z2
514                        .. z2r{direction 0 of triangle_out_b}
515                        & triangle_out_b
516                        & {direction infinity of triangle_out_b}z3'l
517                        .. rt z3
518                        .. top z3
519                        .. z3r{direction 0 of triangle_out_c}
520                        & triangle_out_c
521                        & {direction infinity of triangle_out_c}z1'l
522                        .. cycle;
523
524         labels (0, 10, 20, 30);
525         penlabels (1, 1', 2, 2', 3, 3', 12, 23, 31);
526
527         % attachment Y
528         if stemdir = 1:
529                 charwy := ypart exact_right_point;
530                 charwx := xpart exact_right_point + .5 pen_thick# * xs;
531         else:
532                 charwy := -ypart exact_down_point;
533                 charwx := width# - (xpart exact_down_point - .5 pen_thick# * xs);
534         fi
535 enddef;
536
537
538 def draw_whole_triangle_head =
539         save hei, xs;
540         save llap;
541         save tilt;
542
543         tilt = 40;
544         llap# = 3/4 noteheight#;
545
546         xs = 1.5;
547         caveness := 0.1;
548         define_triangle_shape (1);
549         fill triangle_out;
550         unfill triangle_in;
551 enddef;
552
553
554 fet_beginchar ("Whole trianglehead", "s0triangle");
555         draw_whole_triangle_head;
556
557         draw_staff (-2, 2, 0);
558 fet_endchar;
559
560
561 if test > 0:
562         fet_beginchar ("Whole trianglehead", "s0triangle");
563                 draw_whole_triangle_head;
564
565                 draw_staff (-2, 2, 0.5);
566         fet_endchar;
567 fi;
568
569
570 def draw_small_triangle_head (expr dir) =
571         save hei, xs;
572         save llap;
573         save tilt;
574
575         tilt = 40;
576         llap# = 2/3 noteheight#;
577         xs = 1.2;
578         caveness := 0.1;
579         define_triangle_shape (dir);
580
581         pickup feta_fillpen;
582
583         filldraw triangle_out;
584         unfilldraw triangle_in;
585 enddef;
586
587
588 fet_beginchar ("Half trianglehead (downstem)", "d1triangle");
589         draw_small_triangle_head (-1);
590
591         draw_staff (-2, 2, 0);
592 fet_endchar;
593
594
595 fet_beginchar ("Half trianglehead (upstem)", "u1triangle");
596         draw_small_triangle_head (1);
597
598         draw_staff (-2, 2, 0.5);
599 fet_endchar;
600
601
602 def draw_closed_triangle_head (expr dir) =
603         save hei, xs;
604         save llap;
605         save tilt;
606
607         tilt = 40;
608         llap# = 2/3 noteheight#;
609         xs = 1.0;
610         caveness := 0.1;
611         define_triangle_shape (dir);
612         fill triangle_out;
613 enddef;
614
615
616 fet_beginchar ("Quarter trianglehead (upstem)", "u2triangle");
617         draw_closed_triangle_head (1);
618
619         draw_staff (-2, 2, 0);
620 fet_endchar;
621
622
623 fet_beginchar ("Quarter trianglehead (downstem)", "d2triangle");
624         draw_closed_triangle_head (-1);
625
626         draw_staff (-2, 2, 0.5);
627 fet_endchar;
628
629
630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631 %
632 % Slash heads are for indicating improvisation.  They are
633 % twice as high as normal heads.
634 %
635 def draw_slash (expr hwid_hash) =
636         save exact_height;
637         save ne, nw_dist;
638         pair ne, nw_dist;
639         exact_height = staff_space# + stafflinethickness# / 2;
640
641         set_char_box (0, 2 exact_height / slash_slope + hwid_hash,
642                       exact_height, exact_height);
643
644         charwx := charwd;
645         charwy := charht;
646
647         clearxy;
648
649         d := d - feta_shift;
650
651         pickup pencircle scaled blot_diameter;
652
653         bot y1 = -d;
654         top y2 = h;
655         lft x1 = 0;
656         lft x2 = 2 h / slash_slope;
657
658         rt x3 = w;
659         y3 = y2;
660         y4 = y1;
661         x3 - x2 = x4 - x1;
662
663         ne = unitvector (z3 - z4);
664         nw_dist = (ne rotated 90) * 0.5 blot_diameter;
665
666         fill bot z1{left}
667              .. (z1 + nw_dist){ne}
668              -- (z2 + nw_dist){ne}
669              .. top z2{right}
670              -- top z3{right}
671              .. (z3 - nw_dist){-ne}
672              -- (z4 - nw_dist){-ne}
673              .. bot z4{left}
674              -- cycle;
675
676         if hwid_hash > 2 slash_thick#:
677                 save th;
678
679                 th = slash_thick - blot_diameter;
680                 y6 = y7;
681                 y5 = y8;
682                 y3 - y7 = th;
683                 y5 - y1 = th;
684                 z6 - z5 = whatever * ne;
685                 z8 - z7 = whatever * ne;
686
687                 z5 = z1 + whatever * ne + th * (ne rotated -90);
688                 z8 = z4 + whatever * ne + th * (ne rotated 90);
689
690                 unfill z5
691                        -- z6
692                        -- z7
693                        -- z8
694                        -- cycle;
695         fi
696         labels (range 1 thru 10);
697 enddef;
698
699
700 fet_beginchar ("Whole slashhead", "s0slash");
701         draw_slash (4 slash_thick# + 0.5 staff_space#);
702
703         draw_staff (-2, 2, 0);
704 fet_endchar;
705
706
707 fet_beginchar ("Half slashhead", "s1slash");
708         draw_slash (3.0 slash_thick# + 0.15 staff_space#);
709
710         draw_staff (-2, 2, 0);
711 fet_endchar;
712
713
714 fet_beginchar ("Quarter slashhead", "s2slash");
715         draw_slash (1.5 slash_thick#);
716
717         draw_staff (-2, 2, 0);
718 fet_endchar;
719
720
721 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
722 %
723 % `thick' is the distance between the NE/SW parallel lines in the cross
724 % (distance between centres of lines) in multiples of stafflinethickness
725 %
726 def draw_cross (expr thick) =
727         save ne, nw;
728         save ne_dist, nw_dist, rt_dist, up_dist;
729         save crz_in, crz_out;
730         save thickness;
731         pair ne, nw;
732         pair ne_dist, nw_dist, rt_dist, up_dist;
733         path crz_in, crz_out;
734
735         pen_thick# := 1.2 stafflinethickness#;
736         thickness# := thick * stafflinethickness#;
737         define_pixels (thickness);
738         define_blacker_pixels (pen_thick);
739
740         pickup pencircle scaled pen_thick;
741
742         h := h - feta_shift;
743
744         top y3 = h;
745         ne = unitvector ((1, (2 h - pen_thick) / (w - pen_thick)));
746         rt x4 = w / 2;
747         y5 = 0;
748         z4 - z5 = whatever * ne;
749         x6 = 0;
750         z6 - z3 = whatever * ne;
751         z3 - z4 = whatever * (ne yscaled -1);
752
753         z4 - z3 = whatever * (ne) + (ne rotated -90) * thickness;
754
755
756         x1 = charwd / 2 - .5 pen_thick#;
757         z1 = whatever * ne
758              + thick / 2 * stafflinethickness# * (ne rotated -90);
759
760         % labels (1, 2, 3, 4, 5, 6);
761
762         nw = unitvector (z3 - z4);
763
764         up_dist = up * 0.5 pen_thick / cosd (angle (ne));
765         rt_dist = right * 0.5 pen_thick / sind (angle (ne));
766         nw_dist = (ne rotated 90) * 0.5 pen_thick;
767         ne_dist = (nw rotated -90) * 0.5 pen_thick;
768
769         x4' := x4;
770         x5' := x5;
771         y6' := y6;
772
773         x4 := hround (x4' + .5 pen_thick) - .5 pen_thick;
774         x5 := hfloor (x5' + xpart rt_dist) - xpart rt_dist;
775         y6 := vfloor (y6' + ypart up_dist) - ypart up_dist;
776
777         crz_out = (z6 + up_dist)
778                   -- (z3 + nw_dist){ne}
779                   .. (top z3)
780                   .. (z3 + ne_dist){-nw}
781                   -- (z4 + ne_dist){-nw}
782                   .. (rt z4)
783                   .. (z4 - nw_dist){-ne}
784                   -- (z5 + rt_dist);
785         crz_out := crz_out shifted (0, feta_shift)
786                    -- reverse crz_out yscaled -1 shifted (0, -feta_eps);
787         fill crz_out
788              -- reverse crz_out xscaled -1 shifted (-feta_eps, 0)
789              -- cycle;
790
791         if (thick > 1):
792                 x4 := hround (x4' - xpart rt_dist) + xpart rt_dist;
793                 x5 := hceiling (x5' - .5 pen_thick) + .5 pen_thick;
794                 y6 := vfloor (y6' - .5 pen_thick) + .5 pen_thick;
795
796                 crz_in = (bot z6){right}
797                          .. (z6 - nw_dist){ne}
798                          -- (z3 - up_dist)
799                          -- (z4 - rt_dist)
800                          -- (z5 + nw_dist){-ne}
801                          .. {down}(lft z5);
802                 crz_in := crz_in shifted (0, feta_shift)
803                           -- reverse crz_in yscaled -1 shifted (0, -feta_eps);
804                 unfill crz_in
805                        -- reverse crz_in xscaled -1 shifted (-feta_eps, 0)
806                        -- cycle;
807         fi
808
809         % ugh
810         currentpicture := currentpicture shifted (hround (w / 2), 0);
811
812         charwx := charwd;
813         charwy := y1 + feta_shift;
814
815         z12 = (charwx * hppp, y1 * vppp);
816
817         labels (12);
818 enddef;
819
820
821 fet_beginchar ("Whole Crossed notehead", "s0cross");
822         save wid, hei;
823
824         wid# := black_notehead_width# + 4 stafflinethickness#;
825         hei# := noteheight# + stafflinethickness#;
826
827         set_char_box (0, wid#, hei# / 2, hei# / 2);
828
829         draw_cross (3.75);
830
831         remember_pic := currentpicture;
832
833         draw_staff (-2, 2, 0);
834 fet_endchar;
835
836
837 if test > 0:
838         fet_beginchar ("Whole Crossed notehead", "s0cross");
839                 save wid, hei;
840
841                 wid# := black_notehead_width# + 4 stafflinethickness#;
842                 hei# := noteheight# + stafflinethickness#;
843
844                 set_char_box (0, wid#, hei# / 2, hei# / 2);
845
846                 currentpicture := remember_pic;
847
848                 draw_staff (-2, 2, 0.5);
849         fet_endchar;
850 fi;
851
852
853 fet_beginchar ("Half Crossed notehead", "s1cross");
854         save wid, hei;
855
856         wid# := black_notehead_width# + 2 stafflinethickness#;
857         hei# := noteheight# + stafflinethickness# / 2;
858
859         set_char_box (0, wid#, hei# / 2, hei# / 2);
860
861         draw_cross (3.0);
862
863         remember_pic := currentpicture;
864
865         draw_staff (-2, 2, 0);
866 fet_endchar;
867
868
869 if test > 0:
870         fet_beginchar ("Half Crossed notehead", "s1cross");
871                 save wid, hei;
872
873                 wid# := black_notehead_width# + 2 stafflinethickness#;
874                 hei# := noteheight# + stafflinethickness# / 2;
875
876                 set_char_box (0, wid#, hei# / 2, hei# / 2);
877
878                 currentpicture := remember_pic;
879
880                 draw_staff (-2, 2, 0.5);
881         fet_endchar;
882 fi;
883
884
885 fet_beginchar ("Crossed notehead", "s2cross");
886         wid# := black_notehead_width#;
887         hei# := noteheight#;
888         set_char_box (0, wid#, hei# / 2, hei# / 2);
889
890         draw_cross (1.0);
891
892         remember_pic := currentpicture;
893
894         draw_staff (-2, 2, 0);
895 fet_endchar;
896
897
898 if test > 0:
899         fet_beginchar ("Crossed notehead", "s2cross");
900                 wid# := black_notehead_width#;
901                 hei# := noteheight#;
902                 set_char_box (0, wid#, hei# / 2, hei# / 2);
903
904                 currentpicture := remember_pic;
905
906                 draw_staff (-2, 2, 0.5);
907         fet_endchar;
908 fi;
909
910
911 fet_beginchar ("X-Circled notehead", "s2xcircle");
912         save wid, hei;
913         save cthick, cxd, cyd, dy;
914
915         wid# := black_notehead_width# * sqrt (sqrt2);
916         hei# := noteheight# * sqrt (sqrt2);
917
918         set_char_box (0, wid#, hei# / 2, hei# / 2);
919
920         d := d - feta_space_shift;
921
922         cthick# := (1.2 + 1/4) * stafflinethickness#;
923         define_blacker_pixels (cthick);
924
925         cxd := w - cthick;
926         cyd := h + d - cthick / 2;
927
928         dy = .5 (h - d);
929
930         pickup pencircle scaled cthick;
931
932         fill fullcircle xscaled (cxd + cthick)
933                         yscaled (cyd + cthick)
934                         shifted (w / 2, dy);
935         unfill fullcircle xscaled (cxd - cthick)
936                           yscaled (cyd - cthick)
937                           shifted (w / 2, dy);
938
939         xpos := .5 cxd / sqrt2;
940         ypos := .5 cyd / sqrt2;
941
942         pickup penrazor scaled cthick rotated (angle (xpos, ypos) + 90);
943         draw (-xpos + w / 2, -ypos + dy)
944              -- (xpos + w / 2, ypos + dy);
945
946         pickup penrazor scaled cthick rotated (angle (xpos, -ypos) + 90);
947         draw (-xpos + w / 2, ypos + dy)
948              -- (xpos + w / 2, -ypos + dy);
949
950         charwx := charwd;
951         charwy := 0;
952
953         z12 = (charwx * hppp, charwy * vppp);
954         labels (12);
955
956         remember_pic := currentpicture;
957
958         draw_staff (-2, 2, 0);
959 fet_endchar;
960
961
962 if test > 0:
963         fet_beginchar ("X-Circled notehead", "s2xcircle");
964                 save wid, hei;
965                 save cthick, cxr, cyr;
966
967                 wid# := black_notehead_width# * sqrt (sqrt2);
968                 hei# := noteheight# * sqrt (sqrt2);
969
970                 set_char_box (0, wid#, hei# / 2, hei# / 2);
971
972                 currentpicture := remember_pic;
973
974                 draw_staff (-2, 2, 0.5);
975         fet_endchar;
976 fi;
977
978
979 %%%%%%%%
980 %
981 % SOLFA SHAPED NOTES
982 %
983 %
984 % Note: For whole and half notes, the `fill' curve (p_out) is offset from
985 %       the points that specify the outer geometry, because we need to add
986 %       the rounding.  In contrast, the inner curve is not offset, because
987 %       there is no rounding.
988 %
989 %       This means that to get a line of thick_factor * pen_thickness,
990 %       we need to offset the inner curve by
991 %
992 %         (thick_factor - 0.5) * pen_thickness
993 %
994 %       or by
995 %
996 %         (2 * thick_factor - 1) * half_pen_thickness
997 %
998 save solfa_pen_thick;
999 solfa_pen_thick# = 1.3 stafflinethickness#;
1000 define_blacker_pixels (solfa_pen_thick);
1001
1002 save solfa_pen_radius;
1003 solfa_pen_radius = 0.5 solfa_pen_thick;
1004
1005 save solfa_base_notewidth;
1006 solfa_base_notewidth# := black_notehead_width#;
1007
1008 solfa_whole_width := 1.0;
1009 solfa_half_width := 1.0;
1010 solfa_quarter_width := 1.0;
1011
1012
1013 %%% Do head
1014 %
1015 % Triangle with base parallel to staff lines.
1016 %
1017
1018 def draw_do_head (expr width_factor, dir, thickness_factor) =
1019         save p_in, p_out;
1020         save left_dist, right_dist, bottom_dist;
1021         path p_in, p_out;
1022         pair left_dist, right_dist, bottom_dist;
1023
1024         set_char_box (0, width_factor * solfa_base_notewidth#,
1025                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
1026
1027         bottom_thick_factor := 2 * thickness_factor - 1;
1028         % no different thickness for left side if we want uniform thickness
1029         if thickness_factor = 1:
1030                 left_thick_factor := 1;
1031         else:
1032                 left_thick_factor := 0.7 * bottom_thick_factor;
1033         fi
1034
1035         save pen_radius;
1036         pen_radius := min (solfa_pen_radius,
1037                            (h + d) / (3 * (1 + bottom_thick_factor)));
1038
1039         pickup pencircle scaled (2 * pen_radius);
1040
1041         bot y1 = -d;
1042         y1 = y2;
1043         lft x1 = 0;
1044         rt x2 = w;
1045         top y3 = h;
1046         x3 = .5 [x1, x2];
1047
1048         left_dist = (unitvector (z3 - z1) rotated 90) * pen_radius;
1049         right_dist = (unitvector (z2 - z3) rotated 90) * pen_radius;
1050         bottom_dist = (0,1) * pen_radius;
1051
1052         save pa, pb, pc;
1053         path pa, pb, pc;
1054         save point_a, point_b, point_c;
1055         pair point_a, point_b, point_c;
1056
1057         pa := (z1 - left_thick_factor * left_dist)
1058               -- (z3 - left_thick_factor * left_dist);
1059         pb := (z1 + bottom_thick_factor * bottom_dist)
1060               -- (z2 + bottom_thick_factor * bottom_dist);
1061         pc := (z2 - right_dist)
1062               -- (z3 - right_dist);
1063
1064         point_a := pa intersectionpoint pb;
1065         point_b := pb intersectionpoint pc;
1066         point_c := pc intersectionpoint pa;
1067
1068         p_in := point_a
1069                 -- point_b
1070                 -- point_c
1071                 -- cycle;
1072
1073         p_out := bot z1
1074                  -- bot z2{right}
1075                  .. rt z2{up}
1076                  .. (z2 + right_dist){z3 - z2}
1077                  -- (z3 + right_dist){z3 - z2}
1078                  .. top z3{left}
1079                  .. (z3 + left_dist){z1 - z3}
1080                  -- (z1 + left_dist){z1 - z3}
1081                  .. lft z1{down}
1082                  .. {right}cycle;
1083
1084         labels (1, 2, 3);
1085
1086         charwx := charwd;
1087         charwy := -chardp + 0.5 stafflinethickness#;
1088         if dir = -1:
1089                 charwy := -charwy;
1090         fi;
1091 enddef;
1092
1093 save do_weight;
1094 do_weight := 2;
1095
1096
1097 fet_beginchar ("Whole dohead", "s0do");
1098         draw_do_head (solfa_whole_width, 1, do_weight);
1099         fill p_out;
1100         unfill p_in;
1101 fet_endchar;
1102
1103
1104 fet_beginchar ("Half dohead", "d1do");
1105         draw_do_head (solfa_half_width, -1, do_weight);
1106         fill p_out;
1107         unfill p_in;
1108 fet_endchar;
1109
1110
1111 fet_beginchar ("Half dohead", "u1do");
1112         draw_do_head (solfa_half_width, 1, do_weight);
1113         fill p_out;
1114         unfill p_in;
1115 fet_endchar;
1116
1117
1118 fet_beginchar ("Quarter dohead", "d2do");
1119         draw_do_head (solfa_quarter_width, -1, do_weight);
1120         fill p_out;
1121 fet_endchar;
1122
1123
1124 fet_beginchar ("Quarter dohead", "u2do");
1125         draw_do_head (solfa_quarter_width, 1, do_weight);
1126         fill p_out;
1127 fet_endchar;
1128
1129
1130 fet_beginchar ("Whole thin dohead", "s0doThin");
1131         draw_do_head (solfa_whole_width, 1, 1);
1132         fill p_out;
1133         unfill p_in;
1134 fet_endchar;
1135
1136
1137 fet_beginchar ("Half thin dohead", "d1doThin");
1138         draw_do_head (solfa_half_width, -1, 1);
1139         fill p_out;
1140         unfill p_in;
1141 fet_endchar;
1142
1143
1144 fet_beginchar ("Half thin dohead", "u1doThin");
1145         draw_do_head (solfa_half_width, 1, 1);
1146         fill p_out;
1147         unfill p_in;
1148 fet_endchar;
1149
1150
1151 fet_beginchar ("Quarter thin dohead", "d2doThin");
1152         draw_do_head (solfa_quarter_width, -1, 1);
1153         fill p_out;
1154 fet_endchar;
1155
1156
1157 fet_beginchar ("Quarter thin dohead", "u2doThin");
1158         draw_do_head (solfa_quarter_width, 1, 1);
1159         fill p_out;
1160 fet_endchar;
1161
1162
1163 %
1164 % re - flat top, curved bottom:
1165 %
1166 %   (0,h/2) {dir -90}
1167 %   .. (w/2,-h/2)
1168 %   .. {dir 90} (w,h/2)
1169 %   -- cycle;
1170 %
1171 % (broader along the base and with more vertical sides for half and
1172 % whole notes)
1173 %
1174 % Note: According to some shape-note singers, there should be no size
1175 %       differences for half and whole notes, contrary to the comment above.
1176 %       Consequently, we have made them all the same width.
1177 %
1178 % stem attachment: h/2
1179 %
1180 def draw_re_head (expr width_factor, dir, thickness_factor) =
1181         save p_in, p_out;
1182         path p_in, p_out;
1183
1184         set_char_box (0, width_factor * solfa_base_notewidth#,
1185                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
1186
1187         save offset;
1188         offset = (2 * thickness_factor - 1);
1189
1190         save curve_start;
1191         curve_start = 0.7;
1192
1193         save pen_radius;
1194
1195         pen_radius := min (solfa_pen_radius,
1196                            (h + d) * (1-curve_start) / (1+ offset));
1197
1198         pickup pencircle scaled (2 * pen_radius);
1199
1200         lft x1 = 0;
1201         top y1 = h;
1202         x2 = x1;
1203         y2 = curve_start [y3, y1];
1204         bot y3 = -d;
1205         x3 = .5 [x2, x4];
1206         rt x4 = w;
1207         y4 = y2;
1208         y5 = y1;
1209         x5 = x4;
1210
1211         labels (range 1 thru 5);
1212
1213         p_in := (z1 + pen_radius * (1, -1 * offset))
1214                 -- rt z2{down}
1215                 .. ((top z3) + (0, offset * pen_radius))
1216                 .. lft z4{up}
1217                 -- (z5 + pen_radius * (-1, -1 * offset))
1218                 -- cycle;
1219
1220         p_out := lft z1
1221                  -- lft z2{down}
1222                  .. bot z3
1223                  .. rt z4{up}
1224                  -- rt z5{up}
1225                  .. top z5{left}
1226                  -- top z1{left}
1227                  .. {down}cycle;
1228
1229         charwx := charwd;
1230         charwy := curve_start [-chardp, charht];
1231
1232         if dir = -1:
1233                 charwy := -charwy;
1234         fi;
1235 enddef;
1236
1237
1238 save re_weight;
1239 re_weight := 2;
1240
1241 fet_beginchar ("Whole rehead", "s0re");
1242         draw_re_head (solfa_whole_width, 1, re_weight);
1243         fill p_out;
1244         unfill p_in;
1245 fet_endchar;
1246
1247
1248 fet_beginchar ("Half up rehead", "u1re");
1249         draw_re_head (solfa_half_width, 1, re_weight);
1250         fill p_out;
1251         unfill p_in;
1252 fet_endchar;
1253
1254
1255 fet_beginchar ("Half down rehead", "d1re");
1256         draw_re_head (solfa_half_width, -1, re_weight);
1257         fill p_out;
1258         unfill p_in;
1259 fet_endchar;
1260
1261
1262 fet_beginchar ("Quarter up rehead", "u2re");
1263         draw_re_head (solfa_quarter_width, 1, re_weight);
1264         fill p_out;
1265 fet_endchar;
1266
1267
1268 fet_beginchar ("Quarter down rehead", "d2re");
1269         draw_re_head (solfa_quarter_width, -1, re_weight);
1270         fill p_out;
1271 fet_endchar;
1272
1273
1274 fet_beginchar ("Whole thin rehead", "s0reThin");
1275         draw_re_head (solfa_whole_width, 1, 1);
1276         fill p_out;
1277         unfill p_in;
1278 fet_endchar;
1279
1280
1281 fet_beginchar ("Half up thin rehead", "u1reThin");
1282         draw_re_head (solfa_half_width, 1, 1);
1283         fill p_out;
1284         unfill p_in;
1285 fet_endchar;
1286
1287
1288 fet_beginchar ("Half down thin rehead", "d1reThin");
1289         draw_re_head (solfa_half_width, -1, 1);
1290         fill p_out;
1291         unfill p_in;
1292 fet_endchar;
1293
1294
1295 fet_beginchar ("Quarter thin rehead", "u2reThin");
1296         draw_re_head (solfa_quarter_width, 1, 1);
1297         fill p_out;
1298 fet_endchar;
1299
1300
1301 fet_beginchar ("Quarter thin rehead", "d2reThin");
1302         draw_re_head (solfa_quarter_width, -1, 1);
1303         fill p_out;
1304 fet_endchar;
1305
1306
1307 %%%% mi head -- diamond shape
1308 %
1309 % two versions, depending on whether the `strong' lines are on the nw & se
1310 % or the ne & sw
1311 %
1312 def draw_mi_head (expr width_factor, thickness_factor, mirror) =
1313         save path_out, path_in;
1314         save ne_dist, se_dist, ne, se;
1315         save path_a, path_b, path_c, path_d;
1316         path path_out, path_in;
1317         pair ne_dist, se_dist, ne, se;
1318         path path_a, path_b, path_c, path_d;
1319         save inner_path;
1320         path inner_path;
1321
1322         set_char_box (0, width_factor * solfa_base_notewidth#,
1323                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
1324
1325         save offset;
1326         offset := 2 * thickness_factor - 1;
1327
1328         save note_diagonal;
1329
1330         note_diagonal := w / 2 ++ (h + d) / 2;
1331
1332         save pen_radius;
1333
1334         pen_radius := min (solfa_pen_radius,
1335                            .3 * note_diagonal / (1 + offset));
1336
1337         pickup pencircle scaled (2 * pen_radius);
1338
1339         lft x1 = 0;
1340         y1 = 0;
1341         bot y2 = -d;
1342         x2 = .5 [x1, x3];
1343         rt x3 = w;
1344         x4 = x2;
1345         y3 = y1;
1346         top y4 = h;
1347
1348         % inner sides are parallel to outer sides
1349         z6 - z5 = whatever * (z2 - z1);
1350         z8 - z7 = whatever * (z4 - z3);
1351         z8 - z5 = whatever * (z4 - z1);
1352         z7 - z6 = whatever * (z3 - z2);
1353
1354         ne = unitvector (z4 - z1);
1355         se = unitvector (z2 - z1);
1356
1357         ne_dist = (ne rotated 90) * pen_radius;
1358         se_dist = (se rotated 90) * pen_radius;
1359
1360         path_a := (z1 + se_dist)
1361                   -- (z2 + se_dist);
1362         path_b := (z2 + (ne_dist * offset))
1363                   -- (z3 + (ne_dist * offset));
1364         path_c := (z3 - se_dist)
1365                   -- (z4 - se_dist);
1366         path_d := (z4 - (ne_dist * offset))
1367                   -- (z1 - (ne_dist * offset));
1368
1369         z5 = path_a intersectionpoint path_d;
1370         z7 = path_b intersectionpoint path_c;
1371
1372         labels (range 1 thru 8);
1373
1374         inner_path := z5
1375                       -- z6
1376                       -- z7
1377                       -- z8
1378                       -- cycle;
1379
1380         if mirror:
1381                 path_in := inner_path;
1382         else:
1383                 path_in := inner_path reflectedabout (z2, z4);
1384         fi
1385
1386         path_out := lft z1 {down}
1387                     .. (z1 - se_dist){se}
1388                     -- (z2 - se_dist){se}
1389                     .. bot z2 {right}
1390                     .. (z2 - ne_dist){ne}
1391                     -- (z3 - ne_dist){ne}
1392                     .. rt z3 {up}
1393                     .. (z3 + se_dist){-se}
1394                     -- (z4 + se_dist){-se}
1395                     .. top z4 {left}
1396                     .. (z4 + ne_dist){-ne}
1397                     -- (z1 + ne_dist){-ne}
1398                     .. cycle;
1399 enddef;
1400
1401
1402 save mi_weight, mi_width;
1403 mi_weight := 2;
1404 mi_width := 1.2;
1405
1406 fet_beginchar ("Whole mihead", "s0mi");
1407         draw_mi_head (mi_width * solfa_whole_width, mi_weight, false);
1408         fill path_out;
1409         unfill path_in;
1410 fet_endchar;
1411
1412
1413 fet_beginchar ("Half mihead", "s1mi");
1414         draw_mi_head (mi_width * solfa_quarter_width, mi_weight, false);
1415         fill path_out;
1416         unfill path_in;
1417 fet_endchar;
1418
1419
1420 fet_beginchar ("Quarter mihead", "s2mi");
1421         draw_mi_head (mi_width * solfa_quarter_width, mi_weight, false);
1422         fill path_out;
1423 fet_endchar;
1424
1425
1426 fet_beginchar ("Whole mirror mihead", "s0miMirror");
1427         draw_mi_head (mi_width * solfa_whole_width, mi_weight, true);
1428         fill path_out;
1429         unfill path_in;
1430 fet_endchar;
1431
1432
1433 fet_beginchar ("Half  mirror mihead", "s1miMirror");
1434         draw_mi_head (mi_width * solfa_quarter_width, mi_weight, true);
1435         fill path_out;
1436         unfill path_in;
1437 fet_endchar;
1438
1439
1440 fet_beginchar ("Quarter mirror mihead", "s2miMirror");
1441         draw_mi_head (mi_width * solfa_quarter_width, mi_weight, true);
1442         fill path_out;
1443 fet_endchar;
1444
1445
1446 fet_beginchar ("Whole thin mihead", "s0miThin");
1447         draw_mi_head (mi_width * solfa_whole_width, 1, false);
1448         fill path_out;
1449         unfill path_in;
1450 fet_endchar;
1451
1452
1453 fet_beginchar ("Half thin mihead", "s1miThin");
1454         draw_mi_head (mi_width * solfa_quarter_width, 1, false);
1455         fill path_out;
1456         unfill path_in;
1457 fet_endchar;
1458
1459
1460 fet_beginchar ("Quarter thin mihead", "s2miThin");
1461         draw_mi_head (mi_width * solfa_quarter_width, 1, false);
1462         fill path_out;
1463 fet_endchar;
1464
1465
1466 %%%% fa head
1467 %
1468 % Right triangle, hypotenuse from nw to se corner.  Stem attaches on
1469 % vertical side in direction of horizontal side.
1470 %
1471 def draw_fa_head (expr width_factor, thickness_factor) =
1472         set_char_box (0, width_factor * solfa_base_notewidth#,
1473                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
1474
1475         save p_down_in, p_down_out, p_up_in, p_up_out, nw_dist, nw;
1476         path p_down_in, p_down_out, p_up_in, p_up_out;
1477         save path_a, path_b, path_c;
1478         path path_a, path_b, path_c;
1479         pair nw_dist, nw;
1480
1481         save offset;
1482         offset := 2 * thickness_factor - 1;
1483
1484         save pen_radius;
1485         pen_radius := min (solfa_pen_radius,
1486                            .33 * (h + d) / (1 + offset));
1487
1488         pickup pencircle scaled (2 * pen_radius);
1489
1490         lft x1 = 0;
1491         top y1 = h;
1492
1493         rt x2 = w;
1494         y2 = y1;
1495         bot y3 = -d;
1496         x3 = x2;
1497
1498         y4 = y3;
1499         x4 = x1;
1500
1501         labels (1, 2, 3, 4);
1502
1503         nw = unitvector (z1 - z3);
1504         nw_dist = (nw rotated 90) * pen_radius;
1505
1506         path_a := (z1 - (0,1) * offset * pen_radius)
1507                   -- (z2 - (0,1) * offset * pen_radius);
1508         path_b := (z2 - (1,0) * pen_radius)
1509                   -- (z3 - (1,0) * pen_radius);
1510         path_c := (z3 - nw_dist)
1511                   -- (z1 - nw_dist);
1512
1513         p_up_in := (path_a intersectionpoint path_b)
1514                    -- (path_b intersectionpoint path_c)
1515                    -- (path_c intersectionpoint path_a)
1516                    -- cycle;
1517
1518         p_up_out := lft z1{down}
1519                     .. (z1 + nw_dist){-nw}
1520                     -- (z3 + nw_dist){-nw}
1521                     .. bot z3{right}
1522                     .. rt z3{up}
1523                     -- rt z2{up}
1524                     .. top z2{left}
1525                     -- top z1{left}
1526                     .. cycle;
1527
1528         p_down_in := p_up_in rotated 180 shifted (w, 0);
1529         p_down_out := p_up_out rotated 180 shifted (w, 0);
1530
1531         charwy := 0.0;
1532         charwx := charwd;
1533 enddef;
1534
1535 save fa_weight;
1536 fa_weight := 1.75;
1537
1538 fet_beginchar ("Whole fa up head", "u0fa");
1539         draw_fa_head (solfa_whole_width, fa_weight);
1540         fill p_up_out;
1541         unfill p_up_in;
1542 fet_endchar;
1543
1544
1545 fet_beginchar ("Whole fa down head", "d0fa");
1546         draw_fa_head (solfa_whole_width, fa_weight);
1547         fill p_down_out;
1548         unfill p_down_in;
1549 fet_endchar;
1550
1551
1552 fet_beginchar ("half fa up head", "u1fa");
1553         draw_fa_head (solfa_half_width, fa_weight);
1554         fill p_up_out;
1555         unfill p_up_in;
1556 fet_endchar;
1557
1558
1559 fet_beginchar ("Half fa down head", "d1fa");
1560         draw_fa_head (solfa_half_width, fa_weight);
1561         fill p_down_out;
1562         unfill p_down_in;
1563 fet_endchar;
1564
1565
1566 fet_beginchar ("Quarter fa up head", "u2fa");
1567         draw_fa_head (solfa_quarter_width, fa_weight);
1568         fill p_up_out;
1569 fet_endchar;
1570
1571
1572 fet_beginchar ("Quarter fa down head", "d2fa");
1573         draw_fa_head (solfa_quarter_width, fa_weight);
1574         fill p_down_out;
1575 fet_endchar;
1576
1577
1578 fet_beginchar ("Whole thin fa up head", "u0faThin");
1579         draw_fa_head (solfa_whole_width, 1);
1580         fill p_up_out;
1581         unfill p_up_in;
1582 fet_endchar;
1583
1584
1585 fet_beginchar ("Whole thin fa down head", "d0faThin");
1586         draw_fa_head (solfa_whole_width, 1);
1587         fill p_down_out;
1588         unfill p_down_in;
1589 fet_endchar;
1590
1591
1592 fet_beginchar ("half thin fa up head", "u1faThin");
1593         draw_fa_head (solfa_half_width, 1);
1594         fill p_up_out;
1595         unfill p_up_in;
1596 fet_endchar;
1597
1598
1599 fet_beginchar ("Half thin fa down head", "d1faThin");
1600         draw_fa_head (solfa_half_width, 1);
1601         fill p_down_out;
1602         unfill p_down_in;
1603 fet_endchar;
1604
1605
1606 fet_beginchar ("Quarter thin fa up head", "u2faThin");
1607         draw_fa_head (solfa_quarter_width, 1);
1608         fill p_up_out;
1609 fet_endchar;
1610
1611
1612 fet_beginchar ("Quarter thin fa down head", "d2faThin");
1613         draw_fa_head (solfa_quarter_width, 1);
1614         fill p_down_out;
1615 fet_endchar;
1616
1617
1618
1619 %%%% sol head
1620 %
1621 % Note: sol head is the same shape as a standard music head, and doesn't
1622 %       vary from style to style.  However, width is constant with duration,
1623 %       so we can't just use the standard note font.
1624 %
1625 def draw_sol_head (expr filled) =
1626         draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17);
1627         if not filled:
1628           undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#);
1629         fi
1630         draw_staff (-2, 2, 0);
1631 enddef;
1632
1633 fet_beginchar ("Whole solhead", "s0sol");
1634         draw_sol_head ( false);
1635 fet_endchar;
1636
1637
1638 fet_beginchar ("Half solhead", "s1sol");
1639         draw_sol_head ( false);
1640 fet_endchar;
1641
1642
1643 fet_beginchar ("Quarter solhead", "s2sol");
1644         draw_sol_head ( true);
1645 fet_endchar;
1646
1647
1648 %%%% la head
1649 %
1650 %   Rectangle head
1651 %
1652 def draw_la_head (expr width_factor, thickness_factor) =
1653         set_char_box (0, width_factor * solfa_base_notewidth#,
1654                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
1655         save p_in, p_out;
1656         path p_in, p_out;
1657
1658         save offset;
1659         offset := 2 * thickness_factor - 1;
1660
1661         save pen_radius;
1662         pen_radius := min (solfa_pen_radius,
1663                            .35 * (h + d) / (1 + offset));
1664
1665         pickup pencircle scaled (2 * pen_radius);
1666
1667         lft x1 = 0;
1668         top y1 = h;
1669
1670         rt x2 = w;
1671         y2 = y1;
1672         bot y3 = -d;
1673         x3 = x2;
1674
1675         y4 = y3;
1676         x4 = x1;
1677
1678         labels (range 1 thru 4);
1679
1680         p_in := (z1 + pen_radius * (1, -offset))
1681                 -- (z2 + pen_radius * (-1, -offset))
1682                 -- (z3 + pen_radius * (-1, offset))
1683                 -- (z4 + pen_radius * (1, offset))
1684                 -- cycle;
1685
1686         p_out := top z1
1687                  -- top z2{right}
1688                  .. rt z2{down}
1689                  -- rt z3{down}
1690                  .. bot z3{left}
1691                  -- bot z4{left}
1692                  .. lft z4{up}
1693                  -- lft z1{up}
1694                  .. cycle;
1695 enddef;
1696
1697
1698 save la_weight;
1699 la_weight := 2;
1700
1701 fet_beginchar ("Whole lahead", "s0la");
1702         draw_la_head (solfa_whole_width, la_weight);
1703         fill p_out;
1704         unfill p_in;
1705 fet_endchar;
1706
1707
1708 fet_beginchar ("Half lahead", "s1la");
1709         draw_la_head (solfa_half_width, la_weight);
1710         fill p_out;
1711         unfill p_in;
1712 fet_endchar;
1713
1714
1715 fet_beginchar ("Quarter lahead", "s2la");
1716         draw_la_head (solfa_quarter_width, la_weight);
1717         fill p_out;
1718 fet_endchar;
1719
1720
1721 fet_beginchar ("Whole thin lahead", "s0laThin");
1722         draw_la_head (solfa_whole_width, 1);
1723         fill p_out;
1724         unfill p_in;
1725 fet_endchar;
1726
1727
1728 fet_beginchar ("Half thin lahead", "s1laThin");
1729         draw_la_head (solfa_half_width, 1);
1730         fill p_out;
1731         unfill p_in;
1732 fet_endchar;
1733
1734
1735 fet_beginchar ("Quarter lahead", "s2laThin");
1736         draw_la_head (solfa_quarter_width, 1);
1737         fill p_out;
1738 fet_endchar;
1739
1740
1741 %%%% ti head
1742 %
1743 %   `Snow-cone', V with rounded top.
1744 %
1745 def draw_ti_head (expr width_factor, dir, thickness_factor) =
1746         set_char_box (0, width_factor * solfa_base_notewidth#,
1747                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
1748         save p_in, p_out, p_top, p_top_in;
1749         path p_in, p_out, p_top, p_top_in;
1750         save cone_height;
1751         cone_height = 0.64;
1752
1753         save offset;
1754         offset := 2 * thickness_factor - 1;
1755
1756         save pen_radius;
1757         pen_radius := min (solfa_pen_radius,
1758                            .4 * (h + d) / (1 + offset));
1759
1760         pickup pencircle scaled (2 * pen_radius);
1761
1762         x1 = .5 [x2, x4];
1763         bot y1 = -d;
1764         lft x2 = 0;
1765         y2 = cone_height [y1, y3];
1766         rt x4 = w;
1767         y4 = y2;
1768         x3 = x1;
1769         top y3 = h;
1770         x5 = x1;
1771         y5 = y1 + offset * pen_radius;
1772
1773         labels (range 1 thru 4);
1774
1775         save nw_dist, sw_dist, nw, sw;
1776         pair nw_dist, sw_dist, nw, sw;
1777
1778         nw = unitvector (z2 - z1);
1779         sw = unitvector (z1 - z4);
1780
1781         nw_dist = (nw rotated 90) * pen_radius;
1782         sw_dist = (sw rotated 90) * pen_radius;
1783
1784         p_top := (z2 + nw * pen_radius)
1785                  .. (top z3){right}
1786                  .. (z4 - sw * pen_radius);
1787
1788         p_top_in := (z2 - nw * offset * pen_radius)
1789                     .. (z3 - (0,1) * pen_radius) {right}
1790                     .. (z4 + sw * offset * pen_radius);
1791
1792         save path_a, path_b;
1793         path path_a, path_b;
1794         path_a := z2
1795                   -- z5;
1796         path_b := z5
1797                   -- z4;
1798
1799         z6 = path_a intersectionpoint p_top_in;
1800         z7 = path_b intersectionpoint p_top_in;
1801
1802         p_in := z5
1803                 -- z6
1804                 .. bot z3
1805                 .. z7
1806                 -- cycle;
1807
1808         p_out := bot z1
1809                  .. (z1 + nw_dist)
1810                  -- (z2 + nw_dist)
1811                  .. lft z2
1812                  .. (z2 + nw * pen_radius){direction 0 of p_top}
1813                  & p_top
1814                  & {direction infinity of p_top}(z4 - sw * pen_radius)
1815                  .. rt z4
1816                  .. (z4 + sw_dist)
1817                  -- (z1 + sw_dist)
1818                  .. cycle;
1819
1820         charwx := charwd;
1821         charwy := cone_height [-chardp, charht];
1822         if dir = -1:
1823                 charwy := -charwy;
1824         fi;
1825 enddef;
1826
1827
1828 save ti_weight;
1829 ti_weight := 2;
1830
1831 fet_beginchar ("Whole up tihead", "s0ti");
1832         draw_ti_head (solfa_whole_width, 1, ti_weight);
1833         fill p_out;
1834         unfill p_in;
1835 fet_endchar;
1836
1837
1838 fet_beginchar ("Half up tihead", "u1ti");
1839         draw_ti_head (solfa_half_width, 1, ti_weight);
1840         fill p_out;
1841         unfill p_in;
1842 fet_endchar;
1843
1844
1845 fet_beginchar ("Half down tihead", "d1ti");
1846         draw_ti_head (solfa_half_width, -1, ti_weight);
1847         fill p_out;
1848         unfill p_in;
1849 fet_endchar;
1850
1851
1852 fet_beginchar ("Quarter up tihead", "u2ti");
1853         draw_ti_head (solfa_quarter_width, 1, ti_weight);
1854         fill p_out;
1855 fet_endchar;
1856
1857
1858 fet_beginchar ("Quarter down tihead", "d2ti");
1859         draw_ti_head (solfa_quarter_width, -1, ti_weight);
1860         fill p_out;
1861 fet_endchar;
1862
1863
1864 fet_beginchar ("Whole thin up tihead", "s0tiThin");
1865         draw_ti_head (solfa_whole_width, 1, 1);
1866         fill p_out;
1867         unfill p_in;
1868 fet_endchar;
1869
1870
1871 fet_beginchar ("Half thin up tihead", "u1tiThin");
1872         draw_ti_head (solfa_half_width, 1, 1);
1873         fill p_out;
1874         unfill p_in;
1875 fet_endchar;
1876
1877
1878 fet_beginchar ("Half thin down tihead", "d1tiThin");
1879         draw_ti_head (solfa_half_width, -1, 1);
1880         fill p_out;
1881         unfill p_in;
1882 fet_endchar;
1883
1884
1885 fet_beginchar ("Quarter thin up tihead", "u2tiThin");
1886         draw_ti_head (solfa_quarter_width, 1, 1);
1887         fill p_out;
1888 fet_endchar;
1889
1890
1891 fet_beginchar ("Quarter thin down tihead", "d2tiThin");
1892         draw_ti_head (solfa_quarter_width, -1, 1);
1893         fill p_out;
1894 fet_endchar;
1895
1896
1897 %%%%%%   Funk shape note heads
1898 %
1899 %  Funk heads are narrower than Aiken and Sacred Harp, so we need a new
1900 %  width.
1901 %
1902 funk_notehead_width := 0.75;
1903
1904
1905 %%%%%%   Funk do head
1906 %          Parabolic on one side, vertical line on other
1907 %          Has up and down shapes for *all* notes
1908 %
1909 def draw_Funk_do_head (expr width_factor, thickness_factor) =
1910         set_char_box (0, width_factor * solfa_base_notewidth#,
1911                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
1912
1913         save offset;
1914         offset := 2 * thickness_factor - 1;
1915
1916         save pen_radius;
1917         pen_radius := min (solfa_pen_radius,
1918                            .3 * (h + d) / (1 + offset));
1919
1920         pickup pencircle scaled (2 * pen_radius);
1921
1922         rt x1 = w;
1923         bot y1 = -d;
1924
1925         lft x2 = 0;
1926         y2 = 0.5 [y1, y3];
1927
1928         x3 = x1;
1929         top y3 = h;
1930
1931         x4 = x1 - pen_radius;
1932         y4 = y1 + offset * pen_radius;
1933
1934         y5 = y2;
1935         x5 = x2 + pen_radius;
1936
1937         x6 = x4;
1938         y6 = y3 - offset * pen_radius;
1939
1940         save p_up_in, p_up_out, p_down_in, p_down_out;
1941         path p_up_in, p_up_out, p_down_in, p_down_out;
1942
1943         p_down_in := z4{left}
1944                      ... z5{up}
1945                      ... z6{right}
1946                      -- cycle;
1947
1948         p_down_out := bot z1{left}
1949                       .. lft z2{up}
1950                       .. top z3{right}
1951                       .. rt z3{down}
1952                       -- rt z1{down}
1953                       .. cycle;
1954
1955         p_up_in := p_down_in rotated 180 shifted (w,0);
1956         p_up_out := p_down_out rotated 180 shifted (w,0);
1957
1958 enddef;
1959
1960
1961 save funk_do_weight;
1962 funk_do_weight := 1.7;
1963
1964 fet_beginchar ("Whole up Funk dohead", "u0doFunk");
1965         draw_Funk_do_head (funk_notehead_width, funk_do_weight);
1966         fill p_up_out;
1967         unfill p_up_in;
1968 fet_endchar;
1969
1970
1971 fet_beginchar ("Whole down Funk dohead", "d0doFunk");
1972         draw_Funk_do_head (funk_notehead_width, funk_do_weight);
1973         fill p_down_out;
1974         unfill p_down_in;
1975 fet_endchar;
1976
1977
1978 fet_beginchar ("Half up Funk dohead", "u1doFunk");
1979         draw_Funk_do_head (funk_notehead_width, funk_do_weight);
1980         fill p_up_out;
1981         unfill p_up_in;
1982 fet_endchar;
1983
1984
1985 fet_beginchar ("Half down Funk dohead", "d1doFunk");
1986         draw_Funk_do_head (funk_notehead_width, funk_do_weight);
1987         fill p_down_out;
1988         unfill p_down_in;
1989 fet_endchar;
1990
1991
1992 fet_beginchar ("Quarter up Funk dohead", "u2doFunk");
1993         draw_Funk_do_head (funk_notehead_width, funk_do_weight);
1994         fill p_up_out;
1995 fet_endchar;
1996
1997
1998 fet_beginchar ("Quarter down Funk dohead", "d2doFunk");
1999         draw_Funk_do_head (funk_notehead_width, funk_do_weight);
2000         fill p_down_out;
2001 fet_endchar;
2002
2003
2004 %%%%%%  Funk re head
2005 %       Arrowhead shape.
2006 %       Has up and down shapes for *all* notes
2007 %
2008 def draw_Funk_re_head (expr width_factor, thickness_factor) =
2009         set_char_box (0, width_factor * solfa_base_notewidth#,
2010                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
2011
2012         save offset;
2013         offset := 2 * thickness_factor - 1;
2014
2015         save pen_radius;
2016         pen_radius := min (solfa_pen_radius,
2017                            .3 * (h + d) / (1 + offset));
2018
2019         pickup pencircle scaled (2 * pen_radius);
2020
2021         save curve_in;
2022         curve_in := 0.9;
2023
2024         lft x1 = 0;
2025         y1 := 0.5 [y2, y4];
2026
2027         rt x2 = w;
2028         top y2 = h;
2029
2030         x3 := curve_in [x1, x2];
2031         y3 := y1;
2032
2033         x4 = x2;
2034         bot y4 = -d;
2035
2036         z6 = lft z3;
2037
2038         save ne, se, ne_perp, se_perp;
2039         pair ne, se, ne_perp, se_perp;
2040
2041         ne := unitvector (z2 - z1);
2042         se := unitvector (z4 - z1);
2043         ne_perp := ne rotated 90;
2044         se_perp := se rotated 90;
2045
2046         save path_a, path_b, path_c, path_d;
2047         path path_a, path_b, path_c, path_d;
2048         save arrow_a_perp, arrow_b_perp;
2049         pair arrow_a_perp, arrow_b_perp;
2050
2051
2052         path_d := z2 .. z3{down} .. z4;
2053         arrow_a_perp = unitvector (direction 0 of path_d rotated 90)
2054                        * pen_radius;
2055         arrow_b_perp = unitvector (direction 2 of path_d rotated 90)
2056                        * pen_radius;
2057
2058         path_b := (z1 + se_perp * pen_radius)
2059                   -- z4 + se_perp * offset * pen_radius;
2060         path_a := (z1 - ne_perp * pen_radius)
2061                   -- z2 - ne_perp * offset * pen_radius;
2062         path_c := z2 - arrow_a_perp
2063                   .. z6{down}
2064                   .. z4 - arrow_b_perp;
2065
2066         z5 = path_a intersectionpoint path_b;
2067         z7 = path_a intersectionpoint path_c;
2068         z8 = path_b intersectionpoint path_c;
2069
2070         save p_up_in, p_down_in, p_up_out, p_down_out;
2071         path p_up_in, p_down_in, p_up_out, p_down_out;
2072
2073         p_down_in := z5
2074                      -- z7
2075                      .. z6{down}
2076                      .. z8
2077                      -- cycle;
2078
2079         p_down_out := lft z1{up}
2080                       .. (z1 + ne_perp * pen_radius){ne}
2081                       -- (z2 + ne_perp * pen_radius){ne}
2082                       .. top z2 {right}
2083                       .. rt z2{down}
2084                       .. (z2 + arrow_a_perp)
2085                       .. rt z3{down}
2086                       .. (z4 + arrow_b_perp)
2087                       .. rt z4{down}
2088                       .. bot z4 {left}
2089                       .. z4 - se_perp * pen_radius
2090                       -- z1 - se_perp * pen_radius
2091                       .. cycle;
2092
2093         p_up_in := p_down_in rotated 180 shifted (w, 0);
2094         p_up_out := p_down_out rotated 180 shifted (w, 0);
2095
2096 enddef;
2097
2098
2099 save funk_re_weight;
2100 funk_re_weight = 1.7;
2101
2102 fet_beginchar ("Whole up Funk rehead", "u0reFunk");
2103         draw_Funk_re_head (funk_notehead_width, funk_re_weight);
2104         fill p_up_out;
2105         unfill p_up_in;
2106 fet_endchar;
2107
2108
2109 fet_beginchar ("Whole down Funk rehead", "d0reFunk");
2110         draw_Funk_re_head (funk_notehead_width, funk_re_weight);
2111         fill p_down_out;
2112         unfill p_down_in;
2113 fet_endchar;
2114
2115
2116 fet_beginchar ("Half up Funk rehead", "u1reFunk");
2117         draw_Funk_re_head (funk_notehead_width, funk_re_weight);
2118         fill p_up_out;
2119         unfill p_up_in;
2120 fet_endchar;
2121
2122
2123 fet_beginchar ("Half down Funk rehead", "d1reFunk");
2124         draw_Funk_re_head (funk_notehead_width, funk_re_weight);
2125         fill p_down_out;
2126         unfill p_down_in;
2127 fet_endchar;
2128
2129
2130 fet_beginchar ("Quarter up Funk rehead", "u2reFunk");
2131         draw_Funk_re_head (funk_notehead_width, funk_re_weight);
2132         fill p_up_out;
2133 fet_endchar;
2134
2135
2136 fet_beginchar ("Quarter down Funk rehead", "d2reFunk");
2137         draw_Funk_re_head (funk_notehead_width, funk_re_weight);
2138         fill p_down_out;
2139 fet_endchar;
2140
2141
2142 %%%%%%  Funk mi head
2143 %       Diamond shape
2144 %       Has up and down shapes for all hollow notes
2145 %
2146 save funk_mi_width, funk_mi_weight;
2147 funk_mi_width := 1.2;
2148 funk_mi_weight := 1.9;
2149
2150 fet_beginchar ("Whole up Funk mihead", "u0miFunk");
2151         draw_mi_head (funk_mi_width * funk_notehead_width,
2152                       funk_mi_weight, false);
2153         fill path_out;
2154         unfill path_in;
2155 fet_endchar;
2156
2157
2158 fet_beginchar ("Whole down Funk mihead", "d0miFunk");
2159         draw_mi_head (funk_mi_width * funk_notehead_width,
2160                       funk_mi_weight, true);
2161         fill path_out;
2162         unfill path_in;
2163 fet_endchar;
2164
2165
2166 fet_beginchar ("Half up Funk mihead", "u1miFunk");
2167         draw_mi_head (funk_mi_width * funk_notehead_width,
2168                       funk_mi_weight, false);
2169         fill path_out;
2170         unfill path_in;
2171 fet_endchar;
2172
2173
2174 fet_beginchar ("Half down Funk mihead", "d1miFunk");
2175         draw_mi_head (funk_mi_width * funk_notehead_width,
2176                       funk_mi_weight, true);
2177         fill path_out;
2178         unfill path_in;
2179 fet_endchar;
2180
2181
2182 fet_beginchar ("Quarter Funk mihead", "s2miFunk");
2183         draw_mi_head (funk_mi_width * funk_notehead_width,
2184                       funk_mi_weight, false);
2185         fill path_out;
2186 fet_endchar;
2187
2188
2189 %%%%%%  Funk fa
2190 %       Triangle shape
2191 %       Does it rotate for whole notes?
2192 %       Same as other shape note systems
2193 %       Need special notes because of special width
2194 %
2195 save funk_fa_weight;
2196 funk_fa_weight := 1.9;
2197
2198 fet_beginchar ("Whole up Funk fahead", "u0faFunk");
2199         draw_fa_head (funk_notehead_width, funk_fa_weight);
2200         fill p_up_out;
2201         unfill p_up_in;
2202 fet_endchar;
2203
2204
2205 fet_beginchar ("Whole down Funk fahead", "d0faFunk");
2206         draw_fa_head (funk_notehead_width, funk_fa_weight);
2207         fill p_down_out;
2208         unfill p_down_in;
2209 fet_endchar;
2210
2211
2212 fet_beginchar ("Half up Funk fahead", "u1faFunk");
2213         draw_fa_head (funk_notehead_width, funk_fa_weight);
2214         fill p_up_out;
2215         unfill p_up_in;
2216 fet_endchar;
2217
2218
2219 fet_beginchar ("Half down Funk fahead", "d1faFunk");
2220         draw_fa_head (funk_notehead_width, funk_fa_weight);
2221         fill p_down_out;
2222         unfill p_down_in;
2223 fet_endchar;
2224
2225
2226 fet_beginchar ("Quarter up Funk fahead", "u2faFunk");
2227         draw_fa_head (funk_notehead_width, funk_fa_weight);
2228         fill p_up_out;
2229 fet_endchar;
2230
2231
2232 fet_beginchar ("Quarter down Funk fahead", "d2faFunk");
2233         draw_fa_head (funk_notehead_width, funk_fa_weight);
2234         fill p_down_out;
2235 fet_endchar;
2236
2237
2238 %%%%%%  Funk sol head is the same as the others
2239 %       Need special character because of skinnier head
2240 %
2241 def draw_Funk_sol_head (expr filled) =
2242 begingroup
2243         save noteheight;
2244         noteheight# := solfa_noteheight#;
2245         draw_outside_ellipse (1.2, 34, 0.71, 0.);
2246         if not filled:
2247           undraw_inside_ellipse (1.9, 33, 0.74, 5.5 stafflinethickness#);
2248         fi
2249         draw_staff (-2, 2, 0);
2250 endgroup
2251 enddef;
2252
2253
2254 fet_beginchar ("Whole Funk solhead", "s0solFunk");
2255         draw_Funk_sol_head ( false);
2256 fet_endchar;
2257
2258
2259 fet_beginchar ("Half Funk solhead", "s1solFunk");
2260         draw_Funk_sol_head ( false);
2261 fet_endchar;
2262
2263
2264 fet_beginchar ("Quarter Funk solhead", "s2solFunk");
2265         draw_Funk_sol_head ( true);
2266 fet_endchar;
2267
2268
2269 %%%%%%  Funk la head
2270 %       Rectangle head
2271 %       Same as for other shape notes
2272 %       Smaller width requires special characters
2273 %
2274 save funk_la_weight;
2275 funk_la_weight := 1.9;
2276
2277 fet_beginchar ("Whole Funk lahead", "s0laFunk");
2278         draw_la_head (funk_notehead_width, funk_notehead_width);
2279         fill p_out;
2280         unfill p_in;
2281 fet_endchar;
2282
2283
2284 fet_beginchar ("Half Funk lahead", "s1laFunk");
2285         draw_la_head (funk_notehead_width, funk_notehead_width);
2286         fill p_out;
2287         unfill p_in;
2288 fet_endchar;
2289
2290
2291 fet_beginchar ("Quarter Funk lahead", "s2laFunk");
2292         draw_la_head (funk_notehead_width, funk_notehead_width);
2293         fill p_out;
2294 fet_endchar;
2295
2296
2297 %%%%%%  Funk ti head
2298 %       `Sideways snow cone'.
2299 %       Rotates for all notes.
2300 %
2301 def draw_Funk_ti_head (expr width_factor, thickness_factor) =
2302         set_char_box (0, width_factor * solfa_base_notewidth#,
2303                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
2304         save cone_width;
2305         cone_width = 0.8;
2306
2307         save offset;
2308         offset := 2 * thickness_factor - 1;
2309
2310         save pen_radius;
2311         pen_radius := min (solfa_pen_radius,
2312                            .33 * (h + d) / (1 + offset));
2313
2314         pickup pencircle scaled (2 * pen_radius);
2315
2316         lft x1 = 0;
2317         y1 = .5 [y2, y4];
2318
2319         x2 = cone_width [x1, x3];
2320         top y2 = h;
2321
2322         rt x3 = w;
2323         y3 = y1;
2324
2325         x4 = x2;
2326         bot y4 = -d;
2327
2328         save nw_dist, sw_dist, ne, se;
2329         pair nw_dist, sw_dist, ne, se;
2330
2331         ne = unitvector (z2 - z1);
2332         se = unitvector (z4 - z1);
2333
2334         nw_dist = (ne rotated 90) * pen_radius ;
2335         sw_dist = (se rotated -90) * pen_radius;
2336
2337         save path_a, path_b;
2338         path path_a, path_b;
2339         path_a := z1 - nw_dist
2340                   -- z2 - offset * nw_dist;
2341         path_b := z1 - sw_dist
2342                   -- z4 - offset * sw_dist;
2343
2344         save path_right, path_right_in;
2345         path path_right, path_right_in;
2346         path_right := (z2 + ne * pen_radius)
2347                       .. (rt z3){down}
2348                       .. (z4 + se * pen_radius);
2349
2350         path_right_in := (z2 - ne * pen_radius)
2351                          .. lft z3{down}
2352                          .. (z4 - se * pen_radius);
2353
2354         z5 = path_a intersectionpoint path_b;
2355         z6 = path_a intersectionpoint path_right_in;
2356         z7 = path_b intersectionpoint path_right_in;
2357
2358         save p_up_in, p_down_in, p_up_out, p_down_out;
2359         path p_up_in, p_down_in, p_up_out, p_down_out;
2360
2361         p_down_in := z5
2362                      -- z6
2363                      .. lft z3
2364                      .. z7
2365                      -- cycle;
2366
2367         p_down_out := lft z1
2368                       .. (z1 + nw_dist)
2369                       -- (z2 + nw_dist)
2370                       .. top z2
2371                       .. (z2 + ne * pen_radius){direction 0 of path_right}
2372                       & path_right
2373                       & {direction infinity of path_right}(z4 + se * pen_radius)
2374                       .. bot z4
2375                       .. (z4 + sw_dist)
2376                       -- (z1 + sw_dist)
2377                       .. cycle;
2378
2379         p_up_in := p_down_in rotated 180 shifted (w, 0);
2380         p_up_out := p_down_out rotated 180 shifted (w, 0);
2381 enddef;
2382
2383
2384 save funk_ti_weight;
2385 funk_ti_weight := 1.6;
2386
2387 fet_beginchar ("Whole up Funk tihead", "u0tiFunk");
2388         draw_Funk_ti_head (funk_notehead_width, funk_ti_weight);
2389         fill p_up_out;
2390         unfill p_up_in;
2391 fet_endchar;
2392
2393
2394 fet_beginchar ("Whole down Funk tihead", "d0tiFunk");
2395         draw_Funk_ti_head (funk_notehead_width, funk_ti_weight);
2396         fill p_down_out;
2397         unfill p_down_in;
2398 fet_endchar;
2399
2400
2401 fet_beginchar ("Half up Funk tihead", "u1tiFunk");
2402         draw_Funk_ti_head (funk_notehead_width, funk_ti_weight);
2403         fill p_up_out;
2404         unfill p_up_in;
2405 fet_endchar;
2406
2407
2408 fet_beginchar ("Half down Funk tihead", "d1tiFunk");
2409         draw_Funk_ti_head (funk_notehead_width, funk_ti_weight);
2410         fill p_down_out;
2411         unfill p_down_in;
2412 fet_endchar;
2413
2414
2415 fet_beginchar ("Quarter up Funk tihead", "u2tiFunk");
2416         draw_Funk_ti_head (funk_notehead_width, funk_ti_weight);
2417         fill p_up_out;
2418 fet_endchar;
2419
2420
2421 fet_beginchar ("Quarter down Funk tihead", "d2tiFunk");
2422         draw_Funk_ti_head (funk_notehead_width, funk_ti_weight);
2423         fill p_down_out;
2424 fet_endchar;
2425
2426
2427 %%%%%%   Walker shape note heads
2428 %
2429 % Walker heads are narrow like Funk heads, so use funk_notehead_width.
2430 %
2431
2432 %%%%%%   Walker do head
2433 %
2434 % Trapezoid, with largest side on stem side
2435 %
2436 def draw_Walker_do_head (expr width_factor, dir, thickness_factor) =
2437         set_char_box (0, width_factor * solfa_base_notewidth#,
2438                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
2439
2440         pickup pencircle scaled solfa_pen_thick;
2441
2442         save offset;
2443         offset := 2 * thickness_factor - 1;
2444
2445         % adjust width so stem can be centered
2446         if .5w <> good.x .5w: change_width; fi
2447
2448         save scaling;
2449
2450         scaling# = charwd / w;
2451
2452         save inset;
2453         inset := 0.25;
2454
2455         x1 = inset [x4, x3];
2456         top y1 = h;
2457
2458         x2 = inset [x3, x4];
2459         y2 = y1;
2460
2461         bot y3 = -d;
2462         rt x3 = w;
2463
2464         y4 = y3;
2465         lft x4 = 0;
2466
2467         labels (range 1 thru 4);
2468
2469         save left_dir, left_perp, right_dir, right_perp;
2470         pair left_dir, left_perp, right_dir, right_perp;
2471
2472         left_dir = unitvector(z1 - z4);
2473         left_perp = (left_dir rotated 90) * solfa_pen_radius;
2474         right_dir = unitvector(z3 - z2);
2475         right_perp = (right_dir rotated 90) * solfa_pen_radius;
2476
2477         save path_a, path_b, path_c, path_d;
2478         path path_a, path_b, path_c, path_d;
2479
2480         path_a := (z4 - left_perp)
2481                   -- (z1 - left_perp);
2482         path_b := (z1 - (0, offset*solfa_pen_radius))
2483                   -- (z2 - (0, offset*solfa_pen_radius));
2484         path_c := (z2 - right_perp)
2485                   -- (z3 - right_perp);
2486         path_d := (z3 + (0, offset*solfa_pen_radius))
2487                   -- (z4 + (0, offset*solfa_pen_radius));
2488
2489         save p_in, p_out;
2490         path p_in, p_out;
2491
2492         p_in := (path_a intersectionpoint path_b)
2493                 -- (path_b intersectionpoint path_c)
2494                 -- (path_c intersectionpoint path_d)
2495                 -- (path_d intersectionpoint path_a)
2496                 -- cycle;
2497
2498         p_out := top z1{right}
2499                  -- top z2{right}
2500                  .. z2 + right_perp {right_dir}
2501                  -- z3 + right_perp {right_dir}
2502                  .. bot z3{left}
2503                  -- bot z4{left}
2504                  .. z4 + left_perp {left_dir}
2505                  .. z1 + left_perp {left_dir}
2506                  .. cycle;
2507
2508         charwx := scaling# * (w/2 + solfa_pen_radius);
2509         charwy := scaling# * y2 ;
2510
2511         if dir = 1:
2512                 p_in := p_in rotated 180 shifted (w,0);
2513                 p_out := p_out rotated 180 shifted (w,0);
2514         fi;
2515 enddef;
2516
2517
2518 save walker_do_weight;
2519 walker_do_weight := 1.5;
2520
2521 fet_beginchar ("Whole Walker dohead", "s0doWalker");
2522         draw_Walker_do_head (funk_notehead_width, 0, walker_do_weight);
2523         fill p_out;
2524         unfill p_in;
2525 fet_endchar;
2526
2527
2528 fet_beginchar ("Half up Walker dohead", "u1doWalker");
2529         draw_Walker_do_head (funk_notehead_width, 1, walker_do_weight);
2530         fill p_out;
2531         unfill p_in;
2532 fet_endchar;
2533
2534
2535 fet_beginchar ("Half down Walker dohead", "d1doWalker");
2536         draw_Walker_do_head (funk_notehead_width, 0, walker_do_weight);
2537         fill p_out;
2538         unfill p_in;
2539 fet_endchar;
2540
2541
2542 fet_beginchar ("Quarter up Walker dohead", "u2doWalker");
2543         draw_Walker_do_head (funk_notehead_width, 1, walker_do_weight);
2544         fill p_out;
2545 fet_endchar;
2546
2547
2548 fet_beginchar ("Quarter down Walker dohead", "d2doWalker");
2549         draw_Walker_do_head (funk_notehead_width, 0, walker_do_weight);
2550         fill p_out;
2551 fet_endchar;
2552
2553
2554 %%%%%%   Walker re head
2555 %          Parabolic on one side, shallow parabola on other
2556 %          Has up and down shapes for *all* notes
2557 %
2558 def draw_Walker_re_head (expr width_factor, thickness_factor) =
2559         set_char_box (0, width_factor * solfa_base_notewidth#,
2560                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
2561
2562         save offset;
2563         offset := 2 * thickness_factor - 1;
2564
2565         save pen_radius;
2566         pen_radius := min (solfa_pen_radius,
2567                            .3 * (h + d) / (1 + offset));
2568
2569         pickup pencircle scaled (2 * pen_radius);
2570
2571         save dish_factor;
2572         dish_factor := 0.20;
2573
2574         rt x1 = w;
2575         bot y1 = -d;
2576
2577         lft x2 = 0;
2578         y2 = 0.5 [y1, y3];
2579
2580         top y3 = h;
2581         x3 = x1;
2582
2583         x4 = dish_factor [x1, x2];
2584         y4 = y2;
2585
2586         x5 = x1;
2587         y5 = y1 + offset * pen_radius;
2588
2589         y6 = y2;
2590         x6 = x2 + pen_radius;
2591
2592         x7 = x3;
2593         y7 = y3 - offset * pen_radius;
2594
2595         y8 = y4;
2596         x8 = x4 - pen_radius;
2597
2598         save path_a, path_d;
2599         path path_a, path_d;
2600
2601         save p_a_start_dir, p_a_end_dir, p_a_start_perp, p_a_end_perp;
2602         pair p_a_start_dir, p_a_end_dir, p_a_start_perp, p_a_end_perp;
2603
2604         path_a := z3 .. z4{down} .. z1;
2605
2606         p_a_start_dir := unitvector(direction 0 of path_a);
2607         p_a_end_dir := unitvector(direction infinity of path_a);
2608         p_a_start_perp := (p_a_start_dir rotated 90) * pen_radius;
2609         p_a_end_perp := (p_a_end_dir rotated 90) * pen_radius;
2610
2611         path_d := (z3 - p_a_start_perp){p_a_start_dir}
2612                   .. z4 {down}
2613                   ..(z1 - p_a_end_perp){p_a_end_dir};
2614
2615         save path_b, path_c;
2616         path path_b, path_c;
2617
2618         path_b := z5 {left} .. z6{up};
2619         path_c := z7 {left} .. z6{down};
2620
2621         z9 = path_d intersectionpoint path_b;
2622         z10 = path_d intersectionpoint path_c;
2623
2624         labels (range 1 thru 4);
2625
2626         save p_up_in, p_up_out, p_down_in, p_down_out;
2627         path p_up_in, p_up_out, p_down_in, p_down_out;
2628
2629         p_down_in := z6{up}
2630                      ... {right} z10 {p_a_start_dir}
2631                      .. z8{down}
2632                      .. {p_a_end_dir} z9 {left}
2633                      ... cycle;
2634
2635         p_down_out := lft z2{up}
2636                       .. top z3{right}
2637                       .. rt z3
2638                       .. (z3 + p_a_start_perp){p_a_start_dir}
2639                       .. rt z4{down}
2640                       .. (z1 + p_a_end_perp) {p_a_end_dir}
2641                       .. rt z1
2642                       .. bot z1 {left}
2643                       .. cycle;
2644
2645         p_up_in := p_down_in rotated 180 shifted (w,0);
2646         p_up_out := p_down_out rotated 180 shifted (w,0);
2647 enddef;
2648
2649
2650 save walker_re_weight;
2651 walker_re_weight := 1.2;
2652
2653 fet_beginchar ("Whole Walker rehead", "s0reWalker");
2654         draw_Walker_re_head (funk_notehead_width, walker_re_weight);
2655         fill p_down_out;
2656         unfill p_down_in;
2657 fet_endchar;
2658
2659
2660 fet_beginchar ("Half up Walker rehead", "u1reWalker");
2661         draw_Walker_re_head (funk_notehead_width, walker_re_weight);
2662         fill p_up_out;
2663         unfill p_up_in;
2664 fet_endchar;
2665
2666
2667 fet_beginchar ("Half down Walker rehead", "d1reWalker");
2668         draw_Walker_re_head (funk_notehead_width, walker_re_weight);
2669         fill p_down_out;
2670         unfill p_down_in;
2671 fet_endchar;
2672
2673
2674 fet_beginchar ("Quarter up Walker rehead", "u2reWalker");
2675         draw_Walker_re_head (funk_notehead_width, walker_re_weight);
2676         fill p_up_out;
2677 fet_endchar;
2678
2679
2680 fet_beginchar ("Quarter down Walker rehead", "d2reWalker");
2681         draw_Walker_re_head (funk_notehead_width, walker_re_weight);
2682         fill p_down_out;
2683 fet_endchar;
2684
2685
2686 %%%%%%  Walker mi head
2687 %       Diamond shape
2688 %       Symmetric for all hollow notes
2689 %
2690 save walker_mi_width, walker_mi_weight;
2691 walker_mi_width := 1.2;
2692 walker_mi_weight := 1.5;
2693
2694 fet_beginchar ("Whole Walker mihead", "s0miWalker");
2695         draw_mi_head (walker_mi_width * funk_notehead_width,
2696                       walker_mi_weight, true);
2697         fill path_out;
2698         unfill path_in;
2699 fet_endchar;
2700
2701
2702 fet_beginchar ("Half Walker mihead", "s1miWalker");
2703         draw_mi_head (walker_mi_width * funk_notehead_width,
2704                       walker_mi_weight, true);
2705         fill path_out;
2706         unfill path_in;
2707 fet_endchar;
2708
2709
2710 fet_beginchar ("Quarter Walker mihead", "s2miWalker");
2711         draw_mi_head (walker_mi_width * funk_notehead_width,
2712                       walker_mi_weight, true);
2713         fill path_out;
2714 fet_endchar;
2715
2716
2717 %%%%%%  Walker fa
2718 %       Triangle shape
2719 %       Does not rotate for whole notes
2720 %       Whole rotation is different from Funk, so special notes
2721
2722 %%%%%%  Funk sol head is the same as the others
2723 %       Need special character because of skinnier head
2724 %
2725 save walker_fa_weight;
2726 walker_fa_weight := 1.5;
2727
2728 fet_beginchar ("Whole Walker fahead", "s0faWalker");
2729         draw_fa_head (funk_notehead_width, walker_fa_weight);
2730         fill p_down_out;
2731         unfill p_down_in;
2732 fet_endchar;
2733
2734
2735 fet_beginchar ("Half up Walker fahead", "u1faWalker");
2736         draw_fa_head (funk_notehead_width, walker_fa_weight);
2737         fill p_up_out;
2738         unfill p_up_in;
2739 fet_endchar;
2740
2741
2742 fet_beginchar ("Half down Walker fahead", "d1faWalker");
2743         draw_fa_head (funk_notehead_width, walker_fa_weight);
2744         fill p_down_out;
2745         unfill p_down_in;
2746 fet_endchar;
2747
2748
2749 fet_beginchar ("Quarter up Walker fahead", "u2faWalker");
2750         draw_fa_head (funk_notehead_width, walker_fa_weight);
2751         fill p_up_out;
2752 fet_endchar;
2753
2754
2755 fet_beginchar ("Quarter down Walker fahead", "d2faWalker");
2756         draw_fa_head (funk_notehead_width, walker_fa_weight);
2757         fill p_down_out;
2758 fet_endchar;
2759
2760
2761 %%%%%%  Walker sol
2762 %       Same as Funk, no special notes
2763 %
2764
2765 %%%%%%  Walker la head
2766 %       Rectcangle head
2767 %       Lighter weight requires separate notes
2768 %
2769 save walker_la_weight;
2770 walker_la_weight := 1.5;
2771
2772 fet_beginchar ("Whole Walker lahead", "s0laWalker");
2773         draw_la_head (funk_notehead_width, walker_la_weight);
2774         fill p_out;
2775         unfill p_in;
2776 fet_endchar;
2777
2778
2779 fet_beginchar ("Half Funk lahead", "s1laWalker");
2780         draw_la_head (funk_notehead_width, walker_la_weight);
2781         fill p_out;
2782         unfill p_in;
2783 fet_endchar;
2784
2785
2786 fet_beginchar ("Quarter Funk lahead", "s2laWalker");
2787         draw_la_head (funk_notehead_width, walker_la_weight);
2788         fill p_out;
2789 fet_endchar;
2790
2791
2792 %%%%%%  Walker ti head
2793 %       Triangular arrowhead
2794 %       Rotates for all but whole notes
2795 %
2796 def draw_Walker_ti_head (expr width_factor, thickness_factor) =
2797         set_char_box (0, width_factor * solfa_base_notewidth#,
2798                       0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
2799
2800         save offset;
2801         offset := 2 * thickness_factor - 1;
2802
2803         save pen_radius;
2804         pen_radius := min (solfa_pen_radius,
2805                            .3 * (h + d) / (1 + offset));
2806
2807         pickup pencircle scaled (2 * pen_radius);
2808
2809         lft x1 = 0;
2810         y1 = .5 [y2, y3];
2811
2812         rt x2 = w;
2813         top y2 = h;
2814
2815         x3 = x2;
2816         bot y3 = -d;
2817
2818
2819         labels (range 1 thru 4);
2820
2821         save nw_dist, sw_dist, ne, se;
2822         pair nw_dist, sw_dist, ne, se;
2823
2824         ne = unitvector (z2 - z1);
2825         se = unitvector (z3 - z1);
2826
2827         nw_dist = (ne rotated 90) * pen_radius ;
2828         sw_dist = (se rotated -90) * pen_radius;
2829
2830
2831         save path_a, path_b, path_c;
2832         path path_a, path_b, path_c;
2833         path_a := z2 - nw_dist * offset
2834                   -- z1 - nw_dist * offset;
2835         path_b := z3 - sw_dist * offset
2836                   -- z1 - sw_dist * offset;
2837         path_c := z2 + left * pen_radius
2838                   -- z3 + left * pen_radius;
2839
2840         z4 = path_a intersectionpoint path_b;
2841         z5 = path_a intersectionpoint path_c;
2842         z6 = path_b intersectionpoint path_c;
2843
2844         save p_up_in, p_down_in, p_up_out, p_down_out;
2845         path p_up_in, p_down_in, p_up_out, p_down_out;
2846
2847         p_down_in := z4
2848                      -- z5
2849                      -- z6
2850                      -- cycle;
2851
2852         p_down_out := lft z1{up}
2853                       .. (z1 + nw_dist){ne}
2854                       -- (z2 + nw_dist){ne}
2855                       .. top z2{right}
2856                       .. rt z2 {down}
2857                       -- rt z3 {down}
2858                       .. bot z3 {left}
2859                       .. (z3 + sw_dist){- se}
2860                       .. (z1 + sw_dist){- se}
2861                       .. cycle;
2862
2863         p_up_in := p_down_in rotated 180 shifted (w, 0);
2864         p_up_out := p_down_out rotated 180 shifted (w, 0);
2865 enddef;
2866
2867
2868 save walker_ti_weight;
2869 walker_ti_weight := 1.4;
2870
2871 fet_beginchar ("Whole Walker tihead", "s0tiWalker");
2872         draw_Walker_ti_head (funk_notehead_width, walker_ti_weight);
2873         fill p_down_out;
2874         unfill p_down_in;
2875 fet_endchar;
2876
2877
2878 fet_beginchar ("Half up Walker tihead", "u1tiWalker");
2879         draw_Walker_ti_head (funk_notehead_width, walker_ti_weight);
2880         fill p_up_out;
2881         unfill p_up_in;
2882 fet_endchar;
2883
2884
2885 fet_beginchar ("Half down Walker tihead", "d1tiWalker");
2886         draw_Walker_ti_head (funk_notehead_width, walker_ti_weight);
2887         fill p_down_out;
2888         unfill p_down_in;
2889 fet_endchar;
2890
2891
2892 fet_beginchar ("Quarter up Walker tihead", "u2tiWalker");
2893         draw_Walker_ti_head (funk_notehead_width, walker_ti_weight);
2894         fill p_up_out;
2895 fet_endchar;
2896
2897
2898 fet_beginchar ("Quarter down Walker tihead", "d2tiWalker");
2899         draw_Walker_ti_head (funk_notehead_width, walker_ti_weight);
2900         fill p_down_out;
2901 fet_endchar;
2902
2903 fet_endgroup ("noteheads");
2904
2905
2906 %
2907 % we derive black_notehead_width# from the quarter head,
2908 % so we have to define black_notehead_width (pixel qty)
2909 % after the black_notehead_width# itself.
2910 %
2911 % Let's keep it outside the group as well.
2912 %
2913
2914 define_pixels (black_notehead_width);