1 % feta-eindelijk.mf -- implement rest symbols -*-Fundamental-*-
3 % part of LilyPond's pretty-but-neat music font
5 % source file of the Feta (not the Font-En-Tja) music font
7 % (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
9 fet_begingroup("rests");
13 thick#:=1/16designsize;
14 define_blacker_pixels(thick);
16 rthin:=1/8*staff_space;
20 def shift_pic (expr pone, ptwo) =
21 currentpicture:=currentpicture shifted (round(pone),round(ptwo))
24 % stuff for 8th,16th etc rests
26 save stem, ball_crook_stem, ball_crook_balldiam, flare;
28 % stem#:=1/8*staff_space#;
29 stem# = 1/5staff_space#;
30 % flare# = 2/3staff_space#;
31 flare# = 2/3staff_space# - 1/8stafflinethickness#;
33 define_pixels(stem,flare);
35 ball_crook_stem = stem;
36 ball_crook_balldiam =flare;
39 save block_rest_y, block_rest_x;
41 save breve_rest_y, breve_rest_x;
43 breve_rest_y# = staff_space#;
44 breve_rest_x# = 3/5 staff_space#;
45 block_rest_y# = 5/8 staff_space#;
46 block_rest_x# = 3/2 staff_space#;
48 define_pixels(block_rest_y, block_rest_x);
51 draw_block ((0,0), (block_rest_x, block_rest_y));
54 fet_beginchar( "whole rest", "0", "wholerest");
55 set_char_box(0, block_rest_x#,
58 currentpicture := currentpicture shifted (0,- block_rest_y);
61 fet_beginchar("half rest", "1", "halfrest");
62 set_char_box(0, block_rest_x#, 0, block_rest_y#);
68 % should use ledgerline thickness?
70 fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
71 set_char_box(0, block_rest_x#,
72 block_rest_y#, ledgerlinethickness#/2);
74 currentpicture := currentpicture shifted (0, - block_rest_y);
75 pickup pencircle scaled ledgerlinethickness;
78 lft x5 = - b - block_rest_y;
79 rt x6 = w + block_rest_y;
80 draw_gridline(z5,z6,ledgerlinethickness);
83 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
84 set_char_box(0, block_rest_x#,
85 ledgerlinethickness#/2, block_rest_y#);
87 pickup pencircle scaled ledgerlinethickness;
89 lft x5 = - b - block_rest_y ;
90 rt x6 = w + block_rest_y;
91 draw_gridline (z5,z6,ledgerlinethickness);
96 define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height);
99 fet_beginchar("longa rest", "-2", "longarest");
100 set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
101 draw_block ((0,-floor (breve_rest_y)), (breve_rest_x, floor (breve_rest_y)));
104 fet_beginchar("breve rest", "-1", "breverest");
105 set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
106 draw_block ((0,0), (breve_rest_x, floor (breve_rest_y)));
109 tracingvariables := 1;
111 fet_beginchar("Quarter rest","2","quartrest");
112 % draw_staff (-2, 2, 0.0);
113 save alpha, yshift, height;
115 yshift# = -1.25 staff_space#;
116 height# = 2.8125 staff_space#;
117 define_pixels (yshift, height);
119 xcenter = -0.1 staff_space;
121 set_char_box(0, 0.95 staff_space#,
125 save ne,nw,se,sw; pair ne,nw,se,sw;
127 se=dir alpha; nw=dir (alpha+180);
128 ne=dir (alpha+90); sw=dir (alpha-90);
129 penpos1(rthin,alpha+90);
130 penpos2(5/4rthick,alpha);
131 penpos4(5/4rthick,alpha);
132 penpos5(rthin,alpha+90);
133 penpos3(3/4rthick,alpha);
134 % penpos6(5/8rthick,alpha);
135 penpos6(2/3rthick,alpha);
136 penpos7(1/2rthin,alpha+90);
139 % z11=z4l+1/2rthin*sw;
140 z11=z4l+1/2rthin*sw+1/2rthin*se;
142 % z13=z2r+1/2rthin*ne;
143 z13=z2r+1/2rthin*ne+1/2rthin*nw;
146 x1l=xcenter + 1/3staff_space;
147 z2r=z1+staff_space*se;
149 x4= xcenter + 3/8staff_space;
151 z5=z4l+1.3staff_space*se;
154 x7= xcenter + 2/5staff_space;
157 fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
158 fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
159 penlabels(1,2,3,4,5,6,7);
160 penlabels(10,11,12,13);
162 % 3/4 staff_space# + yshift#,
163 % 18/5staff_space# + yshift#)
167 def rest_crook(expr a, w) =
168 balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
172 % Notes about 8th rest:
174 % * 8th rest should be no wider than the black note head
176 % * The inside corner of the horizontal portion is usually a little blotted.
178 % * The top of the crook chops off the vertical brush
180 % * The crook widens a little
182 % * The bottom of the brush is slightly flat, as it has to align with
183 % stafflines if it is inside the staff.
185 % * The top of the brush usually is a little lower than the top of bulb.
187 % * The bulb can vary. Sometimes it is open (like in the clefs). Sometimes
188 % it is closed, or even a flare.
192 def draw_rest_bulb(expr ycenter, ycut, pat, stretch) =
195 z1l = point 0 of pat;
196 z2l = point 1 of pat;
197 z2r = point 3 of pat;
198 z1r = point 4 of pat;
202 z10 = whatever[z2, z1] + left*bulb_diam*stretch;
205 z3 = z10+bulb_diam/2.15*dir(-72) ;
208 x4 = x10+bulb_diam*.62 ;
209 y4 := ceiling (y10 - 2 stafflinethickness + crook_thin);
211 z5 = z10 + up*bulb_diam/2 + right*stafflinethickness/3;
214 z7 = 0.5 [z4, z5] + (0.45 stafflinethickness,0.4 stafflinethickness);
215 x8 = x10-0.4bulb_diam;
216 y8 = y10 + 0.25 stafflinethickness;
218 z6 = whatever [z1l, z2l];
219 z6 = z3+whatever * dir(12);
221 (pt,whatever) = pat intersectiontimes ((0,ycut)--(w,ycut));
223 fill point pt of pat {-direction pt of pat} .. tension 2
224 .. z4{left} .. tension 0.9 .. z7
225 .. z5{left} .. z8 .. z3{right}
226 .. {curl 0.2} z6 {right} .. tension 10 .. {left} point pt of pat -- cycle;
228 labels(3, 4, 5, 6, 7, 8, 9, 10);
233 def draw_eighth_rest =
234 save width, bulb_diam, thin, thick;
235 save ycenter, crook_thick, crook_thin;
236 save crook_dir, lower_brush, pat;
240 width# := 1.0 staff_space#;
241 bulb_diam# := 0.64 staff_space#;
242 thin# := 1.2 stafflinethickness#;
243 thick# := 2.2 stafflinethickness#;
244 crook_thick# := 1.8 stafflinethickness#;
245 crook_thin := 1.3 stafflinethickness;
247 lower_brush := 1.5 stafflinethickness;
249 define_pixels (width, bulb_diam, thin, thick, crook_thick);
250 set_char_box (0, width#,
251 1.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
257 y2 = h - lower_brush;
259 z2 = z1 + whatever*dir(75);
260 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
261 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
265 draw_rest_bulb(0.5 staff_space , y2r , pat , 1.0);
269 % draw_staff (-2,2,0.0);
273 fet_beginchar("8th rest","3","eighthrest");
277 fet_beginchar("Classical quarter rest","2classical","clasquartrest");
279 currentpicture := currentpicture xscaled -1 shifted (w,0);
282 fet_beginchar("16th rest","4","sixteenthrest");
283 save width, bulb_diam, thin, thick;
284 save ycenter, crook_thick, crook_thin;
285 save crook_dir, lower_brush, pat;
289 width# := 1.25 staff_space#;
290 bulb_diam# := 0.64 staff_space#;
291 thin# := 1.2 stafflinethickness#;
292 thick# := 2.2 stafflinethickness#;
293 crook_thick# := 1.8 stafflinethickness#;
294 crook_thin := 1.3 stafflinethickness;
296 lower_brush := 2.5 stafflinethickness;
298 define_pixels (width, bulb_diam, thin, thick, crook_thick);
299 set_char_box (0, width#,
300 2.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
305 y1 = -2 staff_space ;
306 y2 = h - lower_brush;
308 z2 = z1 + whatever*dir(75.5);
309 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
310 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
314 draw_rest_bulb(0.5 staff_space , y2r , pat , 0.98);
315 draw_rest_bulb(-0.5 staff_space , (-0.5+0.12)*staff_space , pat , 1.02);
319 % draw_staff (-2,2,0.0);
322 fet_beginchar("32th rest","5","thirtysecondrest");
323 save width, bulb_diam, thin, thick;
324 save ycenter, crook_thick, crook_thin;
325 save crook_dir, lower_brush, pat;
329 width# := 1.5 staff_space#;
330 bulb_diam# := 0.64 staff_space#;
331 thin# := 1.2 stafflinethickness#;
332 thick# := 2.2 stafflinethickness#;
333 crook_thick# := 1.8 stafflinethickness#;
334 crook_thin := 1.3 stafflinethickness;
336 lower_brush := 2.5 stafflinethickness;
338 define_pixels (width, bulb_diam, thin, thick, crook_thick);
339 set_char_box (0, width#,
340 2.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
345 y1 = -2 staff_space ;
346 y2 = h - lower_brush;
348 z2 = z1 + whatever*dir(76);
349 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
350 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
354 draw_rest_bulb(1.5 staff_space , y2r , pat , 0.96);
355 draw_rest_bulb(0.5 staff_space , (0.5+0.12)*staff_space , pat , 1.00);
356 draw_rest_bulb(-0.5 staff_space , (-0.5+0.13)*staff_space , pat , 1.04);
360 % draw_staff (-2,2,0.0);
363 fet_beginchar("64th rest","6","sixtyfourthrest");
364 save width, bulb_diam, thin, thick;
365 save ycenter, crook_thick, crook_thin;
366 save crook_dir, lower_brush, pat;
370 width# := 1.75 staff_space#;
371 bulb_diam# := 0.64 staff_space#;
372 thin# := 1.2 stafflinethickness#;
373 thick# := 2.2 stafflinethickness#;
374 crook_thick# := 1.8 stafflinethickness#;
375 crook_thin := 1.3 stafflinethickness;
377 lower_brush := 2.5 stafflinethickness;
379 define_pixels (width, bulb_diam, thin, thick, crook_thick);
380 set_char_box (0, width#,
381 3.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
386 y1 = -3 staff_space ;
387 y2 = h - lower_brush;
389 z2 = z1 + whatever*dir(76.5);
390 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
391 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
395 draw_rest_bulb(1.5 staff_space , y2r , pat , 0.94);
396 draw_rest_bulb(0.5 staff_space , (0.5+0.12)*staff_space , pat , 0.98);
397 draw_rest_bulb(-0.5 staff_space , (-0.5+0.13)*staff_space , pat , 1.02);
398 draw_rest_bulb(-1.5 staff_space , (-1.5+0.14)*staff_space , pat , 1.06);
402 % draw_staff (-2,2,0.0);
405 fet_beginchar("128th rest","7","hundredtwentyeighthrest");
406 save width, bulb_diam, thin, thick;
407 save ycenter, crook_thick, crook_thin;
408 save crook_dir, lower_brush, pat;
412 width# := 2.0 staff_space#;
413 bulb_diam# := 0.64 staff_space#;
414 thin# := 1.2 stafflinethickness#;
415 thick# := 2.2 stafflinethickness#;
416 crook_thick# := 1.8 stafflinethickness#;
417 crook_thin := 1.3 stafflinethickness;
419 lower_brush := 2.5 stafflinethickness;
421 define_pixels (width, bulb_diam, thin, thick, crook_thick);
422 set_char_box (0, width#,
423 3.0 staff_space# + 0.5 stafflinethickness#, 2.5 staff_space# + bulb_diam#/2);
428 y1 = -3 staff_space ;
429 y2 = h - lower_brush;
431 z2 = z1 + whatever*dir(77);
432 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
433 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
437 draw_rest_bulb(2.5 staff_space , y2r , pat , 0.92);
438 draw_rest_bulb(1.5 staff_space , (1.5+0.12)*staff_space , pat , 0.96);
439 draw_rest_bulb(0.5 staff_space , (0.5+0.13)*staff_space , pat , 1.0);
440 draw_rest_bulb(-0.5 staff_space , (-0.5+0.14)*staff_space , pat , 1.04);
441 draw_rest_bulb(-1.5 staff_space , (-1.5+0.15)*staff_space , pat , 1.08);
445 % draw_staff (-2,2,0.0);
461 % Neo-mensural longa and breve are identical with default longa and breve.
463 neomens_block_rest_x# = 2/5 staff_space#;
464 neomens_block_rest_y# = 1/1 staff_space#;
465 neomens_half_block_rest_y# = 5/8 staff_space#;
467 define_pixels(neomens_block_rest_x,
468 neomens_block_rest_y, neomens_half_block_rest_y);
470 def neomens_half_block_rest =
471 draw_block ((0,0), (neomens_block_rest_x, neomens_half_block_rest_y));
474 fet_beginchar("Neo-mensural maxima rest", "-3neo_mensural", "neomensmaximarest");
475 set_char_box(0, neomens_block_rest_x#,
476 neomens_block_rest_y#, 2 neomens_block_rest_y#);
477 draw_block ((0,-neomens_block_rest_y),
478 (neomens_block_rest_x, 2 neomens_block_rest_y));
481 fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
482 set_char_box(0, neomens_block_rest_x#,
483 neomens_block_rest_y#, neomens_block_rest_y#);
484 draw_block ((0,-neomens_block_rest_y),
485 (neomens_block_rest_x, neomens_block_rest_y));
488 fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
489 set_char_box(0, neomens_block_rest_x#,
490 0, neomens_block_rest_y#);
491 draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
494 fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
495 set_char_box(0, neomens_block_rest_x#,
496 neomens_half_block_rest_y#, 0);
497 neomens_half_block_rest;
499 currentpicture shifted (0,- neomens_half_block_rest_y);
502 fet_beginchar("Neo-mensural half rest", "1neo_mensural", "neomensminimahalfrest");
503 set_char_box(0, neomens_block_rest_x#,
504 0, neomens_half_block_rest_y#);
505 neomens_half_block_rest;
508 neomensrestsize# = .8staff_space#;
510 fet_beginchar("Neo-mensural 4th rest","2neo_mensural","neomenssemiminimarest")
511 set_char_box(0,neomensrestsize#,0,neomensrestsize#);
512 pickup pencircle scaled 2 stafflinethickness;
523 fet_beginchar("Neo-mensural 8th rest","3neo_mensural","neomensfusarest")
524 set_char_box(0,neomensrestsize#,0,neomensrestsize#);
525 pickup pencircle scaled 2 stafflinethickness;
536 fet_beginchar("Neo-mensural 16th rest","4neo_mensural","neomenssemifusarest")
537 set_char_box(0,neomensrestsize#,0,staff_space#);
538 pickup pencircle scaled 2 stafflinethickness;
546 pickup pencircle scaled 2 stafflinethickness;
561 fet_endgroup("rests")