]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.9.jcn2: sleur
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 30 Nov 1998 21:14:01 +0000 (22:14 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 30 Nov 1998 21:14:01 +0000 (22:14 +0100)
pl 9.jcn2
- bf/redo: slur.cc, encompass-info: setting of encompass array.
- switched tuplet-engaver off (core dumps)

18 files changed:
NEWS
VERSION
dstreamrc
init/engraver.ly
input/bugs/hari-number.ly
input/bugs/slur-broken.ly
input/bugs/slur-bug.fly
input/bugs/slur-symmetry.ly
input/test/sleur.ly
input/test/slur-symmetry-1.ly [new file with mode: 0644]
input/test/slur-symmetry.ly [new file with mode: 0644]
lily/abbrev.cc
lily/bezier.cc
lily/bow.cc
lily/encompass-info.cc
lily/include/bezier.hh
lily/slur.cc
lily/stem.cc

diff --git a/NEWS b/NEWS
index f62055d1acadc5954414e38366ad090563356da7..0da4d944416af46bad464a31821e1e5c7fb2b2d0 100644 (file)
--- 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 60a009dfcf33be057979abd53e63aada6be0b6d0..0b426ed3f58c33bb8a19177a6f678772729338ca 100644 (file)
--- 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.
index 330a276b849e50b650c0bf9e728d138cfc09face..c7db1bd6ce9cc8009a2282fa664a28a634aa35aa 100644 (file)
--- 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
index 078a6211ac5bce3685b987ad36df7457ed20675d..a2c9db5990218e42a3f290174420dd401f83e93f 100644 (file)
@@ -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";
 };
index 79bdd6050d2ba093a52dbdecdc7b94dc39d514d2..444d4e32063c48a152077a85047abf049932771a 100644 (file)
@@ -1,5 +1,5 @@
 \score{
-       \melodic { R1 }
+       \notes { R1 }
        \paper{
                linewidth = 40.0\mm;
 
index cb8391a086a4ecba7a52cb96c1263b200a9dbb3f..7cf4645bcde1e08953fbb1d6f3efbc75b1ae24f7 100644 (file)
@@ -1,4 +1,4 @@
-shortlong = \melodic{
+shortlong = \notes{
        c4()c( c c  |
        c c c c |
        c c c c |
index 474bf96c2308a0c2f45e386569dcdae0687b739a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -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 |
-       }
-}
index 60e1ad8dc6642c78caaeb9334a37e47df0d29781..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -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;
-       }
-}
index a40246690749603096452c4fc2a852277c8dee48..d23fe761cb1a261eb32d23fdb4dfdc7096cc9c1b 100644 (file)
@@ -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 (file)
index 0000000..4811a63
--- /dev/null
@@ -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 (file)
index 0000000..93c2df1
--- /dev/null
@@ -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;
+       }
+}
index 841f063ca6f739f095043dde8a6bfe2790914d3c..36279673fd1fc049f414fb0a1adee8f582c49271 100644 (file)
@@ -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_)
     { 
index 6eb7bbecfdefd3c7c903bafdf86b3320fc79c4b4..59948a0d181fc7380edc12a07f3e91afcee882f9 100644 (file)
@@ -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);
 }
 
index 51463e2c5020ed75eeac7c070f5fdb9b0fd10cf2..016308a23359fabbcb805135b52c2225bf475aa5 100644 (file)
@@ -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;
 }
index 3da2c28559a74edb3e05f721e77475629fea2fa5..163287b6556e417b0f99bb51e0d0d4275883c3a8 100644 (file)
@@ -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;
 }
 
index 80140377009c23682c838a9772dbb6d79991301d..274c9f59a481dce66c26e7c220a88578a4845661 100644 (file)
@@ -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 ();
index 26d369703d6656806da1083a60ae7486d8acdd5f..f02f5826d4615afab53bf5f1bf86efba7065be4e 100644 (file)
@@ -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;
 }
 
index f23ca3b67ab339bdfe2f82c7351f5689ac575fe3..aa9d542f48266a1ff18e153ffec544a86507f869 100644 (file)
@@ -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_];
     }