lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fixes position of mensural c clef (issue 6503091)


From: PhilEHolmes
Subject: Fixes position of mensural c clef (issue 6503091)
Date: Fri, 07 Sep 2012 17:10:04 +0000

Reviewers: ,

Message:
Please review

Description:
Well, after about a week of study of metafont code and debugging the
original, I've finally arrived at an updated version of the mensural C
clef. The previous version is undoubtedly misplaced - the centre of the
clef should align with a middle C note, but it was half a staff-space
low.  There were a number of logic errors in the code which meant that
the intended use of the shift parameter invariably failed except for the
special case that was in the original code.  I've also added support for
a clef on each staff line while I was at it.

Please review this at http://codereview.appspot.com/6503091/

Affected files:
  M mf/parmesan-clefs.mf
  M scm/parser-clef.scm


Index: mf/parmesan-clefs.mf
diff --git a/mf/parmesan-clefs.mf b/mf/parmesan-clefs.mf
index 34a09cf20bc40d7b0def688c2af66fc54731362f..934109fe54d5f63c00a006a99ded0370974ef534 100644
--- a/mf/parmesan-clefs.mf
+++ b/mf/parmesan-clefs.mf
@@ -528,7 +528,7 @@ enddef;
 % The other parameters are the same as with `draw_brevis'.
 %
 def draw_triple_brevis (expr exact_center, bwidth, bheight,
-                            blinethickness, shift) =
+                               blinethickness, shift) =
        save brevis_width, brevis_height, linethickness;

        brevis_width# = bwidth;
@@ -580,7 +580,7 @@ def draw_triple_brevis (expr exact_center, bwidth, bheight,
                                      shifted (2 xoffs + brevis_width, 0);
        pat_out := pat_out
                   -- reverse pat_out yscaled -1
-                                     shifted (0, -2 yoffs)
+                                     shifted (0, 2 yoffs - 2 shift)
                   -- cycle;

        fill pat_out;
@@ -851,9 +851,9 @@ def draw_mensural_c_clef (expr exact_center, reduction) =

        define_pixels (reduced_il);

-       draw_triple_brevis (exact_center + (0, 0.5 staff_space#),
-                           2 reduced_il#, 0.8 staff_space#,
-                           0.8 linethickness#, staff_space);
+       draw_triple_brevis (exact_center + (0, 1.0 staff_space#),
+                               2 reduced_il#, 0.8 staff_space#,
+                               0.8 linethickness#, staff_space);

        save half_reduced_il;

@@ -862,10 +862,9 @@ def draw_mensural_c_clef (expr exact_center, reduction) =
        define_pixels (half_reduced_il);

        set_char_box (0 - xpart exact_center,
-                     2 reduced_il# + xpart exact_center,
-                     2.2 half_reduced_il# + staff_space# -
-                       2 ypart exact_center,
-                     2.2 half_reduced_il# + 2 ypart exact_center);
+                       2 reduced_il# + xpart exact_center,
+                       2.2 half_reduced_il# + staff_space# - 2 ypart 
exact_center,
+                       2.2 half_reduced_il# + 2 ypart exact_center);

        save xoffs, yoffs;

@@ -883,38 +882,35 @@ def draw_mensural_c_clef (expr exact_center, reduction) =
        pickup pencircle transformed T;
        ellipse := fullcircle transformed T;

-       lft x11 = lft x13 = xoffs;
-       top y11 = yoffs + 2.2 half_reduced_il;
-       bot y13 = yoffs - 2.2 half_reduced_il - staff_space;
-       rt x15 = rt x17 = xoffs + brevis_width;
-       y15 = yoffs + 1.4 half_reduced_il;
-       y17 = yoffs - 1.4 half_reduced_il - staff_space;
-
-       z12 = z14 yscaled -1 shifted (0, -staff_space);
-       z14 = z9;
-       z16 = z18 yscaled -1 shifted (0, -staff_space);
-       rt z18 = lft z14 shifted (brevis_width, 0);
+       z12 = z9 shifted (0, 2.5 staff_space);
+       z11 = z12 shifted (0, 1.8 staff_space);
+       z14 = z9;  % z9 is the bottom left of the drawn triple-clef
+       z13 = z14 shifted (0,  -1.1 staff_space);
+       z16 = z9 shifted (brevis_width - 1.4 linethickness, 0);
+       z15 = z16 shifted (0, -0.4 staff_space);
+       z18 = z16 shifted (0, 3.0 staff_space);
+       z17 = z18 shifted (0, 0.5 staff_space);

        penpos12 (1.4 linethickness, 0);
        penpos14 (1.4 linethickness, 0);
        penpos16 (1.4 linethickness, 0);
        penpos18 (1.4 linethickness, 0);

-       fill get_subpath (ellipse, up, down, z11)
+       fill get_subpath (ellipse, up, down, z11) %top left ornament
             -- z12l
             -- z12r
             -- cycle;
-       fill get_subpath (ellipse, down, up, z13)
+       fill get_subpath (ellipse, down, up, z13) %bottom left ornament
             -- z14r
             -- z14l
             -- cycle;
-       fill get_subpath (ellipse, up, down, z15)
-            -- z16l
+       fill get_subpath (ellipse, down, up, z15) %bottom right
             -- z16r
+            -- z16l
             -- cycle;
-       fill get_subpath (ellipse, down, up, z17)
-            -- z18r
+       fill get_subpath (ellipse, up, down, z17) %top right
             -- z18l
+            -- z18r
             -- cycle;

        labels (11, 13, 15, 17);
Index: scm/parser-clef.scm
diff --git a/scm/parser-clef.scm b/scm/parser-clef.scm
index 6d46cc626cc8df1cc64743af3428bed24fc665d7..ccff6e92741627ec1bfa5ff13da01098c97f657b 100644
--- a/scm/parser-clef.scm
+++ b/scm/parser-clef.scm
@@ -44,7 +44,6 @@
     ("vaticana-do2" . ("clefs.vaticana.do" 1 0))
     ("vaticana-do3" . ("clefs.vaticana.do" 3 0))
     ("vaticana-fa1" . ("clefs.vaticana.fa" -1 0))
-
     ("vaticana-fa2" . ("clefs.vaticana.fa" 1 0))
     ("medicaea-do1" . ("clefs.medicaea.do" -1 0))
     ("medicaea-do2" . ("clefs.medicaea.do" 1 0))
@@ -57,16 +56,18 @@
     ("hufnagel-fa1" . ("clefs.hufnagel.fa" -1 0))
     ("hufnagel-fa2" . ("clefs.hufnagel.fa" 1 0))
     ("hufnagel-do-fa" . ("clefs.hufnagel.do.fa" 4 0))
-    ("mensural-c1" . ("clefs.mensural.c" -2 0))
-    ("mensural-c2" . ("clefs.mensural.c" 0 0))
-    ("mensural-c3" . ("clefs.mensural.c" 2 0))
-    ("mensural-c4" . ("clefs.mensural.c" 4 0))
+    ("mensural-c1" . ("clefs.mensural.c" -4 0))
+    ("mensural-c2" . ("clefs.mensural.c" -2 0))
+    ("mensural-c3" . ("clefs.mensural.c" 0 0))
+    ("mensural-c4" . ("clefs.mensural.c" 2 0))
+    ("mensural-c5" . ("clefs.mensural.c" 4 0))
     ("mensural-f" . ("clefs.mensural.f" 2 0))
     ("mensural-g" . ("clefs.mensural.g" -2 0))
     ("neomensural-c1" . ("clefs.neomensural.c" -4 0))
     ("neomensural-c2" . ("clefs.neomensural.c" -2 0))
     ("neomensural-c3" . ("clefs.neomensural.c" 0 0))
     ("neomensural-c4" . ("clefs.neomensural.c" 2 0))
+    ("neomensural-c5" . ("clefs.neomensural.c" 4 0))
     ("petrucci-c1" . ("clefs.petrucci.c1" -4 0))
     ("petrucci-c2" . ("clefs.petrucci.c2" -2 0))
     ("petrucci-c3" . ("clefs.petrucci.c3" 0 0))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]