News for hackers. Stuff that matters.
Re:Looping Music Seamlessly by MadWombat on Tuesday October 29, 2019 @09:25PM (#21393805)
I might be misusing "sparse". What I meant was that in a sufficiently high sample rate music, there are a lot of samples between notes and a lot of the samples are noise and garbage.

I do understand how autocorrelation works, to a reasonable degree. And that is the reason for the DFT. We are talking music, so we care about the frequencies more than about the immediate sample value.

And the window is important because autocorrelating over individual data points is useless, sound signals are noisy and you get a lot of randomness.

Also, I tried the code provided on a few pieces I thought would be appropriate and it didn't do a very good job. I might run a few experiments.

Re:Looping Music Seamlessly by klodolph on Wednesday October 30, 2019 @09:43AM (#21397602)
> We are talking music, so we care about the frequencies more than about the immediate sample value.

The frequencies and the sample values are just two different ways at looking at the same data.

> And the window is important because autocorrelating over individual data points is useless, sound signals are noisy and you get a lot of randomness.

I’m not sure what you mean by “individual data points”. The autocorrelation is computed for an entire signal, not for any individual data point. Talking about an individual data point in the input doesn’t make much sense.

Autocorrelation is not especially susceptible to noise.

> Also, I tried the code provided on a few pieces I thought would be appropriate and it didn't do a very good job. I might run a few experiments.

Try doing just a simple autocorrelation instead. This will work for the use cases described (looped samples of music), you will see a large spike in the autocorrelation for the loop point.

For music which repeats but is not looped, you can do some preprocessing e.g. to find envelopes and do autocorrelation on that.

Re:Looping Music Seamlessly by MadWombat on Wednesday October 30, 2019 @10:23PM (#21405120)
> you will see a large spike in the autocorrelation for the loop point

Why? All I can hope for is to pick the max autocorrelation value, but why would I see a spike?

Re:Looping Music Seamlessly by alanbernstein on Saturday November 09, 2019 @09:21AM (#21491688)
That is the exact intended purpose of the autocorrelation