- Moment stop_mom = note_l->duration() + ptr()->audio_column_l_->at_mom();
- for ( int i=0; i < stop_note_queue.size(); i++ ) {
- if ( stop_note_queue[ i ].val->pitch_i() == note_l->pitch_i() ) {
- if ( stop_note_queue[ i ].key < stop_mom )
- stop_note_queue[ i ].ignore_b_ = true;
- else // skip the stopnote
- return;
+ Audio_item *ptr = items_[index_];
+ assert (note->audio_ == ptr);
+ int stop_ticks = int (moment_to_real (note->audio_->length_mom_) * Real (384 * 4))
+ + ptr->audio_column_->ticks ();
+
+ bool play_start = true;
+ for (vsize i = 0; i < stop_note_queue.size (); i++)
+ {
+ /* if this pith already in queue */
+ if (stop_note_queue[i].val->get_semitone_pitch ()
+ == note->get_semitone_pitch ())
+ {
+ if (stop_note_queue[i].key < stop_ticks)
+ {
+ /* let stopnote in queue be ignored,
+ new stop note wins */
+ stop_note_queue[i].ignore_ = true;
+
+ /* don't replay start note, */
+ play_start = false;
+ break;
+ }
+ else
+ {
+ /* skip this stopnote,
+ don't play the start note */
+ note = 0;
+ break;
+ }