]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bezier-bow.cc
* lily/parser.yy (relative_music): start at middle C without pitch
[lilypond.git] / lily / bezier-bow.cc
index 89d1af47750f4129ba7defacaf7162dd44c4f1fa..85d116e78c0725671c357363340009a619806803 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include <math.h>
@@ -26,6 +26,16 @@ slur_height (Real width, Real h_inf, Real r_0)
 }
 
   /*
+
+
+  ^              x                    x                  
+  |
+height   <indent>
+  |
+  v      x                                    x
+
+  
+  
   For small w, the height should be proportional to w, for w ->
   infinity, the height should rise to a limit asymptotically.
 
@@ -41,7 +51,7 @@ slur_height (Real width, Real h_inf, Real r_0)
 
   * F (x) = 2/pi * atan (pi x/2)
 
-  * F (x) 1/alpha * x^alpha / (1 + x^alpha)
+  * F (x) 1/alpha * x^alpha / (1 + x^alpha)
 
   * (etc.)
 
@@ -54,6 +64,23 @@ slur_height (Real width, Real h_inf, Real r_0)
   no experiments for determining the best combinations of F, h_inf and
   r_0.
 
+
+  The indent is proportional to the height of the slur for small
+  slurs.  For large slurs, this gives a certain hookiness at the end,
+  so we increase the indent.
+
+  ind = G(w)
+
+  w -> 0,  G(w) -> .5 h
+
+  w -> inf, G(w) -> 2*h
+
+  eg.
+
+
+  G(w) = h (w/(w+h_inf) 1.5 + .5 h 
+  
+  
   */
 
 Bezier
@@ -61,7 +88,7 @@ slur_shape (Real width, Real h_inf, Real r_0)
 {
   Bezier curve;
   Real height =  slur_height (width, h_inf, r_0);
-  Real indent = height;
+  Real indent = (width/(h_inf+ width)*1.5 + 0.5) * height;
 
   curve.control_[0] = Offset (0, 0);
   curve.control_[1] = Offset (indent, height);