A lightweight Akai-style time-stretch algorithm (realtime!)

Hi :),

in making my latest plugin, i’ve come up with this time stretch algorithm that, i think, pretty closely mimics the classic akai s950 (and others) time-stretch. That is, it sounds very metallic and unnatural on purpose :laughing: .

As a bonus it works in realtime, where current closed source solutions like Akaizer were offline, so you have to bounce the whole file when you make a change, the parameters for this struct are automatable :+1: .

It is a fairly short struct with a simple interface:

I hope someone finds this useful!

4 Likes

Excellent! Thank you for this, I can’t wait to try this out! Can you elaborate a little on how this kind of time stretching works? I just suffered weeks implementing rubberband stretch in my audio application and while it was brutal wrapping my head around the buffering, it got me interested in how something like time stretching even works. I understand this is something of a granular time stretch like Abletons right? Except theirs does some snapped granular sizes like 1/8, 1/16th note lengths. Very curious to learn more!

Hi,

This is a very very crude approach to granular timestretch, like Abletons yes. But as the title implies its aimed to sound more like an Akai, Abletons “Texture” mode never really hit the spot for that kinda thing.

I implemented this with reading from static buffers, so not truly realtime, but a friend of mine has been able to implement it realtime no problem, but simply allowing for a buffer to be filled, and looping back around once you’ve reached the end if that makes sense.

The basic idea is having two grains overlapping eachother, once you start fading out one grain, you fade in the next grain, with some offset in the source buffer.
The result is not a perfect recreation of the akai - stretch, but i think a pretty good approximation.

1 Like

How do you think it could be improved?

Firstly it could be fleshed out with some realtime decoration, a buffer to cache etc.

But now that I think about it that can all be abstracted away and this be kept as a pure little C++ struct which is very pleasing to my brain haha.

Secondly, I’m not 100% satisfied with the sound, In doing some tests at more extreme settings (2000% stretch rate), It wasnt quite matching the akai sound. My one has more prominent transients and clear attacks, whereas the Akai is a bit smoother, which i prefer.

small things

1 Like

Do you have some sound samples you can share? I’d love to hear it. You’d think sharper transients would be ideal lol. I might take a shot at writing the real time code when I get some free time. I’m working hard to have an alpha of my app up by December so it might be a minute. Since my app is a performance tool I think this time stretching approach may come in handy

1 Like

type “amigo sampler” into youtube :wink:

2 Likes

Did not realize that was your project! Excellent work! Bought a copy to support, thank you for giving to the community

4 Likes