]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.19.jcn2: Re: niew trei
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 8 Jan 1999 17:21:21 +0000 (18:21 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 8 Jan 1999 17:21:21 +0000 (18:21 +0100)
pl 19.jcn2
- multi-measure-rest is now spanner SkipBars=0 is broken

pl 19.jcn1
- hmm, almost centered whole-bar rests -- NOT

15 files changed:
NEWS
TODO
VERSION
init/engraver.ly
lily/include/multi-measure-rest-engraver.hh
lily/include/multi-measure-rest.hh
lily/include/score-column.hh
lily/include/volta-spanner.hh
lily/multi-measure-rest-engraver.cc
lily/multi-measure-rest.cc
lily/score-engraver.cc
lily/stem-info.cc
lily/timing-translator.cc
lily/volta-spanner.cc
mutopia/J.S.Bach/wtk1-fugue2.ly

diff --git a/NEWS b/NEWS
index ed3b41e22cd368e24dc26945450ade3c73869fb4..a7003e2ef94dad95d2f765ca0271fda9a6043988 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+pl 19.jcn2
+       - multi-measure-rest is now spanner SkipBars=0 is broken
+
+pl 19.jcn1
+       - hmm, almost centered whole-bar rests -- NOT
+
 pl 18.jcn5
        - bf: beamtrend
        - bf: vv-duet
diff --git a/TODO b/TODO
index 8fc5b1d5770bc06928133bc1735977616a12fc3b..2b1245e0000714daf39b1bbcc4fd76ef4e1aa27c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -30,6 +30,9 @@ grep for TODO and ugh/ugr/urg
        * update mi2mu for lilypond 1.1
 
 BUGS:
+       * collisions/voices \voiceone \voicetwo are broken; see 
+         input/praeludium-fuga-E.ly
+         mutopia/J.S.Bach/wtk1-fugue2.ly
 
        * fix: standchen.
 
@@ -573,7 +576,9 @@ SMALLISH PROJECTS
 
        * handle EOF graciously in error messages.
 
-       * centered whole rest
+       * really centered whole rest
+
+       * centered multi-bar-rest
 
        * declare notenametab?
 
diff --git a/VERSION b/VERSION
index 985f62eacd89c8d7755cdb6197e8794a96a9799f..80ecd75d529df3b5b3bda2acb700f6b45d03b8bc 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=19
-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 11f088408155292bbd2ecf9a5f2777337dc8765d..6ad41f5600d269142fbf223f0e96d9f349baf855 100644 (file)
@@ -15,6 +15,7 @@ StaffContext=\translator {
 %}
 %      \type "Hara_kiri_line_group_engraver";
 
+       \consists "Multi_measure_rest_engraver";
        \consists "Repeat_engraver";
        \consists "Bar_engraver";
        \consists "Clef_engraver";
@@ -97,7 +98,7 @@ VoiceContext = \translator {
        \consists "Stem_engraver";
        \consists "Beam_engraver";
        \consists "Abbreviation_beam_engraver";
-       \consists "Multi_measure_rest_engraver";
+%      \consists "Multi_measure_rest_engraver";
 
        % ugh.  Order matters here.
        \consists "Text_engraver";
index 4b54fa417cb40a52ac19892338e6ea4438fcbb53..b9d47c91588fa42018545c5da3bbb416880b07b8 100644 (file)
@@ -22,18 +22,21 @@ public:
   Multi_measure_rest_engraver ();
 
 protected:
+  virtual void acknowledge_element (Score_element_info i);
   virtual void do_process_requests ();
   virtual bool do_try_music (Music*);
   virtual void do_pre_move_processing ();
   virtual void do_post_move_processing ();
+
 private:
-  Moment rest_req_stop_mom_;
-  Moment rest_item_creation_mom_;
-  Moment req_start_mom_;
+  Moment rest_stop_mom_;
+//  Moment rest_item_creation_mom_;
+  Moment rest_start_mom_;
 
   
   int start_measure_i_;
   Multi_measure_rest_req* multi_measure_req_l_;
   Multi_measure_rest* mmrest_p_;
+  Multi_measure_rest* lastrest_p_;
 };
 #endif // MULTI_MEASURE_REST_ENGRAVER_HH
index 8be84d3002352cb7328669b23166237054011179..ed9c9769fde159d84263e95c7fa2d35aa472eb7e 100644 (file)
 #ifndef MULTI_MEASURE_REST_HH
 #define MULTI_MEASURE_REST_HH
 
-#include "item.hh"
+#include "spanner.hh"
 
-class Multi_measure_rest : public Item 
+class Multi_measure_rest : public Spanner
 {
 public:
   Multi_measure_rest ();
   int measures_i_;
+  void add_column (Bar*);
 
-  
+  Link_array<Bar> column_arr_;
 
 protected:
-  virtual void do_print () const;
   virtual Molecule *do_brew_molecule_p () const;
+  VIRTUAL_COPY_CONS (Score_element);
+
+  virtual void do_add_processing ();
+  virtual void do_post_processing ();
+  virtual void do_print () const;
+  virtual void do_substitute_dependency (Score_element*,Score_element*);
 };
 
 #endif /* MULTI_MEASURE_REST_HH */
index dc3f53961ab6c743ea85bf0cbb47a5572071f8ae..736712abdf015c9a2f8f01eba5589b782e1378c4 100644 (file)
@@ -42,7 +42,7 @@ public:
     
 
   Moment when() {  return when_; }
-  Score_column (Moment when, bool musical_b = false);
+  Score_column (Moment when, bool musical_b=false);
   void add_duration (Moment);
   void preprocess();
   bool musical_b() { return musical_b_; }
index 92dc770812a03c73e3d7daaf2a4a7f2473923192..cf8c1b32d55f88c1c51738c9d4ea711398398baf 100644 (file)
@@ -9,11 +9,11 @@
 
 #include "text-def.hh"
 #include "pointer.hh"
-#include "directional-spanner.hh"
+#include "spanner.hh"
 
 /** Volta bracket with number */
 
-class Volta_spanner : public Directional_spanner
+class Volta_spanner : public Spanner
 {
 public:
   Volta_spanner ();
@@ -29,7 +29,7 @@ public:
  
 protected:
   virtual Molecule* do_brew_molecule_p () const;
-  VIRTUAL_COPY_CONS(Score_element);
+  VIRTUAL_COPY_CONS (Score_element);
 
   virtual void do_add_processing ();
   virtual void do_post_processing ();
index 4bfa5be725a5cdde6df93d45ba1cfb5bf0fa5104..f1df3cf2e325b15013c0d317c8e24a2dfabdf919 100644 (file)
 #include "multi-measure-rest-engraver.hh"
 #include "score-column.hh"
 #include "time-description.hh"
-#include "p-score.hh"
+//#include "paper-score.hh"
+//#include "p-score.hh"
+//#include "paper-def.hh"
+//#include "main.hh"
+//#include "global-translator.hh"
+#include "bar.hh"
 
 
 ADD_THIS_TRANSLATOR (Multi_measure_rest_engraver);
@@ -19,11 +24,24 @@ ADD_THIS_TRANSLATOR (Multi_measure_rest_engraver);
 Multi_measure_rest_engraver::Multi_measure_rest_engraver ()
 {
   start_measure_i_ = 0;
-  rest_item_creation_mom_ = rest_req_stop_mom_ =0;
+  rest_stop_mom_ =0;
+  // rest_item_creation_mom_ = 0;
   multi_measure_req_l_ = 0;
   mmrest_p_ = 0;
 }
 
+void
+Multi_measure_rest_engraver::acknowledge_element (Score_element_info i)
+{
+  if (Bar *c = dynamic_cast<Bar*> (i.elem_l_))
+    {
+      if (mmrest_p_) 
+       mmrest_p_->add_column (c);
+      if (lastrest_p_)
+       lastrest_p_->add_column (c);
+    }
+}
+
 bool
 Multi_measure_rest_engraver::do_try_music (Music* req_l)
 {
@@ -31,13 +49,13 @@ Multi_measure_rest_engraver::do_try_music (Music* req_l)
    {
      if (multi_measure_req_l_)
        if (!multi_measure_req_l_->equal_b (mr)
-          || req_start_mom_ != now_moment ())
+          || rest_start_mom_ != now_moment ())
         return false;
   
      multi_measure_req_l_ = mr;
-     req_start_mom_ = now_moment ();
+     rest_start_mom_ = now_moment ();
      
-     rest_req_stop_mom_ = req_start_mom_ + multi_measure_req_l_->duration_.length ();
+     rest_stop_mom_ = rest_start_mom_ + multi_measure_req_l_->duration_.length ();
      return true;
    }
  return false;
@@ -50,15 +68,7 @@ Multi_measure_rest_engraver::do_process_requests ()
     {
       Time_description const *time = get_staff_info().time_C_;
       mmrest_p_ = new Multi_measure_rest;
-      rest_item_creation_mom_ = time->when_mom ();
-
-      rest_item_creation_mom_ += time->whole_per_measure_ / Moment (2);
-#if 0
-      // core dump because of missing column?
-      mmrest_p_->pscore_l_->add_column (new Score_column (rest_item_creation_mom_));
-      mmrest_p_->pscore_l_->add_column (new Score_column (rest_item_creation_mom_, true));
-#endif
-
+      // rest_item_creation_mom_ = time->when_mom ();
       announce_element (Score_element_info (mmrest_p_, multi_measure_req_l_));
       start_measure_i_ = time->bars_i_;
     }
@@ -68,10 +78,18 @@ void
 Multi_measure_rest_engraver::do_pre_move_processing ()
 {
   Moment now (now_moment ());
-  if (mmrest_p_ && rest_item_creation_mom_ == now)
+  //urg lily dumps core if i want to let her print all (SkipBars=0) rests...
+#if 0
+  if (mmrest_p_ && (now >= rest_start_mom_) && (mmrest_p_->column_arr_.size () >= 2))
     {
       typeset_element (mmrest_p_);
     }
+#endif
+  if (lastrest_p_)
+    {
+      typeset_element (lastrest_p_);
+      lastrest_p_ = 0;
+    }
 }
 
 void
@@ -79,12 +97,24 @@ Multi_measure_rest_engraver::do_post_move_processing ()
 {
   Time_description const *time = get_staff_info().time_C_;
   Moment now (now_moment ());
-  if (rest_req_stop_mom_ <= now)
-    multi_measure_req_l_ = 0;
 
-  if (mmrest_p_ && (!time->whole_in_measure_ || !multi_measure_req_l_))
+  /*
+   when our time's up, calculate the number of bars rest and
+   make way for new request
+   however, linger around a bit to catch this last column when
+   its announced
+   */
+  if (mmrest_p_ && (now >= rest_stop_mom_)) //&& (!time->whole_in_measure_))
     {
-      assert (rest_item_creation_mom_ < now);
+      lastrest_p_ = mmrest_p_;
+      lastrest_p_->measures_i_ = time->bars_i_ - start_measure_i_;
+      //urg lily dumps core if i want to let her print all (SkipBars=0) rests...
+#if 0
+      if (lastrest_p_->column_arr_.size () >= 2)
+        lastrest_p_ = 0;
+#endif
+      multi_measure_req_l_ = 0;
       mmrest_p_ = 0;
     }
 }
+
index 6bb3a5a6e48f868dabe74595a3f989a44514ebbe..77a49ca7bb3a8b5f90d64953f9f6d58a3f61740a 100644 (file)
@@ -3,13 +3,15 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1998, 1999 Jan Nieuwenhuizen <janneke@gnu.org>
   
  */
 
 #include "multi-measure-rest.hh"
 #include "debug.hh"
 #include "paper-def.hh"
+#include "p-col.hh" // urg
+#include "bar.hh"
 #include "lookup.hh"
 #include "rest.hh"
 #include "script.hh"
@@ -33,20 +35,26 @@ Molecule*
 Multi_measure_rest::do_brew_molecule_p () const
 {
   /*
-   [TODO]                                     3
-     * make real multi-measure rest symbol: |---|
-     * make two,four,eight-measure-rest symbols
+   [TODO]                                          17
+     * variable-sized multi-measure rest symbol: |====| ??
+     * build 3, 5, 6, 7, 8 symbols (how far, property?)
+       from whole, brevis and longa rests
    */
+  Molecule* mol_p = new Molecule;
+  if (!column_arr_.size ())
+    return mol_p;
+
   Atom s;
   if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4) 
     {
       s = (lookup_l ()->rest (- intlog2(measures_i_), 0));
+      s.translate_axis (-s.extent ()[X_AXIS].length () / 2, X_AXIS);
     }
   else 
     {
       s = (lookup_l ()->rest (-4, 0));
     }
-  Molecule* mol_p = new Molecule ( Atom (s));
+  mol_p->add_atom (s);
   Real interline_f = paper ()->interline_f ();
   if (measures_i_ == 1)
     {
@@ -67,3 +75,34 @@ Multi_measure_rest::do_brew_molecule_p () const
   return mol_p;
 }
 
+void
+Multi_measure_rest::do_add_processing ()
+{
+  if (column_arr_.size ())
+    {
+      set_bounds (LEFT, column_arr_[0 >? column_arr_.size () - 2]);
+      set_bounds (RIGHT, column_arr_[column_arr_.size () - 1]);
+    }
+}
+  
+void
+Multi_measure_rest::do_post_processing ()
+{
+  if (column_arr_.size ())
+    translate_axis (extent (X_AXIS).length () / 2, X_AXIS);
+}
+
+void
+Multi_measure_rest::do_substitute_dependency (Score_element* o, Score_element* n)
+{
+  if (Bar* c = dynamic_cast <Bar*> (o))
+    column_arr_.substitute (c, dynamic_cast<Bar*> (n));
+}
+  
+void
+Multi_measure_rest::add_column (Bar* c)
+{
+  column_arr_.push (c);
+  add_dependency (c);
+}
+
index 783e36399bc418a5819cf5658c931f95b44c1aaa..e1ab3ab2fb5ea2e055d531f17ac289792b8c35df 100644 (file)
@@ -16,7 +16,6 @@
 #include "score-column.hh"
 #include "command-request.hh"
 #include "paper-def.hh"
-#include "p-score.hh"
 
 
 
index 20f16ea05c4a02d5d19124c9807e727c5b334465..42374eb12b43ed77c630a45f56d1e194f3970cb7 100644 (file)
@@ -93,7 +93,7 @@ Stem_info::Stem_info (Stem const *s)
       if (((int)s->chord_start_f ()) && (s->dir_ != s->get_default_dir ()))
        {
          idealy_f_ -= shorten_f;
-         miny_f_ = miny_f_ <? idealy_f_ + internote_f;
+//       miny_f_ = miny_f_ <? idealy_f_ + internote_f;
        }
 
       // lowest beam of (UP) beam must never be lower than second staffline
index 71c3eb09e1ed5f22f962a47a5c39b96e7aed70c2..534d3f2f31e3503cb6e4000fac8db618b93c5318 100644 (file)
@@ -121,7 +121,7 @@ Timing_translator::do_pre_move_processing()
   /* allbars == ! skipbars */
   bool allbars = ! get_property ("SkipBars", 0).to_bool ();
 
-
+  // urg: multi bar rests: should always must process whole of first bar?
   if (!time_.cadenza_b_ && allbars)
     global_l->add_moment_to_process (time_.next_bar_moment ());
 }
index a5b6f629a03e44d9b15a1ee1a0b417c25bf7802d..751314638832671df76da764cc76a6695fa6a728 100644 (file)
 #include "stem.hh"
 #include "text-def.hh"
 
-/*
-   Hmm, should probably make generic Bracket_spanner,
-   or and derive Plet and volta spanner from that.
- */
-
 Volta_spanner::Volta_spanner ()
 {
-  dir_ = UP;
   last_b_ = false;
   number_p_.set_p (new Text_def);
   number_p_->align_dir_ = LEFT;
@@ -40,38 +34,38 @@ Volta_spanner::do_brew_molecule_p () const
 {
   Molecule* mol_p = new Molecule;
 
-  if (column_arr_.size ())
-    {
-      Real internote_f = paper ()->internote_f ();
-      Real dx = internote_f;
-      Real w = extent (X_AXIS).length () - 2 * dx;
-      Atom volta (lookup_l ()->volta (w, last_b_));
-      Real h = volta.dim_.y ().length ();
-      Atom num (number_p_->get_atom (paper (), LEFT));
-      Atom dot (dot_p_->get_atom (paper (), LEFT));
-      Real dy = column_arr_.top ()->extent (Y_AXIS) [dir_] > 
-       column_arr_[0]->extent (Y_AXIS) [dir_];
-      dy += 2 * h;
+  if (!column_arr_.size ())
+    return mol_p;
 
-      /*
-       UGH.  Must use extent  ()[dir_]
-       */
-      for (int i = 0; i < note_column_arr_.size (); i++)
-        dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
-      dy -= h;
+  Real internote_f = paper ()->internote_f ();
+  Real dx = internote_f;
+  Real w = extent (X_AXIS).length () - 2 * dx;
+  Atom volta (lookup_l ()->volta (w, last_b_));
+  Real h = volta.dim_.y ().length ();
+  Atom num (number_p_->get_atom (paper (), LEFT));
+  Atom dot (dot_p_->get_atom (paper (), LEFT));
+  Real dy = column_arr_.top ()->extent (Y_AXIS) [UP] > 
+    column_arr_[0]->extent (Y_AXIS) [UP];
+  dy += 2 * h;
 
-      Real gap = num.dim_.x ().length () / 2;
-      Offset off (num.dim_.x ().length () + gap, 
-        (h - num.dim_.y ().length ()) / internote_f - gap);
-      num.translate (off);
-      Real dotheight = dot.dim_.y ().length () / 7;
-      off -= Offset (0, dotheight);
-      dot.translate (off);
-      mol_p->add_atom (volta);
-      mol_p->add_atom (num);
-      mol_p->add_atom (dot);
-      mol_p->translate (Offset (dx, dy));
-    }
+  /*
+    UGH.  Must use extent  ()[dir_]
+   */
+  for (int i = 0; i < note_column_arr_.size (); i++)
+    dy = dy >? note_column_arr_[i]->extent (Y_AXIS).max ();
+  dy -= h;
+
+  Real gap = num.dim_.x ().length () / 2;
+  Offset off (num.dim_.x ().length () + gap, 
+    (h - num.dim_.y ().length ()) / internote_f - gap);
+  num.translate (off);
+  Real dotheight = dot.dim_.y ().length () / 7;
+  off -= Offset (0, dotheight);
+  dot.translate (off);
+  mol_p->add_atom (volta);
+  mol_p->add_atom (num);
+  mol_p->add_atom (dot);
+  mol_p->translate (Offset (dx, dy));
   return mol_p;
 }
   
@@ -91,8 +85,8 @@ Volta_spanner::do_add_processing ()
 void
 Volta_spanner::do_post_processing ()
 {
-    if (column_arr_.size())
-       translate_axis (column_arr_[0]->extent (Y_AXIS)[dir_], Y_AXIS);
+  if (column_arr_.size())
+    translate_axis (column_arr_[0]->extent (Y_AXIS)[UP], Y_AXIS);
 }
 
 void
index 9aeb030879c36049d5c480ea7ec15b3100c7a274..7d2239f96864f2c213c13a7ba0fc349e02c75708 100644 (file)
@@ -77,8 +77,8 @@ dux = \notes \relative c''{
 
 comes = \notes \relative c''  {
   \voiceone
-  r1 |
-  r1 |
+  R1 |
+  R1 |
   r8 [g'16 fis] [g8 c,] [es g16 fis] [g8 a] |
   [d,8 g16 fis] [g8 a] [c,16 d] es4 [d16 c] |
 %%5
@@ -120,13 +120,13 @@ comes = \notes \relative c''  {
 bassdux = \notes \relative c' {
   \clef bass;
 
-  r1 |
-  r |
-  r |
-  r |
+  R1 |
+  R |
+  R |
+  R |
 %%5
-  r |
-  r1 |
+  R |
+  R1 |
   r8 [c16 b] [c8 g] [as c16 b] [c8 d] |
   [g, c16 b] [c8 d] [f,16 g] as4 [g16 f] | 
  [es c'  b a] [g f es d] [c d es d] [c bes! as! g] |