]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.19.jcn4: jcn4
authorJan Nieuwenhuizen <janneke@gnu.org>
Sat, 9 Jan 1999 20:42:58 +0000 (21:42 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sat, 9 Jan 1999 20:42:58 +0000 (21:42 +0100)
pl 19.jcn4
- new stem/beam parameters
- bf: forced stem shorten

---
Generated by janneke@gnu.org using package-diff 0.62,
>From = lilypond-1.1.19.jcn3, To = lilypond-1.1.19.jcn4

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.19.jcn4.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
and possibly make outdirs.

--state
1.1.19.jcn3
1.1.19.jcn4
++state

NEWS
VERSION
init/params.ly
lily/beam.cc
lily/stem-info.cc
lily/stem.cc

diff --git a/NEWS b/NEWS
index 41e92f7bb3f86b2e5d62002a81feee710f35bd09..c394b259e768ca5b6abef845b8a0adff2ad85f0f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,13 @@
---- ../lilypond-1.1.19.jcn2/NEWS       Fri Jan  8 18:01:10 1999
+--- ../lilypond-1.1.19.jcn3/NEWS       Sat Jan  9 16:03:22 1999
+++ b/NEWS      Sat Jan  9 21:11:06 1999
+@@ -1,3 +1,7 @@
+pl 19.jcn4
+       - new stem/beam parameters
+       - bf: forced stem shorten
+
+ pl 19.jcn3
+       - dehairification of beam code; cleanup and bugfixes
+         * stemlength--- ../lilypond-1.1.19.jcn2/NEWS  Fri Jan  8 18:01:10 1999
 ++ b/NEWS      Sat Jan  9 16:03:22 1999
 @@ -1,4 +1,12 @@
 -pl 19.jcn1
diff --git a/VERSION b/VERSION
index 04747dc65500e4410466e98b751f2b3bd1ae9e21..198de8d0d55b36a2327a64eaa5d42d43247bd043 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=jcn3
+MY_PATCH_LEVEL=jcn4
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 3f04da0af6d43b1fa8322a9e529f17491d6b3248..650f51783bdb24ddad558f903cc1e8711963af13 100644 (file)
@@ -16,20 +16,31 @@ beam_thickness = 0.52 * (\interline - \staffline);
 interbeam = (2.0 * \interline - \beam_thickness) / 2.0;
 interbeam4 = (3.0 * \interline - \beam_thickness) / 3.0;
 
-
 % stems and beams
 %
-% not used for beams
-stem_length = 3.5*\interline;
-
+% poor man's array size
+stem_max = 3.0;
 %
+stem_length0 = 3.5*\interline;
+stem_length1 = 2.5 * \interline;
+stem_length2 = 2.0 * \interline;
+stem_length3 = 1.5 * \interline;
+
+% only used for beams
+minimum_stem_length0 = 0.0; % not used
+minimum_stem_length1 = 1.5 * \interline;
+minimum_stem_length2 = 1.25 * \interline;
+minimum_stem_length3 = 1.0 * \interline;
+
 % stems in unnatural (forced) direction should be shortened,
 % according to [Roush & Gourlay].  Their suggestion to knock off
-% a whole staffspace seems a bit drastical though?
+% a whole staffspace seems a bit drastical: we'll do half.
 %
-forced_stem_shorten = 1.0 * \interline;
+forced_stem_shorten0 = 0.5 * \interline;
+forced_stem_shorten1 = \forced_stem_shorten0;
+forced_stem_shorten2 = \forced_stem_shorten1;
+forced_stem_shorten3 = \forced_stem_shorten2;
 
-%
 % there are several ways to calculate the direction of a beam
 % 
 % * MAJORITY : number count of up or down notes
@@ -46,24 +57,6 @@ MEDIAN = 4.0;
 % [Ross]: majority
 beam_dir_algorithm = \MAJORITY;
 
-%
-%
-% some beam-stemlength settings...
-%
-% poor man's array
-%    beam_*1 : multiplicity < beam_multiple_break
-%    beam_*2 : multiplicity >= beam_multiple_break
-%
-beam_multiple_break = 3.0;
-beam_minimum_stem1 = 0.75 * \interline;
-beam_ideal_stem1 = 1.75 * \interline;
-beam_minimum_stem2 = 0.75 * \interline;
-beam_ideal_stem2 = 1.25 * \interline;
-% same here
-beam_forced_multiple_break = 2.0;
-beam_forced_stem_shorten1 = 0.65 * \interline;
-beam_forced_stem_shorten2 = 0.50 * \interline;
-
 % catch suspect beam slopes, set slope to zero if
 % outer stem is lengthened more than
 beam_lengthened = 0.2 * \interline;
index 4cdc6e7afe884bfd763ac503e55346139e5b8ce2..6e2e3b4641e778d6b0cc4f3e685c1f99f313c31b 100644 (file)
@@ -269,14 +269,12 @@ Beam::set_steminfo ()
       total_count_i++;
     }
 
