2 % part of LilyPond's pretty-but-neat music font
3 % third try at bolletjes
4 % most beautiful bolletjes are not circular, and not even symmetric.
6 interline#:=staffsize#/(stafflines-1)+stafflinethickness#;
9 makegrid(-5pt,-4pt,-3pt,-2pt,-1pt,0pt,1pt,2pt,3pt,4pt,5pt)
10 (-5pt,-4pt,-3pt,-2pt,-1pt,0pt,1pt,2pt,3pt,4pt,5pt);
11 makegrid(-4.8pt,-4.6pt,-4.4pt,-4.2pt,-4.0pt,
12 -3.8pt,-3.6pt,-3.4pt,-3.2pt,-3.0pt,
13 -2.8pt,-2.6pt,-2.4pt,-2.2pt,-2.0pt,
14 -1.8pt,-1.6pt,-1.4pt,-1.2pt,-1.0pt,
15 -0.8pt,-0.6pt,-0.4pt,-0.2pt,-0.0pt,
16 0.0pt,0.2pt,0.4pt,0.6pt,0.8pt,
17 1.0pt,1.2pt,1.4pt,1.6pt,1.8pt,
18 2.0pt,2.2pt,2.4pt,2.6pt,2.8pt,
19 3.0pt,3.2pt,3.4pt,3.6pt,3.8pt,
20 4.0pt,4.2pt,4.4pt,4.6pt,4.8pt)
21 (-4.8pt,-4.6pt,-4.4pt,-4.2pt,-4.0pt,
22 -3.8pt,-3.6pt,-3.4pt,-3.2pt,-3.0pt,
23 -2.8pt,-2.6pt,-2.4pt,-2.2pt,-2.0pt,
24 -1.8pt,-1.6pt,-1.4pt,-1.2pt,-1.0pt,
25 -0.8pt,-0.6pt,-0.4pt,-0.2pt,-0.0pt,
26 0.0pt,0.2pt,0.4pt,0.6pt,0.8pt,
27 1.0pt,1.2pt,1.4pt,1.6pt,1.8pt,
28 2.0pt,2.2pt,2.4pt,2.6pt,2.8pt,
29 3.0pt,3.2pt,3.4pt,3.6pt,3.8pt,
30 4.0pt,4.2pt,4.4pt,4.6pt,4.8pt);
36 % err_x: drift of y axis at top
37 % err_y: drift of x axis at right
38 def distorted_ellipse(expr a,b,err_y,err_x,super) =
39 superellipse((a,err_x),(-err_y,b),(-a,-err_x),(err_y,-b),super);
43 % def notehead(expr code,il,hdb,adb,adw,xda,s,alpha,cda,ddb,r) =
44 def notehead(expr code,interline,name) =
56 % x1=-x3=a; x2=x4=0; y1=y3=0; y2=-y4=b;
59 beginchar(code,w#,h#,0); name;
60 fill distorted_ellipse(a,b,a*err_y_a,0,super);
61 unfill distorted_ellipse(ai,bi,ai*err_y_ai,0,superi);
64 draw (0,0)--(a,0) rotated alpha;
65 draw (0,0)--(-a,0) rotated alphai;
70 beginchar(code,w#,h#,0); name;
72 black=distorted_ellipse(a,b,a*err_y_a,0,super);
73 black:=black rotated alpha;
74 % black:=black shifted (w/2,h/2);
75 black:=black shifted (w/2,0);
77 white=distorted_ellipse(ai,bi,ai*err_y_ai,bi*err_x_bi,superi);
78 white:=white rotated alphai;
79 % white:=white shifted (w/2,h/2);
80 white:=white shifted (w/2,0);
91 %notehead(incr code,interline#,1,1.7,1,1/20,0.707,0,1/2.2,1/1.3,0.74);
92 %notehead(incr code,interline#,1,1.7,1,1/20,0.707,0,5/11,3/4,0.74);
94 %def notehead(expr code,il,hdb,adb,adw,xda,s,alpha,cda,ddb,r) =
98 save a_b,err_y_a,alpha,super;
99 save ai_a,ai_bi,err_y_ai,err_x_bi,alphai,superi;
102 err_y_a:=0; % no slant
113 b_h:=1; %no rotate-> no height correction
114 a_w:=1; % no rotate-> no width correction
115 notehead(incr code,interline#,"Whole notehead");
131 notehead(incr code,interline#,"Half notehead");
147 notehead(incr code,interline#,"Quarter notehead");