Dirac Timestretching anyone?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Borogove wrote:
JCJR wrote:Its realtime, and its an effect. What diff does it make if the effect is acting on a disk file rather than live input?
If it's on disk, it can read ahead (effectively 'into the future') to accomodate speed-up, or it can read more slowly without risk of running out of RAM to accomodate slow-down.
Exactly. Agree completely.

The quoted statement was a quibble about semantics-- what to call a player (or sequencer, or sampler, whatever) that can stretch in realtime. All audio players, IMO, must at least have 'loose' realtime characteristics, to keep audio from dropping out. The audio player must have each buffer prepared in time for the soundcard's realtime constraints, or playback fails. That would be called realtime stretching in my book.

http://www.linuxdevices.com/articles/AT3524337625.html

=====

On another topic, joer's gated stretch idea might be an interesting 'live playthru' effect. Perhaps useful in 'outside' recordings or live performance, or at least a hoot late at nite after a few beers.

Maybe have a 30 second delay buffer. Run a gate detector on the live input. On each audio input phrase onset, the gate would reset the stretch process to output to 'now' in the buffer, mixing the new stretch output with whatever was already written to the delay buffer. It would gradually 'fade out' stale contents of the buffer. Might be tricky to configure correctly.

If stretching 2X, if you speak, "Twinkle, Twinkle, Little", the gate would move the stretcher output to 'now' at the onset of each word. The first 'slowed down' word would still be playing when the second 'slowed down' word gets mixed-in atop the tail of the first 'slowed down' word, etc.

If nothing else, speaking, singing, or playing thru such a plugin would be a wonderful way to get terminally confused (GRIN).

Post

JCJR wrote:
Borogove wrote:
JCJR wrote:Its realtime, and its an effect. What diff does it make if the effect is acting on a disk file rather than live input?
If it's on disk, it can read ahead (effectively 'into the future') to accomodate speed-up, or it can read more slowly without risk of running out of RAM to accomodate slow-down.
Exactly. Agree completely.

The quoted statement was a quibble about semantics-- what to call a player (or sequencer, or sampler, whatever) that can stretch in realtime. All audio players, IMO, must at least have 'loose' realtime characteristics, to keep audio from dropping out.
But there's a huge difference between (a) buffering a few milliseconds out of an input stream being driven by a human holding a guitar in live concert on the one hand, who doesn't know in advance how long a solo or how many encore's he's going to take, and (b) a 279-second-long wave file that already exists on disk, in terms of what you can do with it.
Image
Don't do it my way.

Post

Interesting Linux article JCJR, I'll try not to be any more helpful to you in getting your ideas across (as I was not the only person who was confused by your initial statements). Also, try not to confuse RTOS and real-time application, apples & oranges again. Linux's (and windows CE) touts as Real-time Operating Systems are debatable to begin with and should not be thought of as a solid starting point for understanding real-time or embedded systems or programs (including DSP).

Post

Yes!!!!!
a hoot late at nite after a few beers.

Post

We must, of course, know the exact maximum buffer size we need and therefore determine the exact latency of such plugin!

Post

Or maybe it could have variable latency, that would be a thing to mess up the control freaks!

Not you of course!!

OK i've been in the pub again :hyper:

Post

Joer, on your 'gated stretch' idea, maybe you don't need more latency than the thruput latency of input-to-output? Maybe it could be as low as the host's input-thru-to-output latency (depending on the timestretch method)?

For sake of simplified brainstorming, posit a very crude 2 X stretch-- just repeat each sample twice. Duration is doubled and pitch is halved.

Also posit a circular stretch buffer. 30 seconds is probably enough, but you could make it user-adjustable. Maybe the plugin could write to the stretch buffer at half-speed (repeat-sample moving double the distance compared to normal speed), and the plugin would read from the stretch buffer at full-speed.

If the audio input envelope is above threshold, we could write stretched audio to the buffer. If the audio falls below threshold, we reset the write pointer to the read pointer, and we don't write anything to the buffer until the audio again gets louder than threshold.

If we say, "twinkle, twinkle" into the plugin, after the first word, the stretch buffer looks like this-- (R is read pointer, W is write pointer, very crude ascii graphics)

R______________W
|ttwwiinnkkllee_____________________________|

The plugin returns whatever size it is requested on each process call, moving the read pointer at 1:1 thru the stretch buffer.

When the next word comes in, we mix-write the new stretched audio into the stretch buffer from the read pointer current position--

New data-
______R______________W
______|ttwwiinnkkllee_______________________|

Mixed with the old data-

______R______________W
______|nkkllee______________________________|

Lots of twiddly details, but maybe something like that would be suitably mind-numbing...

Post

pustekuchen wrote:Everyone, who actually has got a little bit brain, can actually see that a "real realtime stretching" of audio (in both directions) is pure nonsense. Because you can't (at least) look into the future - not currently - :hihi: ...) But he obviously could.
Why would you have to look in the future to do time stretching? If you have different sample rate for the input and output a "real" realtime time stretch (I assume you mean "full duplex" by that...?) would simply be a matter of a pitch-compensated pitch shifter. I see nothing wrong with the logic here. Of course, you usually don't have full control over the sample rates and they are generally the same for the input and output so this is kindof a moot point, but "he" is still right... ;-)

--th
I'm the stereo chancellor

Post

JCJR wrote:I emailed Stephan suggesting an ActiveX component version of Dirac, but he is so busy, it is doubtful that will happen anytime soon.
At least he has a free demo version now (actually, this is a full featured time stretcher - a very good one at that...!) :o

--th
I'm the stereo chancellor

Post

Whatsoever, it may also be intresting to know that:
Latest News

May 24, 2005 -- The free time stretching and pitch shifting library DIRAC (formerly ClearScale) is now online in the Technology category on http://www.dspdimension.com

April 19, 2005 -- Here are the latest (and last) news regarding my ClearScale project that was aimed at bringing an open source high end time stretching and pitch shifting to the market, to be published under the GPL. Unfortunately, as it happens frequently in this educational business, the company who agreed on sponsoring the development never paid for it and the money from donations (a whopping 120 USD) wasn't even enough to pay for the costs of keeping the site alive. However, since I have the project half finished already I decided for a compromise: ClearScale will soon be available as a free object library for various platforms called "Dirac". I will not publish the source code, but the basic library is still free to be used in commercial and non-commercial projects without restriction. I plan on making a professional version available for a licensing fee to finally cover the development costs, but the basic library is free for the time being. I think this is fair enough, considering the many months development time that went into creating it. More on the Dirac library will soon be posted on the DSPdimension at http://www.dspdimension.com when I'm finished cleaning up and redesigning the site. ClearScale.org will eventually be closed.
source: http://www.clearscale.org/

Post

pustekuchen wrote:

Everyone, who actually has got a little bit brain

Post

A one bit brain with a parity error...

Post

OT: What goes 'Pieces of Seven, Pieces of Seven, Pieces of Seven'?

Parroty Error.

{My all time favourite joke that}
{Man, what a saddo!}

:)

DSP
Image

Post Reply

Return to “DSP and Plugin Development”