Fix search of first tied tuplet note
First version of merge voices function (but crash sometimes appears)