Audio does not loop seamlessly

I have a 60-sec 44.1kHz sound that is set to play “Locked to Timeline”. The timeline and region lengths are both set to 3600 frames (60 seconds @ 60 fps).

The problem is that, when it plays, there is an audible glitch when the sound loops at the end of the timeline.

As you can see on the screenshot, it is weirdly possible for me to scrub the timeline past 3600. Sometimes I can go to 3603 other times up to 3609. Even when I manually reset everything to 3600 frames (both timeline and region), the glitch can be heard. Strangely, on some occasions, the audio loops seamlessly. I have not been able to identify the conditions which cause the playback to glitch.

As you can see on the screenshot the audio is precisely 2 646 000 samples long (44100Hz x 60 seconds).

Am I doing something wrong? Here’s the screenshot:

I’m using version 2023.12230 on Windows.

Because of the high-precision requirements for audio decoding, I tend to prefer to let the audio playback drive component time, not the other way around.

The video refresh interval (60hz) is a much bigger window than the audio refresh interval (44100hz). Trimming even a single sample from the audio will potentially cause an audible pop.

Consider moving the other things that you have locked to time into another COMP with component time, then drive that timeline using the current playback position of your looping audio which plays sequentially outside the COMP that chases it. This will allow the audio file to loop cleanly and other events to get sync from it.

Thanks for your answer Florian. It makes sense. However, this problem has not surfaced for me before even though, each year, I ask my students to create such a project, based on a 60-sec audio loop. This is why I showed a sreenshot establishing that the audio has the exact number of samples for a 60-sec loop.

The other trippy part is the ability to scrub past the end of the timeline. This definitely feels like a bug.

Anyway, thanks for your input. I just hope someone from Derivative chimes in.

Cheers!

Hi @djipco,

just tried with a 90hz sine wave. I setup a Wave CHOP to create a 3600 frames long wave but this results in 2.646.001 samples. But no audible glitch. Could you try the attached file or share your audio for us to check this out?

cheers
Markus
wave1.zip (26.4 KB)

Hello Markus,

Thanks for your input. I’m in transit today and I do not have the file on hand but I will definitely upload it as soon as I can for you to look at.

Regarding your example, isn’t it odd that you get one extra sample?

Anyway, thanks for taking the time. I will get back to you soon.

Cheers!

Hi @djipco,

I had to look at that as well but is makes sense:
the Start parameter was set to frame 1 while the End parameter was set to frame 2.
The End parameter is inclusive. So since frame 2 comes after the last sample of frame 1, an extra sample is added.

cheers
Markus

Here is an actual .toe and sound files showcasing the problem:

@snaut I tried your .aiff file (in replacement of my own audio file) and it also produces an audible click when the timeline loops.

So, I generated my own 100Hz tone in Audacity, put it in a .wav and replaced the music with it. Problem gone! So, I re-exported the student’s music file (using Audacity) and the problem also seems to be gone. When I go back to the original (problematic file), I’m no longer able to reproduce the problem. I’m still able to scrub to 3603 frames on the TD timeline, though (but not 3609 frames like before).

I don’t know what to make of all this…

I’m still trying to understand what’s going on. So, I went back to the demo file I sent above (the one that shows the current frame to be 3609 even though the timeline length is 3600) and, sure enough, the problem is still there.

So, I start from scratch with version 2 of the music file and… the problem comes back. In short, it’s inconsistent. Sometimes the problem is there, sometimes not and I have no clue what triggers it.

In any case, here is the project folder with all the files (audiotest.toe, music_v1.wav, music_v2.wav, tone.wav and wave.aiff from Markus):

Hi @djipco,

regarding the scrolling, puzzled how you got the Range End setting to be larger than the End setting.

Just so I understand correctly, the problem also exists when the Timeline and the Timeline’s range are set to the same values?

cheers
Markus

If I scrub to the right, past the end of timeline, it will go a few frames above the maximum number of frames. Currently, it goes up to 3 frames above the Range End but, with the problematic music from earlier, it would go up to 9 frames past the Range End.

To answer your question, it will sometimes not loop smoothly even when the Timeline and the Timeline’s range are set to the same values. At other times, it will play fine. What I observed is this: if I do not touch the timeline settings, it will always play the way it did before. It’s when I change the timeline settings, or scrub past the maximum, that it will start or stop to glitch. Another thing I observed is that the Range End slider sometimes does not touch the right edge of the timeline even though it should (e.g. when the range is the same as the timeline).

I hope this is somewhat clear. I wish I was able to better isolate the issue but I haven’t been able to.