]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-bolletjes.mf
Merge with git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond.git
[lilypond.git] / mf / feta-bolletjes.mf
index 0eb46ae98cfa36dd8a9ccb8c1a240b7260b04274..36abfcf1a8bd049c18f47352cc0d786fb88a0059 100644 (file)
@@ -26,8 +26,14 @@ picture remember_pic;
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 save black_notehead_width, noteheight;
-save slash_thick, slash_slope, overdone_heads;
-numeric black_notehead_width, noteheight, slash_thick;
+save half_notehead_width, whole_notehead_width, slash_thick;
+save slash_slope, overdone_heads, solfa_noteheight;
+
+numeric noteheight;
+numeric slash_thick;
+numeric black_notehead_width;
+numeric whole_notehead_width;
+numeric half_notehead_width;
 
 
 fet_begingroup ("noteheads");
@@ -48,6 +54,12 @@ slash_thick# := 2/3 * 0.48 staff_space#;
 overdone_heads = 0.0;
 noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
 
+
+%
+% solfa heads should not overlap on chords.
+%
+solfa_noteheight# := staff_space# - stafflinethickness#;
+
 define_pixels (slash_thick);
 define_whole_vertical_pixels (noteheight);
 
@@ -133,6 +145,77 @@ endgroup;
 enddef;
 
 
+%
+% dimensions aren't entirely right.
+%
+def draw_longa (expr up) =
+       save stemthick, fudge;
+
+       stemthick# = 2 stafflinethickness#;
+       define_whole_blacker_pixels (stemthick);
+
+       fudge = hround (blot_diameter / 2);
+
+       draw_outside_ellipse (1.80, 0, 0.707, 0);
+       undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
+
+       pickup pencircle scaled stemthick;
+
+       if up:
+               bot y1 = -d;
+               y2 = h;
+               rt x1 - fudge = 0;
+               x1 = x2;
+
+               fudge + lft x3 = w;
+               x4 = x3;
+               top y4 = h + 3.0 staff_space;
+               y3 = y1;
+       else:
+               bot y1 = -d - 3.0 staff_space;
+               top y2 = h;
+               rt x1 - fudge = 0;
+               x1 = x2;
+
+               fudge + lft x3 = w;
+               x4 = x3;
+               y4 = y2;
+               bot y3 = -d;
+       fi;
+
+       draw_gridline (z1, z2, stemthick);
+       draw_gridline (z3, z4, stemthick);
+enddef;
+
+
+fet_beginchar ("Longa notehead", "u-2");
+       draw_longa (true);
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+fet_beginchar ("Longa notehead", "d-2");
+       draw_longa (false);
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+       fet_beginchar ("Longa notehead", "u-2");
+               draw_longa (true);
+
+               draw_staff (-2, 2, 0.5);
+       fet_endchar;
+
+       fet_beginchar ("Longa notehead", "d-2");
+               draw_longa (false);
+
+               draw_staff (-2, 2, 0.5);
+       fet_endchar;
+fi;
+
+
 %
 % dimensions aren't entirely right.
 %
@@ -185,6 +268,8 @@ fet_beginchar ("Whole notehead", "s0");
        undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
                               0.68, 2 stafflinethickness#);
 
+       whole_notehead_width# := charwd;
+
        draw_staff (-2, 2, 0);
 fet_endchar;
 
@@ -201,10 +286,14 @@ if test > 0:
 fi;
 
 
+
+
 fet_beginchar ("Half notehead", "s1");
        draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17);
        undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#);
 
+       half_notehead_width# := charwd;
+
        draw_staff (-2, 2, 0);
 fet_endchar;
 
@@ -229,7 +318,6 @@ fet_beginchar ("Quart notehead", "s2");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
-
 if test > 0:
        fet_beginchar ("Quart notehead", "s2");
                draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31,
@@ -319,6 +407,10 @@ endgroup
 enddef;
 
 
+%
+%
+% UGH : xs not declared as argument.
+%
 def define_triangle_shape (expr stemdir) =
        save triangle_a, triangle_b, triangle_c;
        save triangle_out_a, triangle_out_b, triangle_out_c;
@@ -422,16 +514,17 @@ def define_triangle_shape (expr stemdir) =
                       & {direction infinity of triangle_out_c}z1'l
                       .. cycle;
 
