5 fet_begingroup("flags")
8 % Flags pointing down overlap with the notehead (in x-direction), so
9 % the down-flag can be bigger
10 upflag_width# = .750 black_notehead_width# + stemthickness#/2;
11 downflag_width# = .833 black_notehead_width# + stemthickness#/2;
13 right_upflag_space# = .2 upflag_width#;
14 right_downflag_space# = .2 downflag_width#;
17 % Flags pointing down cannot overlap with the notehead in y-direction,
18 % so they have less slant.
20 % Because of optical illusion, the utmost flag (bottom for
21 % down-pointing, top for up-pointing) should be smaller than the other
22 % flags. Adobe Sonata doesn't do this correctly. (Instead they have
23 % an extension flag, which looks less elegant)
26 save hip_thickness, foot_thickness;
27 hip_thickness# = 1.3 stemthickness#;
28 foot_thickness# = hip_thickness#;
39 def draw_mensural_outermost_flag_i =
40 define_pixels(stafflinethickness, staff_space)
43 xscaled 1.00 stafflinethickness
44 yscaled 0.22 staff_space
47 save za, zb, zc, zd, ze;
48 pair za, zb, zc, zd, ze;
50 za = (+0.00 staff_space, -0.00 staff_space);
51 zb = (+0.15 staff_space, -0.00 staff_space);
52 zc = (+0.45 staff_space, -0.35 staff_space);
53 zd = (+0.45 staff_space, -0.85 staff_space);
54 ze = (+0.00 staff_space, -2.00 staff_space);
56 draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
59 def draw_mensural_outermost_flag_ii =
60 define_pixels(stafflinethickness, staff_space)
63 xscaled 1.00 stafflinethickness
64 yscaled 0.22 staff_space
67 save za, zb, zc, zd, ze;
68 pair za, zb, zc, zd, ze;
70 za = (+0.00 staff_space, -0.00 staff_space);
71 zb = (+0.15 staff_space, -0.00 staff_space);
72 zc = (+0.20 staff_space, -0.05 staff_space);
73 zd = (+0.20 staff_space, -1.15 staff_space);
74 ze = (+0.00 staff_space, -1.40 staff_space);
76 draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
79 def draw_mensural_inner_flag(expr il_shift) =
80 define_pixels(stafflinethickness, staff_space)
83 xscaled 1.00 stafflinethickness
84 yscaled 0.22 staff_space
87 save zs, za, zb, zc, zd;
88 pair zs, za, zb, zc, zd;
90 zs = (0, -il_shift * staff_space);
91 za = zs + (+0.00 staff_space, -0.10 staff_space);
92 zb = zs + (+0.33 staff_space, -0.30 staff_space);
93 zc = zs + (+0.33 staff_space, -0.70 staff_space);
94 zd = zs + (+0.00 staff_space, -0.90 staff_space);
96 draw za{2,1} .. zb .. zc .. {-2,-1}zd;
99 fet_beginchar("8th Mensural Flag (up)", "mensuralu03", "menseighthflag")
100 set_char_box(0, 0.60 staff_space#, 2.00 staff_space#, 0)
101 draw_mensural_outermost_flag_i
104 fet_beginchar("8th Mensural Flag (up)", "mensuralu13", "mens1eighthflag")
105 set_char_box(0, 0.60 staff_space#, 1.50 staff_space#, 0)
106 draw_mensural_outermost_flag_ii
109 fet_beginchar("8th Mensural Flag (down)", "mensurald03", "mensdeighthflag")
110 set_char_box(0.60 staff_space#, 0, 0, 2.00 staff_space#)
111 draw_mensural_outermost_flag_i
112 currentpicture := currentpicture xscaled -1 yscaled -1;
115 fet_beginchar("8th Mensural Flag (down)", "mensurald13", "mensd1eighthflag")
116 set_char_box(0.60 staff_space#, 0, 0, 1.50 staff_space#)
117 draw_mensural_outermost_flag_ii
118 currentpicture := currentpicture xscaled -1 yscaled -1;
121 fet_beginchar("16th Mensural Flag (up)", "mensuralu04", "menssixteenthflag")
122 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
123 draw_mensural_outermost_flag_i
124 draw_mensural_inner_flag(2.0)
127 fet_beginchar("16th Mensural Flag (up)", "mensuralu14", "mens1sixteenthflag")
128 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
129 draw_mensural_outermost_flag_ii
130 draw_mensural_inner_flag(1.5)
133 fet_beginchar("16th Mensural Flag (down)", "mensurald04", "mensdsixteenthflag")
134 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
135 draw_mensural_outermost_flag_i
136 draw_mensural_inner_flag(2.0)
137 currentpicture := currentpicture xscaled -1 yscaled -1;
140 fet_beginchar("16th Mensural Flag (down)", "mensurald14", "mensd1sixteenthflag")
141 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
142 draw_mensural_outermost_flag_ii
143 draw_mensural_inner_flag(1.5)
144 currentpicture := currentpicture xscaled -1 yscaled -1;
147 fet_beginchar("32th Mensural Flag (up)", "mensuralu05", "mensthirtysecondflag")
148 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
149 draw_mensural_outermost_flag_i
150 draw_mensural_inner_flag(2.0)
151 draw_mensural_inner_flag(3.0)
154 fet_beginchar("32th Mensural Flag (up)", "mensuralu15", "mens1thirtysecondflag")
155 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
156 draw_mensural_outermost_flag_ii
157 draw_mensural_inner_flag(1.5)
158 draw_mensural_inner_flag(2.5)
161 fet_beginchar("32th Mensural Flag (down)", "mensurald05", "mensdthirtysecondflag")
162 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
163 draw_mensural_outermost_flag_i
164 draw_mensural_inner_flag(2.0)
165 draw_mensural_inner_flag(3.0)
166 currentpicture := currentpicture xscaled -1 yscaled -1;
169 fet_beginchar("32th Mensural Flag (down)", "mensurald15", "mensd1thirtysecondflag")
170 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
171 draw_mensural_outermost_flag_ii
172 draw_mensural_inner_flag(1.5)
173 draw_mensural_inner_flag(2.5)
174 currentpicture := currentpicture xscaled -1 yscaled -1;
177 fet_beginchar("64th Mensural Flag (up)", "mensuralu06", "menssixtyfourthflag")
178 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
179 draw_mensural_outermost_flag_i
180 draw_mensural_inner_flag(1.5)
181 draw_mensural_inner_flag(2.5)
182 draw_mensural_inner_flag(3.5)
185 fet_beginchar("64th Mensural Flag (up)", "mensuralu16", "mens1sixtyfourthflag")
186 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
187 draw_mensural_outermost_flag_ii
188 draw_mensural_inner_flag(1.17)
189 draw_mensural_inner_flag(2.08)
190 draw_mensural_inner_flag(3.00)
193 fet_beginchar("64th Mensural Flag (down)", "mensurald06", "mensdsixtyfourthflag")
194 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
195 draw_mensural_outermost_flag_i
196 draw_mensural_inner_flag(1.5)
197 draw_mensural_inner_flag(2.5)
198 draw_mensural_inner_flag(3.5)
199 currentpicture := currentpicture xscaled -1 yscaled -1;
202 fet_beginchar("64th Mensural Flag (down)", "mensurald16", "mensd1sixtyfourthflag")
203 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
204 draw_mensural_outermost_flag_ii
205 draw_mensural_inner_flag(1.17)
206 draw_mensural_inner_flag(2.08)
207 draw_mensural_inner_flag(3.00)
208 currentpicture := currentpicture xscaled -1 yscaled -1;
220 def draw_mensural_outermost_flag_i =
221 define_pixels(stafflinethickness, staff_space)
224 xscaled 1.00 stafflinethickness
225 yscaled 0.22 staff_space
228 save za, zb, zc, zd, ze;
229 pair za, zb, zc, zd, ze;
231 za = (+0.00 staff_space, -0.00 staff_space);
232 zb = (+0.15 staff_space, -0.00 staff_space);
233 zc = (+0.45 staff_space, -0.35 staff_space);
234 zd = (+0.45 staff_space, -0.85 staff_space);
235 ze = (+0.00 staff_space, -2.00 staff_space);
237 draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
240 def draw_mensural_outermost_flag_ii =
241 define_pixels(stafflinethickness, staff_space)
244 xscaled 1.00 stafflinethickness
245 yscaled 0.22 staff_space
248 save za, zb, zc, zd, ze;
249 pair za, zb, zc, zd, ze;
251 za = (+0.00 staff_space, -0.00 staff_space);
252 zb = (+0.15 staff_space, -0.00 staff_space);
253 zc = (+0.20 staff_space, -0.05 staff_space);
254 zd = (+0.20 staff_space, -1.15 staff_space);
255 ze = (+0.00 staff_space, -1.40 staff_space);
257 draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
260 def draw_mensural_inner_flag(expr il_shift) =
261 define_pixels(stafflinethickness, staff_space)
264 xscaled 1.00 stafflinethickness
265 yscaled 0.22 staff_space
268 save zs, za, zb, zc, zd;
269 pair zs, za, zb, zc, zd;
271 zs = (0, -il_shift * staff_space);
272 za = zs + (+0.00 staff_space, -0.10 staff_space);
273 zb = zs + (+0.33 staff_space, -0.30 staff_space);
274 zc = zs + (+0.33 staff_space, -0.70 staff_space);
275 zd = zs + (+0.00 staff_space, -0.90 staff_space);
277 draw za{2,1} .. zb .. zc .. {-2,-1}zd;
280 fet_beginchar("8th Mensural Flag (up)", "mensuralu03", "menseighthflag")
281 set_char_box(0, 0.60 staff_space#, 2.00 staff_space#, 0)
282 draw_mensural_outermost_flag_i
285 fet_beginchar("8th Mensural Flag (up)", "mensuralu13", "mens1eighthflag")
286 set_char_box(0, 0.60 staff_space#, 1.50 staff_space#, 0)
287 draw_mensural_outermost_flag_ii
290 fet_beginchar("8th Mensural Flag (down)", "mensurald03", "mensdeighthflag")
291 set_char_box(0.60 staff_space#, 0, 0, 2.00 staff_space#)
292 draw_mensural_outermost_flag_i
293 currentpicture := currentpicture xscaled -1 yscaled -1;
296 fet_beginchar("8th Mensural Flag (down)", "mensurald13", "mensd1eighthflag")
297 set_char_box(0.60 staff_space#, 0, 0, 1.50 staff_space#)
298 draw_mensural_outermost_flag_ii
299 currentpicture := currentpicture xscaled -1 yscaled -1;
302 fet_beginchar("16th Mensural Flag (up)", "mensuralu04", "menssixteenthflag")
303 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
304 draw_mensural_outermost_flag_i
305 draw_mensural_inner_flag(2.0)
308 fet_beginchar("16th Mensural Flag (up)", "mensuralu14", "mens1sixteenthflag")
309 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
310 draw_mensural_outermost_flag_ii
311 draw_mensural_inner_flag(1.5)
314 fet_beginchar("16th Mensural Flag (down)", "mensurald04", "mensdsixteenthflag")
315 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
316 draw_mensural_outermost_flag_i
317 draw_mensural_inner_flag(2.0)
318 currentpicture := currentpicture xscaled -1 yscaled -1;
321 fet_beginchar("16th Mensural Flag (down)", "mensurald14", "mensd1sixteenthflag")
322 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
323 draw_mensural_outermost_flag_ii
324 draw_mensural_inner_flag(1.5)
325 currentpicture := currentpicture xscaled -1 yscaled -1;
328 fet_beginchar("32th Mensural Flag (up)", "mensuralu05", "mensthirtysecondflag")
329 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
330 draw_mensural_outermost_flag_i
331 draw_mensural_inner_flag(2.0)
332 draw_mensural_inner_flag(3.0)
335 fet_beginchar("32th Mensural Flag (up)", "mensuralu15", "mens1thirtysecondflag")
336 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
337 draw_mensural_outermost_flag_ii
338 draw_mensural_inner_flag(1.5)
339 draw_mensural_inner_flag(2.5)
342 fet_beginchar("32th Mensural Flag (down)", "mensurald05", "mensdthirtysecondflag")
343 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
344 draw_mensural_outermost_flag_i
345 draw_mensural_inner_flag(2.0)
346 draw_mensural_inner_flag(3.0)
347 currentpicture := currentpicture xscaled -1 yscaled -1;
350 fet_beginchar("32th Mensural Flag (down)", "mensurald15", "mensd1thirtysecondflag")
351 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
352 draw_mensural_outermost_flag_ii
353 draw_mensural_inner_flag(1.5)
354 draw_mensural_inner_flag(2.5)
355 currentpicture := currentpicture xscaled -1 yscaled -1;
358 fet_beginchar("64th Mensural Flag (up)", "mensuralu06", "menssixtyfourthflag")
359 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
360 draw_mensural_outermost_flag_i
361 draw_mensural_inner_flag(1.5)
362 draw_mensural_inner_flag(2.5)
363 draw_mensural_inner_flag(3.5)
366 fet_beginchar("64th Mensural Flag (up)", "mensuralu16", "mens1sixtyfourthflag")
367 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
368 draw_mensural_outermost_flag_ii
369 draw_mensural_inner_flag(1.17)
370 draw_mensural_inner_flag(2.08)
371 draw_mensural_inner_flag(3.00)
374 fet_beginchar("64th Mensural Flag (down)", "mensurald06", "mensdsixtyfourthflag")
375 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
376 draw_mensural_outermost_flag_i
377 draw_mensural_inner_flag(1.5)
378 draw_mensural_inner_flag(2.5)
379 draw_mensural_inner_flag(3.5)
380 currentpicture := currentpicture xscaled -1 yscaled -1;
383 fet_beginchar("64th Mensural Flag (down)", "mensurald16", "mensd1sixtyfourthflag")
384 set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
385 draw_mensural_outermost_flag_ii
386 draw_mensural_inner_flag(1.17)
387 draw_mensural_inner_flag(2.08)
388 draw_mensural_inner_flag(3.00)
389 currentpicture := currentpicture xscaled -1 yscaled -1;
396 % Single Stroke for Short Appogiatura
401 fet_beginchar("grace dash (up)", "ugrace", "gracedash")
403 hip_depth_ratio, hip_width,
406 flare# = 1.0 staff_space#;
407 hip_depth_ratio = .72;
408 hip_width# = upflag_width# - hip_thickness#/2;
410 foot_depth# = 3 staff_space#;
412 define_pixels(flare, hip_width, hip_thickness,
413 foot_depth, foot_thickness);
415 set_char_box(hip_width# * hip_depth_ratio,
416 hip_width# + stemthickness#/2 + right_upflag_space#,
417 foot_depth# * hip_depth_ratio, -flare#)
419 pickup pencircle scaled 1.5 stemthickness;
424 fet_beginchar("grace dash (down)", "dgrace", "dgracedash")
425 save flare, hip_depth_ratio, hip_width, foot_depth;
426 save flagspace, total_depth, flag_count;
429 flare# = .99 staff_space#;
430 flagspace# = .9 staff_space#;
431 hip_depth_ratio = .72 ;
432 hip_width# = downflag_width# - hip_thickness#/2;
433 total_depth# = 2.85 staff_space#;
434 (flag_count-1) * flagspace# + foot_depth# = total_depth#;
436 foot_width_ratio = .8;
438 define_pixels(flare, hip_width, hip_thickness,
439 flagspace, foot_depth);
441 set_char_box(hip_width# * hip_depth_ratio,
442 hip_width# + stemthickness#/2 + right_downflag_space#,
443 foot_depth# * hip_depth_ratio, -flare#)
445 pickup pencircle scaled 1.5 stemthickness;
446 draw (-b, -d) .. (w,h);
453 % Stem characters so we can compose metronome markings with Feta
457 fet_beginchar("stem (up)", "stem", "stem")
458 set_char_box(stemthickness#/2, stemthickness#/2, 0, 3.5staff_space#);
459 pickup pencircle scaled stemthickness;
460 draw (0, 0.2staff_space) .. (0, 3.5staff_space);
464 fet_beginchar("stem (down)", "dstem", "dstem")
465 set_char_box(stemthickness#/2, stemthickness#/2, 3.5staff_space#, 0);
466 pickup pencircle scaled stemthickness;
467 draw (0, -0.2staff_space) .. (0, -3.5staff_space);
471 fet_endgroup("flags");