]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-bolletjes.mf
(triangle): add s to 0triangle.
[lilypond.git] / mf / feta-bolletjes.mf
1 %  -*-Fundamental-*-
2 % feta-bolletjes.mf --  implement noteheads
3
4 % source file of LilyPond's pretty-but-neat music font
5
6 % (c) 1997--2004 Jan Nieuwenhuizen <janneke@gnu.org>
7 % & Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 % & Juergen Reuter <reuter@ipd.uka.de>
9
10
11 test_outlines := 0;
12
13
14 % most beautiful noteheads are pronounced, not circular, 
15 % and not even symmetric.
16 % These examples are inspired by [Wanske], see literature list
17
18
19
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21 % NOTE HEAD VARIABLES
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 save black_notehead_width, noteheight,
24         slash_thick, slash_slope, overdone_heads;
25 numeric black_notehead_width, noteheight, slash_thick;
26
27
28 fet_begingroup("noteheads");
29
30
31
32 % slope of slash. From scm/grob-description.scm. How to auto-copy?
33 slash_slope := 1.7; 
34
35 % thickness of slash lines. quarter notes get 1.5slt width.
36 slash_thick# := 2/3*0.48staff_space#;
37
38
39 %
40 % Hand-engraved music often has balls extending above and below
41 % the lines.  If you like that, modify overdone heads (unit:
42 % stafflinethickness)
43 %
44 overdone_heads = 0.0;
45 noteheight#:=staff_space#+ (1 + overdone_heads) *stafflinethickness#;
46
47 define_pixels(slash_thick, noteheight);
48
49
50 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 %
52 % SLANT moves both extremes on the long axis (by SLANT * ELLIPTICITY,
53 % so SLANT = -1, puts the extreme on the long axis next to the short axis one.)
54 %
55
56 def draw_outside_ellipse (expr ellipticity, tilt, superness,
57                           slant) =
58         save attachment_y;
59         save p;
60         path p;
61
62         p := superellipse ((ellipticity, 0), (-slant * ellipticity, 1.0),
63                         (- ellipticity, 0), (slant * ellipticity, -1.0), superness);
64
65         p := p rotated tilt;
66
67         save top_point, right_point;
68         pair top_point, right_point;
69
70         top_point := directionpoint left of p;
71         right_point := directionpoint up of p;
72
73         save scaling, width, height;
74
75         scaling# = noteheight# /(2 ypart (top_point));
76         width# := 2 xpart (right_point) * scaling#;
77
78         define_pixels (width, scaling);
79         
80         set_char_box (0, width#, noteheight#/2, noteheight#/2);
81
82         % attachment Y
83         charwy := ypart (right_point) * scaling#;
84         charwx := width# ;
85
86         p := p scaled scaling shifted (width/2, 0) ;
87         if test_outlines = 1:
88                 pickup pencircle scaled 1 ; draw p;
89         else:
90                 fill p;
91         fi;
92 enddef;
93
94
95 def undraw_inside_ellipse (expr ellipticity, tilt, superness, clearance,
96                         center) =
97 begingroup
98         save p;
99         path p;
100
101         p := superellipse ((ellipticity, 0), (0, 1.0),
102                         (- ellipticity, 0), (0, -1.0), superness);
103
104         p := p rotated tilt;
105
106         save top_point, right_point;
107         pair top_point, right_point;
108
109         top_point := directionpoint left of p;
110         right_point := directionpoint up of p;
111
112         save height, scaling;
113
114         height# = staff_space# + stafflinethickness# - clearance;
115         scaling# = height# /(2 ypart (top_point));
116
117         define_pixels (scaling);
118         p := (p scaled scaling) shifted center;
119
120         if test_outlines = 1:
121                 pickup pencircle scaled 1; draw p;
122         else:
123                 unfill p;
124         fi
125 endgroup;
126 enddef;
127
128
129
130
131
132 %
133 % dimensions aren't entirely right.
134 %
135 fet_beginchar ("Brevis notehead", "s-1");
136         save stemthick, fudge;
137         define_pixels (stemthick);
138         fudge = blot_diameter / 2;
139         stemthick# = 2 stafflinethickness#;
140
141         draw_outside_ellipse (1.80, 0, 0.707, 0);
142         undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#,
143                                 (w /2, 0));
144
145         pickup pencircle scaled stemthick;
146
147         bot y1 = -d;
148         top y2 = h;
149         rt x1 - fudge = 0;
150         x1 = x2;
151
152         fudge + lft x3 = w;
153         x4 = x3;
154         y4 = y2;
155         y3 = y1;
156
157         draw_gridline(z1,z2,stemthick);
158         draw_gridline(z3,z4,stemthick);
159
160 fet_endchar;
161
162
163
164 fet_beginchar("Whole notehead", "s0")
165         draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0, 0.707, 0);
166         undraw_inside_ellipse (1.30, 125 - puff_up_factor *10,
167                         0.68, 2 stafflinethickness#,
168                         (w /2, 0));
169
170 %       draw_staff_outline (-2, 2, 0.5);
171
172 fet_endchar;
173
174
175 fet_beginchar("Half notehead", "s1")
176         draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17);
177         undraw_inside_ellipse (3.25, 33, 0.81,
178                 2.5 stafflinethickness#, (w/2, 0));
179
180 fet_endchar;
181         
182 fet_beginchar("Quart notehead", "s2")
183
184         % used to have 32. With 31, they are slightly bolder.
185         draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31, 0.707, 0);
186         black_notehead_width# := charwd;
187 fet_endchar;
188
189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190
191
192 fet_beginchar("Whole diamondhead", "s0diamond")
193         draw_outside_ellipse (1.80, 0, 0.495, 0);
194         undraw_inside_ellipse (1.30, 125, 0.6,
195                         .4 staff_space# +  stafflinethickness#,
196                                 (w /2, 0));
197
198 fet_endchar;
199
200 fet_beginchar("Half diamondhead", "s1diamond")
201
202         draw_outside_ellipse (1.50, 34, 0.49, 0.17);
203         undraw_inside_ellipse (3.5, 33, 0.80,
204                 .3 staff_space# + 1.5 stafflinethickness#, (w/2, 0));
205
206 fet_endchar;
207
208 fet_beginchar("Quart diamondhead", "s2diamond")
209         draw_outside_ellipse (1.80, 35, 0.495, -0.25);
210 fet_endchar;
211
212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213
214
215
216
217
218 def define_triangle_shape(expr stemdir) =
219         save triangle,kern; path triangle;
220         save width, depth, height;
221         save left_point, height, width, origin;
222         save left_up_dir, exact_right_point, exact_down_point;
223         pair exact_down_point, exact_left_point, origin, left_up_dir, exact_right_point;
224         save pen_thick;
225
226         pen_thick# = stafflinethickness#  + .1 staff_space#;
227         define_pixels(pen_thick, llap);
228
229         left_up_dir = llap# * dir (90 + tilt);
230
231         xpart (left_up_dir) * xs - (pen_thick# * xs)/2 + xpart origin = 0;
232         ypart origin = 0;
233
234         exact_left_point := origin + (left_up_dir xscaled xs);
235         exact_down_point := origin + (left_up_dir rotated 120 xscaled xs);
236         exact_right_point := origin + (left_up_dir rotated 240 xscaled xs);
237
238         height# = ypart (exact_left_point + origin) + pen_thick#/2;
239         depth# = -ypart (exact_down_point + origin) + pen_thick#/2;
240         width# = xpart (exact_right_point - exact_left_point) + pen_thick# * xs;
241
242         set_char_box(0, width#, depth#, height#);
243         
244         z0 = (hround_pixels (xpart origin), 0);
245         z1 = z0 + llap * dir(90+tilt) xscaled xs;  
246         z2 = z0 + (llap * dir(90+tilt + 120) xscaled xs);
247         z3 = z0 + (llap * dir(90+tilt + 240) xscaled xs);
248
249         z12 = caveness[.5[z1,z2],z3];
250         z23 = caveness[.5[z2,z3],z1];
251         z31 = caveness[.5[z3,z1],z2];
252
253         triangle = z1 .. z12 .. z2 ..
254                     z2 .. z23 .. z3 ..
255                     z3 .. z31 .. z1 ..
256                     cycle;
257         pickup pencircle scaled pen_thick xscaled xs;
258         labels(1,2,12,23,31,3);
259
260
261         % attachment Y
262         if stemdir = 1:
263                 charwy := ypart exact_right_point;
264                 charwx := xpart exact_right_point;
265         else:
266                 charwy := - ypart exact_down_point;
267                 charwx := (width# - xpart exact_down_point);
268         fi
269 enddef;
270
271 fet_beginchar("Whole trianglehead", "s0triangle")
272         save hei,xs;
273         save llap;
274         save tilt;
275
276         tilt = 40;
277         llap# = 3/4noteheight#;
278
279         xs = 1.5;
280         caveness:=0.1;
281         define_triangle_shape(1);
282         draw triangle;
283 fet_endchar;
284
285
286 def draw_closed_triangle_head(expr dir) =
287         save hei,xs;
288         save llap;
289         save tilt;
290
291         tilt = 40;
292         llap# = 2/3noteheight#;
293         xs = 1.2;
294         caveness:=0.1;
295         define_triangle_shape(dir);
296         draw triangle;
297 enddef;
298
299 fet_beginchar("Half trianglehead", "d1triangle")
300         draw_closed_triangle_head(-1);
301 fet_endchar;
302
303 fet_beginchar("Half trianglehead", "u1triangle")
304         draw_closed_triangle_head(1);
305 fet_endchar;
306
307 def draw_closed_triangle_head(expr dir) = 
308         save hei,xs;
309         save llap;
310         save tilt;
311         tilt = 40;
312         llap# = 2/3noteheight#;
313         xs = 1.0;
314         caveness:=0.1;
315         define_triangle_shape(dir);
316         filldraw triangle;
317 enddef;
318
319 fet_beginchar("Quart trianglehead", "u2triangle")
320         draw_closed_triangle_head(1);
321 fet_endchar;
322
323 fet_beginchar("Quart trianglehead", "d2triangle")
324         draw_closed_triangle_head(-1);
325 fet_endchar;
326
327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328 %
329 % slash heads are for indicating improvisation. They are  
330 % twice as high as normal heads.
331 %
332 def draw_slash(expr hwid_hash) =
333         save exact_height;
334         save ne_dir;
335         pair ne_dir;
336         exact_height =  staff_space# + stafflinethickness#/2;
337
338         set_char_box (0, 2 exact_height / slash_slope + hwid_hash,
339                         exact_height, exact_height);
340
341         charwx := charwd;
342         charwy := charht;
343
344         clearxy;
345         pickup pencircle scaled blot_diameter;
346
347         bot y1 = - d;
348         top y2 = h;
349         lft x1 = 0;
350         lft x2 = 2 h / slash_slope;
351         
352         rt x3 = w;
353         y3 = y2;
354         y4 = y1;
355         x3- x2 = x4 - x1;
356
357         ne_dir := unitvector( z3  - z4);
358         filldraw z1 --- z2 --- z3 --- z4 --- cycle;
359
360         if hwid_hash > 2 slash_thick#:
361                 save th;
362
363                 th = slash_thick - blot_diameter;
364                 y6 = y7;
365                 y5 = y8;
366                 y3 - y7 = th;
367                 y5 - y1 = th;
368                 z6 - z5 = whatever * ne_dir;
369                 z8 - z7 = whatever * ne_dir;
370
371                 z5  = z1 + whatever * ne_dir + th * (ne_dir rotated -90);
372                 z8  = z4 + whatever * ne_dir + th * (ne_dir rotated 90);
373
374                 unfill
375                         z5 -- z6 -- z7 -- z8 -- cycle;
376         fi
377         labels (range 1 thru 10);
378 enddef;
379
380 fet_beginchar("Whole slashhead","s0slash")
381         draw_slash(4 slash_thick# + 0.5 staff_space#);
382 fet_endchar;
383
384 fet_beginchar("Half slashhead","s1slash")
385         draw_slash(3.0 slash_thick# + 0.15 staff_space#);
386 fet_endchar;
387
388 fet_beginchar("Quart slashhead","s2slash")
389         draw_slash(1.5 slash_thick#);
390 fet_endchar;
391
392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
393 % thick is the distance between the NE/SW parallel lines in the cross
394 % (distance between centres of lines)
395 % in stafflinethickness def
396 %
397 def draw_cross(expr thick) =
398         save pent, slant, ne_dir;
399         pair ne_dir;
400         save crz; path crz;
401
402         pen_thick# := 1.2 stafflinethickness#;
403         define_pixels (pen_thick);
404         pickup pencircle scaled pen_thick;
405
406         top y3 = h;
407         ne_dir := unitvector ((1, (2 h -pen_thick)/(w - pen_thick)));
408         rt x4 = w/2;
409         y5 = 0;
410         z4 - z5 = whatever * ne_dir;
411         x6 = 0;
412         z6 - z3 = whatever * ne_dir;
413         z3 - z4 = whatever * (ne_dir yscaled -1);
414
415         z4 - z3 = whatever * (ne_dir) + (ne_dir rotated -90) * thick * stafflinethickness;
416
417         x1 = charwd/2 - .5 pen_thick#;
418         z1 = whatever * ne_dir + thick/2 * stafflinethickness# * (ne_dir rotated -90);
419
420         
421         labels (1,2,3,4,5,6);
422
423         crz = (z6 -- z3 -- z4 -- z5) ;
424
425         draw crz shifted(w/2,0);
426         draw crz xscaled -1 shifted(w/2,0);
427         draw crz yscaled -1 shifted(w/2,0);
428         draw crz scaled -1 shifted(w/2,0);
429
430         charwx := charwd;
431         charwy := y1;
432         z12 = (charwx * hppp, y1 * vppp);
433         labels (12);
434 enddef;
435
436 fet_beginchar("Whole Crossed notehead", "s0cross")
437         wid# := black_notehead_width#+4stafflinethickness#;
438         hei# := noteheight#+stafflinethickness#;
439         set_char_box(0, wid#,hei#/2,hei#/2);
440         
441         draw_cross (3.75);
442 fet_endchar;
443
444 fet_beginchar("Half Crossed notehead", "s1cross")
445         wid# := black_notehead_width#+2 stafflinethickness#;
446         hei# := noteheight#+stafflinethickness#/2;
447         set_char_box(0, wid#,hei#/2,hei#/2);
448         draw_cross(3.0);
449 fet_endchar;
450
451 fet_beginchar("Crossed notehead", "s2cross")
452         wid# := black_notehead_width#;
453         hei# := noteheight#;
454         set_char_box(0, wid#,hei#/2,hei#/2);
455         draw_cross(1.0);
456 fet_endchar;
457
458 fet_beginchar("X-Circled notehead", "s2xcircle")
459         wid# := black_notehead_width#*sqrt(sqrt2);
460         hei# := noteheight#*sqrt(sqrt2);
461         set_char_box(0, wid#,hei#/2,hei#/2);
462         cthick := (1.2+1/4)*stafflinethickness;
463         cxr := w/2-cthick/2;
464         cyr := h-cthick/2;
465         pickup pencircle scaled cthick;
466         draw fullcircle xscaled 2cxr yscaled 2cyr shifted (w/2,0);
467         xpos := cxr/sqrt2;
468         ypos := cyr/sqrt2;
469         draw (-xpos+w/2,-ypos) -- (xpos+w/2,ypos);
470         draw (-xpos+w/2,ypos) -- (xpos+w/2,-ypos);
471
472         charwx := charwd ; 
473         charwy := 0 ;
474
475         z12 = (charwx * hppp , charwy * vppp );
476         labels (12);
477 fet_endchar;
478
479
480
481
482 %%%%%%%%
483 %
484 %
485 % SOLFA SHAPED NOTES
486 %
487 %
488
489
490 def generic_draw_solfa_note_shape =
491   save a,beta,black,white;
492   path black, white;
493
494   pickup pencircle scaled stafflinethickness;
495   2 beta# = noteheight#;
496   a# = a_b*beta#;
497   wid# := 2a#+stafflinethickness#;
498   hei# := noteheight#+stafflinethickness#;
499   set_char_box(0, wid#,0.5 hei#, 0.5 hei#);
500
501   define_pixels(a,beta);
502
503   black = noteshape xscaled a yscaled beta shifted (a+stafflinethickness/2,0);
504   filldraw black;
505
506   if (solid=false):
507     white = noteishape xscaled (a*ai_a) yscaled (beta*bi_b)
508                        shifted ((dx+1)*(a+stafflinethickness/2),
509                                 dy*(beta+stafflinethickness/2));
510     unfill white;
511   fi;
512 enddef;  
513
514 def draw_solfa_note_shape =
515   save solid; boolean solid;
516   solid=false;
517   generic_draw_solfa_note_shape;
518 enddef;
519 def draw_solfa_quarter_note_shape =
520   save solid; boolean solid;
521   solid=true;
522   generic_draw_solfa_note_shape;
523 enddef;
524
525 % do - equilateral triangle: (0,-h/2) -- (w/2,h/2) -- (w,-h/2) -- cycle;
526 % stem attachment: -h/2
527
528 save triangle; path triangle;
529 triangle := (-1,-1) -- (0,1) -- (1,-1) -- cycle;
530
531
532
533
534 save solfa_pen_thick;
535 solfa_pen_thick# = 2 stafflinethickness#;
536 define_pixels (solfa_pen_thick);
537
538 def draw_do_head (expr width_factor, dir) =
539         save p ;
540         path p;
541         set_char_box(0, width_factor * noteheight#, 0.5 noteheight#, 0.5 noteheight#);
542         
543         pickup pencircle scaled solfa_pen_thick;
544
545         bot y1 =  -d ;
546         y1 = y2;
547         lft x1 = 0;
548         rt x2 = w;
549         top y3 = h;
550         x3 =.5[x1,x2];
551
552         p := z1 -- z2 -- z3 -- cycle;
553
554         charwx := charwd;
555         charwy := - chardp + 0.5 stafflinethickness#;
556         if dir = -1:
557                 charwy := - charwy;
558         fi;
559 enddef;
560
561 fet_beginchar("Whole dohead", "s0do")
562         draw_do_head (1.8, 1);
563         draw p;
564 fet_endchar;
565
566
567 fet_beginchar("Half dohead", "d1do")
568         draw_do_head (1.5, -1);
569         draw p;
570 fet_endchar;
571
572 fet_beginchar("Half dohead", "s1do")
573         draw_do_head (1.5, 1);
574         draw p;
575 fet_endchar;
576
577 fet_beginchar("Quart dohead", "d2do")
578         draw_do_head (1.55, -1);
579         filldraw p;
580 fet_endchar;
581
582
583 fet_beginchar("Quart dohead", "s2do")
584         draw_do_head (1.55, 1);
585         filldraw p;
586 fet_endchar;
587
588   
589 % re - flat top, curved bottom:
590 %                (0,h/2) {dir -90} .. (w/2,-h/2) .. {dir 90} (w,h/2) -- cycle;
591 % (broader along the base and with more vertical sides for half and
592 % whole notes)
593 % stem attachment: h/2
594
595
596
597 def draw_re_head (expr width_factor, dir) =
598         save p ;
599         path p;
600         set_char_box(0, width_factor * noteheight#, 0.5 noteheight#, 0.5 noteheight#);
601         
602         pickup pencircle scaled solfa_pen_thick;
603
604         save curve_start;
605         curve_start = 0.7;
606         lft x1 = 0;
607         y1 = y5;
608         x1 = x2;
609         y2 = curve_start [y3,y1];
610         bot y3 = - d;
611         x3 = .5 [x2,x4];
612         rt x4 = w;
613         y4 = y2;
614         top y5 = h;
615         x5 = x4;
616         labels (range 1 thru 5);
617         p := z1 --- z2 .. z3{right} .. z4 --- z5 --- cycle;
618
619         charwx := charwd;
620         charwy := curve_start [-chardp, charht];
621         if dir = -1:
622                 charwy := - charwy;
623         fi;
624 enddef;
625
626 fet_beginchar("Whole rehead", "s0re")
627         draw_re_head (1.8,1);
628         draw p;
629 fet_endchar;
630
631
632 fet_beginchar("Half up rehead", "u1re")
633         draw_re_head (1.5, 1);
634         draw p;
635 fet_endchar;
636
637 fet_beginchar("Half down rehead", "d1re")
638         draw_re_head (1.5, -1);
639         draw p;
640 fet_endchar;
641
642
643 fet_beginchar("Quart rehead", "u2re")
644         draw_re_head (1.55, 1);
645         filldraw p;
646 fet_endchar;
647
648 fet_beginchar("Quart rehead", "d2re")
649         draw_re_head (1.55, -1);
650         filldraw p;
651 fet_endchar;
652
653
654
655
656 def draw_mi_head (expr width_factor) =
657         save path_out, path_in;
658         path path_out, path_in;
659         set_char_box(0, width_factor * noteheight#, 0.5 noteheight#, 0.5 noteheight#);
660         
661         pickup pencircle scaled solfa_pen_thick;
662
663
664         lft x1 = 0;
665         y1 = 0;
666         bot y2 = -d;
667         x2 = .5 [x1, x3];
668         rt x3 = w;
669         x4 = x2;
670         y3 = y1;
671         top y4 = h;
672
673         z6 - z5 = whatever * (z2 - z1);
674         z8 - z7 = whatever * (z2 - z1);
675         z8 - z5 = whatever * (z4 - z1);
676         z6 - z7 = whatever * (z4 - z1);
677
678         z5 = whatever [z1, z4] + (unitvector (z4 - z1) rotated -90 scaled 0.5 solfa_pen_thick);
679         z5 = whatever [z1, z2] + (unitvector (z2 - z1) rotated 90 scaled 0.75 solfa_pen_thick);
680
681         z5 - z1 = -(z7 - z3);
682         
683         labels (range 1 thru 8);
684         path_out := z1 -- z2 -- z3 -- z4 -- cycle;
685         path_in := z5 -- z6 -- z7 -- z8 -- cycle;
686 %       path_in := z5 -- z1 --cycle;
687 enddef;
688
689 fet_beginchar("Whole mihead", "s0mi")
690         draw_mi_head (1.8);
691         filldraw path_out;
692         unfill path_in;
693 fet_endchar;
694
695
696 fet_beginchar("Half mihead", "s1mi")
697         draw_mi_head (1.6);
698         filldraw path_out;
699         unfill path_in;
700 fet_endchar;
701
702
703 fet_beginchar("Quart mihead", "s2mi")
704         draw_mi_head (1.65);
705         filldraw path_out;
706 fet_endchar;
707
708
709
710
711 def draw_fa_head (expr width_factor) =
712         set_char_box(0, width_factor * noteheight#, 0.5 noteheight#, 0.5 noteheight#);
713         save p_down, p_up;
714         path p_up, p_down;
715         
716         pickup pencircle scaled solfa_pen_thick;
717
718         lft x1 = 0;
719         top y1 = h;
720
721         rt x2 = w;
722         y2 = y1;
723         bot y3 = -d;
724         x3 = x2;
725
726         y4 = y3;
727         x4 = x1;
728
729         labels(range 1 thru 4);
730
731         p_up := z1 -- z2 -- z3 --cycle;
732         p_down := z1 -- z4 -- z3 --cycle;
733
734         charwy := 0.0;
735         charwx := charwd;
736 enddef;
737
738
739 fet_beginchar("Whole fa up head", "d0fa")
740         draw_fa_head (1.8);
741         draw p_up;
742 fet_endchar;
743
744 fet_beginchar("Whole fa down head", "u0fa")
745         draw_fa_head (1.8);
746         draw p_down;
747 fet_endchar;
748
749 fet_beginchar("half fa up head", "d1fa")
750         draw_fa_head (1.5);
751         draw p_up;
752 fet_endchar;
753
754 fet_beginchar("Half fa down head", "u1fa")
755         draw_fa_head (1.5);
756         draw p_down;
757 fet_endchar;
758
759 fet_beginchar("Quarter fa up head", "u2fa")
760         draw_fa_head (1.55);
761         filldraw p_up;
762 fet_endchar;
763
764 fet_beginchar("Quarter fa down head", "d2fa")
765         draw_fa_head (1.55);
766         filldraw p_down;
767 fet_endchar;
768
769
770 def draw_la_head (expr width_factor) =
771         set_char_box(0, width_factor * noteheight#, 0.5 noteheight#, 0.5 noteheight#);
772         save p;
773         path p;
774         
775         pickup pencircle scaled solfa_pen_thick;
776
777         lft x1 = 0;
778         top y1 = h;
779
780         rt x2 = w;
781         y2 = y1;
782         bot y3 = -d;
783         x3 = x2;
784
785         y4 = y3;
786         x4 = x1;
787
788         labels(range 1 thru 4);
789
790         p := z1 -- z2 -- z3 -- z4 -- cycle;
791 enddef;
792
793 fet_beginchar("Whole lahead", "s0la")
794         draw_la_head (1.8);
795         draw p;
796 fet_endchar;
797
798
799 fet_beginchar("Half lahead", "s1la")
800         draw_la_head (1.5);
801         draw p;
802 fet_endchar;
803
804
805 fet_beginchar("Quart lahead", "s2la")
806         draw_la_head (1.55);
807         filldraw p;
808 fet_endchar;
809
810
811
812 def draw_ti_head (expr width_factor, dir) =
813         set_char_box(0, width_factor * noteheight#, 0.5 noteheight#, 0.5 noteheight#);
814         save p;
815         path p;
816         save cone_height;
817         cone_height = 0.64;
818
819         pickup pencircle scaled solfa_pen_thick;
820
821         x1 = .5 [x2, x4];
822         bot y1 = -d;
823         lft x2 = 0;
824         y2 = cone_height [y1,y3];
825         rt x4 = w;
826         y4 = y2;
827         x3 = x1;
828         top y3 = h;
829         
830         labels(range 1 thru 4);
831
832         p := z1 -- z2  .. z3{right} .. z4 -- cycle;
833         charwx := charwd;
834         charwy := cone_height [-chardp, charht];
835         if dir = - 1:
836                 charwy := - charwy;
837         fi;
838 enddef;
839
840 fet_beginchar("Whole up tihead", "s0ti")
841         draw_ti_head (1.8, 1);
842         draw p;
843 fet_endchar;
844
845
846 fet_beginchar("Half up tihead", "u1ti")
847         draw_ti_head (1.5, 1);
848         draw p;
849 fet_endchar;
850
851 fet_beginchar("Half down tihead", "d1ti")
852         draw_ti_head (1.5, -1);
853         draw p;
854 fet_endchar;
855
856
857
858 fet_beginchar("Quart up tihead", "u2ti")
859         draw_ti_head (1.55, 1);
860         filldraw p;
861 fet_endchar;
862
863
864 fet_beginchar("Quart down tihead", "d2ti")
865         draw_ti_head (1.55, -1);
866         filldraw p;
867 fet_endchar;
868
869
870
871 fet_endgroup("noteheads");
872
873
874 %
875 % we derive black_notehead_width# from the quarter head,
876 % so we have to define black_notehead_width (pixel qty)  
877 % after the black_notehead_width# itself. Let's keep it outside the group as well.
878
879 define_pixels(black_notehead_width);
880
881
882
883