lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Midi_walker::do_start_note: skip ignored notes in stop_note_queue (issue


From: ht . lilypond . development
Subject: Midi_walker::do_start_note: skip ignored notes in stop_note_queue (issue 296570043 by address@hidden)
Date: Sun, 26 Jun 2016 08:40:57 -0700

Reviewers: ,

Message:
Midi_walker::do_start_note: skip ignored notes in stop_note_queue

For each semitone pitch value, stop_note_queue is likely supposed to
contain
at most one Midi_note event with its "ignore_" flag set to false, and
the
comparisons between notes of equal semitone pitch to be always done
between
the input note and this unique queued note that is not (yet) being
ignored.

If notes which are already being ignored are not skipped in the loop,
the
task of raising the "ignore_" flags for note events of equal semitone
pitch
(overlapping in time) which stop before the maximum stopping time of
these
notes may, due to breaking out of the loop, fail to work if there are
three
or more simultaneous notes of equal semitone pitch, leading to the
emission
of premature "note off" events for this pitch, as demonstrated, for
example,
in
<http://lists.gnu.org/archive/html/bug-lilypond/2016-06/msg00042.html>.



Description:
Midi_walker::do_start_note: skip ignored notes in stop_note_queue

For each semitone pitch value, stop_note_queue is likely supposed to
contain
at most one Midi_note event with its "ignore_" flag set to false, and
the
comparisons between notes of equal semitone pitch to be always done
between
the input note and this unique queued note that is not (yet) being
ignored.

If notes which are already being ignored are not skipped in the loop,
the
task of raising the "ignore_" flags for note events of equal semitone
pitch
(overlapping in time) which stop before the maximum stopping time of
these
notes may, due to breaking out of the loop, fail to work if there are
three
or more simultaneous notes of equal semitone pitch, leading to the
emission
of premature "note off" events for this pitch, as demonstrated, for
example,
in
<http://lists.gnu.org/archive/html/bug-lilypond/2016-06/msg00042.html>.

Please review this at https://codereview.appspot.com/296570043/

Affected files (+3, -2 lines):
  M lily/midi-walker.cc


Index: lily/midi-walker.cc
diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc
index bc6c93dc56344f0a5a8b3b96078dfcdf0ac6d7c0..d9765c681450931fe85acca5c81213a90a153001 100644
--- a/lily/midi-walker.cc
+++ b/lily/midi-walker.cc
@@ -89,8 +89,9 @@ Midi_walker::do_start_note (Midi_note *note)
                         Real (384 * 4)) + now_ticks;
   for (vsize i = 0; i < stop_note_queue.size (); i++)
     {
-      /* if this pitch already in queue */
-      if (stop_note_queue[i].val->get_semitone_pitch ()
+      /* if this pitch already in queue, and is not already ignored */
+      if (!stop_note_queue[i].ignore_ &&
+          stop_note_queue[i].val->get_semitone_pitch ()
           == note->get_semitone_pitch ())
         {
           int queued_ticks





reply via email to

[Prev in Thread] Current Thread [Next in Thread]