Resources and techniques for TSM/Cycle-Based/Akai-style time stretch?

Hi,

I’m currently trying to write a real time time-sretching algorithm that should sound somewhat like the famous metallic akai S950 time stretch. Unfortunately I can find very little resources online on the techniques that they used to get this sound.

I am currently just chopping up my original sample into grains (e.g. 1000 samples), and repeating the grains with a small crossfade until it’s time to play the next grain. This works well in some scenarios like with drums but does not hold up against other solutions when it comes to things like pads and vocals.

Current software solutions include Akaizer (not available for Mac), and Rave Generator. Both of which are closed source so I can’t take a peak. I am pretty inexperienced so I would greatly appreciate any ideas or resources for smoothing out the effect.


You can see that with my time stretch you can physically see the sections where grains are getting repeated, whereas the akai stretch is a lot “smoother” and the sound reflects this.

Many thanks,
Dario

I did a “naïve” time stretcher and provided a few different controls:

grain length - obvious what it’s for
cross-fade amount - ditto
grain trigger speed - how often should a new “grain start” be picked from the “playhead”
playback speed - how fast does the “playhead” move through the source sample

by tweaking those got some interesting results, some of which sound quite like the old Akai method.

interesting, can you explain more in detail the “grain trigger speed”
Right now for me the grains simply repeat until the total length = grainSize*lengthMultiplier.
i.e. if you pick a grain size of 500, and the length multiplier is 2, then the time stretcher will repeat the grain, with some crossfade, until the total samples is 500 * 2 = 1000. at which point it moves to the next grain.

if i understand correctly my “target length” parameter is doing the same thing as your grain trigger speed.

my aim right now is to reduce the “stepiness” that you can see in my stretched waveform. The volume jumps pretty significantly as it goes through each grain as each grain has its own gain structure that gets repeated.

I think so yes. I can’t remember the exact details off the top of my head right now, but iirc it was something like:

at note on set the “playhead” to the start of the source sample and set the grain start accordingly

each block:
output a grain (or part of and cross-fade if needed)
advance the playhead at the desired speed
if necessary update the grain start

The result is that you can get really quite different results depending on how you set those 4 parameters.
With a really slow “grain trigger speed” and 1x playback speed, it might end up you only get 2 grains being picked from the source sample - which doesn’t really sound like a “time-stretch” at all, but can still be quite interesting.

I’ve managed to improve the sound slightly by doing this:
When looping a grain, it actually alternates between the current grain and the next one. Gives a slightly smoother sound. I will try to experiment with different ideas like this one.
Maybe have the grains slide each loop. i.e.
play grain one at position 0.
when its time to crossfade to the next grain.
play at positition 50,
next,
100

I’m not sure if that makes sense but I get the feeling that the key with these algorithms is little tricks like this :laughing:

1 Like