Best Practices When Merging Midi Clips

I have been using te::mergeMidiClips(midiClips); for merging midi clips. This works fine for simple scenarios. But I fear that my implementation is naïve because it is not working properly when merging clips across tempo and time signature changes. Which makes me think that either I am not doing some required preparation before the merge, or maybe it is simply not recommended to merge across tempo and time signature changes.

Suggestions and insight are welcome.

You might have to shed a bit more light on what you mean by “not working properly”, a unit test would be a good definition :wink:

mergeMidiClips works in terms of beats though so it shouldn’t matter if it goes through tempo or time sig changes. But you can always step through it to see where it’s falling down?

Not surprisingly part of the problem is on my end. I was not using the TimePositions and Durations properly. But that may not fix all scenarios. I will be working now to try and isolate if there are any further issues. If I find something questionable I will also need to test it with Waveform to confirm the behavior. And if I manage to do that, I will post here with an example tracktionedit file that demonstrates the issue.

So assume all is good unless I post again.