HydrogenAudio

Hydrogenaudio Forum => Scientific Discussion => Topic started by: robUx4 on 2003-09-15 09:38:19

Title: Time-Stretching
Post by: robUx4 on 2003-09-15 09:38:19
Hi everyone,

I'm working on an audio software and I'd like to do some time stretching in "real-time". That is reading an audio file and changing the duration of the track without changing the pitch.

The first obvious option is to use resampling to change the number of final samples, but that changes the pitch...

So my second option was inspired by granular synthesis. Cut the file in small parts and then output these parts as is with some samples added/removed at the end (added with content from the original part). But the sound is really bad and the pitch seem to be changed anyway (depends on the size of the parts). It sounds especially bad on low frequencies.

I'm thinking about adding some fade in/fade out on the transition part (where data is added remove). But I doubt it will improve the quality much.

So I was wondering if anyone here know places with good informations on how to code a good time-stretching (or even better some working+free code in C or C++).
Title: Time-Stretching
Post by: [JAZ] on 2003-09-15 09:54:06
take a look at this. It might be what you want.
http://www.sunpoint.net/~oparviai/soundtouch/ (http://www.sunpoint.net/~oparviai/soundtouch/)

Note that there also exists a foobar plugin (Download here: http://www.cqasys.com/projects/kode54/index.php (http://www.cqasys.com/projects/kode54/index.php) ).
Title: Time-Stretching
Post by: bond on 2003-09-15 10:05:34
perhaps ac3filter can also do that!? (or only change delay?  )
Title: Time-Stretching
Post by: andy5998 on 2003-09-15 11:33:38
There is a discussion (by me) at
http://www.seventhstring.demon.co.uk/xscri...e/slowdown.html (http://www.seventhstring.demon.co.uk/xscribe/slowdown.html)
though I don't make source code available.

Andy Robinson, Seventh String Software, www.seventhstring.demon.co.uk
Title: Time-Stretching
Post by: kl33per on 2003-09-15 12:46:28
Quote
,Sep 15 2003, 06:54 PM] take a look at this. It might be what you want.
http://www.sunpoint.net/~oparviai/soundtouch/ (http://www.sunpoint.net/~oparviai/soundtouch/)

Note that there also exists a foobar plugin (Download here: http://www.cqasys.com/projects/kode54/index.php (http://www.cqasys.com/projects/kode54/index.php) ).

I must say, that foorbar plugin is very impressive.  It can also alter pitch without changing tempo, very interesting.
Title: Time-Stretching
Post by: robUx4 on 2003-09-15 12:58:11
Quote
,Sep 15 2003, 09:54 AM] Note that there also exists a foobar plugin (Download here: http://www.cqasys.com/projects/kode54/index.php (http://www.cqasys.com/projects/kode54/index.php) ).

I don't see any such thing there
Also what I need is either an algorithm, a principle or a source code, not a binary   

edit: oops I didn't make the link with the previous sentence, sorry...
Title: Time-Stretching
Post by: robUx4 on 2003-09-15 13:17:28
Quote
There is a discussion (by me) at
http://www.seventhstring.demon.co.uk/xscri...e/slowdown.html (http://www.seventhstring.demon.co.uk/xscribe/slowdown.html)
though I don't make source code available.

Very good explanations, thanx !
Title: Time-Stretching
Post by: M on 2003-09-15 13:20:15
You should also be able to do this with a combination of switches in SoX (http://sox.sourceforge.net/).

    - M.
Title: Time-Stretching
Post by: kode54 on 2003-09-15 13:21:43
Quote
Also what I need is either an algorithm, a principle or a source code, not a binary   

SoundTouch library is available as source code, and also includes examples. If you would prefer my DSP component as an example, the source code is available from my page.