Lurker News
I worked on a web service that allows you to import a song and define a target length that the song will be shortened or lengthened to. It does this by analyzing the song and finding repeating audio patterns. This is helpful for making any song match a video or performance with a set duration. You can also specify areas of the song to prefer or avoid. An example is available here: https://mofi.loud.red/edit/8bd3fdf780f8c3927e41029f3b957f8a7...

The cool thing is that after the song is analyzed on the server, the client can recompute and preview the results completely client-side through an implementation that uses Web Workers and WebAssembly. The audio previewing uses Tone.js. I am thinking of writing up some more details about the implementation in the future.
I'm still working on a way to explain this easily, but I like the idea of carrying over the concept of content-aware fill from images to audio.
Please let me know if you have any comments or questions!

Comments (161) 65 threads

Earlier comments
stu20101 reply#
What's the maximum length? I can't find it documented anywhere and keep running into it when trying to try this with Tool tracks.
jaflo1 reply#
There is no enforced maximum length for either input or output right now. In practice, the remote machine times out trying to analyze a song after 10 or so minutes. For output, your machine will take forever to generate really long results.
jaflo#
I had forgotten about this check actually! I just removed it and deployed the changes. You can try again but am unsure if it will break something (it will spin indefinitely, but I would give it up to 10 minutes). Good luck!
jedberg#
The way this works is interesting. I asked it to cut 30 seconds from the middle of a song (a spoken word portion without music) and then shorten the track by 30 seconds. I figured it would just cut that out and do some fancy blending of the music before and after the cut to make it sound good. Instead I got:

    at 00:00 a 00:16 segment (00:00–00:16)
    at 00:16 a 00:51 segment (02:05–02:57)
    at 01:07 a 02:31 segment (01:34–04:05)
    at 03:39 a 00:11 segment (04:03–04:14)
It's adding and repeating chunks of the song and cutting other parts and I'm not sure why.
quickthrower2#
I can finally see and hear what Bohemian Rapsody would have sounded like had they caved in to make a radio-friendly cut.
redox991 reply#
Does this create "new" music for the filled parts, like some AIs (MusicLM, MusicGen, etc) do? Or just repeat in a more seamless way?
jaflo#
It does not create new music from scratch using one of the techniques you mentioned, but just reuses parts from the song, blending the transitions between them. That is a cool idea though!

Load more comments