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 % wanske: whole beamheight; or ca 18 degrees
38 % z2 - z1 = (beamwidth - roundness, beamheight/2);
39 z2 - z1 = (beamwidth - roundness, beamheight);
41 beamslope = (y2-y1)/(x2-x1);
44 hspan = (spanwidth, beamslope * spanwidth);
45 vspan = (0, spanheight);
49 beam := (hspan + vspan -- -hspan
50 + vspan -- -hspan -vspan -- hspan - vspan -- cycle )
53 draw_rounded_path((beam shifted (0,-interbeam/2)), roundness);
54 draw_rounded_path((beam shifted (0,interbeam/2)), roundness);
56 pickup pencircle scaled stemwidth;
57 x3 = x4 = xpart center;
58 bot y3 = -1.5 interline + ypart center;
59 top y4 = 1.5 interline + ypart center;
64 xs := interstem* beamwidth / 2;
65 draw stem shifted (- xs, - xs* beamslope);
66 draw stem shifted (xs , xs *beamslope);
70 fet_beginchar( "Natural", "0", "natural")
71 set_char_box(0, 8/12 interline#, 1.5 interline#, 1.5 interline#);
73 save interbeam, interstem, beamheight, beamwidth,
76 beamheight = 4.5 stafflinethickness;
77 interstem + stemwidth = w;
78 stemwidth = 1.3 stafflinethickness;
80 z2 -z1 = (interstem, slope * interstem);
81 xpart .5 [z2,z1] = xcenter ;
85 pickup penrazor scaled beamheight rotated 90;
86 top y2 = interline - 3/2 stafflinethickness ;
87 slope = stafflinethickness / interstem;
90 draw (xpart z1, -y2) .. (xpart z2, -y1);
93 pickup pencircle scaled stemwidth;
96 top y3 = 1.5 interline;
99 draw (xpart z1, -y4) .. z3;
100 draw (xpart z2, -y3) .. z4;
106 % Dedicated to my mom. (3/10/97)
108 % Mamma, ik hou van je; kom je alsjeblieft terug?
113 % FIXME more metaness
114 % FIXME distribution of the crooks' thickness
116 % FIXME probably doesn't look quite right.
119 def flat_meta_symbol(expr w, d, h,
120 stemwidth, crook_fatness, crook_thinness,
121 bottom_stem_thick, top_stem_thick)=
125 brush(z1, top_stem_thick , z2, bottom_stem_thick);
127 z3 = (0, 7/16 interline);
128 z4 = z3 + whatever * (dir 30);
131 x5 + crook_fatness/2 = w;
132 z6 = z2 + (0,-1) * (bottom_stem_thick - crook_thinness);
134 penpos3(crook_thinness, 90);
135 penpos4(crook_thinness, 90);
136 penpos5(crook_fatness, 0);
137 penpos6(crook_thinness, -90);
139 penstroke z3e{dir 32} .. z4e{dir 30} .. z5e{down} .. {dir 220}z6e;
142 def flat_symbol (expr w, d, h)=
143 save stemwidth, bottom_stem_thick, top_stem_thick,
144 crook_thinness, crook_fatness;
145 stemwidth = stafflinethickness;
146 crook_fatness = 1/4 interline;
147 crook_thinness = stemwidth;
148 bottom_stem_thick = 5/4 stemwidth;
149 top_stem_thick = 2 stemwidth;
150 flat_meta_symbol(w,d,h, stemwidth, crook_fatness, crook_thinness,
151 bottom_stem_thick, top_stem_thick);
155 % unfortunately, 600dpi is not enough to show the brush of the stem.
157 fet_beginchar("Flat", "-1", "flat")
158 set_char_box(0, 9/12 interline#, .5 interline#, 2 interline#);
159 flat_symbol (w, d, h);
162 fet_beginchar("Double flat", "-2", "flatflat")
163 set_char_box(0, 18/12 interline#, .5 interline#, 2 interline#);
164 flat_symbol(w/2, d, h);
165 addto currentpicture also currentpicture
166 shifted (w/2 - stafflinethickness/2,0);
170 fet_beginchar("Double sharp", "2", "sharpsharp")
171 set_char_box(0, interline#, .5 interline#, .5 interline#);
172 save klaverblad, klaversteel;
174 klaversteel = 1/15 interline;
175 klaverblad = .35 interline;
177 z1 = (klaversteel, 0);
178 z2 = (w/2 - klaverblad / 10, h - klaverblad);
180 z4 = z2 reflectedabout((0,0), (1,1));
181 z5 = z1 reflectedabout((0,0), (1,1));
185 z1{dir 45} .. {right}z2 -- z3 -- z4{down} .. {dir 225}z5 .. cycle,
188 addto currentpicture also currentpicture yscaled (-d/h);
189 addto currentpicture also currentpicture xscaled (-1);
192 currentpicture := currentpicture shifted (w/2,0);
198 fet_endgroup("accidentals");