View Single Post
  #5 (permalink)  
Old 05-30-2008, 08:42 AM
R
Guest
 
Posts: n/a
Default Re: Fast (real-time) time stretch code

On Thu, 29 May 2008 22:02:29 -0700 (PDT), robert bristow-johnson
<[email protected]> wrote:

>On May 29, 11:48*pm, R <R...@nospam.com> wrote:
>> On Thu, 29 May 2008 14:35:49 -0700 (PDT), robert bristow-johnson
>>
>> <r...@audioimagination.com> wrote:
>>
>> >first of all, usually for a "real-time" process we mean that the same
>> >amount of time going in is what comes out.

>>
>> I meant response time.

>
>i think you meant the computation is efficient enough that if you can
>play back the audio file either faster or slower from the disk, and
>the algorithm output doesn't fall behind more than a known and bounded
>delay.


Ahem...

>> >as you're slowing it down, are your samples coming from disk (or
>> >whatever source) repeating over some regions?

>>
>> Yes, samples coming from disk. Yes, an option to keep replaying the
>> segment, if that's what you meant.

>
>yeah, if you're slowing it down, you would have to repeat segments in
>some manner. and if you were speeding it up, you would be omitting
>some segments. (discounting any cross-fading in the splices.)


OK--that's obvious. I thought maybe you were suggesting that caching a
preprocessed version of the audio file would be more efficient if it
were to be played multiple times. Which is a good thought, because it
probably would be looped.

>> And
>> as you point out, overtones won't necessarily align even with
>> monophonic sources.

>
>did i say that?? (i have to check.)


Oh, maybe you didn't. I had tried to find info via Google archives of
this group. Maybe that was from one of those posts.

>> But even the old hardware was not that bad
>> sometimes. Guitarists and keyboard players used those for playing
>> root+5th or even full chords at times. You've probably heard the
>> result on recordings.

>
>yeah. actually i was in on the pitch-shifting algs on one of the
>Eventide Harmonizer models.


No kidding. That's what I had in mind when referring to splice algs,
etc. You probably worked on the newer versions, so you would have had
access to some serious DSP power. The older ones used bit-slice
processors. Some had options for a primitive secondary channel that
assisted in finding splice points.

>> Still, if it can be done via FFT without having to crunch overnight,
>> that would be preferable. The sound doesn't have to be hifi, but best
>> that it's free of distracting pulsing or harsh artifacts.

>
>there a bunch of products. SoundToys (or Wave Mechanics) SPEED,
>Serato Pitch 'n Time.


I wasn't looking for a pre-written program, but I've been wondering
whether I'd be further ahead learning how to host a VST plugin.

>> So...any code available for doing this? Pref in C/C++ so I could get
>> it running on a Windows machine.

>
>it's not too hard to write a simple phase vocoder. i'm not gonna send
>you any code nor tell you any tricks that make it sound better than
>what you might get from a published alg (like Laroche or Puckette).
>that's not too hard. do you have your file and sound I/O worked out?


No problem writing file or sound IO. Or the UI for that matter. I've
done enough of that. I was just looking for a start on the time
stretch code. The idea is mostly for a quick rehearsal/transcription
tool, so I didn't want to get too deep into piles of DSP books. I'll
look for the Laroche and Puckette algorithms (thanks for the lead).
Maybe if I'm lucky, someone has posted some working C or C++ code.

Reply With Quote