]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.31.jcn2: ughjeweg
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 17 Feb 1999 20:04:06 +0000 (21:04 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 17 Feb 1999 20:04:06 +0000 (21:04 +0100)
pl 31.jcn2
- fix: rat != float

NEWS
VERSION
flower/include/rational.hh
flower/rational.cc
input/bugs/auto-grace.ly [new file with mode: 0644]
lily/auto-beam-engraver.cc
lily/stem.cc
lily/warn.cc
ly/auto-beam-settings.ly
stepmake/NEWS
stepmake/VERSION

diff --git a/NEWS b/NEWS
index 3a4625f0a36c25df0810d3d9233f2e8bfb5923b4..667a0ee3530810a0047a34f375408f0e1513be78 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+pl 31.jcn2
+       - fix: rat != float
+
 pl 31.jcn1
        - bf: slur-follow-music
 
diff --git a/VERSION b/VERSION
index f8e84f715261942c5b6e55bd522b0fbb4890fc34..071fe9bc5a7dd68bf0890df5303554cc8bc70746 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=31
-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 c8af749cda277dbf05ffa8eaa803202f47d57969..3a2b8fff31476bc1f4dc9800adf07e7e6c98de8e 100644 (file)
@@ -45,7 +45,9 @@ public:
   int den  () const { return den_; }
   int num_i  () const { return sign_ * num_; }
   int den_i  () const { return den_; }
-  Rational truncated () const;
+  Rational trunc_rat () const;
+  Rational div_rat (Rational) const;
+  Rational mod_rat (Rational) const;
   void negate ();
   operator bool () const;
   operator int () const;
@@ -64,6 +66,7 @@ public:
   Rational &operator /= (Rational);  
   Rational &operator += (Rational);
   Rational &operator -= (Rational);
+  Rational &operator %= (Rational);
   static int compare (Rational const&, Rational const&);
   int sign () const;
   String str () const;
@@ -73,6 +76,7 @@ IMPLEMENT_ARITHMETIC_OPERATOR (Rational, / );
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, + );
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, * );
 IMPLEMENT_ARITHMETIC_OPERATOR (Rational, - );
+IMPLEMENT_ARITHMETIC_OPERATOR (Rational, % );
 
 INSTANTIATE_COMPARE (Rational const&, Rational::compare);
 
index bab115c9e37e33f797a146a1d341df52662bba57..ea9fb1ca46e2ba35553eaa53d0c8385098eec966 100644 (file)
@@ -34,7 +34,7 @@ operator << (ostream &o, Rational r)
 }
 
 Rational
-Rational::truncated () const
+Rational::trunc_rat () const
 {
   return Rational(num_ - (num_ % den_), den_);
 }
@@ -90,6 +90,22 @@ Rational::operator - () const
   return r;
 }
 
+Rational
+Rational::div_rat (Rational div) const
+{
+  Rational r (*this);
+  r /= div;
+  return r.trunc_rat ();
+}
+
+Rational
+Rational::mod_rat (Rational div) const
+{
+  Rational r (*this);
+  r = (r / div - r.div_rat (div)) * div;
+  return r;
+}
+
 void
 Rational::normalise ()
 {
@@ -141,6 +157,13 @@ compare (Rational const &r, Rational const &s)
   return Rational::compare (r, s );
 }
 
+Rational &
+Rational::operator %= (Rational r)
+{
+  *this = r.mod_rat (r);
+  return *this;
+}
+
 Rational &
 Rational::operator += (Rational r)
 {
diff --git a/input/bugs/auto-grace.ly b/input/bugs/auto-grace.ly
new file mode 100644 (file)
index 0000000..1e858f0
--- /dev/null
@@ -0,0 +1,19 @@
+
+\version "1.0.14";
+
+\score{
+       \notes\relative c'' {
+               % set either property -> core dump: two autobeams?
+%              \property Voice.fontsize= "-2"
+               \property Voice.pletvisibility = 0
+
+               % strange staffs, but no core dump
+               \times 2/3 { [ c16 c c] } c4 c2
+       }
+       \paper {
+               \translator { \VoiceContext
+%                      \remove Auto_beam_engraver;
+               }
+       }
+}
+
index 9098cba68fd6c9f3c0aaa49a1b079322406e6df6..adb1e98b07f37036acf00333a6e7e740c9040720 100644 (file)
@@ -126,18 +126,13 @@ Auto_beam_engraver::consider_end_and_begin ()
        begin_mom = begin_mult.to_rat ();
     }
 
