I really have no idea if what I'm thinking is feasible, but what the heck.
I have some MP3s of game music. This game music was rendered from a Tracker format, which means that at some point the track loops back to an earlier point, so it's like this:
Intro---|Main loop-------------------|Main loop-------------------|Main loop fade|
Or in "regex" form:
/^\p{Intro}(\p{Main_0}\p{Main_1}\p{Main_2})+\p{Main_0}\p{Main_1_fading}$/
I hope this communicates what's going on!
Basically, I want to know if I can detect the start and end of the main loop based on repetition of the waveform. The idea being that since they are rendered from a tracker format, the waveform should be exactly the same between loops, even after having been "baked" in MP3 format.
If this is possible, how might I go about finding such a repeating loop? The goal is to programmatically extend these looping tracks to repeat more times, so I don't have to do it manually.
At this stage I'm simply looking for general algorithms to approach the problem. I can work out how to read an MP3 file's waveform, process it and save a new one without difficulty, what I need help with here is how to find a repeating portion of the waveform. Does anyone have any wisdom to impart?
Finding the max. peaks of the autocorrelation-function should help you finding repetitions in a signal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With