]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.33.jcn1: Re: jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 8 Mar 1999 20:15:02 +0000 (21:15 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 8 Mar 1999 20:15:02 +0000 (21:15 +0100)
pl 33.jcn1
- allow autobeaming according to duration iso (crude) multiplicity

NEWS
VERSION
input/test/auto-beam-triplet.ly [new file with mode: 0644]
lily/auto-beam-engraver.cc
lily/include/auto-beam-engraver.hh
ly/auto-beam-settings.ly
mutopia/N.W.Gade/score.ly

diff --git a/NEWS b/NEWS
index 6034166157f26e10059602a43a8e91ee67922823..d4ffd6d07011e96c7ebbc6e84f0d6122e210fe94 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+pl 33.jcn1
+       - allow autobeaming according to duration iso (crude) multiplicity
+
 pl 32.mb1
        - bf: \> and \< were interchanged!!
        - Added property: textScriptPadding
diff --git a/VERSION b/VERSION
index 374f94ba078ad81f32a8c8703b8f893e88b7f01b..acfa121bf264ae1dbcb7ec832c06f900a2783df5 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=33
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/auto-beam-triplet.ly b/input/test/auto-beam-triplet.ly
new file mode 100644 (file)
index 0000000..4f3e4b7
--- /dev/null
@@ -0,0 +1,13 @@
+\score{
+       \notes\relative c''{
+               c8 c c c
+               \times 2/3 { c c c c c c}
+       }
+       \paper{
+               % urg, avoid crash
+               \translator{
+                       \VoiceContext
+                       \remove Tuplet_engraver;
+               }
+       }
+}
index a29ec75e67f420e55d831cb50f37f5bd1887e916..c4c72ea4bb944e342a83a3d51dd7ebf0b1609a96 100644 (file)
@@ -22,7 +22,7 @@ ADD_THIS_TRANSLATOR (Auto_beam_engraver);
 Auto_beam_engraver::Auto_beam_engraver ()
 {
   beam_p_ = 0;
-  mult_i_ = 0;
+  shortest_mom_ = 1;
   finished_beam_p_ = 0;
   finished_grouping_p_ = 0;
   grouping_p_ = 0;
@@ -41,8 +41,11 @@ Auto_beam_engraver::consider_end_and_begin ()
   int num = time->whole_per_measure_ / time->one_beat_;
   int den = time->one_beat_.den_i ();
   String time_str = String ("time") + to_str (num) + "_" + to_str (den);
-  int type = 1 << (mult_i_ + 2);
-  String type_str = to_str (type);
+  String type_str;
+  if (shortest_mom_.num () != 1)
+    type_str = to_str (shortest_mom_.num ());
+  if (shortest_mom_.den () != 1)
+    type_str = type_str + "_" + to_str (shortest_mom_.den ());
 
   /*
     Determine end moment for auto beaming (and begin, mostly 0==anywhere) 
@@ -92,7 +95,7 @@ Auto_beam_engraver::consider_end_and_begin ()
   /*
     third guess: property time exception, specific for duration type
   */
-  if (mult_i_)
+  if (type_str.length_i ())
     {
       Scalar end_mult = get_property (time_str + "beamAutoEnd" + type_str, 0);
       if (end_mult.length_i ())
@@ -116,7 +119,7 @@ Auto_beam_engraver::consider_end_and_begin ()
   /*
     fifth guess [user override]: property plain, specific for duration type
   */
-  if (mult_i_)
+  if (type_str.length_i ())
     {
       Scalar end_mult = get_property (String ("beamAutoEnd") + type_str, 0);
       if (end_mult.length_i ())
@@ -194,7 +197,7 @@ Auto_beam_engraver::end_beam ()
       finished_grouping_p_ = grouping_p_;
       beam_p_ = 0;
       grouping_p_ = 0;
-      mult_i_ = 0;
+      shortest_mom_ = 1;
     }
 }
  
@@ -300,17 +303,16 @@ Auto_beam_engraver::acknowledge_element (Score_element_info info)
        }
       else
        {
-         int m = (rhythmic_req->duration_.durlog_i_ - 2);
          /*
-           if multiplicity would become greater,
+           if shortest duration would change
            reconsider ending/starting beam first.
           */
-         if (m > mult_i_)
+         Moment mom = rhythmic_req->duration_.length_mom ();
+         if (mom < shortest_mom_)
            {
-             mult_i_ = m;
+             shortest_mom_ = mom;
              consider_end_and_begin ();
            }
-         mult_i_ = m;
          grouping_p_->add_child (start, rhythmic_req->length_mom ());
          stem_l->flag_i_ = rhythmic_req->duration_.durlog_i_;
          beam_p_->add_stem (stem_l);
@@ -325,22 +327,11 @@ 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];
-      s->beams_i_drul_[LEFT] = 0;
-      s->beams_i_drul_[RIGHT] = 0;
-      s->mult_i_ = 0;
-      s->beam_l_ = 0;
-    }
-#endif
-  
   beam_p_->unlink ();
   beam_p_ = 0;
   delete grouping_p_;
   grouping_p_ = 0;