-  /* UGH
-     Rational != Float
-  */
-  Real f;
+  Rational r;
   if (end_mom)
-    f = fmod (time->whole_in_measure_, end_mom);
+    r = time->whole_in_measure_.mod_rat (end_mom);
   else
-    f = Moment (1);
+    r = Moment (1);
 
-  // enge floots
-  Real epsilon_f = Moment (1, 512);
-  if (beam_p_ && (abs (f) < epsilon_f))
+  if (beam_p_ && !r)
     end_beam ();
      
   /*
@@ -148,8 +143,8 @@ Auto_beam_engraver::consider_end_and_begin ()
     return;
 
   if (begin_mom)
-    f = fmod (time->whole_in_measure_, begin_mom);
-  if (!beam_p_ && (!begin_mom || (abs (f) < epsilon_f)))
+    r = time->whole_in_measure_.mod_rat (begin_mom);
+  if (!beam_p_ && (!begin_mom || !r))
     begin_beam ();
 }
 
@@ -329,6 +324,7 @@ void
 Auto_beam_engraver::junk_beam () 
 {
   assert (beam_p_);
+#if 0
   for (int i=0; i < beam_p_->stems_.size (); i++)
     {
       Stem* s = beam_p_->stems_[i];
@@ -337,6 +333,7 @@ Auto_beam_engraver::junk_beam ()
       s->mult_i_ = 0;
       s->beam_l_ = 0;
     }
+#endif
   
   beam_p_->unlink ();
   beam_p_ = 0;
index 7b387d8d6d5452dca97139e034750aaef23a7fe2..900ee4019f0cde42db135142e7c46bbe877707d2 100644 (file)
@@ -346,4 +346,17 @@ Stem::do_substitute_dependency (Score_element*o,Score_element*n)
   head_l_arr_.substitute (h, dynamic_cast<Note_head*>(n));
   if (Rest *r=dynamic_cast<Rest*> (o))
     rest_l_arr_.substitute (r, dynamic_cast<Rest*>(n));
+  if (Beam* b = dynamic_cast<Beam*> (o))
+    {
+      if (b == beam_l_) 
+       {
+         beam_l_ = dynamic_cast<Beam*> (n);
+         if (!beam_l_)
+           {
+             beams_i_drul_[LEFT] = 0;
+             beams_i_drul_[RIGHT] = 0;
+             mult_i_ = 0;
+           }
+       }
+    }
 }
index b54f5a41aa222b69ec9ff67a89c542700a419f8a..a8d50a36bef6ebc8a9a3da7a5a057616ae3893ac 100644 (file)
@@ -25,7 +25,7 @@ ostream *mlog (&cerr);
 void
 error_t (String const & s, Moment const & r)
 {
-  String t_mom = r.truncated ().str () +  (r - r.truncated ()).str ();
+  String t_mom = r.trunc_rat ().str () +  (r - r.trunc_rat ()).str ();
   String e=s+ " (t = " +  t_mom + ")";
   error (e);
 }
index d52802108a82156167933403b434e2a848fff6fa..09113b139d86a30c518759ff6b3ec6008c837954 100644 (file)
@@ -7,6 +7,7 @@ time3_2beamAutoEnd16 = "1/4";
 time3_2beamAutoEnd32 = "1/8";
 time3_4beamAutoBegin = "1/4";
 time3_4beamAutoEnd8 = "3/4";
+time3_4beamAutoBegin32 = "1/8";
 time3_4beamAutoEnd32 = "1/8";
 time3_8beamAutoBegin = "1/8";
 time3_8beamAutoEnd = "3/8";
index 6fc5bf84a776da9caf86b54a4a1ad258fb9c1b99..23f770d131bfd440d1c495eec6c3cb495105d573 100644 (file)
@@ -1,3 +1,6 @@
+pl 70
+       - GUILE config fixes (AF)
+
 pl 69
        - package_depth detection fix
 
index e92135e2ecd8cacf30030864071cafbd1796d36d..32def17b697b23e8518b5431271dbba417ceb3b1 100644 (file)
@@ -1,7 +1,7 @@
 PACKAGE_NAME=StepMake
 MAJOR_VERSION=0
 MINOR_VERSION=1
-PATCH_LEVEL=69
+PATCH_LEVEL=70
 MY_PATCH_LEVEL=
 
 # use the above to send patches, always empty for released version: