- Moment now = now_mom ();
- Link_array<Audio_note> nharr;
-
- stopped_notes_.clear ();
- while (past_notes_pq_.size ()
- && past_notes_pq_.front ().end_ == now)
- stopped_notes_.push (past_notes_pq_.get ());
- done_ = true;
- return;
- }
-
- if (req_l_)
- {
- now_notes_.sort (CNote_melodic_tuple::pitch_compare);
- stopped_notes_.sort (CNote_melodic_tuple::pitch_compare);
- int i=0;
- int j=0;
- int tie_count=0;
- while (i < now_notes_.size () && j < stopped_notes_.size ())
+ // for each tied note, store the info and its end moment, so we can
+ // later on check whether (1) the note is still ongoing and (2) how
+ // long the skip is with tieWaitForNote
+ Head_audio_event_tuple inf_mom (inf, now_mom () + an->length_mom_);
+ if (an->tie_event_)
+ now_tied_heads_.push_back (inf_mom);
+ else
+ now_heads_.push_back (inf_mom);
+
+ // Find a previous note that ties to the current note. If it exists,
+ // remove it from the heads_to_tie vector and create the tie
+ list<Head_audio_event_tuple>::iterator it;
+ bool found = false;
+ Stream_event *right_mus = inf.event_;
+ for (it = heads_to_tie_.begin ();
+ !found && (it != heads_to_tie_.end());
+ it++)