-  mult_i_ = 0;
+  shortest_mom_ = 1;
 }
 
 void
index a2ebc6d4ccaad3c13e8774083b2cb6c6e68374cb..671967ba0a4aa82261a1446a027ef47e34c79435 100644 (file)
@@ -33,7 +33,7 @@ private:
   void junk_beam ();
   void typeset_beam ();
 
-  int mult_i_;
+  Moment shortest_mom_;
   Beam *finished_beam_p_;
   Beam *beam_p_;
   Moment last_add_mom_;
index 09113b139d86a30c518759ff6b3ec6008c837954..b24a713d417df5551c3650d70fbacaaf3eda182b 100644 (file)
@@ -1,25 +1,31 @@
 %
 % setup for auto beamer
 %
+
+% *num_den (omitted if "1")
+
 time2_8beamAutoEnd = "2/8";
 time3_2beamAutoEnd = "1/2";
-time3_2beamAutoEnd16 = "1/4";
-time3_2beamAutoEnd32 = "1/8";
+time3_2beamAutoEnd_16 = "1/4";
+time3_2beamAutoEnd_32 = "1/8";
 time3_4beamAutoBegin = "1/4";
-time3_4beamAutoEnd8 = "3/4";
-time3_4beamAutoBegin32 = "1/8";
-time3_4beamAutoEnd32 = "1/8";
+time3_4beamAutoEnd_8 = "3/4";
+time3_4beamAutoBegin_32 = "1/8";
+time3_4beamAutoEnd_32 = "1/8";
 time3_8beamAutoBegin = "1/8";
 time3_8beamAutoEnd = "3/8";
-time4_4beamAutoEnd8 = "1/2";
-time4_4beamAutoEnd32 = "1/8";
-time4_8beamAutoEnd8 = "1/4";
-time4_8beamAutoEnd16 = "1/4";
-time4_8beamAutoEnd32 = "1/8";
+time4_4beamAutoEnd_8 = "1/2";
+% 1/12 == 1/8 * 2/3
+time4_4beamAutoEnd_12 = "1/4";
+time4_4beamAutoEnd_32 = "1/8";
+time4_8beamAutoEnd_8 = "1/4";
+time4_8beamAutoEnd_16 = "1/4";
+time4_8beamAutoEnd_32 = "1/8";
 time4_16beamAutoEnd = "1/8";
-time6_8beamAutoEnd8 = "3/8";
-time6_8beamAutoEnd16 = "3/8";
-time6_8beamAutoEnd32 = "1/8";
-time9_8beamAutoEnd8 = "3/8";
-time9_8beamAutoEnd16 = "3/8";
-time6_8beamAutoEnd32 = "1/8";
+time6_8beamAutoEnd_8 = "3/8";
+time6_8beamAutoEnd_16 = "3/8";
+time6_8beamAutoEnd_32 = "1/8";
+time9_8beamAutoEnd_8 = "3/8";
+time9_8beamAutoEnd_16 = "3/8";
+time6_8beamAutoEnd_32 = "1/8";
+
index 23181116e2649b54039ecac8777db6dbae476a9c..6f858159abb3e6eb83cfa71c0c126a2873067bcc 100644 (file)
@@ -132,18 +132,18 @@ copyright =       "Mats Bengtsson, 1999. Free circulation permitted and " +
 
 \score{
   \type StaffGroup <
-    \oboe
-    \flauto
-    \type Staff = cor {\notes \transpose bes <\clarI \clarII >}
-    \fagotto
-    \type Staff = cor {\notes \transpose f <\corI \corII >}
-    \type Staff = cor {\notes \transpose bes <\trpI \trpII >}
-    \timpani
-    \viI
-    \viII
-    \vla
-    \vlc
-    \cb
+    \type Staff = oboe \oboe
+    \type Staff = flauto \flauto
+    \type Staff = clarinetsInBes {\notes \transpose bes <\clarI \clarII >}
+    \type Staff = fagotto \fagotto
+    \type Staff = corniInF {\notes \transpose f <\corI \corII >}
+    \type Staff = trumpetsInBes {\notes \transpose bes <\trpI \trpII >}
+    \type Staff = timpani \timpani
+    \type Staff = violinoi \viI
+    \type Staff = violinoii \viII
+    \type Staff = viola \vla
+    \type Staff = violoncello \vlc
+    \type Staff = contrabass \cb
   >
   \midi {
     \tempo 4=120;