Merge Clips?

In Tracktion Engine we have the super convenient te::splitClips() function. Is there a “mergeClips()” function?

The te::splitClips() works great, and, during an edit session, I can use “Undo” to merge the clips again if needed. But, if I save, or start editing another day, the Undo trail is lost. So, it would be nice to have a “mergeClips()”. Is there one, and I just have not found it?

Merging clips is extremely complicated as there’s so many different ways you could do it.
It’s pretty straightforward for MIDI but for audio it basically involves rendering the audio in to a new clip.

I thought that might be the case.

I was thinking it might be possible if the clips to merge are from the same source file. But, in practice, I wonder how often that is the case? And, in such case, it might just be easier to re-import the clip.

Thank you!

Yeah, there’s all kinds of complications such as source file offset, loop start/duration etc. that you just wouldn’t be able to stitch back together. Maybe in the most simple cases but most of the time you’d have to render to merge them.

did you ever end up implementing any merge functionality? even just for midi clips?

I have not implemented merge yet. And, when I do, it will most likely be just for midi, which seems much more amenable to merging.

alright Im going to try and figure something out for midi. Will let you know what I come up with.

I have fantastic news. There is a helper function already for midi clips. Just add the midi clips you want to merge to an array and call the mergeMidiClips function

juce::Array<tracktion_engine::MidiClip*> clips;
1 Like

Nice! Perfect for coalescing all the clips in one track. I will give this a try.

Thank you!