Timestretch in Real Time
I’ve modified the pitchshift/timestretch example I uploaded last week to work in real time. No more loading samples, you can simply play audio through it and go! This implementation unfortunately imposes some restrictions on use, however – you can’t speed up the playback any more, and instead of being a constant effect, the effect must be triggered. These are both consequences of the fact that we’re not storing the whole file in memory and don’t have access to the data that we would need.
Instead, I’ve rigged it so that any MIDI note will start the effect, and when you release the note, the playback goes back to normal. Using this method it’s possible to alter the pitch/speed of the incoming sounds for a period of time dependent on the playback speed. This period is about 12 seconds while playing in reverse, about 24 seconds while speed = 0, and is infinite when the speed = 1. This means that the pitch-shift effect can be used indefinitely as long as the speed = 1.
Eventually I’ll be expanding this simple demo into a proper beatmashing ensemble. Until then you can download it here.