- Grob *th = heads_to_tie_[i];
- Music * right_mus = unsmob_music (h->get_grob_property ("cause"));
- Music * left_mus = unsmob_music (th->get_grob_property ("cause"));
-
- /*
- maybe should check positions too.
- */
- if (right_mus && left_mus
- && gh_equal_p (right_mus->get_mus_property ("pitch"),
- left_mus->get_mus_property ("pitch")))
- {
- Grob * p = new Spanner (get_property ("Tie"));
- Tie::set_interface (p); // cannot remove yet!
-
- Tie::set_head (p, LEFT, th);
- Tie::set_head (p, RIGHT, h);
-
- ties_.push (p);
- announce_grob(p, last_event_->self_scm());
- }
+ Grob *p = new Spanner (heads_to_tie_[i].tie_definition_,
+ context ()->get_grob_key ("Tie"));
+ announce_grob (p, heads_to_tie_[i].event_->self_scm ());
+ Tie::set_head (p, LEFT, th);
+ Tie::set_head (p, RIGHT, h);
+
+ ties_.push (p);
+ heads_to_tie_.del (i);