[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Ties
From: |
Mark Hindley |
Subject: |
[PATCH] Ties |
Date: |
Tue, 12 Jun 2001 10:02:30 +0100 (BST) |
Hi all,
One of the bits of lily's output I have been least happy with is the
ties. When they are small they don't actually point at the notes they
tie.
I have revised tie.cc with a simpler control mechanism based on a
scheme property. IMHO the ties look much better. What do people think?
Best wishes
Mark
--- ./lily/tie.cc Fri Apr 6 08:15:15 2001
+++ ./lily/tie.cc Tue Jun 12 09:52:52 2001
@@ -185,28 +185,16 @@
Bezier b = slur_shape (width, h_inf, r_0);
- Offset leave_dir = b.control_[1] - b.control_[0];
-
- Grob *hed =head (me, headdir);
- Real dx = (hed->extent (hed, X_AXIS).length () + x_gap_f)/2.0;
- Real max_gap = leave_dir[Y_AXIS] * dx / leave_dir[X_AXIS];
-
/*
- for small ties (t small) we want to start in the Y-center (so dy = 0), for
- large ties, the tie should appear to come from the center of the
- head, so dy = max_gap
-
- maybe use a different formula?
+ I think this better, particularly for small ties. It always allows the
user to move ties if
+ they seem in the wrong place
TODO: what if 2 heads have different size.
- TODO: for small ties, it is better to start over the heads
- iso. next to the heads.
*/
- Real t = (width / staff_space - 5.0); // ugh.
- Real dy = t > 0 ? max_gap * sqr (t / (1 + t)) : 0.0;
- Real ypos = Tie::position_f (me) * staff_space/2 + dir * dy;
+ Real ypos = Tie::position_f (me) * staff_space/2
+ + dir * gh_scm2double (me->get_grob_property ("y-offset"));;
/*
Make sure we don't start on a dots
--- ./scm/grob-property-description.scm Thu May 10 07:44:42 2001
+++ ./scm/grob-property-description.scm Tue Jun 12 09:39:05 2001
@@ -362,4 +362,5 @@
(grob-property-description 'word-space number? "elongate left by this much
(FIXME: cumbersome semantics).")
(grob-property-description 'x-gap number? "horizontal gap between notehead and
tie.")
(grob-property-description 'y-free number? "minimal vertical gap between slur
and noteheads or stems.")
+(grob-property-description 'y-offset number? "extra vertical offset for ties
away from the center line.")
(grob-property-description 'y number? "set by beam: position of left edge.")
--- ./scm/grob-description.scm Tue May 29 08:06:16 2001
+++ ./scm/grob-description.scm Tue Jun 12 09:27:08 2001
@@ -673,6 +673,7 @@
(details . ((ratio . 0.333) (height-limit . 1.0)))
(thickness . 1.2)
(x-gap . 0.2)
+ (y-offset . 0.6)
(minimum-length . 2.5)
(meta . ,(grob-description "Tie" tie-interface ))
))
- [PATCH] Ties,
Mark Hindley <=