-  Real break_i = (int)rint (paper ()->get_var ("beam_forced_multiple_break"));
-  Real shorten_f;
-  if (multiple_i_ < break_i)
-    shorten_f = paper ()->get_var ("beam_forced_stem_shorten1");
-  else
-    shorten_f = paper ()->get_var ("beam_forced_stem_shorten2");
-    
   Real internote_f = paper ()->internote_f ();
+  int stem_max = (int)rint(paper ()->get_var ("stem_max"));
+  Real shorten_f = paper ()->get_var (String ("forced_stem_shorten"
+                                             + to_str (multiple_i_ <? stem_max)))
+    / internote_f;
+    
   Real leftx = 0;
   for (int i=0; i < stems_.size (); i++)
     {
@@ -291,9 +289,9 @@ Beam::set_steminfo ()
       if (info.dir_ == dir_)
         {
          if (forced_count_i == total_count_i)
-           info.idealy_f_ -= shorten_f / internote_f;
+           info.idealy_f_ -= shorten_f;
          else if (forced_count_i > total_count_i / 2)
-           info.idealy_f_ -= shorten_f / 2 / internote_f;
+           info.idealy_f_ -= shorten_f / 2;
        }
       sinfo_.push (info);
     }
index e4504b783e6607b22ea2705854cf0e208ecf0310..370efcfadc42526359cef4f2b441aa556d663cf7 100644 (file)
@@ -28,27 +28,11 @@ Stem_info::Stem_info (Stem*s)
   beam_dir_ = stem_l_->beam_dir_;
   mult_i_ = stem_l_->mult_i_;
 
-  /*
-    [TODO]
-    make this runtime
-
-    Breitkopf + H\"artel:
-    miny_f_ = interline + #beams * interbeam
-    ideal8 = 2 * interline + interbeam
-    ideal16,32,64,128 = 1.5 * interline + #beams * interbeam
-
-    * B\"arenreiter:
-    miny_f_ = interline + #beams * interbeam
-    ideal8,16 = 2 interline + #beams * interbeam
-    ideal32,64,128 = 1.5 interline + #beams * interbeam
-       
-    */
-
-  Real internote_f = stem_l_->paper ()->internote_f ();
-  Real interbeam_f = stem_l_->paper ()->interbeam_f (mult_i_);
-  Real beam_f = stem_l_->paper ()->beam_thickness_f ();
+  Paper_def* paper_l = stem_l_->paper ();
+  Real internote_f = paper_l->internote_f ();
+  Real interbeam_f = paper_l->interbeam_f (mult_i_);
+  Real beam_f = paper_l->beam_thickness_f ();
          
-
   {
       static int i = 1;
       DOUT << "******" << i++ << "******\n" 
@@ -56,47 +40,34 @@ Stem_info::Stem_info (Stem*s)
           << "\nchord_f/i: " << stem_l_->chord_start_f () * dir_ / internote_f << '\n';
   }
 
-  /*
-    For simplicity, we'll assume dir = UP and correct if 
-    dir = DOWN afterwards.
-   */
-  idealy_f_ = stem_l_->chord_start_f () * beam_dir_ / internote_f;
+  // strangely enough, dim(chord_start_f) == pt (and not internote!)
+  idealy_f_ = stem_l_->chord_start_f () / internote_f;
+
+  // calculate using dim(y) == pt
   idealy_f_ *= internote_f;
 
-  Real break_i = (int)rint (stem_l_->paper ()->get_var ("beam_multiple_break"));
-  Real min_stem1_f = stem_l_->paper ()->get_var ("beam_minimum_stem1");
-  Real min_stem2_f = stem_l_->paper ()->get_var ("beam_minimum_stem2");
-  Real ideal_stem1_f = stem_l_->paper ()->get_var ("beam_ideal_stem1");
-  Real ideal_stem2_f = stem_l_->paper ()->get_var ("beam_ideal_stem2");
-  Real shorten_f = stem_l_->paper ()->get_var ("forced_stem_shorten");
+  // for simplicity, we calculate as if dir == UP
+  idealy_f_ *= beam_dir_;
+  
+  int stem_max = (int)rint(paper_l->get_var ("stem_max"));
+  Real min_stem_f = paper_l->get_var (String ("minimum_stem_length")
+                                    + to_str (mult_i_ <? stem_max));
+  Real stem_f = paper_l->get_var (String ("stem_length")
+                                + to_str (mult_i_ <? stem_max));
 
   if (!beam_dir_ || (beam_dir_ == dir_))
