2 % part of LilyPond's pretty-but-neat music font
3 % third try at bolletjes
4 % most beautiful bolletjes are pronounced, not circular,
5 % and not even symmetric.
7 interline#:=staffsize#/(stafflines-1);
8 %noteheight#:=interline#;
9 % even more pronounced (almost overdone), just like the original
10 noteheight#:=interline#+2stafflinethickness#;
14 proofrulethickness 1pt#;
15 makegrid(0pt,0pt for i:=-5pt step 1pt until 5pt: ,i endfor)
16 (0pt,0pt for i:=-5pt step 1pt until 5pt: ,i endfor);
17 proofrulethickness .1pt#;
18 makegrid(0pt,0pt for i:=-4.8pt step .2pt until 4.8pt: ,i endfor)
19 (0pt,0pt for i:=-4.8pt step .2pt until 4.8pt: ,i endfor);
25 % err_x: drift of y axis at top
26 % err_y: drift of x axis at right
27 def distorted_ellipse(expr a,b,err_y,err_x,super) =
28 superellipse((a,err_x),(-err_y,b),(-a,-err_x),(err_y,-b),super);
33 save a_b,err_y_a,alpha,super;
34 save ai_a,ai_bi,err_y_ai,err_x_bi,alphai,superi;
38 def end_notehead(expr code,height,name,id,texstr) =
49 fet_beginchar(code,w#,h#,0,name,id,texstr);
51 black=distorted_ellipse(a,b,a*err_y_a,0,super);
52 white=distorted_ellipse(ai,bi,ai*err_y_ai,bi*err_x_bi,superi);
55 x1=-x3=a; x2=x4=0; y1=y3=0; y2=-y4=b;
59 black:=black rotated alpha;
60 % black:=black shifted (w/2,h/2);
61 black:=black shifted (w/2,0);
62 white:=white rotated alphai;
63 % white:=white shifted (w/2,h/2);
64 white:=white shifted (w/2,0);
72 % fet_begingroup("noteheads");
73 fet_begingroup("balls");
76 % begin_notehead(incr code,interline#,"Whole notehead");
79 err_y_a:=0; % no slant
93 b_h:=1; %no rotate-> no height correction
94 a_w:=1; % no rotate-> no width correction
95 end_notehead(incr code,noteheight#,"Whole notehead","0","wholeball");
100 % a_b:=1.49; % after text
101 a_b:=1.50; % after drawing
116 end_notehead(incr code,noteheight#,"Half notehead","1","halfball");
121 % a_b:=1.57; % after text
122 a_b:=1.54; % after drawing
134 end_notehead(incr code,noteheight#,"Quarter notehead","2","quartball");
139 line_pen:= pencircle scaled lthick;
142 def callpic = currentpicture:= save_pic enddef;
143 def savepic = save_pic:= currentpicture enddef;
145 def add_mirror (expr pone, ptwo) =
146 addto currentpicture also currentpicture
147 reflectedabout (round(pone), round(ptwo))
150 def fill_square (expr xwidth, ywidth, zshift) =
151 fill unitsquare xscaled xwidth yscaled ywidth shifted zshift
157 define_pixels(nhh,nhw);
159 fet_beginchar(incr code,2interline#,interline#,0,"Brevis notehead","-1","breveball");
160 fill_square (5/4nhw, .25nhh, (0,.25nhh));
161 add_mirror (origin, right);
162 x1=x2=0; x3=x4=5/4nhw; y1=-y2=y3=-y4=.7nhh;
164 draw z1--z2; draw z3--z4;
168 fet_beginchar(incr code,2interline#,interline#,0,"Longa notehead","-2","longaball");
171 draw (5/4nhw,-.7nhh)--(5/4nhw,-1.7nhh);
174 % fet_endgroup("noteheads");
175 fet_endgroup("balls");