]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-banier.mf
* mf/feta-bolletjes.mf: make hole in half note little
[lilypond.git] / mf / feta-banier.mf
1 % flags 
2 %
3
4
5 fet_begingroup("flags")
6 save outer_path;
7 path outer_path;
8
9 % Flags pointing down overlap with  the notehead (in x-direction), so 
10 % the down-flag can be bigger
11 upflag_width# = .650 black_notehead_width# + stemthickness#/2;
12 downflag_width# = .833 black_notehead_width# + stemthickness#/2;
13
14 right_upflag_space# = .0 upflag_width#;
15 right_downflag_space# = .0 downflag_width#;
16
17 %
18 % Flags pointing down cannot overlap with the notehead in y-direction,
19 % so they have less slant.
20
21 % Because of optical illusion, the utmost flag (bottom for
22 % down-pointing, top for up-pointing) should be smaller than the other
23 % flags.  Adobe Sonata doesn't do this correctly.  (Instead they have
24 % an extension flag, which looks less elegant)
25 %
26
27 save hip_thickness, foot_thickness;
28 hip_thickness# = 1.3 stemthickness#;
29 foot_thickness# =  0.95 hip_thickness#;
30
31 %
32 % Inspired by Adobe Sonata and [Wanske]
33 % for example, see POSTSCRIPT Language -- program design, 
34 % page 119, and [Wanske], p 41,42
35 %
36 def draw_flag(expr center, flare, 
37         dims, hip_depth, foot_wid, hip_thickness, foot_thickness)=
38         clearxy;
39         save c ;
40         c = 0.7;
41         penpos1(flare, 90);
42         penpos2(whatever, 0);
43         x2r - x2l = hip_thickness;
44         penpos3 (foot_thickness, -20.0);
45
46         z1r  = center;
47         z2r = center + (xpart dims, -ypart(dims) * hip_depth);
48         z3r = center + (xpart(dims) * foot_wid, -ypart dims);
49
50         outer_path := z3r{curl c} .. z2r{up} .. {up}z1r;
51
52         penlabels(1, 2, 3);
53         fill z1l{curl 0}
54                 ..tension 1.1 .. z2l{down} .. 
55                 {curl c} simple_serif(z3l, z3r, 80) &
56                 outer_path & z1r -- cycle;
57 enddef;
58
59 %
60 % TODO: calc intersectpoint (see TeX book, p. 137)
61 % TODO: calc incision_depth
62
63
64 def add_flag(expr yoff, flare, hip_wid_multiplier, 
65                 hip_dep_multiplier,
66                 intersectpoint, hip_thickness, foot_thickness) =
67         begingroup
68         save prev_center, prev_xextreme, prev_yextreme;
69         save rel_foot, ip, center, incision_depth;
70         save prev_hipwid, prev_footdep, prev_hipdep, wid, dep, hip_dep;
71         save hip_dep_ratio, foot_wid_ratio;
72         pair prev_center, center, foot, prev_xextreme, prev_yextreme;
73         pair ip, rel_foot;
74         
75         incision_depth = 1.013;
76         prev_center = point 2 of outer_path;
77         prev_xextreme = point 1 of outer_path;
78         prev_yextreme = point 0 of outer_path;
79         prev_hipwid = xpart (prev_xextreme - prev_center);
80         prev_footdep = -ypart (prev_yextreme - prev_center);
81         prev_hipdep = -ypart(prev_xextreme - prev_center);
82         ip = point intersectpoint of outer_path;
83
84         wid = prev_hipwid * hip_wid_multiplier;
85         hip_dep = prev_hipdep * hip_dep_multiplier;
86
87         center = prev_center + (0,yoff);
88         rel_foot = incision_depth [(wid, hip_dep), ip - center];
89         dep = -ypart(rel_foot);
90         foot_wid_ratio = xpart(rel_foot ) / wid;
91         hip_dep_ratio = hip_dep / dep;
92
93         draw_flag(center, flare, 
94                 (wid, dep), hip_dep_ratio, foot_wid_ratio, 
95                 hip_thickness, foot_thickness);
96         endgroup
97 enddef;
98
99 fet_beginchar("8th Flag (up)", "u3", "eighthflag")
100         save flare, 
101                 hip_depth_ratio, hip_width,
102                 foot_depth, foot_width_ratio;
103
104         flare# = 1.0 staff_space#;
105         hip_depth_ratio = .72; 
106         foot_width_ratio = .8;
107         hip_width# = upflag_width# - hip_thickness#/2;
108
109         foot_depth# =  3 staff_space# - blot_diameter#/2;
110
111         set_char_box(0, hip_width# 
112                 + stemthickness#/2 + right_upflag_space#, 
113                  foot_depth# + foot_thickness#/2, stemthickness#/2)
114
115         define_pixels(flare, hip_width, hip_thickness,
116                 foot_depth, foot_thickness);
117         draw_flag((0,0), flare, 
118                 (hip_width, foot_depth), 
119                 hip_depth_ratio, foot_width_ratio, hip_thickness, foot_thickness);
120
121         draw_square_block ((-.5 stemthickness,-1 staff_space),
122                            (0, 0));
123 fet_endchar;
124
125 fet_beginchar("16th Flag (up)", "u4", "sixteenthflag")
126         save flare, 
127                 hip_depth_ratio, hip_width,
128                 foot_depth, foot_width_ratio;
129         save flagspace, total_depth, flag_count;
130         total_depth# = 3.5 staff_space# - blot_diameter# /2 ;
131         flag_count = 2;
132         flare# = .85 staff_space#;
133         flagspace# = .85 staff_space#;  
134         hip_depth_ratio = .72 ;
135         hip_width# = upflag_width# - hip_thickness#/2;
136         flagspace# + foot_depth# = total_depth#;
137
138         foot_width_ratio = .8;
139
140         set_char_box(0, hip_width#
141                 + stemthickness#/2 + right_upflag_space#, 
142                 total_depth# + foot_thickness#/2, stemthickness#/2)
143
144         define_pixels(flare, hip_width, hip_thickness,
145                 flagspace,
146                 foot_depth,  foot_thickness);
147         draw_flag((0, - flagspace ), flare, 
148                 (hip_width, foot_depth), 
149                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
150
151         add_flag(flagspace, flare,
152                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
153
154         pickup pencircle scaled stemthickness;
155
156         draw_square_block ((-.5 stemthickness,0),
157                            (0, -2 staff_space));
158 fet_endchar;
159
160
161 fet_beginchar("32nd Flag (up)", "u5", "thirtysecondflag")
162         save flare, 
163                 hip_depth_ratio, hip_width,
164                 foot_depth, foot_width_ratio;
165         save flagspace, total_depth, flag_count;
166         flag_count = 3;
167         total_depth#=4.25 staff_space#;
168         flare# = .85 staff_space#;
169         flagspace# = .87 staff_space#;  
170         hip_depth_ratio = .72 ;
171         hip_width# = upflag_width# - hip_thickness#/2;
172         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
173
174         foot_width_ratio = .8;
175
176         set_char_box(0, hip_width#
177                 +  right_upflag_space#, 
178                 total_depth# + foot_thickness#/2, stemthickness#/2)
179
180         define_pixels(flare, hip_width, hip_thickness,
181                 flagspace,
182                 foot_depth,  foot_thickness);
183
184         draw_flag((0,- 2 flagspace), flare, 
185                 (hip_width, foot_depth), 
186                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
187
188         add_flag(flagspace, flare,
189                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
190
191         add_flag(flagspace, flare,
192                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
193
194
195
196         draw_square_block ((-.5 stemthickness,0),
197                            (0, -3 staff_space));
198 fet_endchar;
199
200 fet_beginchar("64th Flag (up)", "u6", "sixtyfourthflag")
201         save flare, 
202                 hip_depth_ratio, hip_width,
203                 foot_depth, foot_width_ratio;
204         save flagspace, total_depth, flag_count;
205         
206         flag_count = 4;
207         flare# = .85 staff_space#;
208         flagspace# = .9 staff_space#;   
209         hip_depth_ratio = .72 ;
210         hip_width# = upflag_width# - hip_thickness#/2;
211         total_depth# = 5.25 staff_space#;
212         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
213
214         foot_width_ratio = .8;
215
216         set_char_box(0, hip_width#
217                 +  right_upflag_space#, 
218                 total_depth# + foot_thickness#/2, stemthickness#/2)
219
220         define_pixels(flare, hip_width, hip_thickness,
221                 flagspace,
222                 foot_depth,  foot_thickness);
223
224         draw_flag((0,- (flag_count-1)* flagspace), flare, 
225                 (hip_width, foot_depth), 
226                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
227
228         add_flag(flagspace, flare,
229                 .97, 1.00, 1.3, hip_thickness, foot_thickness);  
230
231         add_flag(flagspace, flare,
232                 1.00, 1.00, 1.25, hip_thickness, foot_thickness);  
233         add_flag(flagspace, flare,
234                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
235
236         draw_square_block ((-.5 stemthickness,0),
237                            (0, -4 staff_space));
238 fet_endchar;
239
240 fet_beginchar("8th (down)", "d3", "deighthflag")
241         save flare, 
242                 hip_depth_ratio, hip_width,
243                 foot_depth, foot_width_ratio;
244         save flagspace, total_depth, flag_count;
245         
246         flag_count = 1;
247         flare# = .99 staff_space#;
248         flagspace# = .9 staff_space#;   
249         hip_depth_ratio = .72 ;
250         hip_width# = downflag_width# - hip_thickness#/2;
251         total_depth# = 2.85 staff_space#;
252         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
253
254         foot_width_ratio = .8;
255
256         set_char_box(0, hip_width#
257                 +  right_downflag_space#,
258                 total_depth# + foot_thickness#/2, stemthickness#/2)
259
260         define_pixels(flare, hip_width, hip_thickness,
261                 flagspace,
262                 foot_depth,  foot_thickness);
263
264         draw_flag((0,- (flag_count-1) *flagspace), flare, 
265                 (hip_width, foot_depth), 
266                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
267         draw_square_block ((-.5 stemthickness,0),
268                            (0, - staff_space));
269
270         y_mirror_char;
271 fet_endchar;
272
273 %%%%%%%%
274 %
275 %
276 %
277 % Single Stroke for Short Appogiatura
278 %
279 %
280 %
281
282 fet_beginchar("grace dash (up)", "ugrace", "gracedash")
283         save flare, 
284                 hip_depth_ratio, hip_width,
285                 foot_depth;
286
287         flare# = 1.0 staff_space#;
288         hip_depth_ratio = .72; 
289         hip_width# = upflag_width# - hip_thickness#/2;
290
291         foot_depth# =  3 staff_space#;
292
293         define_pixels(flare, hip_width, hip_thickness,
294                 foot_depth, foot_thickness);
295
296         set_char_box(hip_width# * hip_depth_ratio,
297           hip_width# +  right_upflag_space#, 
298           foot_depth# * hip_depth_ratio, -flare#)
299
300         pickup pencircle scaled 1.5 stemthickness;
301         draw (-b ,-d) ..
302           (w, h);
303
304 fet_endchar;
305
306 fet_beginchar("grace dash (down)", "dgrace", "dgracedash")
307         save flare, hip_depth_ratio, hip_width, foot_depth;
308         save flagspace, total_depth, flag_count;
309         
310         flag_count = 1;
311         flare# = .99 staff_space#;
312         flagspace# = .9 staff_space#;   
313         hip_depth_ratio = .72 ;
314         hip_width# = downflag_width# - hip_thickness#/2;
315         total_depth# = 2.85 staff_space#;
316         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
317
318         foot_width_ratio = .8;
319
320         define_pixels(flare, hip_width, hip_thickness,
321                 flagspace, foot_depth);
322
323         set_char_box(hip_width# * hip_depth_ratio,
324           hip_width# +  right_downflag_space#,
325           foot_depth# * hip_depth_ratio, -flare#)
326
327         pickup pencircle scaled 1.5 stemthickness;
328         draw (-b ,-d) ..
329           (w, h);
330         y_mirror_char;
331 fet_endchar;
332
333 fet_beginchar("16th (down)", "d4", "dsixteenthflag")
334         save flare, 
335                 hip_depth_ratio, hip_width,
336                 foot_depth, foot_width_ratio;
337         save flagspace, total_depth, flag_count;
338         
339         flag_count = 2;
340         flare# = .8 staff_space#;
341         flagspace# = .9 staff_space#;   
342         hip_depth_ratio = .85 ;
343         hip_width# = downflag_width# - hip_thickness#/2;
344         total_depth# = 3.0 staff_space# - blot_diameter# /2;
345         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
346
347         foot_width_ratio = .95;
348
349         set_char_box(0, hip_width#
350                 +  right_downflag_space#, 
351                 total_depth# + foot_thickness#/2, stemthickness#/2)
352
353         define_pixels(flare, hip_width, hip_thickness,
354                 flagspace,
355                 foot_depth,  foot_thickness);
356
357         draw_flag((0,- (flag_count-1) *flagspace), flare, 
358                 (hip_width, foot_depth), 
359                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
360         add_flag(flagspace, flare,
361                 .95, 1.00, 1.25, hip_thickness, foot_thickness);  
362
363         
364         draw_square_block ((-.5 stemthickness,0),
365                            (0, - 2 staff_space));
366
367
368         y_mirror_char;
369 fet_endchar;
370
371 fet_beginchar("32nd (down)", "d5", "dthirtysecondflag")
372         save flare, 
373                 hip_depth_ratio, hip_width,
374                 foot_depth, foot_width_ratio;
375         save flagspace, total_depth, flag_count;
376         
377         flag_count = 3;
378         flare# = .84 staff_space#;
379         flagspace# = .9 staff_space#;   
380         hip_depth_ratio = .85 ;
381         hip_width# = downflag_width# - hip_thickness#/2;
382         total_depth# = 3.85 staff_space#;
383         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
384
385         foot_width_ratio = .95;
386
387         set_char_box(0, hip_width#
388                 +  right_downflag_space#, 
389                 total_depth# + foot_thickness#/2, stemthickness#/2)
390
391         define_pixels(flare, hip_width, hip_thickness,
392                 flagspace,
393                 foot_depth,  foot_thickness);
394
395         draw_flag((0,- (flag_count-1) *flagspace), flare, 
396                 (hip_width, foot_depth), 
397                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
398         add_flag(flagspace, flare,
399                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
400
401         add_flag(flagspace, flare,
402                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
403         draw_square_block ((-.5 stemthickness,0),
404                            (0, - 3 staff_space));
405
406
407         y_mirror_char;
408 fet_endchar;
409 fet_beginchar("64th (down)", "d6", "dsixtyfourthflag")
410         save flare, 
411                 hip_depth_ratio, hip_width,
412                 foot_depth, foot_width_ratio;
413         save flagspace, total_depth, flag_count;
414         
415         flag_count = 4;
416         flare# = .8 staff_space#;
417         flagspace# = .9 staff_space#;   
418         hip_depth_ratio = .85 ;
419         hip_width# = downflag_width# - hip_thickness#/2;
420         total_depth# = 4.35 staff_space#;
421         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
422
423         foot_width_ratio = .98;
424
425         set_char_box(0, hip_width#
426                 + right_downflag_space#, 
427                 total_depth# + foot_thickness#/2, stemthickness#/2)
428
429         define_pixels(flare, hip_width, hip_thickness,
430                 flagspace,
431                 foot_depth,  foot_thickness);
432
433         draw_flag((0,- (flag_count-1) *flagspace), flare, 
434                 (hip_width, foot_depth), 
435                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
436         add_flag(flagspace, flare,
437                 .97, 1.20, 1.175, hip_thickness, foot_thickness);  
438         add_flag(flagspace, flare,
439                 .97, 1.10, 1.175, hip_thickness, foot_thickness);  
440
441         add_flag(.98 flagspace, flare,
442                 .91, 1.05, 1.2, hip_thickness, foot_thickness);  
443
444         draw_square_block ((-.5 stemthickness,0),
445                            (0, - 4 staff_space));
446
447         y_mirror_char;
448 fet_endchar;
449
450
451
452 fet_endgroup("flags");