]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-eindelijk.mf
24515de89e1cc222fbc44a0fe49009bdb6df2918
[lilypond.git] / mf / feta-eindelijk.mf
1 % feta-eindelijk.mf -- implement rest symbols -*-Fundamental-*-
2 %
3 % part of LilyPond's pretty-but-neat music font
4 %
5 % source file of the Feta (not the Font-En-Tja) music font
6
7 % (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
8
9 fet_begingroup("rests");
10
11 begingroup
12
13 thick#:=1/16designsize;
14 define_blacker_pixels(thick);
15
16 rthin:=1/8*staff_space;
17 % rthick:=2rthin;
18 rthick:=2thick+rthin;
19
20 def shift_pic (expr pone, ptwo) =
21   currentpicture:=currentpicture shifted (round(pone),round(ptwo))
22 enddef;
23
24 % stuff for     8th,16th etc rests
25 %
26 save stem, ball_crook_stem, ball_crook_balldiam, flare;
27
28 % stem#:=1/8*staff_space#;
29 stem# = 1/5staff_space#;
30 % flare# = 2/3staff_space#;
31 flare# = 2/3staff_space# - 1/8stafflinethickness#;
32
33 define_pixels(stem,flare);
34
35 ball_crook_stem = stem;
36 ball_crook_balldiam =flare;
37
38
39 save block_rest_y, block_rest_x;
40
41 block_rest_y# = 5/8 staff_space#;
42 block_rest_x# = 3/2 staff_space#;
43
44 define_pixels(block_rest_y, block_rest_x);
45
46 def block_rest =
47         draw_block ((0,0), (block_rest_x, block_rest_y));
48         enddef;
49
50 fet_beginchar( "whole rest", "0", "wholerest");
51         set_char_box(0, block_rest_x#,
52                 block_rest_y#,  0);
53         block_rest;
54         currentpicture := currentpicture shifted (0,- block_rest_y);
55 fet_endchar;
56
57 fet_beginchar("half rest", "1", "halfrest");
58         set_char_box(0, block_rest_x#, 0, block_rest_y#);
59         block_rest;
60 fet_endchar;
61
62
63 %
64 % should use ledgerline thickness?
65 %
66 fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
67         set_char_box(0, block_rest_x#,
68                 block_rest_y#, ledgerlinethickness#/2);
69         block_rest;
70         currentpicture := currentpicture shifted (0, - block_rest_y);
71         pickup pencircle scaled ledgerlinethickness;
72
73         y5 = y6 = 0;
74         lft x5 = - b - block_rest_y;
75         rt x6 = w + block_rest_y;
76         draw z5 .. z6;
77 fet_endchar;
78
79 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
80         set_char_box(0, block_rest_x#,
81                 ledgerlinethickness#/2, block_rest_y#);
82         block_rest;
83         pickup pencircle scaled ledgerlinethickness;
84         y5 = y6 = 0;
85         lft x5 = - b - block_rest_y ;  
86         rt x6 = w + block_rest_y;
87         draw z5 .. z6;
88 fet_endchar;
89
90
91 save breve_rest_y, breve_rest_x;
92
93 breve_rest_y# =  staff_space#;
94 breve_rest_x# = 3/5 staff_space#;
95 multi_rest_x# = 4 staff_space#;
96 multi_beam_height# = 1/3 staff_space#;
97
98 define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height);
99
100 fet_beginchar("breve rest", "-1", "breverest");
101        set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
102        draw_block ((0,0), (breve_rest_x, breve_rest_y));
103 fet_endchar;
104
105 fet_beginchar("longa rest", "-2", "longarest");
106        set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
107        draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y));
108 fet_endchar;
109
110 tracingvariables := 1;
111
112 fet_beginchar("multi rest", "-4", "multirest");
113        set_char_box(multi_rest_x#, multi_rest_x#,
114                     breve_rest_y#, breve_rest_y#);
115        draw_block ((- b, - multi_beam_height),
116                    (w, multi_beam_height));
117        draw_block ((- b,-breve_rest_y),
118                    (rthin - b, breve_rest_y));
119        draw_block ((w - rthin,-breve_rest_y),
120                    (w, breve_rest_y));
121 fet_endchar;
122
123 fet_beginchar("Quarter rest","2","quartrest");
124 %       draw_staff (-2, 2, 0.0);        
125         save alpha, yshift, height;
126         alpha:=-50;
127         yshift# = -1.25 staff_space#;
128         height# = 2.8125 staff_space#;
129         define_pixels (yshift, height);
130
131         
132         set_char_box(0, 27/25staff_space#,
133           -yshift#,
134           yshift# + height#);
135         
136         save ne,nw,se,sw; pair ne,nw,se,sw;
137         
138         se=dir alpha; nw=dir (alpha+180);
139         ne=dir (alpha+90); sw=dir (alpha-90);
140         penpos1(rthin,alpha+90);
141         penpos2(5/4rthick,alpha);
142         penpos4(5/4rthick,alpha);
143         penpos5(rthin,alpha+90);
144         penpos3(3/4rthick,alpha);
145 %       penpos6(5/8rthick,alpha);
146         penpos6(2/3rthick,alpha);
147         penpos7(1/2rthin,alpha+90);
148
149         z10=z2l+1/2rthin*sw;
150 %       z11=z4l+1/2rthin*sw;
151         z11=z4l+1/2rthin*sw+1/2rthin*se;
152         z12=z4r+1/2rthin*ne;
153 %       z13=z2r+1/2rthin*ne;
154         z13=z2r+1/2rthin*ne+1/2rthin*nw;
155
156         y1r = h;
157         x1l=1/3staff_space;
158         z2r=z1+staff_space*se;
159         z3=1/2[z2,z4];
160         x4=3/8staff_space;
161         y4= 0;
162         z5=z4l+1.3staff_space*se;
163         x6l=x4l;
164         y6l=y4r;
165         x7=2/5staff_space;
166         y7= -d;
167         
168         fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
169         fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
170         penlabels(1,2,3,4,5,6,7);
171         penlabels(10,11,12,13);
172         
173 %         3/4 staff_space# + yshift#,
174 %         18/5staff_space# + yshift#)
175
176         fet_endchar;
177
178 def rest_crook(expr a, w) =
179         balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
180 enddef;
181
182 fet_beginchar("8th rest","3","eighthrest");
183 %       draw_staff (-2, 2, 0.0);
184         save yshift, ballcorrection;
185         ballcorrection = 0.005 staff_space;
186
187         yshift# := -1.0 staff_space#;
188         define_pixels(yshift);
189
190
191         set_char_box(0, 4/3staff_space#, -yshift#, yshift# +
192                         5/3staff_space#+7/4stafflinethickness#);
193
194         %
195         % The curve is like a valley causing less space between
196         % the curve and the lower staff line. Correct for this.
197         % 
198         save x,y;
199
200         x1=w-stem/6;
201
202         y1 = yshift + 1.5 staff_space + flare/4 + ballcorrection; 
203         rest_crook (z1,w-stem/6);
204         z2-z1=whatever*dir70;
205         y2= yshift + stem/2;
206         brush(z1,2/3stem,z2,stem);
207
208         fet_endchar;
209
210 fet_beginchar("16th rest","4","sixteenthrest");
211 %       draw_staff (-2, 2, 0.0);
212         save yshift, ballcorrection;
213         ballcorrection = 0.005 staff_space;
214
215         yshift# := - 2 staff_space#;
216         define_pixels(yshift);
217
218         save alpha,cw,h,w, height;
219         alpha=74;
220         cw#=7/6staff_space#;
221         height# =  5/3staff_space#+staff_space#+7/4stafflinethickness#;
222         set_char_box(0, cw#+(height#-3/2staff_space#)/tand(alpha),
223                 -yshift#, height# + yshift#);
224
225         define_pixels(cw);
226         save x,y;
227         x1=w-stem/6;
228         y1 = yshift + 2.5 staff_space + flare/4 + ballcorrection;
229
230         z2-z1=whatever*dir alpha;
231         y2= yshift + stem/2;
232         brush(z1,2/3stem,z2,stem);
233         rest_crook (z1,cw);
234         z3-z1=whatever*dir alpha;
235         y3=y1-staff_space;
236         rest_crook (z3,cw);
237         penlabels(1,2);
238         fet_endchar;
239
240 fet_beginchar("32th rest","5","thirtysecondrest");
241 %       draw_staff (-2, 2, 0.0);
242         save yshift, ballcorrection;
243         ballcorrection = 0.005 staff_space;
244
245         yshift# := -2 staff_space#;
246         define_pixels(yshift);
247
248         save alpha,cw,h;
249         alpha=76;
250         cw#=7/6staff_space#;
251         h#=5/3staff_space#+2staff_space#+7/4stafflinethickness#;
252
253         set_char_box(0, cw#+(h#-3/2staff_space#)/tand(alpha),
254                 -yshift#,yshift# +h#);
255         define_pixels(cw);
256         save x,y;
257         x1=w-stem/6;
258         y1 = yshift + 3.5 staff_space + flare/4 + ballcorrection;
259
260         z2-z1=whatever*dir alpha;
261         y2=stem/2 + yshift;
262         brush(z1,2/3stem,z2,stem);
263         rest_crook (z1,cw);
264         z3-z1=whatever*dir alpha;
265         y3=y1-staff_space;
266         rest_crook (z3,cw);
267         z4-z1=whatever*dir alpha;
268         y4=y1-2staff_space;
269         rest_crook (z4,cw);
270         fet_endchar;
271
272 fet_beginchar("64th rest","6","sixtyfourthrest");
273 %       draw_staff (-2, 2, 0.0);
274         save yshift, ballcorrection;
275         ballcorrection = 0.005 staff_space;
276
277         yshift# := -3 staff_space#;
278         define_pixels(yshift);
279
280         save alpha,cw,h,w;
281         alpha=78;
282         cw#=7/6staff_space#;
283         h#=5/3staff_space#+3staff_space#+7/4stafflinethickness#;
284         w#=cw#+(h#-3/2staff_space#)/tand(alpha);
285         set_char_box(0,w#,-yshift# ,yshift# + h#);
286
287         define_pixels(cw);
288         save x,y;
289         x1=w-stem/6;
290
291         y1 = yshift + 4.5 staff_space + flare/4 + ballcorrection;
292
293         z2-z1=whatever*dir alpha;
294         y2=stem/2 + yshift;
295         brush (z1,2/3stem,z2,stem);
296         rest_crook (z1,cw);
297         z3-z1=whatever*dir alpha;
298         y3=y1-staff_space;
299         rest_crook (z3,cw);
300         z4-z1=whatever*dir alpha;
301         y4=y1-2staff_space;
302         rest_crook (z4,cw);
303         z5-z1=whatever*dir alpha;
304         y5=y1-3staff_space;
305         rest_crook (z5,cw);
306
307         fet_endchar;
308
309 fet_beginchar("128th rest","7","hundredtwentyeighthrest"); 
310 %       draw_staff (-2, 2, 0.0);
311         save yshift, ballcorrection;
312         ballcorrection = 0.005 staff_space;
313
314         yshift# := -3 staff_space#;
315         define_pixels(yshift);
316         save alpha,cw,h,w;
317         alpha=78;
318         cw#=7/6staff_space#;
319         h#=5/3staff_space#+4staff_space#+7/4stafflinethickness#;
320         w#=cw#+(h#-3/2staff_space#)/tand(alpha);
321         set_char_box(0,w#, -yshift#,yshift#  + h#);
322         define_pixels(cw);
323         save x,y;
324         x1=w-stem/6;
325         y1 = yshift + 5.5 staff_space + flare/4 + ballcorrection;
326
327         z2-z1=whatever*dir alpha;
328         y2=stem/2 + yshift;
329         brush (z1,2/3stem,z2,stem);
330         rest_crook (z1,cw);
331         z3-z1=whatever*dir alpha;
332         y3=y1-staff_space;
333         rest_crook (z3,cw);
334         z4-z1=whatever*dir alpha;
335         y4=y1-2staff_space;
336         rest_crook (z4,cw);
337         z5-z1=whatever*dir alpha;
338         y5=y1-3staff_space;
339         rest_crook (z5,cw);
340         z6-z1=whatever*dir alpha;
341         y6=y1-4staff_space;
342         rest_crook (z6,cw);
343         
344         fet_endchar;
345
346 endgroup;
347
348 %%%%%%%%
349 %
350 %
351 %
352 % MENSURAL NOTATION
353 %
354 %
355 %
356
357 % Neo-mensural longa and breve are identical with default longa and breve.
358
359 neomens_block_rest_x# = 2/5 staff_space#;
360 neomens_block_rest_y# = 1/1 staff_space#;
361 neomens_half_block_rest_y# = 5/8 staff_space#;
362
363 define_pixels(neomens_block_rest_x,
364               neomens_block_rest_y, neomens_half_block_rest_y);
365
366 def neomens_half_block_rest =
367         draw_block ((0,0), (neomens_block_rest_x, neomens_half_block_rest_y));
368         enddef;
369
370 fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
371        set_char_box(0, neomens_block_rest_x#,
372                     neomens_block_rest_y#, neomens_block_rest_y#);
373        draw_block ((0,-neomens_block_rest_y),
374                    (neomens_block_rest_x, neomens_block_rest_y));
375 fet_endchar;
376
377 fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
378        set_char_box(0, neomens_block_rest_x#,
379                     0, neomens_block_rest_y#);
380        draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
381 fet_endchar;
382
383 fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
384         set_char_box(0, neomens_block_rest_x#,
385                      neomens_half_block_rest_y#,  0);
386         neomens_half_block_rest;
387         currentpicture :=
388                 currentpicture shifted (0,- neomens_half_block_rest_y);
389 fet_endchar;
390
391 fet_beginchar("Neo-mensural half rest", "1neo_mensural", "neomensminimahalfrest");
392         set_char_box(0, neomens_block_rest_x#,
393                      0, neomens_half_block_rest_y#);
394         neomens_half_block_rest;
395 fet_endchar;
396
397 neomensrestsize# = .8staff_space#;
398
399 fet_beginchar("Neo-mensural 4th rest","2neo_mensural","neomenssemiminimarest")
400         set_char_box(0,neomensrestsize#,0,neomensrestsize#);
401         pickup pencircle scaled 2 stafflinethickness;
402         lft x1 = 0;
403         bot y1 = 0;
404         lft x2 = 0;
405         top y2 = h;
406         rt x3 = w;
407         bot y3 = h/2;
408         draw z1 .. z2;
409         draw z2 .. z3;
410 fet_endchar
411
412 fet_beginchar("Neo-mensural 8th rest","3neo_mensural","neomensfusarest")
413         set_char_box(0,neomensrestsize#,0,neomensrestsize#);
414         pickup pencircle scaled 2 stafflinethickness;
415         rt x1 = w;
416         bot y1 = 0;
417         rt x2 = w;
418         top y2 = h;
419         lft x3 = 0;
420         bot y3 = h/2;
421         draw z1 .. z2;
422         draw z2 .. z3;
423 fet_endchar
424
425 fet_beginchar("Neo-mensural 16th rest","4neo_mensural","neomenssemifusarest")
426         set_char_box(0,neomensrestsize#,0,staff_space#);
427         pickup pencircle scaled 2 stafflinethickness;
428         rt x1 = w;
429         bot y1 = 0;
430         rt x2 = w;
431         top y2 = h;
432
433         draw z1 .. z2;
434
435         pickup pencircle scaled 2 stafflinethickness;
436         rt x3 = w;
437         top y3 = h;
438         lft x4 = 0;
439         bot y4 = h/2;
440         rt x5 = w;
441         top y5 = 5/8h;
442         lft x6 = 0;
443         bot y6 = h/8;
444
445         draw z3 .. z4;
446         draw z5 .. z6;
447 fet_endchar
448
449 pen_width# = 2/5 staff_space#;
450 pen_height# = 0;
451 pen_rotation = 30;
452 slight_pen_rotation = 15;
453
454 mens_block_rest_y# = 1/1 staff_space#;
455 mens_half_block_rest_y# = 5/8 staff_space#;
456
457 define_pixels(mens_block_rest_y, mens_half_block_rest_y,
458               pen_width, pen_height);
459
460 fet_beginchar("Mensural longa rest", "-2mensural", "menslongarest");
461         set_char_box(pen_width#/2, pen_width#/2,
462                      mens_block_rest_y#, mens_block_rest_y#);
463         pickup pencircle
464                 xscaled pen_width
465                 yscaled pen_height
466                 rotated slight_pen_rotation;
467         draw (0, -mens_block_rest_y) -- (0, mens_block_rest_y);
468 fet_endchar;
469
470 fet_beginchar("Mensural breve rest", "-1mensural", "mensbreverest");
471         set_char_box(pen_width#/2, pen_width#/2,
472                      0, mens_block_rest_y#);
473         pickup pencircle
474                 xscaled pen_width
475                 yscaled pen_height
476                 rotated slight_pen_rotation;
477         draw (0, 0) -- (0, mens_block_rest_y);
478 fet_endchar;
479
480 fet_beginchar("Mensural whole rest", "0mensural", "menssemibrevisrest");
481         set_char_box(pen_width#/2, pen_width#/2,
482                      mens_half_block_rest_y#, 0);
483         pickup pencircle
484                 xscaled pen_width
485                 yscaled pen_height
486                 rotated slight_pen_rotation;
487         draw (0, 0) -- (0, -mens_half_block_rest_y);
488 fet_endchar;
489
490 fet_beginchar("Mensural half rest", "1mensural", "mensminimahalfrest");
491         set_char_box(pen_width#/2, pen_width#/2,
492                      0, mens_half_block_rest_y#);
493         pickup pencircle
494                 xscaled pen_width
495                 yscaled pen_height
496                 rotated slight_pen_rotation;
497         draw (0, 0) -- (0, mens_half_block_rest_y);
498 fet_endchar;
499
500 mensrestsize# = .8staff_space#;
501
502 fet_beginchar("Mensural 4th rest","2mensural","menssemiminimarest")
503         set_char_box(0,mensrestsize#,0,mensrestsize#);
504         pickup pencircle
505                 xscaled pen_width
506                 yscaled pen_height
507                 rotated pen_rotation;
508         lft x1 =      0;     y1 = 0;
509         lft x2 =      0; top y2 = 5/8 h;
510         rt  x3 =  4/8 w; bot y3 = 6/8 h;
511         rt  x4 = 10/8 w; bot y4 = 4/8 h;
512         draw z1 -- z2 -- z3 -- z4;
513 fet_endchar
514
515 fet_beginchar("Mensural 8th rest","3mensural","mensfusarest")
516         set_char_box(0,mensrestsize#,0,mensrestsize#);
517         pickup pencircle
518                 xscaled pen_width
519                 yscaled pen_height
520                 rotated pen_rotation;
521         rt  x1 = 10/8 w;     y1 = 0;
522         rt  x2 = 10/8 w; top y2 = 5/8 h;
523         lft x3 =  2/8 w; bot y3 = 6/8 h;
524         lft x4 =      0; bot y4 = 4/8 h;
525         draw z1 -- z2 -- z3 -- z4;
526 fet_endchar
527
528 fet_beginchar("Mensural 16th rest","4mensural","menssemifusarest")
529         set_char_box(0,mensrestsize#,0,staff_space#);
530         pickup pencircle
531                 xscaled pen_width
532                 yscaled pen_height
533                 rotated pen_rotation;
534
535         rt  x1 = 10/8 w;     y1 = 0;
536         rt  x2 = 10/8 w; top y2 = 5.5/8 h;
537         lft x3 =  2/8 w; bot y3 = 6.5/8 h;
538         lft x4 =      0; bot y4 = 4.5/8 h;
539         rt  x5 = 10/8 w; top y5 = 2.5/8 h;
540         lft x6 =  2/8 w; bot y6 = 3.5/8 h;
541         lft x7 =      0; bot y7 = 1.5/8 h;
542         draw z1 -- z2 -- z3 -- z4;
543         draw z5 -- z6 -- z7;
544 fet_endchar
545
546 fet_endgroup("rests")