fet_beginchar ("breve rest", "-1");
- set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
+ set_char_box (0, breve_rest_x#, 0, breve_rest_y#);
draw_block ((0, 0), (breve_rest_x, floor (breve_rest_y)));
fet_endchar;
alpha:=-50;
thick# := 1/4 staff_space#;
- define_blacker_pixels(thick);
+ define_blacker_pixels (thick);
rthin := 1.25 linethickness;
rthick := 2 thick + rthin;
save xcenter;
xcenter = -0.1 staff_space;
- set_char_box(0, 0.95 staff_space#,
- -yshift#,
- yshift# + height#);
+ set_char_box (0, 0.95 staff_space#,
+ -yshift#,
+ yshift# + height#);
save ne, nw, se, sw;
pair ne, nw, se, sw;
% PAT is a compact way to pass the brush shape to the routine.
%
-def draw_rest_bulb (expr ycenter, ycut, pat, stretch) =
+def draw_rest_bulb (expr ycenter, ycut, pat, stretch, show_labels) =
begingroup;
save x, y, pt, res;
+
z1l = point 0 of pat;
z2l = point 1 of pat;
z2r = point 3 of pat;
.. z3{right}
.. {curl 0.2}z6;
- labels (3, 4, 5, 6, 7, 8, 10);
+ if show_labels = 1:
+ labels (3, 4, 5, 6, 7, 8, 10);
+ fi;
+
res
endgroup;
enddef;
-def draw_eighth_rest =
+def draw_eighth_rest (expr show_labels) =
save width;
save ycenter;
save pat, bulb;
z2 = z1 + whatever * dir (72);
z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
+ if show_labels = 1:
+ penlabels (1, 2);
+ labels (9);
+ fi;
+
pat = z1l
--- z2l
.. z9
.. z2r
--- z1r
.. cycle;
- bulb = draw_rest_bulb (0.5 staff_space, y2r, pat, 1.0);
-% remove_overlap (pat, bulb) () R;
-% fill R1;
+ bulb = draw_rest_bulb (0.5 staff_space, y2r, pat, 1.0, show_labels);
fill simple_serif (z1l, z1r, 40)
--- z2r
--- z1l
.. cycle;
- penlabels (1, 2);
- labels (9);
-
% draw_staff (-2, 2, 0.0);
enddef;
fet_beginchar ("Classical quarter rest", "2classical");
- draw_eighth_rest;
+ draw_eighth_rest (0);
currentpicture := currentpicture xscaled -1 shifted (w, 0);
fet_endchar;
fet_beginchar ("8th rest", "3");
- draw_eighth_rest;
+ draw_eighth_rest (1);
fet_endchar;
y1 = -2 staff_space ;
y2 = h - lower_brush;
x2r = width;
- z2 = z1 + whatever*dir(74);
- z9 = z2 + 0.5 linethickness * dir (angle(z2 - z1)- 10);
+ z2 = z1 + whatever*dir (74);
+ z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1)- 10);
pat = z1l
--- z2l
.. z9
.. z2r
--- z1r
.. cycle;
- bulb_a = draw_rest_bulb (0.5 staff_space, y2r, pat, 0.98);
+ bulb_a = draw_rest_bulb (0.5 staff_space, y2r, pat, 0.98, 1);
bulb_b = draw_rest_bulb (-0.5 staff_space,
- (-0.5 + 0.2) * staff_space, pat, 1.02);
+ (-0.5 + 0.2) * staff_space, pat, 1.02, 1);
fill simple_serif (z1l, z1r, 40)
--- z2r
.. z2r
--- z1r
.. cycle;
- bulb_a = draw_rest_bulb( 1.5 staff_space, y2r, pat, 0.96);
- bulb_b = draw_rest_bulb( 0.5 staff_space,
- (0.5 + 0.2) * staff_space, pat, 1.00);
- bulb_c = draw_rest_bulb( -0.5 staff_space,
- (-0.5 + 0.21) * staff_space, pat, 1.04);
+ bulb_a = draw_rest_bulb ( 1.5 staff_space, y2r, pat, 0.96, 1);
+ bulb_b = draw_rest_bulb (0.5 staff_space,
+ (0.5 + 0.2) * staff_space, pat, 1.00, 1);
+ bulb_c = draw_rest_bulb (-0.5 staff_space,
+ (-0.5 + 0.21) * staff_space, pat, 1.04, 1);
fill simple_serif (z1l, z1r, 40)
--- z2r
.. z2r
--- z1r
.. cycle;
- bulb_a = draw_rest_bulb (1.5 staff_space, y2r, pat, 0.94);
+ bulb_a = draw_rest_bulb (1.5 staff_space, y2r, pat, 0.94, 1);
bulb_b = draw_rest_bulb (0.5 staff_space,
- (0.5 + 0.20) * staff_space, pat, 0.98);
+ (0.5 + 0.20) * staff_space, pat, 0.98, 1);
bulb_c = draw_rest_bulb (-0.5 staff_space,
- (-0.5 + 0.21) * staff_space, pat, 1.02);
+ (-0.5 + 0.21) * staff_space, pat, 1.02, 1);
bulb_d = draw_rest_bulb (-1.5 staff_space,
- (-1.5 + 0.22) * staff_space, pat, 1.06);
+ (-1.5 + 0.22) * staff_space, pat, 1.06, 1);
fill simple_serif (z1l, z1r, 40)
--- z2r
.. z2r
--- z1r
.. cycle;
- bulb_a = draw_rest_bulb (2.5 staff_space, y2r, pat, 0.92);
+ bulb_a = draw_rest_bulb (2.5 staff_space, y2r, pat, 0.92, 1);
bulb_b = draw_rest_bulb (1.5 staff_space,
- (1.5 + 0.20) * staff_space, pat, 0.96);
+ (1.5 + 0.20) * staff_space, pat, 0.96, 1);
bulb_c = draw_rest_bulb (0.5 staff_space,
- (0.5 + 0.21) * staff_space, pat, 1.0);
+ (0.5 + 0.21) * staff_space, pat, 1.0, 1);
bulb_d = draw_rest_bulb (-0.5 staff_space,
- (-0.5 + 0.22) * staff_space, pat, 1.04);
+ (-0.5 + 0.22) * staff_space, pat, 1.04, 1);
bulb_e = draw_rest_bulb (-1.5 staff_space,
- (-1.5 + 0.23) * staff_space, pat, 1.08);
+ (-1.5 + 0.23) * staff_space, pat, 1.08, 1);
fill simple_serif (z1l, z1r, 40)
--- z2r