]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.10
authorfred <fred>
Tue, 26 Mar 2002 21:44:48 +0000 (21:44 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:44:48 +0000 (21:44 +0000)
17 files changed:
dstreamrc
init/engraver.ly
input/bugs/hari-number.ly
input/bugs/slur-broken.ly
input/opus-130.ly [new file with mode: 0644]
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/dynamic-engraver.cc
lily/encompass-info.cc
lily/include/bezier.hh
lily/slur.cc
lily/stem.cc
lily/text-item.cc

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 |
diff --git a/input/opus-130.ly b/input/opus-130.ly
new file mode 100644 (file)
index 0000000..0f74f1e
--- /dev/null
@@ -0,0 +1,71 @@
+\header{
+filename =      "opus-130.ly";
+title =         "Quartett";
+description =   "";
+composer =      "Ludwig van Beethoven (1770-1827)";
+opus = "130";
+enteredby =     "JCN";
+copyright =     "public domain";
+}
+
+% \version "1.0.10";
+
+global = \notes {
+       \key g;
+       \time 3/8;
+       \skip 4.*8;
+% 1.1.9 broken
+%      \bar ":|";
+}
+
+tempi = \notes {
+       \property Voice.textstyle = "large"
+       s8^"Allegro assai"
+}
+
+dynamics = \notes {
+       \type Voice=i 
+       s8\p\< \!s8.\> \!s16 | s4.\p | s8\< s8. \!s16 | s4.\p |
+       s8\p\< \!s8.\> \!s16 | s4.\p | s8\< s8. \!s16 | s4.\p |
+}
+
+violinei = \notes\relative c''{
+       \type Voice=i 
+       [d8(b)d16] r | g,4. | [a16(b c8)e16] r | g,8~fis4 | 
+       [d''8(b)d16] r | g,4. | [a16(b c8)fis,16] r | fis8~g4 |
+}
+
+violineii = \notes\relative c'{
+       \type Voice=i 
+       [b8(d)b] | [e(g,)e'] | [e(c)a'] | [a(c)a] | 
+       % copy from violinei: 5-8
+       [d8(b)d16] r | g,4. | [a16( b c8)fis,16] r | fis8~g4 |
+}
+
+viola = \notes\relative c'{
+       \type Voice=i 
+       \clef "alto";
+       [g8(b)g] | [b(e,)b'] | [c,(a')c,] | [c'(d,)c'] | [b(d)b] | 
+       [e(g,)e'] | [e(e,<)a' c,]> | <[a(c,> <fis b,> )b,] |
+}
+
+cello = \notes\relative c'{
+       \type Voice=i 
+       \clef "bass";
+       g4 r8 | e'4 r8 | c4 r8 | d4 r8 | [g,,8 b g] | [b(e,)b'] |
+       [c,(a')d,] | [d'(d,)g] |
+}
+
+\score{
+       \type StaffGroup <
+               \type Staff = i < \tempi \global \dynamics \violinei >
+               \type Staff = ii < \global \dynamics \violineii >
+               \type Staff = iii < \global \dynamics \viola >
+               \type Staff = iv < \global \dynamics \cello >
+       >
+       \paper{
+               \translator { \OrchestralScoreContext }
+       }
+       \midi{ \tempo 4 = 160; }
+}
+
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 fbfd95459d5ee0a3f6e137e910f73c41e168c6a2..d5419588446007feaffcf4426e6d177cae55c895 100644 (file)
@@ -62,14 +62,15 @@ Dynamic_engraver::do_process_requests()
            }
          
          Text_def * td_p = new Text_def;
-         td_p->align_dir_ = CENTER;
          String loud = absd->loudness_str ();
          td_p->text_str_ =  paper ()->lookup_l (0)->dynamic (loud).str_; // ugh
          td_p->style_str_ = "dynamic";
-
-         
+         td_p->align_dir_ = RIGHT;
+         Real nw_f = paper ()->note_width () * 0.8;
 
          dynamic_p_ = new Text_item (td_p);
+         dynamic_p_->translate (Offset (nw_f, 0));
+
          announce_element (Score_element_info (dynamic_p_, dreq_l));
        }
       else if (Span_dynamic_req *span_l = dynamic_cast <Span_dynamic_req *> (dreq_l))
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_];
     }
index b6252548673cafea2353d7422e8d9625db60e54a..1cc4105f69690eefebbd27a8273cc041a9e6e222 100644 (file)
@@ -67,9 +67,8 @@ Text_item::brew_molecule_p () const
 {
   Atom a (tdef_p_->get_atom (paper (), dir_));
 
-
-  if (fat_b_)
-    a.dim_[X_AXIS] = tdef_p_->width (paper ());
+  if (!fat_b_)
+    a.dim_[X_AXIS] = Interval (0,0);
   Molecule* mol_p = new Molecule (a);
 
   if (dir_<0)          // should do something better anyway.