]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/beaming-ternary-metrum.ly: update doc.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 17 Jun 2006 23:03:12 +0000 (23:03 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 17 Jun 2006 23:03:12 +0000 (23:03 +0000)
* scm/music-functions.scm (make-time-signature-set): add
standard-beat-grouping.

ChangeLog
input/regression/beaming-ternary-metrum.ly
lily/beaming-pattern.cc
lily/include/beaming-pattern.hh
scm/music-functions.scm

index c592213f4f4bf92c41ccd18ce873da641b12d027..97729c49262874a014d1961837f6054c45d0dcef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-06-18  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * input/regression/beaming-ternary-metrum.ly: update doc.
+
+       * scm/music-functions.scm (make-time-signature-set): add
+       standard-beat-grouping. 
+
 2006-06-17  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
        * input/regression/tie-whole.ly: new file.
index 0bc3df702dbefc13bcffd50034feeb86506790e3..50d071ef92976a1eaa05607776e16341f28297fd 100644 (file)
@@ -1,8 +1,14 @@
 
-\version "2.7.39"
+\version "2.9.10"
+
 \header {
-  texidoc = "Automatic beaming works also in ternary time sigs."
+
+  texidoc = "Automatic beaming works also in ternary time sigs. In
+  this case, the 8th is a beat, so the 16ths are split into two
+  groups."
+
 }
+
 \layout { ragged-right = ##t}
 
 \relative c'' {
index ca9970dd8901324dbfc02d0ca21dfbb8f489ce91..87ff00dc63cb1d5b7cc5732201bac10f6a664d8c 100644 (file)
@@ -56,7 +56,7 @@ Beaming_pattern::best_splitpoint_index (bool *at_boundary) const
 
   *at_boundary = false;
   
-  int min_factor_twos = INT_MAX;
+  int min_den = INT_MAX;
   int min_index = -1;
   
   Moment beat_pos;
@@ -72,11 +72,11 @@ Beaming_pattern::best_splitpoint_index (bool *at_boundary) const
        
        */
       
-      int factor_2s =  count_factor_twos (dt.den ());
+      dt /= infos_[i].beat_length_;
       
-      if (factor_2s < min_factor_twos)
+      if (dt.den () < min_den)
        {
-         min_factor_twos = factor_2s;
+         min_den = dt.den ();
          min_index = i;
        }
     }
@@ -142,7 +142,7 @@ Beaming_pattern::beamify (Context *context)
        j++;
 
       infos_[i].group_start_ = group_starts[j];
-
+      infos_[i].beat_length_ = beat_length;  
       while (k < beat_starts.size() - 1
             && beat_starts[k+1] <= infos_[i].start_moment_)
        k++;
index 9f2adb194029403993189c0cc57a65a3686acc03..603321766881cd3ad0a2e7e867097c844f58b40d 100644 (file)
@@ -19,6 +19,7 @@ struct Beam_rhythmic_element
   Drul_array<int> beam_count_drul_;
 
   Moment beat_start_;
+  Moment beat_length_;
   Moment group_start_;
   
   Beam_rhythmic_element (Moment, int);
index 89d640be1243d4c77a9b4b01285278ad8d11d4fc..e33e1629aff9efd16c7e9a1c9d4bfc7fc3ca65bd 100644 (file)
@@ -474,6 +474,23 @@ OTTAVATION to `8va', or whatever appropriate."
 (define-public (make-time-signature-set num den . rest)
   "Set properties for time signature NUM/DEN.  Rest can contain a list
 of beat groupings "
+
+  (define (standard-beat-grouping num den)
+
+    "Some standard subdivisions for time signatures."
+    (let*
+       ((key (cons num den))
+        (entry (assoc key '(((6 . 8) . (3 3))
+                        ((5 . 8) . (3 2))
+                        ((9 . 8) . (3 3 3))
+                        ((12 . 8) . (3 3 3 3))
+                        ((8 . 8) . (3 3 2))
+                        ))))
+
+      (if entry
+         (cdr entry)
+         '())))    
+  
   (let* ((set1 (make-property-set 'timeSignatureFraction (cons num den)))
         (beat (ly:make-moment 1 den))
         (len  (ly:make-moment num den))
@@ -481,7 +498,7 @@ of beat groupings "
         (set3 (make-property-set 'measureLength len))
         (set4 (make-property-set 'beatGrouping (if (pair? rest)
                                                    (car rest)
-                                                   '())))
+                                                   (standard-beat-grouping num den))))
         (basic  (list set1 set2 set3 set4)))
     (descend-to-context
      (context-spec-music (make-sequential-music basic) 'Timing) 'Score)))