2 % part of LilyPond's pretty-but-neat music font
4 % most beautiful noteheads are pronounced, not circular,
5 % and not even symmetric.
6 % These examples are inspired by [Wanske], see literature list
9 save black_notehead_width;
10 numeric black_notehead_width;
12 fet_begingroup("balls");
14 noteheight#:=interline#+ (1 + overdone_heads) *stafflinethickness#;
15 define_pixels(noteheight);
18 save beamheight, head_width;
19 save holeheight, stem_width;
20 save serif_size, serif_protrude;
22 head_width# = 2 interline#;
23 holeheight = 3 stafflinethickness;
24 stem_width = 1.4 stafflinethickness;
27 define_pixels(head_width);
28 set_char_box(0, head_width#, noteheight#/2, noteheight#/2);
30 2 beamheight + holeheight = noteheight;
31 serif_size = (holeheight - stafflinethickness)/2;
32 serif_protrude = 1.5 serif_size;
33 penpos1(stem_width, 0);
34 penpos2(stem_width, 0);
35 penpos3(beamheight, 90);
36 penpos4(beamheight, 90);
37 penpos5(stem_width, 180);
40 z2l = (0, -stafflinethickness/2);
41 z3r = z2r + serif_size *(1,-1);
44 z5l = z3l + (-serif_size, -serif_protrude);
46 penlabels(1,2,3,4, 5);
47 fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
48 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
50 addto currentpicture also currentpicture yscaled -1;
51 addto currentpicture also currentpicture reflectedabout(z4r, z4l);
54 fet_beginchar("Brevis notehead", "-1", "brevisball")
60 % Some sources (eg Musix/OpusTeX think that the appendage should be on
61 % the right, my only other ref [Willemze], shows an appendage to the left
63 fet_beginchar("Longa notehead", "-2", "longaball");
67 z6 - z7 = (-stem_width/2, -interline);
68 theta = angle(z6-z7)+ 90;
69 penpos7(stem_width, theta);
70 penpos6(1.2 stem_width, theta);
72 fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
77 def setup_notehead_vars =
78 save a_b,err_y_a,tilt,superness;
79 save ai_a,ai_bi,err_y_ai,err_x_bi,inner_tilt,inner_superness;
83 % setup addititional vars and calc them
85 save a,beta,ai,bi, ht, wd;
92 define_pixels(a,beta);
94 set_char_box(0, wd#, .5 ht#, .5 ht#);
98 % draw the outer and inner ellipse.
101 black=distorted_ellipse(a,beta,a*err_y_a,0,superness);
102 white=distorted_ellipse(ai,bi,ai*err_y_ai,bi*err_x_bi,inner_superness);
105 x1=-x3=a; x2=x4=0; y1=y3=0; y2=-y4=b;
109 black:=black rotated tilt;
110 black:=black shifted (w/2,0);
111 white:=white rotated inner_tilt;
112 white:=white shifted (w/2,0);
122 fet_beginchar("Whole notehead", "0", "wholeball")
126 err_y_a:=0; % no slant
137 inner_tilt:=125; % jcn
138 % inner_superness:=0.69;
139 inner_superness:=0.68; % jcn
140 b_h:=1; %no rotate-> no height correction
141 a_w:=1; % no rotate-> no width correction
150 fet_beginchar("Half notehead", "1",
153 % a_b:=1.49; % after text
154 a_b:=1.50; % after drawing
158 superness:=0.67; % jcn
166 inner_superness:=0.80;
177 fet_beginchar("Quart notehead", "2", "quartball")
179 % a_b:=1.57; % after text
180 a_b:=1.54; % after drawing
189 inner_superness:=0.707;
194 black_notehead_width# := wd#;
201 fet_endgroup("balls");
203 define_pixels(black_notehead_width);