]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-toevallig.mf
release: 1.5.47
[lilypond.git] / mf / feta-toevallig.mf
index accc2310ac09de794ffc8c38c09e6d03b7660176..cd57e956fe82c783101ae35e980f2329cf9abad6 100644 (file)
@@ -31,14 +31,15 @@ fet_beginchar("Sharp" , "1", "sharp");
                1.5 staff_space#);
 
        save interbeam, interstem, beamheight, beamwidth, 
-               stemwidth;
+               stemwidth, beamslope;
 
        interbeam := 1.05 staff_space;
        interstem := 7/16 ;
        beamheight := 4 stafflinethickness;
        beamwidth := w;
-       stemwidth := 1.3 stafflinethickness;
-       roundness := 2blot_diameter;
+       stemwidth := 1.5 stafflinethickness;
+       roundness := 2 blot_diameter;
+
        pair center;
        center := (.5 w, 0);
        
@@ -69,14 +70,23 @@ fet_beginchar("Sharp" , "1", "sharp");
 
        pickup pencircle scaled stemwidth;
        x3 = x4 = xpart center;
-       bot y3 = -1.5 staff_space + ypart center;
-       top y4 = 1.5 staff_space + ypart center;
 
        numeric xs;
        xs := interstem* beamwidth / 2;
+
+       (bot y3) + -xs * beamslope = -1.5 staff_space + ypart center;
+       top y4  + xs * beamslope = 1.5 staff_space + ypart center;
+
        draw_gridline (z3-(xs,xs* beamslope),z4-(xs,xs*beamslope),stemwidth);
        addto currentpicture also currentpicture rotated 180 shifted (w,0);
        labels(1,2,3,4);
+
+
+% to check that it doesn't overshoot staffline.
+%
+%      pickup pencircle scaled stafflinethickness;
+%      draw (0, 1.5 staff_space ) ..  (1 staff_space, 1.5 staff_space);
+
        fet_endchar;
 
 
@@ -111,7 +121,7 @@ fet_beginchar( "Natural", "0", "natural")
 
        pickup penrazor scaled beamheight rotated 90;
        top y2 = staff_space - 3/2 stafflinethickness ;
-       slope =  stafflinethickness / interstem;
+       slope = stafflinethickness / interstem;
        
        draw z1 .. z2;
        draw (xpart z1, -y2) .. (xpart z2, -y1);
@@ -153,15 +163,25 @@ fet_beginchar( "Natural", "0", "natural")
 %
 
 % TODO: remove crook_fatness
+% TODO: document, simplify!
+%
 def draw_meta_flat(expr xcenter, w, crook_fatness) =
        clearxy;
        save crook_thinness;
-       save top_stem_thick, bottom_stem_thick, hair;
+       save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
        save center;
        pair center;
        center = (xcenter, 0);
 
-       crook_thinness = 1.25 stafflinethickness;
+%
+%  TODO: parameterize  this
+%
+       if w >= 0.75 staff_space:
+               smaller_hole = 0.2 stafflinethickness;
+       else:
+               smaller_hole = 0.0 stafflinethickness;
+       fi
+       crook_thinness = 1.1 stafflinethickness;
        top_stem_thick = 2 stafflinethickness;
        bottom_stem_thick = 1.2 stafflinethickness;
 
@@ -178,8 +198,10 @@ def draw_meta_flat(expr xcenter, w, crook_fatness) =
        y3l = (staff_space - stafflinethickness)/2 + ypart center;
        z3l = whatever [z2r,z1r];
 
-       z3r = .26 [z2r, z1r];
+       z3r = .26 [z2r, z1r] + (smaller_hole, 0);
+       z10 = whatever [z2r, z1r] + (smaller_hole , 0);
 
+       
 
        z4 = (3/8 staff_space, staff_space/2) + center;
        penpos4(whatever, 53);
@@ -197,26 +219,23 @@ def draw_meta_flat(expr xcenter, w, crook_fatness) =
        save ne_angle;
        ne_angle = angle(z9 - z8);
 
-       z7 = 8/33 [z8,z9];
+       z7 = 8/33 [z8,z9] + (1.0 smaller_hole, 0);
        z6l = 18/33 [z8,z9] + .5 crook_thinness *dir(ne_angle -90);
   
        penpos7(crook_thinness, ne_angle + 90);
 
        z6r = .3 (z9-z8) + z7r;
 
-%      penpos7(crook_thinness, angle(dir(z8-center) -180);
-
        penpos8(whatever, ne_angle + 90);
        x8r =  xpart center - bottom_stem_thick/2;
        penlabels(range 0 thru 10);
 
        y10 = -1/5 staff_space;
-       z10 = whatever [z2r, z1r];
 
        unfill z3r .. z4r{right} .. tension .9 
                .. z6r ---
-               z7r{left}
-               .. z10  -- cycle;
+               z7r{left} 
+               .. z10{z3r-z10}  -- cycle;
        fill z8r{down}
                .. tension 0.8 ..z8l{(z9-z8)}
                .. z7l
@@ -298,11 +317,11 @@ def draw_paren =
        .. simple_serif(z1r, z1l, 90) .. z2l{down} -- cycle;
 enddef;
   
-fet_beginchar("Right Parenthesis", ")", "rightparen")
+fet_beginchar("Right Parenthesis", "rightparen", "rightparen")
        draw_paren;
 fet_endchar;
 
-fet_beginchar("Left Parenthesis", "(", "leftparen")
+fet_beginchar("Left Parenthesis", "leftparen", "leftparen")
        draw_paren;
         currentpicture := currentpicture xscaled -1;
         set_char_box(charwd, charbp, chardp, charht);