From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 30 Nov 1998 21:14:01 +0000 (+0100)
Subject: patch::: 1.1.9.jcn2: sleur
X-Git-Tag: release/1.1.10~2
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=67604ce199d86ea202f2afd8ecb3f02c7660abbd;p=lilypond.git

patch::: 1.1.9.jcn2: sleur

pl 9.jcn2
	- bf/redo: slur.cc, encompass-info: setting of encompass array.
	- switched tuplet-engaver off (core dumps)
---

diff --git a/NEWS b/NEWS
index f62055d1ac..0da4d94441 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+pl 9.jcn2
+	- bf/redo: slur.cc, encompass-info: setting of encompass array.  
+	- switched tuplet-engaver off (core dumps)
+
 pl 9.jcn1	
 	- bf (urg): no |: at start of piece
 	- bf?: text defs without width
diff --git a/VERSION b/VERSION
index 60a009dfcf..0b426ed3f5 100644
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=9
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/dstreamrc b/dstreamrc
index 330a276b84..c7db1bd6ce 100644
--- a/dstreamrc
+++ b/dstreamrc
@@ -31,8 +31,11 @@ Axis_group_administration	0
 Bar			1
 Bar_req			1
 Beam			0
-Bow			1
+Bezier			1
 Bezier_bow		1
+Bezier_bow_controls	1
+Bezier_controls		0
+Bow			1
 Change_iterator		1
 Change_translator	1
 Chord			1
diff --git a/init/engraver.ly b/init/engraver.ly
index 078a6211ac..a2c9db5990 100644
--- a/init/engraver.ly
+++ b/init/engraver.ly
@@ -102,7 +102,7 @@ VoiceContext = \translator {
 	\consists "Font_size_engraver";
 	\consists "Slur_engraver";
 	\consists "Ties_engraver";
-	\consists "Tuplet_engraver";	
+%	\consists "Tuplet_engraver";	
 	\consists "Note_heads_engraver" ;	
 	\consists "Skip_req_swallow_translator";
 };
