]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-eindelijk.mf
''
[lilypond.git] / mf / feta-eindelijk.mf
index 96a9249eb46f8b527d9aed03fc72517c72e818f9..e2709e6d388d7cf32cae965f2a6d39edbf8832ed 100644 (file)
@@ -4,7 +4,7 @@
 %
 % source file of the Feta (not the Font-En-Tja) music font
 % 
-% (c) 1997, 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+% (c) 1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
 
 fet_begingroup("rests");
 
@@ -13,7 +13,7 @@ begingroup
 thick#:=1/16designsize;
 define_blacker_pixels(thick);
 
-rthin:=1/8*interline;
+rthin:=1/8*staff_space;
 % rthick:=2rthin;
 rthick:=2thick+rthin;
 
@@ -25,10 +25,10 @@ enddef;
 %
 save stem, ball_crook_stem, ball_crook_balldiam, flare;
 
-% stem#:=1/8*interline#;
-stem# = 1/5interline#;
-% flare# = 2/3interline#;
-flare# = 2/3interline# - 1/8stafflinethickness#;
+% stem#:=1/8*staff_space#;
+stem# = 1/5staff_space#;
+% flare# = 2/3staff_space#;
+flare# = 2/3staff_space# - 1/8stafflinethickness#;
 
 define_pixels(stem,flare);
 
@@ -38,8 +38,12 @@ ball_crook_balldiam =flare;
 
 save block_rest_y, block_rest_x;
 
-block_rest_y# = 5/8 interline#;
-block_rest_x# = 3/2 interline#;
+save breve_rest_y, breve_rest_x;
+
+breve_rest_y# =  staff_space#;
+breve_rest_x# = 3/5 staff_space#;
+block_rest_y# = 5/8 staff_space#;
+block_rest_x# = 3/2 staff_space#;
 
 define_pixels(block_rest_y, block_rest_x);
 
@@ -73,7 +77,7 @@ fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
        y5 = y6 = 0;
        lft x5 = - b - block_rest_y;
        rt x6 = w + block_rest_y;
-       draw z5 .. z6;
+       draw_gridline(z5,z6,ledgerlinethickness);
 fet_endchar;
 
 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
@@ -84,52 +88,37 @@ fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
        y5 = y6 = 0;
        lft x5 = - b - block_rest_y ;  
        rt x6 = w + block_rest_y;
-       draw z5 .. z6;
+       draw_gridline (z5,z6,ledgerlinethickness);
 fet_endchar;
 
 
-save breve_rest_y, breve_rest_x;
-
-breve_rest_y# =  interline#;
-breve_rest_x# = 3/5 interline#;
-multi_rest_x# = 2 interline#;
-multi_rest_y# = 1/3 interline#;
 
-define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_rest_y);
+define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height);
 
-fet_beginchar("breve rest", "-1", "breverest");
-       set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
-       draw_block ((0,0), (breve_rest_x, breve_rest_y));
-fet_endchar;
 
 fet_beginchar("longa rest", "-2", "longarest");
        set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
-       draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y));
+       draw_block ((0,-floor (breve_rest_y)), (breve_rest_x, floor (breve_rest_y)));
 fet_endchar;
 
