2 % Accidentals from various sources, notably
4 % Baerenreiter edition of Schuberts `Auf dem Strom' (sharp, natural, flat)
5 % F Hofmeister edition of Muellers `Etueden fuer Horn' (double sharp)
11 %\tracingequations:= tracingonline := 1;
13 fet_begingroup("accidentals");
15 fet_beginchar("Sharp" , "1", "sharp");
16 set_char_box(0, 1.1 interline#, 1.5 interline#,
19 save interbeam, interstem, beamheight, beamwidth,
22 interbeam := 1.1 interline;
24 beamheight := 4 stafflinethickness;
26 stemwidth := 1.3 stafflinethickness;
27 roundness := blot_diameter;
31 roundness + 2 spanwidth = beamwidth;
32 roundness + 2 spanheight = beamheight;
34 2 horizontal_protrusion + interstem * beamwidth + stemwidth
37 z2 - z1 = (beamwidth - roundness, beamheight/2);
39 beamslope = (y2-y1)/(x2-x1);
42 hspan = (spanwidth, beamslope * spanwidth);
43 vspan = (0, spanheight);
47 beam := (hspan + vspan -- -hspan
48 + vspan -- -hspan -vspan -- hspan - vspan -- cycle )
51 draw_rounded_path((beam shifted (0,-interbeam/2)), roundness);
52 draw_rounded_path((beam shifted (0,interbeam/2)), roundness);
54 pickup pencircle scaled stemwidth;
55 x3 = x4 = xpart center;
56 bot y3 = -1.5 interline + ypart center;
57 top y4 = 1.5 interline + ypart center;
62 xs := interstem* beamwidth / 2;
63 draw stem shifted (- xs, - xs* beamslope);
64 draw stem shifted (xs , xs *beamslope);
68 fet_beginchar( "Natural", "0", "natural")
69 set_char_box(0, 8/12 interline#, 1.5 interline#, 1.5 interline#);
71 save interbeam, interstem, beamheight, beamwidth,
74 beamheight = 4.5 stafflinethickness;
75 interstem + stemwidth = w;
76 stemwidth = 1.3 stafflinethickness;
78 z2 -z1 = (interstem, slope * interstem);
79 xpart .5 [z2,z1] = xcenter ;
83 pickup penrazor scaled beamheight rotated 90;
84 top y2 = interline - 3/2 stafflinethickness ;
85 slope = stafflinethickness / interstem;
88 draw (xpart z1, -y2) .. (xpart z2, -y1);
91 pickup pencircle scaled stemwidth;
94 top y3 = 1.5 interline;
97 draw (xpart z1, -y4) .. z3;
98 draw (xpart z2, -y3) .. z4;
104 % Dedicated to my mom. (3/10/97)
106 % Mamma, ik hou van je; kom je alsjeblieft terug?
111 % FIXME more metaness
112 % FIXME distribution of the crooks' thickness
114 % FIXME probably doesn't look quite right.
116 def flat_meta_symbol(expr w, d, h,
117 stemwidth, crook_fatness, crook_thinness,
118 bottom_stem_thick, top_stem_thick)=
122 brush(z1, top_stem_thick , z2, bottom_stem_thick);
124 z3 = (0, 7/16 interline);
125 z4 = z3 + whatever * (dir 30);
128 x5 + crook_fatness/2 = w;
129 z6 = z2 + (0,-1) * (bottom_stem_thick - crook_thinness);
131 penpos3(crook_thinness, 90);
132 penpos4(crook_thinness, 90);
133 penpos5(crook_fatness, 0);
134 penpos6(crook_thinness, -90);
136 penstroke z3e{dir 32} .. z4e{dir 30} .. z5e{down} .. {dir 220}z6e;
139 def flat_symbol (expr w, d, h)=
140 save stemwidth, bottom_stem_thick, top_stem_thick,
141 crook_thinness, crook_fatness;
142 stemwidth = stafflinethickness;
143 crook_fatness = 1/4 interline;
144 crook_thinness = stemwidth;
145 bottom_stem_thick = 5/4 stemwidth;
146 top_stem_thick = 2 stemwidth;
147 flat_meta_symbol(w,d,h, stemwidth, crook_fatness, crook_thinness,
148 bottom_stem_thick, top_stem_thick);
152 % unfortunately, 600dpi is not enough to show the brush of the stem.
154 fet_beginchar("Flat", "-1", "flat")
155 set_char_box(0, 9/12 interline#, .5 interline#, 2 interline#);
156 flat_symbol (w, d, h);
159 fet_beginchar("Double flat", "-2", "flatflat")
160 set_char_box(0, 18/12 interline#, .5 interline#, 2 interline#);
161 flat_symbol(w/2, d, h);
162 addto currentpicture also currentpicture
163 shifted (w/2 - stafflinethickness/2,0);
167 fet_beginchar("Double sharp", "2", "sharpsharp")
168 set_char_box(0, interline#, .5 interline#, .5 interline#);
169 save klaverblad, klaversteel;
171 klaversteel = 1/12 interline;
172 klaverblad = 1/3 interline;
174 z1 = (klaversteel, 0);
175 z2 = (w/2 - klaverblad / 10, h - klaverblad);
177 z4 = z2 reflectedabout((0,0), (1,1));
178 z5 = z1 reflectedabout((0,0), (1,1));
181 z1{dir 45} .. {right}z2 -- z3 -- z4{down} .. {dir 225}z5 .. cycle,
185 addto currentpicture also currentpicture rotated 90;
186 addto currentpicture also currentpicture yscaled (-d/h);
188 currentpicture := currentpicture shifted (w/2,0);
192 fet_endgroup("accidentals");