fix #26516: crash on repitch

Can you add a comment here? Something like // in repitch mode only ties between single note chords are handled; one sided ties and ties from or to multi-note chords are removed.
Idem in the copy of the code, maybe with a reference to each other.