-tracingvariables := 1;
-
-fet_beginchar("multi rest", "-4", "multirest");
-       set_char_box(multi_rest_x#, multi_rest_x#,
-                    breve_rest_y#, breve_rest_y#);
-       draw_block ((-multi_rest_x, -multi_rest_y),
-                  (multi_rest_x, multi_rest_y));
-       draw_block ((-multi_rest_x,-breve_rest_y),
-                  (rthin-multi_rest_x, breve_rest_y));
-       draw_block ((multi_rest_x-rthin,-breve_rest_y),
-                  (multi_rest_x, breve_rest_y));
+fet_beginchar("breve rest", "-1", "breverest");
+       set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
+       draw_block ((0,0), (breve_rest_x, floor (breve_rest_y)));
 fet_endchar;
 
+tracingvariables := 1;
+
 fet_beginchar("Quarter rest","2","quartrest");
 %      draw_staff (-2, 2, 0.0);        
        save alpha, yshift, height;
        alpha:=-50;
-       yshift# = -1.25 interline#;
-       height# = 2.8125 interline#;
+       yshift# = -1.25 staff_space#;
+       height# = 2.8125 staff_space#;
        define_pixels (yshift, height);
-
+       save xcenter;
+       xcenter = -0.1 staff_space;
        
-       set_char_box(0, 27/25interline#,
+       set_char_box(0, 0.95 staff_space#,
          -yshift#,
          yshift# + height#);
        
@@ -154,15 +143,15 @@ fet_beginchar("Quarter rest","2","quartrest");
        z13=z2r+1/2rthin*ne+1/2rthin*nw;
 
        y1r = h;
-       x1l=1/3interline;
-       z2r=z1+interline*se;
+       x1l=xcenter +  1/3staff_space;
+       z2r=z1+staff_space*se;
        z3=1/2[z2,z4];
-       x4=3/8interline;
+       x4= xcenter + 3/8staff_space;
        y4= 0;
-       z5=z4l+1.3interline*se;
+       z5=z4l+1.3staff_space*se;
        x6l=x4l;
        y6l=y4r;
-       x7=2/5interline;
+       x7= xcenter + 2/5staff_space;
        y7= -d;
        
        fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
@@ -170,8 +159,8 @@ fet_beginchar("Quarter rest","2","quartrest");
        penlabels(1,2,3,4,5,6,7);
        penlabels(10,11,12,13);
        
-%        3/4 interline# + yshift#,
-%        18/5interline# + yshift#)
+%        3/4 staff_space# + yshift#,
+%        18/5staff_space# + yshift#)
 
        fet_endchar;
 
@@ -179,60 +168,133 @@ def rest_crook(expr a, w) =
        balled_crook(a, w, ball_crook_balldiam, ball_crook_stem)
 enddef;
 
-fet_beginchar("8th rest","3","eighthrest");
-%      draw_staff (-2, 2, 0.0);
-       save yshift, ballcorrection;
-       ballcorrection = 0.005 interline;
+%
+% Notes about 8th rest:  
+% 
+% * 8th rest should be no wider than the black note head
+%
+% * The inside corner of the horizontal portion is usually a little blotted.
+%
+% * The top of the crook chops off the vertical brush
+% 
+% * The crook widens a little
+%
+% * The bottom of the brush is slightly flat, as it has to align with
+% stafflines if it is inside the staff.
+%
+% * The top of the brush usually is a little lower than the top of bulb.
+%
+% * The bulb can vary. Sometimes it is open (like in the clefs). Sometimes 
+% it is closed, or even a flare.
+% 
 
-       yshift# := -1.0 interline#;
-       define_pixels(yshift);
+def normalize (expr p) =
+       (p / length (p))
+enddef ;
 
+def draw_eighth_rest =
+       save width, bulb_diam, thin, thick;
+       save ycenter, crook_thick, crook_thin;
+       save crook_dir, lower_brush;
+       pair crook_dir;
 
-       set_char_box(0, 4/3interline#, -yshift#, yshift# +
-                       5/3interline#+7/4stafflinethickness#);
 
-       %
-       % The curve is like a valley causing less space between
-       % the curve and the lower staff line. Correct for this.
-       % 
-       save x,y;
+       width# := 1.0 staff_space#;
+       bulb_diam# := 0.64 staff_space#;
+       thin# := 1.1 stafflinethickness#;
+       thick# :=  2.2 stafflinethickness#;
+       crook_thick# := 1.8 stafflinethickness#;
+       crook_thin := 1.3 stafflinethickness;
 
-       x1=w-stem/6;
+       lower_brush = 1.5 stafflinethickness;
+       ycenter := 0.5 staff_space;
 
-       y1 = yshift + 1.5 interline + flare/4 + ballcorrection; 
-       rest_crook (z1,w-stem/6);
-       z2-z1=whatever*dir70;
-       y2= yshift + stem/2;
-       brush(z1,2/3stem,z2,stem);
+       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);
+
+       penpos1 (thick, 0);
+       penpos2 (thin, 0);
+
+       y1 = ycenter + - 1.5 staff_space ;
+%      y9 = y5 -  lower_brush;
+       y2 = y5 -  lower_brush;
+       
+       x2r = width;
+
+       y3 - y2l = 0.25 staff_space;
+       x2r - x1 = 0.5 staff_space;
+
+       x3 = x1l ;
+
+
+       x4 = 1.02 bulb_diam ;
+       y4 := ceiling (ycenter - 2 stafflinethickness + crook_thin);
 
+       x5 = 0.5 bulb_diam - 0.25 stafflinethickness;
+       y5 = ycenter +bulb_diam/2;
+       
+       z9 = z2 + 0.46 stafflinethickness * dir (angle(z2 - z1)- 10);
+
+%      z7 = %(bulb_diam/2,ycenter) + 0.23 staff_space * dir ( 35);
+       z7 = 0.5 [z4, z5] + (0.45 stafflinethickness,0.4 stafflinethickness);
+       z8 = (0, ycenter + 0.5 stafflinethickness);
+
+       z6 = whatever [z1l, z2l];
+       z6 = whatever [z2l, z4] + crook_thick * (crook_dir rotated -90);
+       crook_dir = normalize(z2l - z4);
+
+       y3 := ycenter +floor (- bulb_diam/2);
+
+
+       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} .. tension 0.9 .. 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;
-       ballcorrection = 0.005 interline;
+       ballcorrection = 0.005 staff_space;
 
-       yshift# := - 2 interline#;
+       yshift# := - 2 staff_space#;
        define_pixels(yshift);
 
        save alpha,cw,h,w, height;
        alpha=74;
-       cw#=7/6interline#;
-       height# =  5/3interline#+interline#+7/4stafflinethickness#;
-       set_char_box(0, cw#+(height#-3/2interline#)/tand(alpha),
+       cw#=7/6staff_space#;
+       height# =  5/3staff_space#+staff_space#+7/4stafflinethickness#;
+       set_char_box(0, cw#+(height#-3/2staff_space#)/tand(alpha),
                -yshift#, height# + yshift#);
 
        define_pixels(cw);
        save x,y;
        x1=w-stem/6;
-       y1 = yshift + 2.5 interline + flare/4 + ballcorrection;
+       y1 = yshift + 2.5 staff_space + flare/4 + ballcorrection;
 
        z2-z1=whatever*dir alpha;
        y2= yshift + stem/2;
        brush(z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        penlabels(1,2);
        fet_endchar;
@@ -240,68 +302,68 @@ fet_beginchar("16th rest","4","sixteenthrest");
 fet_beginchar("32th rest","5","thirtysecondrest");
 %      draw_staff (-2, 2, 0.0);
        save yshift, ballcorrection;
-       ballcorrection = 0.005 interline;
+       ballcorrection = 0.005 staff_space;
 
-       yshift# := -2 interline#;
+       yshift# := -2 staff_space#;
        define_pixels(yshift);
 
        save alpha,cw,h;
        alpha=76;
-       cw#=7/6interline#;
-       h#=5/3interline#+2interline#+7/4stafflinethickness#;
+       cw#=7/6staff_space#;
+       h#=5/3staff_space#+2staff_space#+7/4stafflinethickness#;
 
-       set_char_box(0, cw#+(h#-3/2interline#)/tand(alpha),
+       set_char_box(0, cw#+(h#-3/2staff_space#)/tand(alpha),
                -yshift#,yshift# +h#);
        define_pixels(cw);
        save x,y;
        x1=w-stem/6;
-       y1 = yshift + 3.5 interline + flare/4 + ballcorrection;
+       y1 = yshift + 3.5 staff_space + flare/4 + ballcorrection;
 
        z2-z1=whatever*dir alpha;
        y2=stem/2 + yshift;
        brush(z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        z4-z1=whatever*dir alpha;
-       y4=y1-2interline;
+       y4=y1-2staff_space;
        rest_crook (z4,cw);
        fet_endchar;
 
 fet_beginchar("64th rest","6","sixtyfourthrest");
 %      draw_staff (-2, 2, 0.0);
        save yshift, ballcorrection;
-       ballcorrection = 0.005 interline;
+       ballcorrection = 0.005 staff_space;
 
-       yshift# := -3 interline#;
+       yshift# := -3 staff_space#;
        define_pixels(yshift);
 
        save alpha,cw,h,w;
        alpha=78;
-       cw#=7/6interline#;
-       h#=5/3interline#+3interline#+7/4stafflinethickness#;
-       w#=cw#+(h#-3/2interline#)/tand(alpha);
+       cw#=7/6staff_space#;
+       h#=5/3staff_space#+3staff_space#+7/4stafflinethickness#;
+       w#=cw#+(h#-3/2staff_space#)/tand(alpha);
        set_char_box(0,w#,-yshift# ,yshift# + h#);
 
        define_pixels(cw);
        save x,y;
        x1=w-stem/6;
 
-       y1 = yshift + 4.5 interline + flare/4 + ballcorrection;
+       y1 = yshift + 4.5 staff_space + flare/4 + ballcorrection;
 
        z2-z1=whatever*dir alpha;
        y2=stem/2 + yshift;
        brush (z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        z4-z1=whatever*dir alpha;
-       y4=y1-2interline;
+       y4=y1-2staff_space;
        rest_crook (z4,cw);
        z5-z1=whatever*dir alpha;
-       y5=y1-3interline;
+       y5=y1-3staff_space;
        rest_crook (z5,cw);
 
        fet_endchar;
@@ -309,48 +371,104 @@ fet_beginchar("64th rest","6","sixtyfourthrest");
 fet_beginchar("128th rest","7","hundredtwentyeighthrest"); 
 %      draw_staff (-2, 2, 0.0);
        save yshift, ballcorrection;
-       ballcorrection = 0.005 interline;
+       ballcorrection = 0.005 staff_space;
 
-       yshift# := -3 interline#;
+       yshift# := -3 staff_space#;
        define_pixels(yshift);
        save alpha,cw,h,w;
        alpha=78;
-       cw#=7/6interline#;
-       h#=5/3interline#+4interline#+7/4stafflinethickness#;
-       w#=cw#+(h#-3/2interline#)/tand(alpha);
+       cw#=7/6staff_space#;
+       h#=5/3staff_space#+4staff_space#+7/4stafflinethickness#;
+       w#=cw#+(h#-3/2staff_space#)/tand(alpha);
        set_char_box(0,w#, -yshift#,yshift#  + h#);
        define_pixels(cw);
        save x,y;
        x1=w-stem/6;
-       y1 = yshift + 5.5 interline + flare/4 + ballcorrection;
+       y1 = yshift + 5.5 staff_space + flare/4 + ballcorrection;
 
        z2-z1=whatever*dir alpha;
        y2=stem/2 + yshift;
        brush (z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        z4-z1=whatever*dir alpha;
-       y4=y1-2interline;
+       y4=y1-2staff_space;
        rest_crook (z4,cw);
        z5-z1=whatever*dir alpha;
-       y5=y1-3interline;
+       y5=y1-3staff_space;
        rest_crook (z5,cw);
        z6-z1=whatever*dir alpha;
-       y6=y1-4interline;
+       y6=y1-4staff_space;
        rest_crook (z6,cw);
        
        fet_endchar;
 
+
 endgroup;
 
-% Rest symbols for mensural notation:
 
-mensrestsize# = .8interline#;
+%%%%%%%%
+%
+%
+%
+% MENSURAL NOTATION
+%
+%
+%
+
+% Neo-mensural longa and breve are identical with default longa and breve.
+
+neomens_block_rest_x# = 2/5 staff_space#;
+neomens_block_rest_y# = 1/1 staff_space#;
+neomens_half_block_rest_y# = 5/8 staff_space#;
+
+define_pixels(neomens_block_rest_x,
+             neomens_block_rest_y, neomens_half_block_rest_y);
 
-fet_beginchar("Mensural 4th rest","2mensural","minimarest")
-       set_char_box(0,mensrestsize#,0,mensrestsize#);
+def neomens_half_block_rest =
+       draw_block ((0,0), (neomens_block_rest_x, neomens_half_block_rest_y));
+       enddef;
+
+fet_beginchar("Neo-mensural maxima rest", "-3neo_mensural", "neomensmaximarest");
+       set_char_box(0, neomens_block_rest_x#,
+                   neomens_block_rest_y#, 2 neomens_block_rest_y#);
+       draw_block ((0,-neomens_block_rest_y),
+                  (neomens_block_rest_x, 2 neomens_block_rest_y));
+fet_endchar;
+
+fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
+       set_char_box(0, neomens_block_rest_x#,
+                   neomens_block_rest_y#, neomens_block_rest_y#);
+       draw_block ((0,-neomens_block_rest_y),
+                  (neomens_block_rest_x, neomens_block_rest_y));
+fet_endchar;
+
+fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
+       set_char_box(0, neomens_block_rest_x#,
+                   0, neomens_block_rest_y#);
+       draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
+fet_endchar;
+
+fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
+       set_char_box(0, neomens_block_rest_x#,
+                    neomens_half_block_rest_y#,  0);
+       neomens_half_block_rest;
+       currentpicture :=
+               currentpicture shifted (0,- neomens_half_block_rest_y);
+fet_endchar;
+
+fet_beginchar("Neo-mensural half rest", "1neo_mensural", "neomensminimahalfrest");
+       set_char_box(0, neomens_block_rest_x#,
+                    0, neomens_half_block_rest_y#);
+       neomens_half_block_rest;
+fet_endchar;
+
+neomensrestsize# = .8staff_space#;
+
+fet_beginchar("Neo-mensural 4th rest","2neo_mensural","neomenssemiminimarest")
+       set_char_box(0,neomensrestsize#,0,neomensrestsize#);
         pickup pencircle scaled 2 stafflinethickness;
        lft x1 = 0;
        bot y1 = 0;
@@ -362,8 +480,8 @@ fet_beginchar("Mensural 4th rest","2mensural","minimarest")
        draw z2 .. z3;
 fet_endchar
 
-fet_beginchar("Mensural 8th rest","3mensural","fusarest")
-       set_char_box(0,mensrestsize#,0,mensrestsize#);
+fet_beginchar("Neo-mensural 8th rest","3neo_mensural","neomensfusarest")
+       set_char_box(0,neomensrestsize#,0,neomensrestsize#);
         pickup pencircle scaled 2 stafflinethickness;
        rt x1 = w;
        bot y1 = 0;
@@ -375,8 +493,8 @@ fet_beginchar("Mensural 8th rest","3mensural","fusarest")
        draw z2 .. z3;
 fet_endchar
 
-fet_beginchar("Mensural 16th rest","4mensural","semifusarest")
-       set_char_box(0,mensrestsize#,0,interline#);
+fet_beginchar("Neo-mensural 16th rest","4neo_mensural","neomenssemifusarest")
+       set_char_box(0,neomensrestsize#,0,staff_space#);
         pickup pencircle scaled 2 stafflinethickness;
        rt x1 = w;
        bot y1 = 0;
@@ -399,4 +517,5 @@ fet_beginchar("Mensural 16th rest","4mensural","semifusarest")
        draw z5 .. z6;
 fet_endchar
 
+
 fet_endgroup("rests")