+ now_heads_.sort (CHead_melodic_tuple::pitch_compare);
+ stopped_heads_.sort(CHead_melodic_tuple::pitch_compare);
+
+ SCM head_list = SCM_EOL;
+
+ int j = stopped_heads_.size ()-1;
+ int i = now_heads_.size ()-1;
+
+ while (i >= 0 && j >=0)
+ {
+ int comp
+ = Musical_pitch::compare (now_heads_[i].req_l_->pitch_ ,
+ stopped_heads_[j].req_l_->pitch_);
+
+ if (comp)
+ {
+ (comp < 0) ? j -- : i--;
+ continue;
+ }
+ else
+ {
+ head_list = gh_cons (gh_cons (stopped_heads_[j].head_l_->self_scm_,
+ now_heads_[i].head_l_->self_scm_),
+ head_list);
+
+ past_notes_pq_. insert (now_heads_[i]);
+ now_heads_.del (i);
+ stopped_heads_.del (j);
+ i--;
+ j--;
+ }
+ }
+
+
+ SCM sparse = get_property ("sparseTies");
+ if (to_boolean (sparse))