Looping sounds off

Noticing an issue in my project when (in the simplest example) I have one clip placed on a track and the loop set to exactly the bounds of the clip. The clip sounds perfect on the first pass, but after the playhead loops back to the beginning and every subsequent loop, the first moment of the clip glitches/gets cut off. Any thoughts on what I might be doing wrong?

You may want to post a short example of your method of looping the clip.

It’s scattered over a number of files, but essentially, I:

  • Make/initialize an empty edit
  • Add one audio track
  • Insert a wave clip onto the audio track starting at 0.0 and ending at 4.0 seconds; the clip is precisely 4 seconds at 44.1kHz (176400 samples)
  • Set the loop bounds to begin at 0.0 and end at 4.0 seconds, and enable looping
  • Set the clip to not use a proxy
  • Play
  • Is this on desktop (or iOS for example)?
  • What time-stretching backend are you using (E.g. SoundTouch, RubberBand, Elastique)?

Testing on Windows at the moment.

We use Elastique; historically in our codebase when we’ve wanted to do pitch shifting or time stretch, we’ve manually used the tracktion_engine::TimeStretcher class to create new files on disk and play those back. Right now, however, I’m hoping to test a simpler case that doesn’t require any time stretching (the file I’m testing is 4 seconds, supposed to be 2 measures at 120bpm, and the tempo sequence of the edit only has one entry of 120bpm). Should I do the time stretch step anyway?

No, that should work fine in real-time.
Are you using the tip of develop?

I’m not; we haven’t updated tracktion in our codebase in quite some time, maybe early 2021. I was considering updating in hopes that might alleviate this

Yes, the whole backend for setUsesProxy has changed since then so should work a lot better.
There are API breakages in v2 though so read this first: tracktion_engine/Engine_2.0_Transition.md at develop · Tracktion/tracktion_engine · GitHub