]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/part-combine-mmrest-after-solo.ly (Module): new
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 10 Sep 2004 22:34:18 +0000 (22:34 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 10 Sep 2004 22:34:18 +0000 (22:34 +0000)
file.

* lily/part-combine-iterator.cc (unisono): bugfix for the case
that voice-2 plays solo, and voice-1 has an mmrest that starts
earlier. In that case, we switch to voice-2, so we catch the
mmrest of voice-2. This fixes: partcombine-rest.ly.

ChangeLog
input/regression/part-combine-mmrest-after-solo.ly [new file with mode: 0644]
lily/part-combine-iterator.cc
scm/part-combiner.scm

index 526abf1813830ce66dd33d34881e76bf3ad95469..03330de6f36851d99c4ec175cf7aece59f120022 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-09-11  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * input/regression/part-combine-mmrest-after-solo.ly (Module): new
+       file.
+
+       * lily/part-combine-iterator.cc (unisono): bugfix for the case
+       that voice-2 plays solo, and voice-1 has an mmrest that starts
+       earlier. In that case, we switch to voice-2, so we catch the
+       mmrest of voice-2. This fixes: partcombine-rest.ly.
 2004-09-10  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * scm/define-grob-properties.scm (all-internal-grob-properties):
diff --git a/input/regression/part-combine-mmrest-after-solo.ly b/input/regression/part-combine-mmrest-after-solo.ly
new file mode 100644 (file)
index 0000000..74989bb
--- /dev/null
@@ -0,0 +1,10 @@
+
+\header { texidoc = " Multimeasure rests are printed after solos, both
+    for solo1 and for solo2."  }
+\version "2.3.15"
+
+\paper { raggedright = ##t }
+  \new Staff 
+    \partcombine
+     \relative c''{ R1*2 | c4 r2.  | c2 r  | R1 }
+     \relative c' {  c2 r | R1 | c4 r2. | R1*2  }
index 59475df5cd9b99cfdf780a7177197070c8282b54..0b17fd3f48f86f0a50a84aac3151d19f8a31cb98 100644 (file)
@@ -188,7 +188,7 @@ Part_combine_iterator::solo1 ()
 
 void
 Part_combine_iterator::substitute_both (Context * to1,
-                                 Context * to2)
+                                       Context * to2)
 {
   Context *tos[]  = {to1,to2};
   Music_iterator *mis[] = {first_iter_, second_iter_}; 
@@ -224,9 +224,19 @@ Part_combine_iterator::unisono (bool silent)
     return; 
   else
     {
-      substitute_both (shared_.get_outlet (), null_.get_outlet ());
+      /*
+       If we're coming from SOLO2 state, we might have kill mmrests
+       in the 1st voice, so in that case, we use the second voice 
+       as a basis for events.
+       */
+      Context *c1 = (state_ == SOLO2) ? null_.get_outlet() : shared_.get_outlet();
+      Context *c2 = (state_ == SOLO2) ? shared_.get_outlet() : null_.get_outlet();
+      
+      substitute_both (c1, c2);
 
-      kill_mmrest (two_.get_outlet ());
+      
+      kill_mmrest ((state_ == SOLO2)
+                  ? one_.get_outlet () : two_.get_outlet ());
       kill_mmrest (shared_.get_outlet ());
 
       if (playing_state_ != UNISONO
@@ -236,7 +246,8 @@ Part_combine_iterator::unisono (bool silent)
          if (!event)
            event = make_music_by_name (ly_symbol2scm ("UnisonoEvent"));
 
-         first_iter_-> try_music_in_children (event);      
+         (state_ == SOLO2 ? second_iter_ : first_iter_)
+           ->try_music_in_children (event);      
          playing_state_ = UNISONO;
        }
       state_ = newstate;
index 62b60260c7d9cbfa181496e0b591ab63357a4557..40039f7d5c57b20e3e4785dbb897f27e3e24366a 100644 (file)
@@ -444,7 +444,8 @@ the mark when there are no spanners active."
     (set! result (map
                  (lambda (x) (cons (when x) (configuration x)))
                  (vector->list result)))
-    ;; (if pc-debug (display result))
+    (if #f ;; pc-debug
+        (display result))
     result))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;