]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-schrift.mf
''
[lilypond.git] / mf / feta-schrift.mf
index 95c0a7a3df83799c3058e7ffd1051613dca47898..1d6c1e68510df2ce75312391a94b90acfb92dc78 100644 (file)
@@ -12,7 +12,7 @@
 fet_begingroup("scripts")
 
 def draw_fermata =
-  save alpha, radius, crook_thinness, crook_fatness, dot_diam;
+  save alpha, radius, crook_thinness, crook_fatness, dot_radius;
   
        % [Wanske] and some  Baerenreiter editions
        % suggest ca 80 degrees iso half-circle
@@ -27,7 +27,7 @@ def draw_fermata =
   set_char_box(w#, w#, crook_thinness#/2, h#);
   
   define_pixels(radius, crook_thinness, crook_fatness);
-  dot_diam = 4/3 crook_fatness;
+  dot_radius = round (4/6 crook_fatness);
 
 
   penpos1(crook_thinness, 0);
@@ -41,10 +41,10 @@ def draw_fermata =
   addto currentpicture also 
   currentpicture xscaled -1;
 
-  pickup pencircle scaled dot_diam;
+  pickup pencircle scaled 2dot_radius;
   x4 =0;
   bot y4 = - crook_thinness/2;
-  draw z4;
+  drawdot z4;
 enddef;
 
 fet_beginchar("fermata up", "ufermata", "ufermata")
@@ -134,9 +134,9 @@ fet_endchar;
 fet_beginchar("staccato dot", "staccato", "staccato")
        save radius;
        radius# = 1.4 stafflinethickness#;
-       define_pixels(radius);
+       define_whole_pixels(radius);
        pickup pencircle scaled 2 radius;
-       draw (0,0);
+       drawdot (0,0);
        set_char_box(radius#, radius#, radius#, radius#);
 fet_endchar;
 
@@ -144,7 +144,8 @@ def draw_staccatissimo =
        save radius, height;
        height# = .8 staff_space#;
        radius# = 2 stafflinethickness#;
-       define_pixels(radius, height);
+       define_whole_pixels(radius);
+       define_pixels(height);
 
        draw_brush((0,0), stafflinethickness, (0, height),2 radius);
        set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
@@ -165,15 +166,43 @@ fet_endchar;
 
 fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
        save thick;
-       thick# = 1.4 stafflinethickness#;
-       define_pixels(thick);
+       thick# = 1.6 stafflinethickness#;
+       define_whole_pixels(thick);
 
        set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,thick#/2);
        pickup pencircle scaled thick;
-       lft x1 = -b;
-       rt x2 = w;
-       y1 = y2 = 0;
-       draw z1 .. z2;
+       draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
+fet_endchar;
+
+
+%
+% Portato by Heikki Junes <heikki.junes@hut.fi>
+%
+
+def draw_portato = 
+       save thick, radius;
+       thick# = 1.4 stafflinethickness#;
+       radius# = 1.4 stafflinethickness#;
+       define_whole_pixels(thick,radius);
+       
+       set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,.5 staff_space#+ radius#);
+       draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
+
+       pickup pencircle scaled 2 radius;
+       drawdot (0,h);
+enddef;
+
+
+fet_beginchar("portato/tenuto with staccato", "uportato", 
+               "uportato")
+       draw_portato;
+fet_endchar;
+
+
+fet_beginchar("portato/tenuto with staccato", "dportato", 
+               "dportato")
+       draw_portato;
+       y_mirror_char
 fet_endchar;
 
 
@@ -244,73 +273,67 @@ fet_beginchar("plus (stopped)", "stopped", "plusstop")
        size# = 1.1 staff_space#;
 
        set_char_box(size#/2, size#/2, size#/2, size#/2);
-       pickup pencircle scaled thick;
-
-       rt x1 = w;
-       y1 = 0;
-       z2 = -z1;
-
-       draw z1 .. z2;
-       draw (z1 .. z2) rotated 90;
+       draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
+       addto currentpicture also currentpicture rotated 90;
 fet_endchar;
 
+
 %
-% FIXME: blotting 
+% A vee with tapered insides to prevent visual blotting
 %
-fet_beginchar("Upbow", "upbow", "upbow")
-       save ht, wd, thick;
 
-       thick = 1.4 stafflinethickness;
-       wd# = 1.3 staff_space#;
-       ht# = 1.6 wd#; 
+def draw_vee (expr width, height, thickness) =
+begingroup
+       save diminish;
 
-       
-       set_char_box(wd#/2, wd#/2, 0, ht#);
-       pickup pencircle scaled thick;
+       diminish = 0.75;
 
+       pickup pencircle scaled thickness;
+       
        x1 = 0;
        bot y1 = 0;
        rt x2 =  w;
        top y2 = h;
 
+       z3 = 0.6 [z2, z1];
+       penpos3(thickness, 0);
+       penpos4(thickness * diminish, 0);
+       x4r = thickness/2;
+       y4 = thickness/2;
        labels(1,2);
-       draw z2 -- z1 -- (z2 xscaled -1);
+       penlabels(3,4);
+
+       draw z1;
+       draw z3 -- z2;
+       penstroke z3e .. z4e;
+       addto currentpicture also currentpicture xscaled -1;
+endgroup;
+enddef;
+
+fet_beginchar("Upbow", "upbow", "upbow")
+       save ht, wd, thick, diminish;
+       
+       thick = 1.4 stafflinethickness;
+       wd# = 1.3 staff_space#;
+       ht# = 1.6 wd#; 
+       set_char_box(wd#/2, wd#/2, 0, ht#);
+       draw_vee (wd, ht, thick);
 fet_endchar;
 
 
 fet_beginchar("Downbow", "downbow", "downbow")
        save stemthick, beamheight;
-       save wd;
+       save wd,round;
        define_pixels(wd)
 
        wd# = 1.5 staff_space#;
        stemthick = 1.2 stafflinethickness;
-
        set_char_box(wd#/2, wd#/2, 0, 4/3 staff_space#);
 
        beamheight = 4/10 h;
 
-
-       pickup pencircle scaled blot_diameter;
-       top y2 - bot y1  = beamheight;
-       top y2 = h;
-       rt x1 = w;
-       x1 = x2;
-       y2 = y3;
-       y1 = y4;
-       x3 = 0;
-       x4 = x3;
-       save p;
-       path p;
-       filldraw z1 -- z2 -- z3 -- z4 --cycle;
-
-       pickup pencircle scaled stemthick;
-
-       bot y5 =0;
-       rt x5 = rt x6 = w;
-       y6 = h - beamheight;
-       draw z6 -- z5;
-       labels(1, 2,3,4,5,6);
+       draw_rounded_block((-b,h-beamheight),(w,h),blot_diameter);
+       draw_rounded_block((-b,-d),(-b+stemthick,h-stemthick),stemthick);
        addto currentpicture also currentpicture xscaled -1;
 fet_endchar;
 
@@ -406,59 +429,74 @@ fet_beginchar("Trill (`tr')","trill","trill")
 
        ascender_extra# = 1/2 ex#;
        ascender# = ascender_extra# + ex#;
-       ex# = 1.5 staff_space#;
-       kerning# = .75 ex#;
+       ex# = 1.4 staff_space#;
+       kerning# = .60 ex#;
        start_nib_angle = 20;
-       bulb_size = 0.47;
+       bulb_size = 0.70;
        define_pixels(ex, ascender_extra, ascender, kerning);
 
        t_overshoot = 0.03 ex;
        fatness = 12/40 ex;
-       t_fatness = 8/10 fatness;
-       r_fatness = .75 fatness;
-       uitschieter = 21/40 ex;
+       t_fatness = 0.78 fatness;
+       t_width =  1.9 t_fatness;
+       r_fatness = 0.78 fatness;
+       uitschieter = 0.48 ex;
        hair_thick =  blot_diameter;
-
+       r_flare = 0.45  r_fatness;
+       r_width =  2 r_fatness + 0.25 kerning;
        slant = .2;
 
+%      slant = .0;
+
        local_copy(transform)(currenttransform);
        currenttransform := currenttransform slanted slant shifted (- staff_space, 0)  ;
 
        y1 = ascender;
-       x1l = 0;
-       x1r = t_fatness;
+
+       % try to position in such a way that the center is the visual
+       % center
+
+       x1l = 0.2 staff_space;
+       x1r - x1l = t_fatness;
        penpos1(start_nib_wid, start_nib_angle);
        
        z2 = (x1, 7/18 ex);
        penpos2(start_nib_wid, start_nib_angle);
 
-       z3l = (11/10 t_fatness, - t_overshoot);
+       z3l = (x2l + 0.5 t_width, - t_overshoot);
+
+       z4l = (x2l + t_width, 0.23 ex);
+       penpos4(whatever, 200);
+       x4l - x4r = hair_thick;
 
-       z4l = (13/6 t_fatness, 5/16 ex);
-       penpos4(hair_thick, 180);
+       x3r = 0.5 [x4r, x2r];
+%      1.7 [x3l, x3r] = x4r;
+       y3r - y3l = 0.6 t_fatness;
 
-       1.9 [z3l, z3r] = z4r;
-       z3 = .5 [z3l, z3r];
        
        save t_p, krul_p;
        path t_p, krul_p, r_p;
 
+       z5 = (x2l + t_fatness/2, 2/3 ex);
+%      penpos5(hair_thick, ); 
 
-       t_p := z1l -- z2l{down} .. tension (1 + .5 slant)
+       t_p := z1r{dir (angle(z1l-z1r) + 30)} .. z1l{-dir (angle(z1r-z1l) - 45)}
+               -- z2l {down}
+               .. tension (1 + .5 slant)
                .. z3l{right} 
                
                .. z4l{up} -- z4r{down} 
-               .. z3r{left} .. z2r{up} .. z1r -- cycle;
+               .. z3r{left}
+               .. tension (1.5 + .7 slant)
+               .. z2r{up} .. z1r -- cycle;
        fill t_p ;
 
        krul_ang = 32;
 
        pickup pencircle scaled hair_thick;
-
-       z5 = (t_fatness/2, 2/3 ex);
        
-       lft x6 = - uitschieter;
-       y6 =  y5 - 1/20 ex;
+       lft x6 = x2l - uitschieter;
+       y6 =  y5 ; % - 1/20 ex;
 
        z7 = z5 + whatever*dir krul_ang;
        up_angle = krul_ang;
@@ -468,39 +506,49 @@ fet_beginchar("Trill (`tr')","trill","trill")
        penpos7(hair_thick, up_angle + 90);
 
        
-       x8l = .7 [x9r, x7r];
-       y8l = y7l;
-       penpos8(2 hair_thick, (up_angle +90)/2);
-
        y9 = 3/4 ex;
        x9 = x1 + kerning;
        penpos9(r_fatness, 0);
 
        x10 = x9;
-       y10 = 0;
+       y10 =  -0.3 stafflinethickness;
        penpos10(r_fatness, 0);
 
-       krul_p := z4{up} .. tension 1.1  .. z5 
-               .. tension 1 and .75 .. {down}z6
-               .. tension .85 and 1.1 .. z5 --- z7;
+       krul_p := z4{up}
+               .. tension 0.98
+               .. z5
+               .. z6
+               .. z5 --- z7;
        draw krul_p;
-       r_p := z7l{z7-z5} .. z8l{right} .. z9l{down} --- z10l -- z10r
+       r_p := z7l{z7-z5} .. z9l{down} --- simple_serif (z10l, z10r, -30)
                --- z9r{up} 
-               ..  z8r{left} ..  z7r{z5-z7} -- cycle;
+                ..  z7r{z5-z7} -- cycle;
        fill r_p;
-       set_char_box(staff_space# , staff_space#, 0,ascender#);
 
+       set_char_box(.85 staff_space# , .85 staff_space#, 0,ascender#);
 
-       penpos11(1/4 r_fatness, -20);
+
+       penpos11(1/4 r_fatness, -4);
        z11r = z9r;
        
-       z13 = (x9 + 2 r_fatness, y11 );
-       penpos13(r_fatness, 180);
-       fill z11r{dir 70} .. z13r{down} -- z13l{up} .. z11l{dir 250} -- cycle;
-       penlabels(range 1 thru 15);
+       z13l = (x9l + r_width, y11 -  stafflinethickness );
+       penpos13(r_flare, 180);
+
+       z15 = z13r  - (bulb_size * r_fatness,0);
+       z14 = 0.5 [z13l, z15] - (0,bulb_size* r_fatness);
+       z16 = 0.5 [z13l, z15] + (0,bulb_size* r_fatness);
+
+
+       fill z11r{up} .. tension 0.94 .. z13r{down} -- z15{down}
+               .. tension 1.0 .. z13l{up}
+               .. z11l{down} -- cycle;
 
+       fill z15{up} .. tension 1.06 .. z13l{down} .. z14 .. cycle;
+
+
+
+       penlabels(range 1 thru 15);
 
-       draw_bulb(-1, z13r, z13l, bulb_size * r_fatness, 1.5);
 fet_endchar;
 
 
@@ -549,17 +597,7 @@ def draw_toe =
 
 
        set_char_box(wd#, wd#, 0, ht#);
-       
-       pickup pencircle scaled thickness;
-       lft x1 = -b;
-       bot y1 = 0;
-       x2 =0;
-       top y2 = h;
-       z3 = z1 xscaled -1;
-
-
-       draw z1 -- z2 -- z3;
-
+       draw_vee (wd, ht, thickness);
 enddef;
        
 fet_beginchar("left toe", "upedaltoe", "upedaltoe")
@@ -680,9 +718,8 @@ fet_beginchar("Coda", "coda", "coda")
        fill halfcoda;
        fill (halfcoda scaled -1);
 
-       pickup pencircle scaled thin;
-       draw (0,-h) -- (0,h);
-       draw (-w,0) -- (w,0);
+       draw_gridline((0,-h),(0,h),thin);
+       draw_gridline((-w,0),(w,0),thin);
 
 fet_endchar;
 
@@ -766,99 +803,76 @@ fet_beginchar("Arpeggio","arpeggio","arpeggio");
        draw_arpeggio;
        fet_endchar;
 
-% Arrowhead nestles underneath / on top of the arpeggio symbol 
-
-def draw_arpeggio_arrow = 
-       save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
-       pair ne, nw, se, sw;
+% Extendable Trill symbol.
+% Not yet used
+% Rename me to Trill, rename Trill to Tr?
+fet_beginchar("Trill-element","trill-element","trillelement");
+       save height, overshoot;
        height# = staff_space#;
        width# = 0.8height#;
         overshoot# = 0.25 staff_space#;
        define_pixels (height,overshoot,width);
-       set_char_box(0, width#, 0, height#);
-       alpha := -40;
-       nw = dir (alpha+180);
-       sw = dir (alpha-90); se = dir alpha;      
+       set_char_box(0, height#, 0, width#);
+       draw_arpeggio;
+       currentpicture := currentpicture shifted -(width/2, height/2);
+       currentpicture := currentpicture rotated 90;
+       currentpicture := currentpicture shifted (height/2, width/2);
+       fet_endchar;
 
-       penpos1(rthin,     alpha+90);
-       penpos2(5/4rthick, alpha);
-       penpos3(rthin,     alpha);
 
-       z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
-       z2 = 2[z4,(width/2,height/2)];
-       z3 = (0.5 width, 0.5 height);
-       z4 = (0.25 staff_space, rthin);
-       z6 = z2l + 1/2rthin*sw;
-       z9 = (width/2, height) + overshoot*se;
 
-       z10 = (0.5w, -0.5h);
-       z11 = (0, 0);
-       z12 = (w, 0);
-       
-       fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
+%
+% Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
+%
 
-       pickup pencircle scaled rthin;
-       draw z3 -- z10 -- z11;
-       draw z10 -- z12;
-      enddef;
+def draw_arpeggio_arrow =
+        save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
+       pair ne, nw, se, sw;
+        height# = staff_space#;
+        width# = 0.8height#;
+        overshoot# = 0.25 staff_space#;
+        define_pixels (height,overshoot,width);
+       set_char_box(0, width#, 0, height#);
+        alpha := -40;
+       nw = dir (alpha+180);
+        sw = dir (alpha-90); se = dir alpha;
 
-fet_beginchar("Arpeggio arrow down", "arrowdown", "arrowdown");
-       draw_arpeggio_arrow;
-fet_endchar;
+        penpos1(rthin,     alpha+90);
+       penpos2(5/4 rthick, alpha);
+        penpos3(5/4 rthick,     0);
 
-fet_beginchar("Arpeggio arrow up", "arrowup", "arrowup");
+        z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
+        z2 = 2[z4,(width/2,height/2)];
+        z3 = (0.5 width, 0.5 height);
+        z4 = (0.25 staff_space, rthin);
+       z6 = z2l + 1/2rthin*sw;
+        z9 = (width/2, height) + overshoot*se;
+        fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
+
+       bot z10 = ( 0.5w,  0   );
+       lft z11 = (-0.3w,  0.8h);
+       rt z12  = ( 1.3w,  0.8h);
+       pickup pencircle scaled 0.5 rthin;
+       filldraw z3 -- z12 {dir -130} ..  {dir -110} z10 {dir 110} ..  {dir 130} z11 -- cycle;
+enddef;
+
+fet_beginchar("Arpeggio arrow down", "arpeggio-arrow--1", "arpeggioarrowdown");
        draw_arpeggio_arrow;
-       currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space);
 fet_endchar;
 
 
-def draw_chordbrace_end = 
-       save thinness;
-       set_char_box(0, staff_space#, 0, staff_space#);
-       pickup pencircle scaled stemthickness;
-       bot rt z1 = (w, -h);
-       bot lft z2 = (0, -h);
-       top lft z3 = (0, h);
-       draw z1 -- z2 -- z3;
-enddef;
-
-fet_beginchar("Bottom of chord brace", "bracebottom", "bracebottom");
-       draw_chordbrace_end;
-       labels (1, 2, 3);
+fet_beginchar("Arpeggio arrow up", "arpeggio-arrow-1", "arpeggioarrowup");
+        draw_arpeggio_arrow;
+        currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space);
 fet_endchar;
 
-fet_beginchar("Top of chord brace", "bracetop", "bracetop");
-       draw_chordbrace_end;
-       y_mirror_char;
-fet_endchar;
 
-%% Same as a note stem, but only a staff-space long. 
-fet_beginchar("chord brace segment (up)", "braceseg", "braceseg")
-       set_char_box(stemthickness#/2, stemthickness#/2, 0, staff_space#);
-       pickup pencircle scaled stemthickness;
-       bot lft z1 = (0, 0);
-       top lft z2 = (0, h);
-       draw z1 -- z2;
-fet_endchar;
 
-% Extendable Trill symbol.
-% Not yet used
-% Rename me to Trill, rename Trill to Tr?
-fet_beginchar("Trill-element","trill-element","trill-element");
-       save height, overshoot;
-       height# = staff_space#;
-       width# = 0.8height#;
-        overshoot# = 0.25 staff_space#;
-       define_pixels (height,overshoot,width);
-       set_char_box(0, height#, 0, width#);
-       draw_arpeggio;
-       currentpicture := currentpicture shifted -(width/2, height/2);
-       currentpicture := currentpicture rotated 90;
-       currentpicture := currentpicture shifted (height/2, width/2);
-       fet_endchar;
 
 % Hmm
 input feta-slag;
 
+
+
 fet_endgroup("scripts");