+2002-08-20 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/completion-note-heads-engraver.cc (class
+ Completion_heads_engraver): don't be confused by polyphonic rhythms.
+
+ * input/regression/completion-heads-polyphony.ly: new file.
+
2002-08-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* GNUmakefile.in (web-ext): distribute .ly with web tarball too.
--- /dev/null
+\header {\r
+\r
+ texidoc = "Completion heads are broken across bar lines. This was\r
+intended as a debugging tool, but it can be used to ease music entry.\r
+Completion heads are not fooled by polyphony with a different rhythm.\r
+"\r
+\r
+}\r
+\r
+\score{ \r
+ \context Staff \notes \relative c'' < \r
+ { c2. c bes2 } \\\r
+ { c,2. a8 g4 f4. g4 f }\r
+ >\r
+\r
+ \paper {\r
+ \translator{\r
+ \ThreadContext\r
+ \remove "Note_heads_engraver"\r
+ \consists "Completion_heads_engraver"\r
+ }\r
+ }\r
+}\r
Moment note_end_mom_;
bool first_b_;
Rational left_to_do_;
-
+ Rational do_nothing_until_;
+
Moment next_barline_moment ();
Duration find_nearest_duration (Rational length);
musiclen.main_part_ = Rational (0,1);
}
note_end_mom_ = note_end_mom_ >? (now + musiclen);
+ do_nothing_until_ = Rational (0,0);
+
return true;
}
else if (dynamic_cast<Busy_playing_req*> (m))
}
+/*
+ The duration _until_ the next barline.
+ */
Moment
Completion_heads_engraver::next_barline_moment ( )
{
{
if (!first_b_ && !left_to_do_)
return ;
-
+
first_b_ = false;
+
+ Moment now = now_mom ();
+ if (do_nothing_until_ > now.main_part_)
+ return ;
Duration note_dur;
Duration *orig = 0;
orig = unsmob_duration (note_reqs_[0]->get_mus_property ("duration"));
note_dur = *orig;
}
-
Moment nb = next_barline_moment ();
if (nb < note_dur.length_mom ())
{
note_dur = find_nearest_duration (nb.main_part_);
- Moment next = now_mom();
+ Moment next = now;
next.main_part_ += note_dur.length_mom ();
top_engraver ()->add_moment_to_process (next);
+ do_nothing_until_ = next.main_part_;
}
if (orig)