From: Pál Benkő Date: Mon, 7 Jun 2010 20:13:10 +0000 (+0100) Subject: Fix 1082. X-Git-Tag: release/2.13.24-1~31 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5d6b0104ce22f859eb46b684b785e19bb05ac96a;p=lilypond.git Fix 1082. Set do_nothing_until_ unconditionally in each timestep. --- diff --git a/input/regression/completion-heads-polyphony-2.ly b/input/regression/completion-heads-polyphony-2.ly new file mode 100644 index 0000000000..750e5ff32d --- /dev/null +++ b/input/regression/completion-heads-polyphony-2.ly @@ -0,0 +1,21 @@ +\version "2.13.24" + +\header { + texidoc = " +Complex completion heads work properly in a polyphonic environment. +" +} + +\layout { + \context { + \Voice + \remove "Note_heads_engraver" + \consists "Completion_heads_engraver" + } +} + +\context Staff \relative c'' << + { c4. c c c4 c4. c4 } + \\ + { g8 g2 g1 g4. } +>> diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index eb454e7152..081cf60b64 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -189,23 +189,25 @@ Completion_heads_engraver::process_music () Duration note_dur; Duration *orig = 0; if (left_to_do_) - note_dur = Duration (left_to_do_ / factor_, false).compressed (factor_); + { + /* + note that note_dur may be strictly less than left_to_do_ + (say, if left_to_do_ == 5/8) + */ + note_dur = Duration (left_to_do_ / factor_, false).compressed (factor_); + } else { orig = unsmob_duration (note_events_[0]->get_property ("duration")); note_dur = *orig; factor_ = note_dur.factor (); + left_to_do_ = orig->get_length (); } Moment nb = next_barline_moment (); if (nb.main_part_ && nb < note_dur.get_length ()) - { - note_dur = Duration (nb.main_part_ / factor_, false).compressed (factor_); - - do_nothing_until_ = now.main_part_ + note_dur.get_length (); - } + note_dur = Duration (nb.main_part_ / factor_, false).compressed (factor_); - if (orig) - left_to_do_ = orig->get_length (); + do_nothing_until_ = now.main_part_ + note_dur.get_length (); for (vsize i = 0; left_to_do_ && i < note_events_.size (); i++) {