-    /* normal (beamed) stem */
+    /* normal beamed stem */
     {
-      idealy_f_ += interbeam_f * mult_i_;
+      if (mult_i_)
+       {
+         idealy_f_ += beam_f;
+         idealy_f_ += (mult_i_ - 1) * interbeam_f;
+       }
       miny_f_ = idealy_f_;
       maxy_f_ = INT_MAX;
 
-      if (mult_i_ < break_i)
-        {
-         idealy_f_ += ideal_stem1_f;
-         miny_f_ += min_stem1_f;
-       }
-      else
-        {
-         idealy_f_ += ideal_stem2_f;
-         miny_f_ += min_stem2_f;
-       }
-
-      /*
-        stems in unnatural (forced) direction are shortened but
-        - central line is never 'forced'
-        - beamed stems are shortened only by beam itself
-       */
-      if (!mult_i_ && ((int)stem_l_->chord_start_f ()) && (stem_l_->dir_ != stem_l_->get_default_dir ()))
-       {
-         idealy_f_ -= shorten_f;
-       }
+      idealy_f_ += stem_f;
+      miny_f_ += min_stem_f;
 
       // lowest beam of (UP) beam must never be lower than second staffline
       miny_f_ = miny_f_ >? (- 2 * internote_f - beam_f
@@ -109,19 +80,11 @@ Stem_info::Stem_info (Stem*s)
       maxy_f_ = idealy_f_;
       miny_f_ = -INT_MAX;
 
-      if (mult_i_ < break_i)
-        {
-         idealy_f_ -= ideal_stem1_f;
-         maxy_f_ -= min_stem1_f;
-       }
-      else
-        {
-         idealy_f_ -= ideal_stem2_f;
-         maxy_f_ -= min_stem2_f;
-       }
+      idealy_f_ -= stem_f;
+      maxy_f_ -= min_stem_f;
     }
 
-
+  // set dim(y) == internote
   idealy_f_ /= internote_f;
   miny_f_ /= internote_f;
   maxy_f_ /= internote_f;
index 90a12ae5555f998fca08951f9aebcd5ed44df793..740cb41666048396c6300865a3036a1482efa1f6 100644 (file)
@@ -164,41 +164,32 @@ Stem::set_default_dir ()
 void
 Stem::set_default_stemlen ()
 {
-  /*
-   TODO
-   urg; this should be handled by Stem_info
-   */
-
-  Real length_f = paper ()->get_var ("stem_length");
-  Real shorten_f = paper ()->get_var ("forced_stem_shorten");
-
   Real internote_f = paper ()->internote_f ();
-  length_f /= internote_f;
-  shorten_f /= internote_f;
+  Real length_f = paper ()->get_var ("stem_length0") / internote_f;
+  Real shorten_f = paper ()->get_var ("forced_stem_shorten0") / internote_f;
 
-  Real len = length_f;
   if (!dir_)
     set_default_dir ();
   /* 
     stems in unnatural (forced) direction should be shortened, 
     accoding to [Roush & Gourlay]
    */
-  else if (dir_ != get_default_dir ())
-    len -= shorten_f / internote_f;
+  if (((int)chord_start_f ())
+      && (dir_ != get_default_dir ()))
+    length_f -= shorten_f;
 
   if (flag_i_ >= 5)
-    len += 2.0;
+    length_f += 2.0;
   if (flag_i_ >= 6)
-    len += 1.0;
+    length_f += 1.0;
   
-  set_stemend ((dir_ > 0) ? head_positions()[BIGGER] + len :
-              head_positions()[SMALLER] - len);
+  set_stemend ((dir_ > 0) ? head_positions()[BIGGER] + length_f:
+              head_positions()[SMALLER] - length_f);
 
   if (dir_ * stem_end_f () < 0)
-    {
-      set_stemend (0);
-    }
+    set_stemend (0);
 }
+
 //xxx
 void
 Stem::set_default_extents ()