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);
16 brevis_wid# := 2 interline#;
18 def draw_brevis(expr brevwid) =
19 save beamheight, head_width;
20 save holeheight, stem_width;
21 save serif_size, serif_protrude;
23 head_width# = brevwid;
24 holeheight = 3 stafflinethickness;
25 stem_width = 1.4 stafflinethickness;
28 define_pixels(head_width);
29 set_char_box(0, head_width#, noteheight#/2, noteheight#/2);
31 2 beamheight + holeheight = noteheight;
32 serif_size = (holeheight - stafflinethickness)/2;
33 serif_protrude = 1.5 serif_size;
34 penpos1(stem_width, 0);
35 penpos2(stem_width, 0);
36 penpos3(beamheight, 90);
37 penpos4(beamheight, 90);
38 penpos5(stem_width, 180);
41 z2l = (0, -stafflinethickness/2);
42 z3r = z2r + serif_size *(1,-1);
45 z5l = z3l + (-serif_size, -serif_protrude);
47 penlabels(1,2,3,4, 5);
48 fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
49 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
51 addto currentpicture also currentpicture yscaled -1;
52 addto currentpicture also currentpicture reflectedabout(z4r, z4l);
57 def draw_ledger(expr wid)=
58 set_char_box(uitsteek * wid, (1+ uitsteek)*wid,
59 ledgerlinethickness#/2,ledgerlinethickness#/2);
60 pickup pencircle scaled ledgerlinethickness;
67 fet_beginchar("Brevis notehead", "-1", "brevisball")
68 draw_brevis(brevis_wid#);
70 fet_beginchar("Brevis ledger", "-1l", "brevisledger")
71 draw_ledger(brevis_wid#);
75 % Some sources (eg Musix/OpusTeX think that the appendage should be on
76 % the right, my only other ref [Willemze], shows an appendage to the left
78 fet_beginchar("Longa notehead", "-2", "longaball");
79 draw_brevis(brevis_wid#);
82 z6 - z7 = (-stem_width/2, -interline);
83 theta = angle(z6-z7)+ 90;
84 penpos7(stem_width, theta);
85 penpos6(1.2 stem_width, theta);
87 fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
90 fet_beginchar("Longa ledger", "-2l", "longaledger")
91 draw_ledger(brevis_wid#);
96 def setup_notehead_vars =
97 save a_b,err_y_a,tilt,superness;
98 save ai_a,ai_bi,err_y_ai,err_x_bi,inner_tilt,inner_superness;
102 % setup addititional vars and calc them
104 save a,beta,ai,bi, ht, wd;
111 define_pixels(a,beta);
112 define_pixels(ai,bi);
113 set_char_box(0, wd#, .5 ht#, .5 ht#);
117 % draw the outer and inner ellipse.
120 black=distorted_ellipse(a,beta,a*err_y_a,0,superness);
121 white=distorted_ellipse(ai,bi,ai*err_y_ai,bi*err_x_bi,inner_superness);
124 x1=-x3=a; x2=x4=0; y1=y3=0; y2=-y4=b;
128 black:=black rotated tilt;
129 black:=black shifted (w/2,0);
130 white:=white rotated inner_tilt;
131 white:=white shifted (w/2,0);
141 fet_beginchar("Whole notehead", "0", "wholeball")
145 err_y_a:=0; % no slant
156 inner_tilt:=125; % jcn
157 % inner_superness:=0.69;
158 inner_superness:=0.68; % jcn
159 b_h:=1; %no rotate-> no height correction
160 a_w:=1; % no rotate-> no width correction
163 whole_notehead_width# := wd#;
168 fet_beginchar("Whole ledger line", "0l", "wholeledger")
169 draw_ledger(whole_notehead_width#);
174 fet_beginchar("Half notehead", "1",
177 % a_b:=1.49; % after text
178 a_b:=1.50; % after drawing
182 superness:=0.67; % jcn
190 inner_superness:=0.80;
195 half_notehead_width# := wd#;
200 fet_beginchar("Half ledger", "1l", "halfledger")
201 draw_ledger(half_notehead_width#);
206 fet_beginchar("Quart notehead", "2", "quartball")
208 % a_b:=1.57; % after text
209 a_b:=1.54; % after drawing
218 inner_superness:=0.707;
223 black_notehead_width# := wd#;
228 fet_beginchar("Quart ledger", "2l", "quartledger")
229 draw_ledger(black_notehead_width#);
232 fet_endgroup("balls");
234 define_pixels(black_notehead_width);