diff --git a/input/bugs/hari-number.ly b/input/bugs/hari-number.ly
index 79bdd6050d..444d4e3206 100644
--- a/input/bugs/hari-number.ly
+++ b/input/bugs/hari-number.ly
@@ -1,5 +1,5 @@
 \score{
-	\melodic { R1 }
+	\notes { R1 }
 	\paper{
 		linewidth = 40.0\mm;
 
diff --git a/input/bugs/slur-broken.ly b/input/bugs/slur-broken.ly
index cb8391a086..7cf4645bcd 100644
--- a/input/bugs/slur-broken.ly
+++ b/input/bugs/slur-broken.ly
@@ -1,4 +1,4 @@
-shortlong = \melodic{
+shortlong = \notes{
 	c4()c( c c  |
 	c c c c |
 	c c c c |
diff --git a/input/bugs/slur-bug.fly b/input/bugs/slur-bug.fly
index 474bf96c23..e69de29bb2 100644
--- a/input/bugs/slur-bug.fly
+++ b/input/bugs/slur-bug.fly
@@ -1,9 +0,0 @@
-% bug
-% excentric slur can't handle this ...
-\score{
-	\melodic{
-		\octave c; 
-		\stemdown; 
-		\[4/5c8( c f,, c c\]1/1 c c c )c |
-	}
-}
diff --git a/input/bugs/slur-symmetry.ly b/input/bugs/slur-symmetry.ly
index 60e1ad8dc6..e69de29bb2 100644
--- a/input/bugs/slur-symmetry.ly
+++ b/input/bugs/slur-symmetry.ly
@@ -1,16 +0,0 @@
-\header{
-% should look the same
-title="symmetry";
-}
-\score{
-	\melodic\relative c'{
-		[g'8( e )c' g,]
-		[d'( f' )a, a]
-		[d( f )a, d']
-		[g,( e, )c' c]
-	}
-	\paper{
-		castingalgorithm = \Wordwrap;
-		linewidth = 50.0\mm;
-	}
-}
diff --git a/input/test/sleur.ly b/input/test/sleur.ly
index a402466907..d23fe761cb 100644
--- a/input/test/sleur.ly
+++ b/input/test/sleur.ly
@@ -170,6 +170,7 @@ clipping = \notes\transpose c'{
 
 \score{
 	\notes{ 
+%		\property Voice.pletvisibility = 0;
 		% use blend for fast check
 		\blend
 % {
diff --git a/input/test/slur-symmetry-1.ly b/input/test/slur-symmetry-1.ly
new file mode 100644
index 0000000000..4811a63d4c
--- /dev/null
+++ b/input/test/slur-symmetry-1.ly
@@ -0,0 +1,15 @@
+\header{
+% should look the same
+title="symmetry";
+}
+\score{
+	\notes\relative c'{
+		[g'8( e )c' g,] r2
+		\break
+		[d''8( f )a, d'] r2
+	}
+	\paper{
+		castingalgorithm = \Wordwrap;
+		linewidth = 50.0\mm;
+	}
+}
diff --git a/input/test/slur-symmetry.ly b/input/test/slur-symmetry.ly
new file mode 100644
index 0000000000..93c2df1825
--- /dev/null
+++ b/input/test/slur-symmetry.ly
@@ -0,0 +1,16 @@
+\header{
+% should look the same
+title="symmetry";
+}
+\score{
+	\notes\relative c'{
+		[g'8( e )c' g,]
+		[d'( f' )a, a]
+		[d( f )a, d']
+		[g,( e, )c' c]
+	}
+	\paper{
+		castingalgorithm = \Wordwrap;
+		linewidth = 50.0\mm;
+	}
+}
diff --git a/lily/abbrev.cc b/lily/abbrev.cc
index 841f063ca6..36279673fd 100644
--- a/lily/abbrev.cc
+++ b/lily/abbrev.cc
@@ -54,13 +54,7 @@ Abbreviation::brew_molecule_p () const
       b.translate_axis (interbeam_f * i, Y_AXIS);
       beams->add_atom (b);
     }
-#define EGCS_ICE
-#ifndef EGCS_ICE
   beams->translate_axis (-beams->extent ()[Y_AXIS].center (), Y_AXIS);
-#else
-  beams->translate_axis (-(beams->extent ()[Y_AXIS].min () + 
-    beams->extent ()[Y_AXIS].max ()) / 2 , Y_AXIS);
-#endif
 
   if (stem_l_)
     { 
diff --git a/lily/bezier.cc b/lily/bezier.cc
index 6eb7bbecfd..59948a0d18 100644
--- a/lily/bezier.cc
+++ b/lily/bezier.cc
@@ -85,6 +85,24 @@ Bezier::calc (int steps)
     }
 }
 
+void
+Bezier::print () const
+{
+#ifndef NPRINT
+  if (check_debug && !monitor->silent_b ("Bezier_controls"))
+    {
+      if (control_[1].length ())
+        {
+	  cout << "Bezier\n";
+	  cout << "Controls:  ";
+	  for (int i=0; i < control_.size (); i++)
+	    cout << control_[i].str () << ", ";
+//	  cout << "\n";
+	}
+    }
+#endif
+}
+
 void
 Bezier::set (Array<Offset> points)
 {       
@@ -212,11 +230,33 @@ Bezier_bow::calc_f (Real height)
 void
 Bezier_bow::calc ()
 {
+#ifndef NPRINT
+//  if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+  if (check_debug && !(monitor->silent_b ("Bezier_controls")
+    && monitor->silent_b ("Bezier_bow_controls")))
+    {
+      cout << "Before transform*********\n";
+      print ();
+      cout << "************************\n";
+    }
+#endif
   transform ();
+  print ();
 
   calc_controls ();
 
+  print ();
   transform_back ();
+#ifndef NPRINT
+//  if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+  if (check_debug && !(monitor->silent_b ("Bezier_controls")
+    && monitor->silent_b ("Bezier_bow_controls")))
+    {
+      cout << "After transform*********\n";
+      print ();
+      cout << "************************\n";
+    }
+#endif
 }
 
 /*
@@ -474,6 +514,22 @@ Bezier_bow::check_fit_f ()
   return dy;
 }
 
+void
+Bezier_bow::print () const
+{
+#ifndef NPRINT
+  Bezier::print ();
+  if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+    {
+      cout << "Bezier_bow\n";
+      cout << "Encompass: ";
+      for (int i=0; i < encompass_.size (); i++)
+	cout << encompass_[i].str () << ", ";
+//      cout << "\n";
+    }
+#endif
+}
+
 void
 Bezier_bow::set (Array<Offset> points, int dir)
 {
@@ -541,20 +597,11 @@ Bezier_bow::calc_default (Real h)
   Real indent = alpha * atan (beta * b);
   Real height = indent + h;
  
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
   Array<Offset> control;
   control.push (Offset (0, 0));
   control.push (Offset (indent, height));
   control.push (Offset (b - indent, height));
   control.push (Offset (b, 0));
-#else
-  Array<Offset> control (4);
-  control[0] = Offset (0, 0);
-  control[1] = Offset (indent, height);
-  control[2] = Offset (b - indent, height);
-  control[3] = Offset (b, 0);
-#endif
   Bezier::set (control);
 }
 
diff --git a/lily/bow.cc b/lily/bow.cc
index 51463e2c50..016308a233 100644
--- a/lily/bow.cc
+++ b/lily/bow.cc
@@ -77,9 +77,8 @@ Bow::center () const
 Interval
 Bow::do_height () const
 {
-  Array<Offset> c (get_controls());
-
   Interval iv;
+  Array<Offset> c (get_controls());
   for (int i=0; i < c.size (); i++)
     {
       Real y = c[i][Y_AXIS];
@@ -118,16 +117,9 @@ Bow::get_encompass_offset_arr () const
     dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
   d.x() += width (). length ();
 
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
   Array<Offset> notes;
-  notes.push (Offset 0, 0));
+  notes.push (Offset (0, 0));
   notes.push (d);
-#else
-  Array<Offset> notes (2);
-  notes[0] = Offset (0, 0);
-  notes[1] = Offset (d);
-#endif
 
   return notes;
 }
diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc
index 3da2c28559..163287b655 100644
--- a/lily/encompass-info.cc
+++ b/lily/encompass-info.cc
@@ -22,44 +22,36 @@ Encompass_info::Encompass_info (Note_column const* note, Direction dir)
 {
   Paper_def* paper = note->paper ();
   Real interline = paper->interline_f ();
-  Real notewidth = paper->note_width ();
+  // UGH
+  Real notewidth = paper->note_width () * 0.8;
   Real internote = interline / 2;
 
   Stem* stem = note->stem_l_;
   /* 
-    set o_.x () to middle of notehead or on eo_.x ()act o_.x () position of stem,
+    set o_.x () to middle of notehead or on the exact position of stem,
     according to slur direction
-       */
+   */
   o_.x () = stem->hpos_f ();
 
-  if (stem->dir_ != dir)
-    {
-      o_.x () += 0.5 * notewidth;
-      // ugh
-      if (dir == DOWN)
-	o_.x () -= 0.5 * notewidth;
-      else
-	o_.x () += 0.5 * notewidth;
-    }
-  else if (stem->dir_ == UP)
-    o_.x () += 1.0 * notewidth;
+  /*
+     stem->dir == dir
+                      ________
+           |   |     /        \
+          x|  x|       |x  |x
+        \________/     |   |
 
-//  o_.x () -= left_o_.x ();
+   */
 
-  o_.y () = stem->height ()[dir];
+  if (stem->dir_ != dir)
+    o_.x () -= 0.5 * notewidth * stem->dir_;
 
+  o_.y () = stem->height ()[dir];
   /*
-    leave a gap: slur mustn't touch head/stem
+   leave a gap: slur mustn't touch head/stem
    */
-  if (stem->dir_ != dir)
-    o_.y () += 3.0 * internote * dir;
-  else
-    o_.y () += 2.0 * internote * dir;
+  o_.y () += 2.5 * internote * dir;
 
-  // ugh
-  if (dir == DOWN)
-    o_.y () += 1.5 * internote * dir;
-
-//  o_.y () -= left_o_.y ();
+  if (stem->dir_ != dir)
+    o_.y () += 1.0 * internote * dir;
 }
 
diff --git a/lily/include/bezier.hh b/lily/include/bezier.hh
index 8014037700..274c9f59a4 100644
--- a/lily/include/bezier.hh
+++ b/lily/include/bezier.hh
@@ -26,6 +26,7 @@ public:
   Calculate bezier curve into Offset (x,y) array.
   */
   void calc (int steps);
+  void print () const;
 
   void set (Array<Offset> points);
 
@@ -60,6 +61,7 @@ public:
   void calc_tangent_controls ();
   bool check_fit_bo ();
   Real check_fit_f ();
+  void print () const;
   void set (Array<Offset> points, int dir);
   void transform ();
   void transform_back ();
diff --git a/lily/slur.cc b/lily/slur.cc
index 26d369703d..f02f5826d4 100644
--- a/lily/slur.cc
+++ b/lily/slur.cc
@@ -100,7 +100,8 @@ Slur::do_post_processing ()
 
   Real interline_f = paper ()->interline_f ();
   Real internote_f = interline_f / 2;
-  Real notewidth_f = paper ()->note_width ();
+  // URG
+  Real notewidth_f = paper ()->note_width () * 0.8;
   Real slur_min = paper ()->get_var ("slur_x_minimum");
 
   /* 
@@ -219,9 +220,36 @@ Slur::do_post_processing ()
 Array<Offset>
 Slur::get_encompass_offset_arr () const
 {
+  Real notewidth = paper ()->note_width () * 0.8;
+  Real gap = paper ()->get_var ("slur_x_gap");
+  Real internote = paper ()->internote_f ();
+
   Offset left = Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]);
   left.x () += encompass_arr_[0]->stem_l_->hpos_f ();
 
+  /*
+    <URG>
+    i don't understand these two, but *must* for symmetry 
+    look at encompass array: 
+       lilypond -D input/test/slur-symmetry*.ly
+       lilypond -D input/test/sleur.ly
+
+    do_post_processing should have calculated these into
+    dx_f_drul_[], no??
+
+   */
+
+  if (dir_ != encompass_arr_[0]->stem_l_->dir_)
+    left.x () += - 0.5 * notewidth * encompass_arr_[0]->stem_l_->dir_
+      + gap;
+  else if (encompass_arr_[0]->stem_l_->dir_ == UP)
+    left.x () -= notewidth;
+
+  if ((dir_ == encompass_arr_[0]->stem_l_->dir_) 
+    && (encompass_arr_[0]->stem_l_->dir_ == DOWN))
+    left.y () -= internote * encompass_arr_[0]->stem_l_->dir_;
+  /* </URG> */
+
   Offset d = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT],
     dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
   d.x () += width ().length ();
@@ -237,38 +265,16 @@ Slur::get_encompass_offset_arr () const
   if (encompass_arr_.top () != spanned_drul_[RIGHT])
     last++;
 
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
-
   Array<Offset> notes;
   notes.push (Offset (0,0));
-//  notes.push (left);
 
   for (int i = first; i < last; i++)
     {
       Encompass_info info (encompass_arr_[i], dir_);
       notes.push (info.o_ - left);
-//      notes.push (info.o_ - left);
     }
   notes.push (d);
 
-#else
-
-  int n = last - first + 2;
-  Array<Offset> notes (n);
-  notes[0] = Offset (0,0);
-//  notes[0] = left;
-
-  for (int i = first; i < last; i++)
-    {
-      Encompass_info info (encompass_arr_[i], dir_);
-      notes[i - first + 1] = info.o_ - left;
-//     notes[i - first + 1] = info.o_;
-    }
-  notes[n - 1] = Offset (d);
-
-#endif
-
   return notes;
 }
 
diff --git a/lily/stem.cc b/lily/stem.cc
index f23ca3b67a..aa9d542f48 100644
--- a/lily/stem.cc
+++ b/lily/stem.cc
@@ -322,12 +322,7 @@ Stem::note_delta_f () const
       Real rule_thick(paper ()->rule_thickness ());
       Interval stem_wid(-rule_thick/2, rule_thick/2);
       if (stem_xdir_ == CENTER)
-#define EGCS_ICE
-#ifndef EGCS_ICE
 	r = head_wid.center ();
-#else
-	r = (head_wid.min () + head_wid.max ()) / 2;
-#endif
       else
 	r = head_wid[stem_xdir_] - stem_wid[stem_xdir_];
     }