]> git.donarmstrong.com Git - lilypond.git/commitdiff
(best_splitpoint_index): fix beaming
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 13 Jun 2006 10:42:29 +0000 (10:42 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 13 Jun 2006 10:42:29 +0000 (10:42 +0000)
patterns for 16th triplets.

ChangeLog
THANKS
input/regression/beaming.ly
lily/beaming-pattern.cc
scm/define-markup-commands.scm

index 34ad37fb06a0966ced6003dde9f2b8ce3aa266f1..c125b3fc402b8ce49c844a7b14b22f2364818781 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-13  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * lily/beaming-pattern.cc (best_splitpoint_index): fix beaming
+       patterns for 16th triplets.
+
 2006-06-10  Graham Percival  <gpermus@gmail.com>
 
        * Documentation/user/ page.itely, global.itely: editing
@@ -25,6 +30,9 @@
 
 2006-06-10  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * scm/define-markup-commands.scm (wordwrap-markups): use
+       output-def 'line-width if undefined.
+
        * HACKING: trim outdated info.
 
 2006-06-09  Mats Bengtsson  <mabe@drongo.s3.kth.se>
diff --git a/THANKS b/THANKS
index c44741fb8ef8c7c4c91a9c2b00b6ef297449fd8b..f2f6118f9d6604d8315b66a8b8c19320688287b2 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -5,7 +5,6 @@ DEVELOPMENT TEAM
 
 Han-Wen Nienhuys  - Core development
 Jan Nieuwenhuizen - Core development
-Pedro Kroger      - Build Meister
 Graham Percival   - Documentation Editor
 Mats Bengtsson    - Support Guru 
 
@@ -24,8 +23,10 @@ Trevor Bača
 Andrew Sidwell
 Chris Sawer
 Jamie Bullock
+Michael Meixner 
 Steve Doonan
 Trent Johnston
+Vivian Barty-Taylor
 
 
 DOCUMENTATION HELPERS
index 09dc8938f1434a64948c64bad79b964d3be43e2e..b2507a433f1185472981e41d3edcc4bf87301f1d 100644 (file)
@@ -4,12 +4,15 @@
 \header{
 texidoc="
 Beaming is generated automatically. Beams may cross bar lines. In that
-case, line breaks are forbidden.  Yet clef and key signatures are
-hidden just as with breakable bar lines.
+case, line breaks are forbidden.
 "
 }
 
 \context Staff  \relative c''  {
+
+  c8[ \times 2/3 { c16 d e] }
+  s4*3
+  
   c8.[ c16]
   c8.[ c16 c8.  c16]
   c16[ c8.] |
@@ -22,7 +25,7 @@ hidden just as with breakable bar lines.
   c32
   c2
 
-  c8[ c c] c8 % over barline
+  c8[^"over barline" c c] c8 
   c16[ c8 c16]
   c32[ c16 c16 c16 c32]
   c32[ c16 c8 c32]              % hmm ?
index f48faadc5666e8bf0c365839a26d7cedae71ce92..b6e5a36e516b0b3168ec39f908fb1300d12e0118 100644 (file)
@@ -24,6 +24,20 @@ Beam_rhythmic_element::Beam_rhythmic_element (Moment m, int i)
   beam_count_drul_[RIGHT] = i;
 }
 
+
+int
+count_factor_twos (int x)
+{
+  int c = 0;
+  while (x && x % 2)
+    {
+      x /= 2;
+      c ++;
+    }
+        
+  return c;
+}
+
 int
 Beaming_pattern::best_splitpoint_index (bool *at_boundary) const
 {
@@ -42,16 +56,27 @@ Beaming_pattern::best_splitpoint_index (bool *at_boundary) const
 
   *at_boundary = false;
   
-  int min_denominator = INT_MAX;
+  int min_factor_twos = INT_MAX;
   int min_index = -1;
   
   Moment beat_pos;
   for (vsize i = 1; i < infos_.size (); i++)  
     {
-      Moment dt = infos_[i].start_moment_ - infos_[i].beat_start_; 
-      if (dt.den () < min_denominator)
+      Moment dt = infos_[i].start_moment_ - infos_[i].beat_start_;
+
+      /*
+       This is a kludge, for the most common case of 16th, 32nds
+       etc. What should really happen is that \times x/y should
+       locally introduce a voice-specific beat duration.  (or
+       perhaps: a list of beat durations for nested tuplets.)
+       
+       */
+      
+      int factor_2s =  count_factor_twos (dt.den ());
+      
+      if (factor_2s < min_factor_twos)
        {
-         min_denominator = dt.den ();
+         min_factor_twos = factor_2s;
          min_index = i;
        }
     }
@@ -79,7 +104,7 @@ Beaming_pattern::beamify (Context *context)
   
   bool subdivide_beams = to_boolean (context->get_property ("subdivideBeams"));
   Moment beat_length = robust_scm2moment (context->get_property ("beatLength"), Moment (1, 4));
-  Moment measure_length = robust_scm2moment (context->get_property ("beatLength"), Moment (1, 4));
+  Moment measure_length = robust_scm2moment (context->get_property ("measureLength"), Moment (1, 4));
 
   if (infos_[0].start_moment_ < Moment (0))
     for (vsize i = 0; i < infos_.size(); i++)
@@ -112,13 +137,13 @@ Beaming_pattern::beamify (Context *context)
   vsize k = 0;
   for (vsize i = 0; i  < infos_.size(); i++)
     {
-      while (j < group_starts.size()-1
+      while (j < group_starts.size() - 1
             && group_starts[j+1] <= infos_[i].start_moment_)
        j++;
 
       infos_[i].group_start_ = group_starts[j];
 
-      while (k < beat_starts.size()-1
+      while (k < beat_starts.size() - 1
             && beat_starts[k+1] <= infos_[i].start_moment_)
        k++;
 
index 83c575001036be13bd3b8e811b83f1715bd65997..d450ec24682532618c9c6730fe8a3cd70607c60d 100644 (file)
@@ -330,8 +330,10 @@ gsave /ecrm10 findfont
         (text-width (apply + text-widths))
         (text-dir (chain-assoc-get 'text-direction props RIGHT))
         (word-count (length stencils))
-        (word-space (chain-assoc-get 'word-space props))
-        (line-width (chain-assoc-get 'line-width props))
+        (word-space (chain-assoc-get 'word-space props 1))
+        (prop-line-width (chain-assoc-get 'line-width props #f))
+        (line-width (if prop-line-width prop-line-width
+                        (ly:output-def-lookup layout 'line-width)))
         (fill-space
                (cond
                        ((= word-count 1) 
@@ -464,7 +466,9 @@ determines the space between each markup in @var{args}."
 (define (wordwrap-markups layout props args justify)
   (let*
       ((baseline-skip (chain-assoc-get 'baseline-skip props))
-       (line-width (chain-assoc-get 'line-width props))
+       (prop-line-width (chain-assoc-get 'line-width props #f))
+       (line-width (if prop-line-width prop-line-width
+                      (ly:output-def-lookup layout 'line-width)))
        (word-space (chain-assoc-get 'word-space props))
        (text-dir (chain-assoc-get 'text-direction props RIGHT)) 
        (lines (wordwrap-stencils