+
        labels (0, 10, 20, 30);
        penlabels (1, 1', 2, 2', 3, 3', 12, 23, 31);
 
        % attachment Y
        if stemdir = 1:
                charwy := ypart exact_right_point;
-               charwx := xpart exact_right_point;
+               charwx := xpart exact_right_point + .5 pen_thick# * xs;
        else:
                charwy := -ypart exact_down_point;
-               charwx := (width# - xpart exact_down_point);
+               charwx := (width# - (xpart exact_down_point - 0.5 * xs * pen_thick#));
        fi
 enddef;
 
@@ -486,14 +579,14 @@ def draw_small_triangle_head (expr dir) =
 enddef;
 
 
-fet_beginchar ("Half trianglehead", "d1triangle");
+fet_beginchar ("Half trianglehead (downstem)", "d1triangle");
        draw_small_triangle_head (-1);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
 
 
-fet_beginchar ("Half trianglehead", "u1triangle");
+fet_beginchar ("Half trianglehead (upstem)", "u1triangle");
        draw_small_triangle_head (1);
 
        draw_staff (-2, 2, 0.5);
@@ -514,14 +607,14 @@ def draw_closed_triangle_head (expr dir) =
 enddef;
 
 
-fet_beginchar ("Quart trianglehead", "u2triangle");
+fet_beginchar ("Quart trianglehead (upstem)", "u2triangle");
        draw_closed_triangle_head (1);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
 
 
-fet_beginchar ("Quart trianglehead", "d2triangle");
+fet_beginchar ("Quart trianglehead (downstem)", "d2triangle");
        draw_closed_triangle_head (-1);
 
        draw_staff (-2, 2, 0.5);
@@ -881,14 +974,16 @@ fi;
 %
 
 save solfa_pen_thick;
-solfa_pen_thick# = 2 stafflinethickness#;
+solfa_pen_thick# = 1.75 stafflinethickness#;
 define_blacker_pixels (solfa_pen_thick);
 
 
-solfa_whole_width := 1.8;
-solfa_half_width := 1.35;
-solfa_quarter_width := 1.35;
+save solfa_base_notewidth;
+solfa_base_notewidth# := black_notehead_width#;
 
+solfa_whole_width := whole_notehead_width# / black_notehead_width#;
+solfa_half_width := half_notehead_width# / black_notehead_width#;
+solfa_quarter_width := 1.0;
 
 def draw_do_head (expr width_factor, dir) =
        save p_in, p_out;
@@ -896,8 +991,8 @@ def draw_do_head (expr width_factor, dir) =
        path p_in, p_out;
        pair left_dist, right_dist;
 
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_base_notewidth#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        pickup pencircle scaled solfa_pen_thick;
 
@@ -986,8 +1081,8 @@ def draw_re_head (expr width_factor, dir) =
        save p_in, p_out;
        path p_in, p_out;
 
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_base_notewidth#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        pickup pencircle scaled solfa_pen_thick;
 
@@ -1070,8 +1165,8 @@ def draw_mi_head (expr width_factor) =
        path path_out, path_in;
        pair ne_dist, se_dist, ne, se;
 
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_base_notewidth#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        pickup pencircle scaled solfa_pen_thick;
 
@@ -1132,21 +1227,21 @@ fet_endchar;
 
 
 fet_beginchar ("Half mihead", "s1mi");
-       draw_mi_head (1.6);
+       draw_mi_head (solfa_quarter_width);
        fill path_out;
        unfill path_in;
 fet_endchar;
 
 
 fet_beginchar ("Quart mihead", "s2mi");
-       draw_mi_head (1.65);
+       draw_mi_head (solfa_quarter_width);
        fill path_out;
 fet_endchar;
 
 
 def draw_fa_head (expr width_factor) =
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_base_notewidth#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        save p_down_in, p_down_out, p_up_in, p_up_out, nw_dist, nw;
        path p_down_in, p_down_out, p_up_in, p_up_out;
@@ -1236,8 +1331,8 @@ fet_endchar;
 
 
 def draw_la_head (expr width_factor) =
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_base_notewidth#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
        save p_in, p_out;
        path p_in, p_out;
 
@@ -1295,8 +1390,8 @@ fet_endchar;
 
 
 def draw_ti_head (expr width_factor, dir) =
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_base_notewidth#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
        save p_in, p_out, p_top;
        save nw_dist, sw_dist, nw, sw;
        path p_in, p_out, p_top;