]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-bolletjes.mf
* mf/feta-bolletjes.mf: merge solfa heads into main note heads.
[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 * ELLIPSIDITY,
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 ellipsidity, tilt, superness,
57                         slant) =
58         save attachment_y;
59         save p;
60         path p;
61
62         p := superellipse ((ellipsidity, 0), (-slant * ellipsidity, 1.0),
63                         (- ellipsidity, 0), (slant * ellipsidity, -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 ellipsidity, tilt, superness, clearance,
96                         center) =
97 begingroup
98         save p;
99         path p;
100
101         p := superellipse ((ellipsidity, 0), (0, 1.0),
102                         (- ellipsidity, 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", "-1", "brevishead");
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", "0", "wholehead")
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", "1", "halfhead")
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", "2", "quarthead")
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 %% testing shapes.
192 if 0 = 1 : 
193
194
195 fet_beginchar("Quart noteheadPQ", "2PQ", "quartheadPQ")
196         draw_outside_ellipse (1.0 - puff_up_factor / 2.0, 32, 0.707, 0);
197 fet_endchar;
198
199 fet_beginchar("Quart noteheadAA", "2AA", "quartheadAA")
200         draw_outside_ellipse (1.35 - puff_up_factor / 2.0, 32, 0.707, 0);
201 fet_endchar;
202
203 fet_beginchar("Quart noteheadAB", "2AB", "quartheadAB")
204         draw_outside_ellipse (1.4 - puff_up_factor / 2.0, 32, 0.707, 0);
205         
206 fet_endchar;
207 fet_beginchar("Quart noteheadAC", "2AC", "quartheadAC")
208         draw_outside_ellipse (1.45 - puff_up_factor / 2.0, 32, 0.707, 0);
209 fet_endchar;
210
211 fet_beginchar("Quart noteheadAD", "2AD", "quartheadAD")
212         draw_outside_ellipse (1.5 - puff_up_factor / 2.0, 32, 0.707, 0);
213 fet_endchar;
214
215 fet_beginchar("Quart noteheadAD", "2AE", "quartheadAD")
216         draw_outside_ellipse (1.55 - puff_up_factor / 2.0, 32, 0.707, 0);
217 fet_endchar;
218
219 fet_beginchar("Quart noteheadAD", "2AF", "quartheadAD")
220         draw_outside_ellipse (1.6 - puff_up_factor / 2.0, 32, 0.707, 0);
221 fet_endchar;
222 fet_beginchar("Quart noteheadAD", "2AG", "quartheadAD")
223         draw_outside_ellipse (1.65 - puff_up_factor / 2.0, 32, 0.707, 0);
224 fet_endchar;
225
226
227 fet_beginchar("Quart noteheadBA", "2BA", "quartheadBA")
228         draw_outside_ellipse (1.35 - puff_up_factor / 2.0, 35, 0.707, 0);
229 fet_endchar;
230 fet_beginchar("Quart noteheadBB", "2BB", "quartheadBB")
231         draw_outside_ellipse (1.4 - puff_up_factor / 2.0, 35, 0.707, 0);
232         
233 fet_endchar;
234 fet_beginchar("Quart noteheadBC", "2BC", "quartheadBC")
235         draw_outside_ellipse (1.45 - puff_up_factor / 2.0, 35, 0.707, 0);
236 fet_endchar;
237 fet_beginchar("Quart noteheadBD", "2BD", "quartheadBD")
238         draw_outside_ellipse (1.5 - puff_up_factor / 2.0, 35, 0.707, 0);
239 fet_endchar;
240 fet_beginchar("Quart noteheadBD", "2BE", "quartheadBD")
241         draw_outside_ellipse (1.55 - puff_up_factor / 2.0, 35, 0.707, 0);
242 fet_endchar;
243 fet_beginchar("Quart noteheadBD", "2BF", "quartheadBD")
244         draw_outside_ellipse (1.6 - puff_up_factor / 2.0, 35, 0.707, 0);
245 fet_endchar;
246 fet_beginchar("Quart noteheadBD", "2BG", "quartheadBD")
247         draw_outside_ellipse (1.65 - puff_up_factor / 2.0, 35, 0.707, 0);
248 fet_endchar;
249
250
251
252 fet_beginchar("Quart noteheadCA", "2CA", "quartheadCA")
253         draw_outside_ellipse (1.35 - puff_up_factor / 2.0, 40, 0.707, 0);
254 fet_endchar;
255 fet_beginchar("Quart noteheadCB", "2CB", "quartheadCB")
256         draw_outside_ellipse (1.4 - puff_up_factor / 2.0, 40, 0.707, 0);
257 fet_endchar;
258 fet_beginchar("Quart noteheadCC", "2CC", "quartheadCC")
259         draw_outside_ellipse (1.45 - puff_up_factor / 2.0, 40, 0.707, 0);
260 fet_endchar;
261 fet_beginchar("Quart noteheadCD", "2CD", "quartheadCD")
262         draw_outside_ellipse (1.5 - puff_up_factor / 2.0, 40, 0.707, 0);
263 fet_endchar;
264 fet_beginchar("Quart noteheadCD", "2CE", "quartheadCD")
265         draw_outside_ellipse (1.55 - puff_up_factor / 2.0, 40, 0.707, 0);
266 fet_endchar;
267 fet_beginchar("Quart noteheadCD", "2CF", "quartheadCD")
268         draw_outside_ellipse (1.6 - puff_up_factor / 2.0, 40, 0.707, 0);
269 fet_endchar;
270 fet_beginchar("Quart noteheadCD", "2CG", "quartheadCD")
271         draw_outside_ellipse (1.65 - puff_up_factor / 2.0, 40, 0.707, 0);
272 fet_endchar;
273
274 fi
275
276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
277
278
279 fet_beginchar("Whole diamondhead", "0diamond", "wholediamondhead")
280         draw_outside_ellipse (1.80, 0, 0.495, 0);
281         undraw_inside_ellipse (1.30, 125, 0.6,
282                         .4 staff_space# +  stafflinethickness#,
283                                 (w /2, 0));
284
285 fet_endchar;
286
287 fet_beginchar("Half diamondhead", "1diamond", 
288         "halfdiamondhead")
289
290         draw_outside_ellipse (1.50, 34, 0.49, 0.17);
291         undraw_inside_ellipse (3.5, 33, 0.80,
292                 .3 staff_space# + 1.5 stafflinethickness#, (w/2, 0));
293
294 fet_endchar;
295
296 fet_beginchar("Quart diamondhead", "2diamond", "diamondhead")
297         draw_outside_ellipse (1.80, 35, 0.495, -0.25);
298 fet_endchar;
299
300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
301
302
303
304
305
306 def def_triangle =
307         save triangle,kern; path triangle;
308         save left_point, height, width;
309         pair exact_left_point;
310         save pen_thick;
311         pen_thick# = stafflinethickness#  + .1 staff_space#;
312         define_pixels(pen_thick);
313
314         exact_left_point := llap# * dir (90 + tilt);
315         height# = max (ypart exact_left_point,
316                         -ypart  (exact_left_point rotated 120)) + pen_thick#/2;
317
318         kern# = 1/3 xpart (exact_left_point - (exact_left_point rotated 120));
319         width# = xpart (-exact_left_point + (exact_left_point rotated 240));
320         define_pixels (kern);   
321         z1 = (hround_pixels (xpart exact_left_point), vround_pixels  (ypart exact_left_point));
322         z2 = z1 rotated 120;
323         z3 = z1 rotated 240;
324
325         z12 = caveness[.5[z1,z2],z3];
326         z23 = z12 rotated 120;
327         z31 = z12 rotated 240;
328         triangle = z1 .. z12 .. z2 ..
329                     z2 .. z23 .. z3 ..
330                     z3 .. z31 .. z1 ..
331                     cycle;
332         triangle := triangle shifted (-x1+pen_thick/2-kern,0) xscaled xs;
333         pickup pencircle scaled pen_thick xscaled xs;
334 %       labels(1,2,12,23,31,3);
335         set_char_box(0, width# - kern#+ pen_thick#, height#, height#);
336 enddef;
337
338 fet_beginchar("Whole trianglehead", "0triangle", "wholetrianglehead")
339         save hei,xs;
340         save llap;
341         save tilt;
342
343         tilt = 40;
344         llap# = 3/4noteheight#;
345
346         xs = 1.5;
347         caveness:=0.1;
348         def_triangle;
349         draw triangle;
350 fet_endchar;
351
352 fet_beginchar("Half trianglehead", "1triangle", "halftrianglehead")
353         save hei,xs;
354         save llap;
355         save tilt;
356
357         tilt = 40;
358         llap# = 2/3noteheight#;
359         xs = 1.2;
360         caveness:=0.1;
361         def_triangle;
362         draw triangle;
363 fet_endchar;
364
365 fet_beginchar("Quart trianglehead", "2triangle", "trianglehead")
366         save hei,xs;
367         save llap;
368         save tilt;
369         tilt = 40;
370         llap# = 2/3noteheight#;
371         xs = 1.0;
372         caveness:=0.1;
373         def_triangle;
374         filldraw triangle;
375 fet_endchar;
376
377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
378 %
379 % slash heads are for indicating improvisation. They are  
380 % twice as high as normal heads.
381 %
382 def draw_slash(expr hwid_hash) =
383         save exact_height;
384         save ne_dir;
385         pair ne_dir;
386         exact_height =  staff_space# + stafflinethickness#/2;
387
388         set_char_box (0, 2 exact_height / slash_slope + hwid_hash,
389                         exact_height, exact_height);
390
391         charwx := charwd;
392         charwy := charht;
393
394         clearxy;
395         pickup pencircle scaled blot_diameter;
396
397         bot y1 = - d;
398         top y2 = h;
399         lft x1 = 0;
400         lft x2 = 2 h / slash_slope;
401         
402         rt x3 = w;
403         y3 = y2;
404         y4 = y1;
405         x3- x2 = x4 - x1;
406
407         ne_dir := unitvector( z3  - z4);
408         filldraw z1 --- z2 --- z3 --- z4 --- cycle;
409
410         if hwid_hash > 2 slash_thick#:
411                 save th;
412
413                 th = slash_thick - blot_diameter;
414                 y6 = y7;
415                 y5 = y8;
416                 y3 - y7 = th;
417                 y5 - y1 = th;
418                 z6 - z5 = whatever * ne_dir;
419                 z8 - z7 = whatever * ne_dir;
420
421                 z5  = z1 + whatever * ne_dir + th * (ne_dir rotated -90);
422                 z8  = z4 + whatever * ne_dir + th * (ne_dir rotated 90);
423
424                 unfill
425                         z5 -- z6 -- z7 -- z8 -- cycle;
426         fi
427         labels (range 1 thru 10);
428 enddef;
429
430 fet_beginchar("Whole slashhead","0slash","wholeslashhead")
431         draw_slash(4 slash_thick# + 0.5 staff_space#);
432 fet_endchar;
433
434 fet_beginchar("Half slashhead","1slash","halfslashhead")
435         draw_slash(3.0 slash_thick# + 0.15 staff_space#);
436 fet_endchar;
437
438 fet_beginchar("Quart slashhead","2slash","quartslashhead")
439         draw_slash(1.5 slash_thick#);
440 fet_endchar;
441
442 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
443 % thick is the distance between the NE/SW parallel lines in the cross
444 % (distance between centres of lines)
445 % in stafflinethickness def
446 %
447 def draw_cross(expr thick) =
448         save pent, slant, ne_dir;
449         pair ne_dir;
450         save crz; path crz;
451
452         pen_thick# := 1.2stafflinethickness#;
453         define_pixels (pen_thick);
454         pickup pencircle scaled pen_thick;
455
456         top y3 = h;
457         ne_dir := unitvector ((1, (2 h -pen_thick)/(w - pen_thick)));
458         rt x4 = w/2;
459         y5 = 0;
460         z4 - z5 = whatever * ne_dir;
461         x6 = 0;
462         z6 - z3 = whatever * ne_dir;
463         z3 - z4 = whatever * (ne_dir yscaled -1);
464
465         z4 - z3 = whatever * (ne_dir) + (ne_dir rotated -90) * thick * stafflinethickness;
466
467         x1 = charwd/2 - .5 pen_thick#;
468         z1 = whatever * ne_dir + thick/2 * stafflinethickness# * (ne_dir rotated -90);
469
470         
471         labels (1,2,3,4,5,6);
472
473         crz = (z6 -- z3 -- z4 -- z5) ;
474
475         draw crz shifted(w/2,0);
476         draw crz xscaled -1 shifted(w/2,0);
477         draw crz yscaled -1 shifted(w/2,0);
478         draw crz scaled -1 shifted(w/2,0);
479
480         charwx := charwd;
481         charwy := y1;
482                 message (decimal charwx);
483                 message (decimal charwy);
484         z12 = (charwx * hppp, y1 * vppp);
485         labels (12);
486 enddef;
487
488 fet_beginchar("Whole Crossed notehead", "0cross", "wholecrossedhead")
489         wid# := black_notehead_width#+4stafflinethickness#;
490         hei# := noteheight#+stafflinethickness#;
491         set_char_box(0, wid#,hei#/2,hei#/2);
492         
493         draw_cross (3.75);
494 fet_endchar;
495
496 fet_beginchar("Half Crossed notehead", "1cross", "halfcrossedhead")
497         wid# := black_notehead_width#+2stafflinethickness#;
498         hei# := noteheight#+stafflinethickness#/2;
499         set_char_box(0, wid#,hei#/2,hei#/2);
500         draw_cross(3.0);
501 fet_endchar;
502
503 fet_beginchar("Crossed notehead", "2cross", "crossedhead")
504         wid# := black_notehead_width#;
505         hei# := noteheight#;
506         set_char_box(0, wid#,hei#/2,hei#/2);
507         draw_cross(1.0);
508 fet_endchar;
509
510 fet_beginchar("X-Circled notehead", "2xcircle", "xcircledhead")
511         wid# := black_notehead_width#*sqrt(sqrt2);
512         hei# := noteheight#*sqrt(sqrt2);
513         set_char_box(0, wid#,hei#/2,hei#/2);
514         cthick := (1.2+1/4)*stafflinethickness;
515         cxr := w/2-cthick/2;
516         cyr := h-cthick/2;
517         pickup pencircle scaled cthick;
518         draw fullcircle xscaled 2cxr yscaled 2cyr shifted (w/2,0);
519         xpos := cxr/sqrt2;
520         ypos := cyr/sqrt2;
521         draw (-xpos+w/2,-ypos) -- (xpos+w/2,ypos);
522         draw (-xpos+w/2,ypos) -- (xpos+w/2,-ypos);
523
524         charwx := charwd ; 
525         charwy := 0 ;
526
527         z12 = (charwx * hppp , charwy * vppp );
528         labels (12);
529 fet_endchar;
530
531
532
533
534 %%%%%%%%
535 %
536 %
537 % SOLFA SHAPED NOTES
538 %
539 %
540
541
542 def generic_draw_solfa_note_shape =
543   save a,beta,black,white;
544   path black, white;
545
546   pickup pencircle scaled stafflinethickness;
547   2 beta# = noteheight#;
548   a# = a_b*beta#;
549   wid# := 2a#+stafflinethickness#;
550   hei# := noteheight#+stafflinethickness#;
551   set_char_box(0, wid#,0.5 hei#, 0.5 hei#);
552
553   define_pixels(a,beta);
554
555   black = noteshape xscaled a yscaled beta shifted (a+stafflinethickness/2,0);
556   filldraw black;
557
558   if (solid=false):
559     white = noteishape xscaled (a*ai_a) yscaled (beta*bi_b)
560                        shifted ((dx+1)*(a+stafflinethickness/2),dy*(beta+stafflinethickness/2));
561     unfill white;
562   fi;
563 enddef;  
564
565 def draw_solfa_note_shape =
566   save solid; boolean solid;
567   solid=false;
568   generic_draw_solfa_note_shape;
569 enddef;
570 def draw_solfa_quarter_note_shape =
571   save solid; boolean solid;
572   solid=true;
573   generic_draw_solfa_note_shape;
574 enddef;
575
576 % do - equilateral triangle: (0,-h/2) -- (w/2,h/2) -- (w,-h/2) -- cycle;
577 % stem attachment: -h/2
578
579 save triangle; path triangle;
580 triangle := (-1,-1) -- (0,1) -- (1,-1) -- cycle;
581
582 def drawdoshape =
583   save noteshape, noteishape, dx, dy, ai_a, bi_b;
584   path noteshape, noteishape;
585   noteshape = noteishape = triangle;
586   (dx,dy)=(0,0.05);
587   (ai_a,bi_b)=(i_o,i_o);
588   draw_solfa_note_shape;
589 enddef;
590
591 fet_beginchar("Whole dohead", "0do", "wholedohead")
592   pickup pencircle scaled blot_diameter;
593   save a_b, i_o;
594   a_b = 1.8;
595   i_o = 0.6;
596
597   drawdoshape;
598 fet_endchar;
599   
600 fet_beginchar("Half dohead", "1do", "halfdohead")
601   save a_b, i_o;
602   a_b = 1.5;
603   i_o = 0.6;
604
605   drawdoshape;
606 fet_endchar;
607   
608 fet_beginchar("Quart dohead", "2do", "dohead")
609   save a_b, noteshape;
610   path noteshape;
611   a_b = 1.54;
612   
613   noteshape = triangle;
614   draw_solfa_quarter_note_shape;
615
616 fet_endchar;
617   
618 % re - flat top, curved bottom:
619 %                (0,h/2) {dir -90} .. (w/2,-h/2) .. {dir 90} (w,h/2) -- cycle;
620 % (broader along the base and with more vertical sides for half and
621 % whole notes)
622 % stem attachment: h/2
623
624 save reshape; path reshape;
625 reshape = (-1,1)--(-1,0.2){down} ... (0,-1) ... {up}(1,0.2)--(1,1)--cycle;
626
627 fet_beginchar("Whole rehead", "0re", "wholerehead")
628   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
629   path noteshape, noteishape;
630   noteshape = reshape;
631   noteishape = reshape;
632   a_b = 1.8;
633   bi_b = 0.65;
634   ai_a = 0.8;
635   (dx,dy)=(0,-0.1);
636   draw_solfa_note_shape;
637 fet_endchar;
638
639 fet_beginchar("Half rehead", "1re", "halfrehead")
640   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
641   path noteshape, noteishape;
642   noteshape = reshape;
643   noteishape = reshape;
644   a_b = 1.5;
645   bi_b = 0.65;
646   ai_a = 0.8;
647   (dx,dy)=(0,-0.1);
648   draw_solfa_note_shape;
649 fet_endchar;
650
651 fet_beginchar("Quart rehead", "2ro", "rehead")
652   save a_b, noteshape;
653   path noteshape;
654   a_b = 1.54;
655   
656   noteshape = reshape;
657   draw_solfa_quarter_note_shape;
658 fet_endchar;
659   
660 % me - diamond: (0,0) -- (w/2,h/2) -- (w,0) -- (w/2,-h/2) -- cycle;
661 % similar to existing diamond shaped head, but not quite the same
662 % stem attachment: 0
663
664 save mishape; path mishape;
665 mishape = (-1,0)--(0,1)--(1,0)--(0,-1)--cycle;
666
667 fet_beginchar("Whole mihead", "0mi", "wholemihead")
668   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
669   path noteshape, noteishape;
670   noteshape = mishape;
671   noteishape = (mishape slanted -0.35) rotated -10.5;
672   a_b = 1.8;
673   bi_b = 0.65;
674   ai_a = 0.7;
675   (dx,dy)=(0,0);
676   draw_solfa_note_shape;
677 fet_endchar;
678
679 fet_beginchar("Half mihead", "1mi", "halfmihead")
680   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
681   path noteshape, noteishape;
682   noteshape = mishape;
683   noteishape =  (mishape slanted -0.35) rotated -10.5;
684   a_b = 1.5;
685   bi_b = 0.65;
686   ai_a = 0.7;
687   (dx,dy)=(0,0);
688   draw_solfa_note_shape;
689 fet_endchar;
690
691 fet_beginchar("Quart mihead", "2mi", "mihead")
692   save a_b, noteshape;
693   path noteshape;
694   a_b = 1.54;
695   
696   noteshape = mishape;
697   draw_solfa_quarter_note_shape;
698 fet_endchar;
699
700
701 % fa - scalene triangle:
702 %         for stem up: (0,h/2) -- (w,h/2) -- (w,-h/2) -- cycle;
703 %       for stem down: (w,-h/2) -- (0,1h/2) -- (0,h/2) -- cycle;
704 %       (one is a 180 degree rotation of the other)
705 % stem attachment: (doesn't much matter)
706
707 save fashape; path fashape;
708 fashape = (-1,1)--(1,1)--(1,-1)--cycle;
709
710 fet_beginchar("Whole fahead", "0fa", "wholefahead")
711   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
712   path noteshape, noteishape;
713   noteshape = fashape;
714   noteishape = fashape;
715   a_b = 1.8;
716   bi_b = 0.6;
717   ai_a = 0.6;
718   (dx,dy)=(0.2,.05);
719   draw_solfa_note_shape;
720 fet_endchar;
721
722 fet_beginchar("Half stemup fahead", "1fau", "halffauhead")
723   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
724   path noteshape, noteishape;
725   noteshape = fashape;
726   noteishape =  fashape;
727   a_b = 1.5;
728   bi_b = 0.6;
729   ai_a = 0.6;
730   (dx,dy)=(0.2,.05);
731   draw_solfa_note_shape;
732 fet_endchar;
733
734 fet_beginchar("Quart stemup fahead", "2fau", "fauhead")
735   save a_b, noteshape;
736   path noteshape;
737   a_b = 1.54;
738   
739   noteshape = fashape;
740   draw_solfa_quarter_note_shape;
741 fet_endchar;
742
743 fet_beginchar("Half stemdn fahead", "1fad", "halffadhead")
744   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
745   path noteshape, noteishape;
746   noteshape = fashape rotated 180;
747   noteishape =  fashape rotated 180;
748   a_b = 1.5;
749   bi_b = 0.6;
750   ai_a = 0.6;
751   (dx,dy)=(-0.2,-.05);
752   draw_solfa_note_shape;
753 fet_endchar;
754
755 fet_beginchar("Quart stemdn fahead", "2fad", "fadhead")
756   save a_b, noteshape;
757   path noteshape;
758   a_b = 1.54;
759   
760   noteshape = fashape rotated 180;
761   draw_solfa_quarter_note_shape;
762 fet_endchar;
763
764
765 % sol - oval ... the standard "round" note
766
767 % la - rectangle: (0,h/2)--(w,h.2)--(w,-h/2)--(0,-h/2)--cycle;
768 % stem attachment: (doesn't much matter)
769 save lashape; path lashape;
770 lashape = (-1,-1)--(-1,1)--(1,1)--(1,-1)--cycle;
771
772 fet_beginchar("Whole lahead", "0la", "wholelahead")
773   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
774   path noteshape, noteishape;
775   noteshape = lashape;
776   noteishape = lashape;
777   a_b = 1.8;
778   bi_b = 0.6;
779   ai_a = 0.85;
780   (dx,dy)=(0,0);
781   draw_solfa_note_shape;
782 fet_endchar;
783
784 fet_beginchar("Half lahead", "1la", "halflahead")
785   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
786   path noteshape, noteishape;
787   noteshape = lashape;
788   noteishape =  lashape;
789   a_b = 1.5;
790   bi_b = 0.6;
791   ai_a = 0.85;
792   (dx,dy)=(0,0);
793   draw_solfa_note_shape;
794 fet_endchar;
795
796 fet_beginchar("Quart lahead", "2la", "lahead")
797   save a_b, noteshape;
798   path noteshape;
799   a_b = 1.54;
800   
801   noteshape = lashape;
802   draw_solfa_quarter_note_shape;
803 fet_endchar;
804
805
806 % ti - an "icecream cone" with about 2/3 of
807 % the height in the cone and only 1/3 in the curved top:
808 %      (0,h/6)--(w/2,-h/2)--(w,h/6)..(w/2,h/2)..cycle;
809 % stem attachment: h/6
810 save tishape; path tishape;
811 tishape = (0,-1)--(-1,0.3)..(0,1)..(1,0.3)--cycle;
812
813 fet_beginchar("Whole tihead", "0ti", "wholetihead")
814   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
815   path noteshape, noteishape;
816   noteshape = tishape;
817   noteishape = tishape;
818   a_b = 1.8;
819   bi_b = 0.75;
820   ai_a = 0.75;
821   (dx,dy)=(0,-.02);
822   draw_solfa_note_shape;
823 fet_endchar;
824
825 fet_beginchar("Half tihead", "1ti", "halftihead")
826   save a_b, ai_a, bi_b, dx, dy, noteshape, noteishape;
827   path noteshape, noteishape;
828   noteshape = tishape;
829   noteishape =  tishape;
830   a_b = 1.5;
831   bi_b = 0.75;
832   ai_a = 0.75;
833   (dx,dy)=(0,-.02);
834   draw_solfa_note_shape;
835 fet_endchar;
836
837 fet_beginchar("Quart tihead", "2ti", "tihead")
838   save a_b, noteshape;
839   path noteshape;
840   a_b = 1.54;
841   
842   noteshape = tishape;
843   draw_solfa_quarter_note_shape;
844 fet_endchar;
845
846
847
848 fet_endgroup("noteheads");
849
850
851 %
852 % we derive black_notehead_width# from the quarter head,
853 % so we have to define black_notehead_width (pixel qty)  
854 % after the black_notehead_width# itself. Let's keep it outside the group as well.
855
856 define_pixels(black_notehead_width);
857
858
859
860