From: Han-Wen Nienhuys Date: Fri, 10 Sep 2004 22:34:18 +0000 (+0000) Subject: * input/regression/part-combine-mmrest-after-solo.ly (Module): new X-Git-Tag: release/2.3.16~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=40ce03239ae5e7d7056508c2dea7d368a7cd9bf4;p=lilypond.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 526abf1813..03330de6f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-09-11 Han-Wen Nienhuys + + * 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 * 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 index 0000000000..74989bb3a7 --- /dev/null +++ b/input/regression/part-combine-mmrest-after-solo.ly @@ -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 } diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 59475df5cd..0b17fd3f48 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -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; diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm index 62b60260c7..40039f7d5c 100644 --- a/scm/part-combiner.scm +++ b/scm/part-combiner.scm @@ -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)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;