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);
98 fet_beginchar("maxima rest", "-3", "maximarest");
99 set_char_box(0, 3 breve_rest_x#, breve_rest_y#, breve_rest_y#);
100 draw_block ((0,-floor (breve_rest_y)), (breve_rest_x, floor (breve_rest_y)));
101 addto currentpicture also currentpicture shifted (2 breve_rest_x, 0);
104 fet_beginchar("longa rest", "-2", "longarest");
105 set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
106 draw_block ((0,-floor (breve_rest_y)), (breve_rest_x, floor (breve_rest_y)));
109 fet_beginchar("breve rest", "-1", "breverest");
110 set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
111 draw_block ((0,0), (breve_rest_x, floor (breve_rest_y)));
115 tracingvariables := 1;
117 fet_beginchar("Quarter rest","2","quartrest");
118 % draw_staff (-2, 2, 0.0);
119 save alpha, yshift, height;
121 yshift# = -1.25 staff_space#;
122 height# = 2.8125 staff_space#;
123 define_pixels (yshift, height);
125 xcenter = -0.1 staff_space;
127 set_char_box(0, 0.95 staff_space#,
131 save ne,nw,se,sw; pair ne,nw,se,sw;
133 se=dir alpha; nw=dir (alpha+180);
134 ne=dir (alpha+90); sw=dir (alpha-90);
135 penpos1(rthin,alpha+90);
136 penpos2(5/4rthick,alpha);
137 penpos4(5/4rthick,alpha);
138 penpos5(rthin,alpha+90);
139 penpos3(3/4rthick,alpha);
140 % penpos6(5/8rthick,alpha);
141 penpos6(2/3rthick,alpha);
142 penpos7(1/2rthin,alpha+90);
145 % z11=z4l+1/2rthin*sw;
146 z11=z4l+1/2rthin*sw+1/2rthin*se;
148 % z13=z2r+1/2rthin*ne;
149 z13=z2r+1/2rthin*ne+1/2rthin*nw;
152 x1l=xcenter + 1/3staff_space;
153 z2r=z1+staff_space*se;
155 x4= xcenter + 3/8staff_space;
157 z5=z4l+1.3staff_space*se;
160 x7= xcenter + 2/5staff_space;
163 fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
164 fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
165 penlabels(1,2,3,4,5,6,7);
166 penlabels(10,11,12,13);
168 % 3/4 staff_space# + yshift#,
169 % 18/5staff_space# + yshift#)
173 def rest_crook(expr a, w) =
174 balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
178 % Notes about 8th rest:
180 % * 8th rest should be no wider than the black note head
182 % * The inside corner of the horizontal portion is usually a little blotted.
184 % * The top of the crook chops off the vertical brush
186 % * The crook widens a little
188 % * The bottom of the brush is slightly flat, as it has to align with
189 % stafflines if it is inside the staff.
191 % * The top of the brush usually is a little lower than the top of bulb.
193 % * The bulb can vary. Sometimes it is open (like in the clefs). Sometimes
194 % it is closed, or even a flare.
197 % from an email to Rune Zedeler:
200 % For example, the 8th rest was vaguely based on a book with trumpet
201 % studies by Duhem, and by Baerenreiters cello suites. I included my
202 % findings in a comment in the mf file. One of the things that I tried
203 % to do was make the rest a little lighter and narrower than the black
204 % note head. I think this looks better in polyphonic music, when the
205 % rest is below a head from a different voice.
210 def draw_rest_bulb(expr ycenter, ycut, pat, stretch) =
213 z1l = point 0 of pat;
214 z2l = point 1 of pat;
215 z2r = point 3 of pat;
216 z1r = point 4 of pat;
220 z10 = whatever[z2, z1] + left*bulb_diam*stretch;
223 z3 = z10+bulb_diam/2.15*dir(-72) ;
226 x4 = x10+bulb_diam*.62 ;
227 y4 := ceiling (y10 - 2 stafflinethickness + crook_thin);
229 z5 = z10 + up*bulb_diam/2 + right*stafflinethickness/3;
232 z7 = 0.5 [z4, z5] + (0.45 stafflinethickness,0.4 stafflinethickness);
233 x8 = x10-0.4bulb_diam;
234 y8 = y10 + 0.25 stafflinethickness;
236 z6 = whatever [z1l, z2l];
237 z6 = z3+whatever * dir(12);
239 (pt,whatever) = pat intersectiontimes ((0,ycut)--(w,ycut));
241 fill point pt of pat {-direction pt of pat} .. tension 2
242 .. z4{left} .. tension 0.9 .. z7
243 .. z5{left} .. z8 .. z3{right}
244 .. {curl 0.2} z6 {right} .. tension 10 .. {left} point pt of pat -- cycle;
246 labels(3, 4, 5, 6, 7, 8, 9, 10);
251 def draw_eighth_rest =
252 save width, bulb_diam, thin, thick;
253 save ycenter, crook_thick, crook_thin;
254 save crook_dir, lower_brush, pat;
258 width# := 1.0 staff_space#;
259 bulb_diam# := 0.64 staff_space#;
260 thin# := 1.2 stafflinethickness#;
261 thick# := 2.2 stafflinethickness#;
262 crook_thick# := 1.8 stafflinethickness#;
263 crook_thin := 1.3 stafflinethickness;
265 lower_brush := 1.5 stafflinethickness;
267 define_pixels (width, bulb_diam, thin, thick, crook_thick);
268 set_char_box (0, width#,
269 1.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
275 y2 = h - lower_brush;
277 z2 = z1 + whatever*dir(72);
278 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
279 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
283 draw_rest_bulb(0.5 staff_space , y2r , pat , 1.0);
287 % draw_staff (-2,2,0.0);
291 fet_beginchar("Classical quarter rest","2classical","clasquartrest");
293 currentpicture := currentpicture xscaled -1 shifted (w,0);
296 fet_beginchar("8th rest","3","eighthrest");
300 fet_beginchar("16th rest","4","sixteenthrest");
301 save width, bulb_diam, thin, thick;
302 save ycenter, crook_thick, crook_thin;
303 save crook_dir, lower_brush, pat;
307 width# := 1.2 staff_space#;
308 bulb_diam# := 0.64 staff_space#;
309 thin# := 1.2 stafflinethickness#;
310 thick# := 2.2 stafflinethickness#;
311 crook_thick# := 1.8 stafflinethickness#;
312 crook_thin := 1.3 stafflinethickness;
314 lower_brush := 1.5 stafflinethickness;
316 define_pixels (width, bulb_diam, thin, thick, crook_thick);
317 set_char_box (0, width#,
318 2.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
323 y1 = -2 staff_space ;
324 y2 = h - lower_brush;
326 z2 = z1 + whatever*dir(74);
327 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
328 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
332 draw_rest_bulb(0.5 staff_space , y2r , pat , 0.98);
333 draw_rest_bulb(-0.5 staff_space , (-0.5+0.2)*staff_space , pat , 1.02);
337 % draw_staff (-2,2,0.0);
340 fet_beginchar("32th rest","5","thirtysecondrest");
341 save width, bulb_diam, thin, thick;
342 save ycenter, crook_thick, crook_thin;
343 save crook_dir, lower_brush, pat;
347 width# := 1.3 staff_space#;
348 bulb_diam# := 0.64 staff_space#;
349 thin# := 1.2 stafflinethickness#;
350 thick# := 2.2 stafflinethickness#;
351 crook_thick# := 1.8 stafflinethickness#;
352 crook_thin := 1.3 stafflinethickness;
354 lower_brush := 1.5 stafflinethickness;
356 define_pixels (width, bulb_diam, thin, thick, crook_thick);
357 set_char_box (0, width#,
358 2.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
363 y1 = -2 staff_space ;
364 y2 = h - lower_brush;
366 z2 = z1 + whatever*dir(76);
367 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
368 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
372 draw_rest_bulb(1.5 staff_space , y2r , pat , 0.96);
373 draw_rest_bulb(0.5 staff_space , (0.5+0.2)*staff_space , pat , 1.00);
374 draw_rest_bulb(-0.5 staff_space , (-0.5+0.21)*staff_space , pat , 1.04);
378 % draw_staff (-2,2,0.0);
381 fet_beginchar("64th rest","6","sixtyfourthrest");
382 save width, bulb_diam, thin, thick;
383 save ycenter, crook_thick, crook_thin;
384 save crook_dir, lower_brush, pat;
388 width# := 1.4 staff_space#;
389 bulb_diam# := 0.64 staff_space#;
390 thin# := 1.2 stafflinethickness#;
391 thick# := 2.2 stafflinethickness#;
392 crook_thick# := 1.8 stafflinethickness#;
393 crook_thin := 1.3 stafflinethickness;
395 lower_brush := 1.5 stafflinethickness;
397 define_pixels (width, bulb_diam, thin, thick, crook_thick);
398 set_char_box (0, width#,
399 3.0 staff_space# + 0.5 stafflinethickness#, 1.5 staff_space# + bulb_diam#/2);
404 y1 = -3 staff_space ;
405 y2 = h - lower_brush;
407 z2 = z1 + whatever*dir(78);
408 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
409 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
413 draw_rest_bulb(1.5 staff_space , y2r , pat , 0.94);
414 draw_rest_bulb(0.5 staff_space , (0.5+0.20)*staff_space , pat , 0.98);
415 draw_rest_bulb(-0.5 staff_space , (-0.5+0.21)*staff_space , pat , 1.02);
416 draw_rest_bulb(-1.5 staff_space , (-1.5+0.22)*staff_space , pat , 1.06);
420 % draw_staff (-2,2,0.0);
423 fet_beginchar("128th rest","7","hundredtwentyeighthrest");
424 save width, bulb_diam, thin, thick;
425 save ycenter, crook_thick, crook_thin;
426 save crook_dir, lower_brush, pat;
430 width# = 1.5 staff_space#;
431 bulb_diam# := 0.64 staff_space#;
432 thin# := 1.2 stafflinethickness#;
433 thick# := 2.2 stafflinethickness#;
434 crook_thick# := 1.8 stafflinethickness#;
435 crook_thin := 1.3 stafflinethickness;
437 lower_brush := 1.5 stafflinethickness;
439 define_pixels (width, bulb_diam, thin, thick, crook_thick);
440 set_char_box (0, width#,
441 3.0 staff_space# + 0.5 stafflinethickness#, 2.5 staff_space# + bulb_diam#/2);
446 y1 = -3 staff_space ;
447 y2 = h - lower_brush;
449 z2 = z1 + whatever*dir(80);
450 z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
451 pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
455 draw_rest_bulb(2.5 staff_space , y2r , pat , 0.92);
456 draw_rest_bulb(1.5 staff_space , (1.5+0.20)*staff_space , pat , 0.96);
457 draw_rest_bulb(0.5 staff_space , (0.5+0.21)*staff_space , pat , 1.0);
458 draw_rest_bulb(-0.5 staff_space , (-0.5+0.22)*staff_space , pat , 1.04);
459 draw_rest_bulb(-1.5 staff_space , (-1.5+0.23)*staff_space , pat , 1.08);
463 % draw_staff (-2,2,0.0);
479 % Neo-mensural longa and breve are identical with default longa and breve.
481 neomens_block_rest_x# = 2/5 staff_space#;
482 neomens_block_rest_y# = 1/1 staff_space#;
483 neomens_half_block_rest_y# = 5/8 staff_space#;
485 define_pixels(neomens_block_rest_x,
486 neomens_block_rest_y, neomens_half_block_rest_y);
488 def neomens_half_block_rest =
489 draw_block ((0,0), (neomens_block_rest_x, neomens_half_block_rest_y));
492 fet_beginchar("Neo-mensural maxima rest", "-3neo_mensural", "neomensmaximarest");
493 set_char_box(0, neomens_block_rest_x#,
494 neomens_block_rest_y#, 2 neomens_block_rest_y#);
495 draw_block ((0,-neomens_block_rest_y),
496 (neomens_block_rest_x, 2 neomens_block_rest_y));
499 fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
500 set_char_box(0, neomens_block_rest_x#,
501 neomens_block_rest_y#, neomens_block_rest_y#);
502 draw_block ((0,-neomens_block_rest_y),
503 (neomens_block_rest_x, neomens_block_rest_y));
506 fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
507 set_char_box(0, neomens_block_rest_x#,
508 0, neomens_block_rest_y#);
509 draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
512 fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
513 set_char_box(0, neomens_block_rest_x#,
514 neomens_half_block_rest_y#, 0);
515 neomens_half_block_rest;
517 currentpicture shifted (0,- neomens_half_block_rest_y);
520 fet_beginchar("Neo-mensural half rest", "1neo_mensural", "neomensminimahalfrest");
521 set_char_box(0, neomens_block_rest_x#,
522 0, neomens_half_block_rest_y#);
523 neomens_half_block_rest;
526 neomensrestsize# = 0.8 staff_space#;
528 fet_beginchar("Neo-mensural 4th rest","2neo_mensural","neomenssemiminimarest")
529 set_char_box(0,neomensrestsize#,0,neomensrestsize#);
530 pickup pencircle scaled 2 stafflinethickness;
541 fet_beginchar("Neo-mensural 8th rest","3neo_mensural","neomensfusarest")
542 set_char_box(0,neomensrestsize#,0,neomensrestsize#);
543 pickup pencircle scaled 2 stafflinethickness;
554 fet_beginchar("Neo-mensural 16th rest","4neo_mensural","neomenssemifusarest")
555 set_char_box(0,neomensrestsize#,0,staff_space#);
556 pickup pencircle scaled 2 stafflinethickness;
564 pickup pencircle scaled 2 stafflinethickness;
579 fet_endgroup("rests")