balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
enddef;
+%
+%
+% todo: document rest.
+%
+
+
def draw_eighth_rest =
-% draw_staff (-2, 2, 0.0);
- save yshift, ballcorrection;
- ballcorrection = 0.005 staff_space;
+ save width, bulb_diam, thin, thick;
+ save ycenter, crook_thick;
+ save crook_dir;
+ pair crook_dir;
- yshift# := -1.0 staff_space#;
- define_pixels(yshift);
+ width# := 1.0 staff_space#;
+ bulb_diam# := 0.6 staff_space#;
+ thin# := 1.0 stafflinethickness#;
+ thick# := 2.0 stafflinethickness#;
+ crook_thick# := 1.6 stafflinethickness#;
- set_char_box(0, 4/3staff_space#, -yshift#, yshift# +
- 5/3staff_space#+7/4stafflinethickness#);
+ ycenter := 0.5 staff_space;
- %
- % The curve is like a valley causing less space between
- % the curve and the lower staff line. Correct for this.
- %
- save x,y;
+ define_pixels (width, bulb_diam, thin, thick, crook_thick);
+ set_char_box (0, width#,
+ 1.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
- x1=w-stem/6;
+ penpos1 (thick, 0);
+ penpos2 (thin, 0);
- y1 = yshift + 1.5 staff_space + flare/4 + ballcorrection;
- rest_crook (z1,w-stem/6);
- z2-z1=whatever*dir70;
- y2= yshift + stem/2;
- brush(z1,2/3stem,z2,stem);
-enddef;
+ y1 = ycenter + - 1.5 staff_space ;
+ y2 = y5 - 2.0 stafflinethickness;
+ x2r = width;
+
+ y3 - y2l = 0.25 staff_space;
+ x2r - x1 = 0.5 staff_space;
+
+ x3 = x1l ;
+ y3 := ycenter +floor (- bulb_diam/2);
+
+ x4 = 1.02 bulb_diam ;
+ y4 = ycenter - stafflinethickness;
+
+ x5 = 0.5 bulb_diam;
+ y5 = ycenter +bulb_diam/2;
+
+ crook_dir = (z2l - z4) / length(z2l - z4);
+
+ z6 = whatever [z1l, z2l];
+ z6 = whatever [z2l, z4] + crook_thick * (crook_dir rotated -90);
+
+ z7 = (bulb_diam/2,ycenter) + 0.26 staff_space * dir ( 35);
+ z8 = (0, ycenter);
+
+ z9 = z2 + 0.46 stafflinethickness * dir (angle(z2 - z1)- 10);
+
+ penlabels (1, 2);
+ labels(3, 4, 5, 6, 7, 8, 9);
+
+ fill z2r -- z2l -- simple_serif (z1l, z1r, 40) -- cycle;
+ fill z2r{z2r-z1r} .. z9 .. z2l{dir(232)} .. tension 2
+ .. z4{left} .. z7{dir(90 + 25)}
+ .. z5{left} .. z8 .. z3{right}
+ .. {curl 0.2}z6 -- cycle;
+
+
+ enddef;
fet_beginchar("8th rest","3","eighthrest");
draw_eighth_rest;
+ fet_endchar;
+fet_beginchar("Classical quarter rest","2classical","clasquartrest");
+ draw_eighth_rest;
+ currentpicture := currentpicture xscaled -1 shifted (w,0);
fet_endchar;
+
fet_beginchar("16th rest","4","sixteenthrest");
% draw_staff (-2, 2, 0.0);
save yshift, ballcorrection;
fet_endchar;
-fet_beginchar("Classical quarter rest","2classical","clasquartrest");
- draw_eighth_rest;
- currentpicture := currentpicture xscaled -1 shifted (w,0);
- fet_endchar;
endgroup;