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.
191 % from an email to Rune Zedeler:
194 % For example, the 8th rest was vaguely based on a book with trumpet
195 % studies by Duhem, and by Baerenreiters cello suites. I included my
196 % findings in a comment in the mf file. One of the things that I tried
197 % to do was make the rest a little lighter and narrower than the black
198 % note head. I think this looks better in polyphonic music, when the
199 % rest is below a head from a different voice.
204 def draw_rest_bulb(expr ycenter, ycut, pat, stretch) =
207 z1l = point 0 of pat;
208 z2l = point 1 of pat;
209 z2r = point 3 of pat;
210 z1r = point 4 of pat;
214 z10 = whatever[z2, z1] + left*bulb_diam*stretch;
217 z3 = z10+bulb_diam/2.15*dir(-72) ;
220 x4 = x10+bulb_diam*.62 ;
221 y4 := ceiling (y10 - 2 stafflinethickness + crook_thin);
223 z5 = z10 + up*bulb_diam/2 + right*stafflinethickness/3;
226 z7 = 0.5 [z4, z5] + (0.45 stafflinethickness,0.4 stafflinethickness);
227 x8 = x10-0.4bulb_diam;
228 y8 = y10 + 0.25 stafflinethickness;
230 z6 = whatever [z1l, z2l];
231 z6 = z3+whatever * dir(12);
233 (pt,whatever) = pat intersectiontimes ((0,ycut)--(w,ycut));
235 fill point pt of pat {-direction pt of pat} .. tension 2
236 .. z4{left} .. tension 0.9 .. z7
237 .. z5{left} .. z8 .. z3{right}
238 .. {curl 0.2} z6 {right} .. tension 10 .. {left} point pt of pat -- cycle;
240 labels(3, 4, 5, 6, 7, 8, 9, 10);
245 def draw_eighth_rest =
246 save width, bulb_diam, thin, thick;
247 save ycenter, crook_thick, crook_thin;
248 save crook_dir, lower_brush, pat;
252 width# := 1.0 staff_space#;
253 bulb_diam# := 0.64 staff_space#;
254 thin# := 1.2 stafflinethickness#;
255 thick# := 2.2 stafflinethickness#;
256 crook_thick# := 1.8 stafflinethickness#;
257 crook_thin := 1.3 stafflinethickness;
259 lower_brush := 1.5 stafflinethickness;
261 define_pixels (width, bulb_diam, thin, thick, crook_thick);
262 set_char_box (0, width#,
263 1.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
269 y2 = h - lower_brush;
271 z2 = z1 + whatever*dir(72);
272 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
273 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
277 draw_rest_bulb(0.5 staff_space , y2r , pat , 1.0);
281 % draw_staff (-2,2,0.0);
285 fet_beginchar("Classical quarter rest","2classical","clasquartrest");
287 currentpicture := currentpicture xscaled -1 shifted (w,0);
290 fet_beginchar("8th rest","3","eighthrest");
294 fet_beginchar("16th rest","4","sixteenthrest");
295 save width, bulb_diam, thin, thick;
296 save ycenter, crook_thick, crook_thin;
297 save crook_dir, lower_brush, pat;
301 width# := 1.2 staff_space#;
302 bulb_diam# := 0.64 staff_space#;
303 thin# := 1.2 stafflinethickness#;
304 thick# := 2.2 stafflinethickness#;
305 crook_thick# := 1.8 stafflinethickness#;
306 crook_thin := 1.3 stafflinethickness;
308 lower_brush := 1.5 stafflinethickness;
310 define_pixels (width, bulb_diam, thin, thick, crook_thick);
311 set_char_box (0, width#,
312 2.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
317 y1 = -2 staff_space ;
318 y2 = h - lower_brush;
320 z2 = z1 + whatever*dir(74);
321 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
322 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
326 draw_rest_bulb(0.5 staff_space , y2r , pat , 0.98);
327 draw_rest_bulb(-0.5 staff_space , (-0.5+0.2)*staff_space , pat , 1.02);
331 % draw_staff (-2,2,0.0);
334 fet_beginchar("32th rest","5","thirtysecondrest");
335 save width, bulb_diam, thin, thick;
336 save ycenter, crook_thick, crook_thin;
337 save crook_dir, lower_brush, pat;
341 width# := 1.3 staff_space#;
342 bulb_diam# := 0.64 staff_space#;
343 thin# := 1.2 stafflinethickness#;
344 thick# := 2.2 stafflinethickness#;
345 crook_thick# := 1.8 stafflinethickness#;
346 crook_thin := 1.3 stafflinethickness;
348 lower_brush := 1.5 stafflinethickness;
350 define_pixels (width, bulb_diam, thin, thick, crook_thick);
351 set_char_box (0, width#,
352 2.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
357 y1 = -2 staff_space ;
358 y2 = h - lower_brush;
360 z2 = z1 + whatever*dir(76);
361 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
362 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
366 draw_rest_bulb(1.5 staff_space , y2r , pat , 0.96);
367 draw_rest_bulb(0.5 staff_space , (0.5+0.2)*staff_space , pat , 1.00);
368 draw_rest_bulb(-0.5 staff_space , (-0.5+0.21)*staff_space , pat , 1.04);
372 % draw_staff (-2,2,0.0);
375 fet_beginchar("64th rest","6","sixtyfourthrest");
376 save width, bulb_diam, thin, thick;
377 save ycenter, crook_thick, crook_thin;
378 save crook_dir, lower_brush, pat;
382 width# := 1.4 staff_space#;
383 bulb_diam# := 0.64 staff_space#;
384 thin# := 1.2 stafflinethickness#;
385 thick# := 2.2 stafflinethickness#;
386 crook_thick# := 1.8 stafflinethickness#;
387 crook_thin := 1.3 stafflinethickness;
389 lower_brush := 1.5 stafflinethickness;
391 define_pixels (width, bulb_diam, thin, thick, crook_thick);
392 set_char_box (0, width#,
393 3.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
398 y1 = -3 staff_space ;
399 y2 = h - lower_brush;
401 z2 = z1 + whatever*dir(78);
402 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
403 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
407 draw_rest_bulb(1.5 staff_space , y2r , pat , 0.94);
408 draw_rest_bulb(0.5 staff_space , (0.5+0.20)*staff_space , pat , 0.98);
409 draw_rest_bulb(-0.5 staff_space , (-0.5+0.21)*staff_space , pat , 1.02);
410 draw_rest_bulb(-1.5 staff_space , (-1.5+0.22)*staff_space , pat , 1.06);
414 % draw_staff (-2,2,0.0);
417 fet_beginchar("128th rest","7","hundredtwentyeighthrest");
418 save width, bulb_diam, thin, thick;
419 save ycenter, crook_thick, crook_thin;
420 save crook_dir, lower_brush, pat;
424 width# = 1.5 staff_space#;
425 bulb_diam# := 0.64 staff_space#;
426 thin# := 1.2 stafflinethickness#;
427 thick# := 2.2 stafflinethickness#;
428 crook_thick# := 1.8 stafflinethickness#;
429 crook_thin := 1.3 stafflinethickness;
431 lower_brush := 1.5 stafflinethickness;
433 define_pixels (width, bulb_diam, thin, thick, crook_thick);
434 set_char_box (0, width#,
435 3.0 staff_space# + 0.5 stafflinethickness#, 2.5 staff_space# + bulb_diam#/2);
440 y1 = -3 staff_space ;
441 y2 = h - lower_brush;
443 z2 = z1 + whatever*dir(80);
444 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
445 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
449 draw_rest_bulb(2.5 staff_space , y2r , pat , 0.92);
450 draw_rest_bulb(1.5 staff_space , (1.5+0.20)*staff_space , pat , 0.96);
451 draw_rest_bulb(0.5 staff_space , (0.5+0.21)*staff_space , pat , 1.0);
452 draw_rest_bulb(-0.5 staff_space , (-0.5+0.22)*staff_space , pat , 1.04);
453 draw_rest_bulb(-1.5 staff_space , (-1.5+0.23)*staff_space , pat , 1.08);
457 % draw_staff (-2,2,0.0);
473 % Neo-mensural longa and breve are identical with default longa and breve.
475 neomens_block_rest_x# = 2/5 staff_space#;
476 neomens_block_rest_y# = 1/1 staff_space#;
477 neomens_half_block_rest_y# = 5/8 staff_space#;
479 define_pixels(neomens_block_rest_x,
480 neomens_block_rest_y, neomens_half_block_rest_y);
482 def neomens_half_block_rest =
483 draw_block ((0,0), (neomens_block_rest_x, neomens_half_block_rest_y));
486 fet_beginchar("Neo-mensural maxima rest", "-3neo_mensural", "neomensmaximarest");
487 set_char_box(0, neomens_block_rest_x#,
488 neomens_block_rest_y#, 2 neomens_block_rest_y#);
489 draw_block ((0,-neomens_block_rest_y),
490 (neomens_block_rest_x, 2 neomens_block_rest_y));
493 fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
494 set_char_box(0, neomens_block_rest_x#,
495 neomens_block_rest_y#, neomens_block_rest_y#);
496 draw_block ((0,-neomens_block_rest_y),
497 (neomens_block_rest_x, neomens_block_rest_y));
500 fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
501 set_char_box(0, neomens_block_rest_x#,
502 0, neomens_block_rest_y#);
503 draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
506 fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
507 set_char_box(0, neomens_block_rest_x#,
508 neomens_half_block_rest_y#, 0);
509 neomens_half_block_rest;
511 currentpicture shifted (0,- neomens_half_block_rest_y);
514 fet_beginchar("Neo-mensural half rest", "1neo_mensural", "neomensminimahalfrest");
515 set_char_box(0, neomens_block_rest_x#,
516 0, neomens_half_block_rest_y#);
517 neomens_half_block_rest;
520 neomensrestsize# = .8staff_space#;
522 fet_beginchar("Neo-mensural 4th rest","2neo_mensural","neomenssemiminimarest")
523 set_char_box(0,neomensrestsize#,0,neomensrestsize#);
524 pickup pencircle scaled 2 stafflinethickness;
535 fet_beginchar("Neo-mensural 8th rest","3neo_mensural","neomensfusarest")
536 set_char_box(0,neomensrestsize#,0,neomensrestsize#);
537 pickup pencircle scaled 2 stafflinethickness;
548 fet_beginchar("Neo-mensural 16th rest","4neo_mensural","neomenssemifusarest")
549 set_char_box(0,neomensrestsize#,0,staff_space#);
550 pickup pencircle scaled 2 stafflinethickness;
558 pickup pencircle scaled 2 stafflinethickness;
573 fet_endgroup("rests")