I would strongly suggest looking at Rubberband: <meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://breakfastquay.com/rubberband/why.html">http://breakfastquay.com/rubberband/why.html</a><div>

<br></div><div><a href="http://breakfastquay.com/rubberband/why.html"></a>However, it is unclear what you want: audio time-stretching, or audio resampling.  Resampling will get you the "slowed down record" or "sped up record" effect, where the pitch is affected along with the time.  However, if you want to manipulate the pitch and time separately, then you need time-stretching.  If you're not sure what you want, I would still suggest librubberband, because it can do all of the above, plus allow you to manipulate the parameters in real time.</div>

<div><br></div><div>Jeremy<br><br><div class="gmail_quote">On Sun, Jan 2, 2011 at 2:51 PM, Harry Van Haaren <span dir="ltr"><<a href="mailto:harryhaaren@gmail.com">harryhaaren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hey all,<div><br></div><div>I'm looking for an open-source time-stretching library, suitable for RT work.</div><div>I've googled and come up with the following list, which I can't choose from:</div><div><br></div>


<div>-Soundtouch : <a href="http://www.surina.net/soundtouch/index.html" target="_blank">http://www.surina.net/soundtouch/index.html</a></div><div>-ClearScale / DspDimension: <a href="http://www.clearscale.org/" target="_blank">http://www.clearscale.org/</a></div>


<div>-SecretRabbitCode / libsamplerate : <a href="http://www.mega-nerd.com/SRC/" target="_blank">http://www.mega-nerd.com/SRC/</a></div><div>-LibResample : <a href="https://ccrma.stanford.edu/~jos/resample/" target="_blank">https://ccrma.stanford.edu/~jos/resample/</a></div>


<div>-MFFM timescale: <a href="http://mffmtimescale.sourceforge.net/" target="_blank">http://mffmtimescale.sourceforge.net/</a></div><div>-LibZita-Resampler: <a href="http://www.kokkinizita.net/linuxaudio/zita-resampler/resampler.html" target="_blank">http://www.kokkinizita.net/linuxaudio/zita-resampler/resampler.html</a></div>


<div><br></div><div>I'm attepmting to write a sample player, that will time-stretch long loops to stay in sync</div><div>with JACK transport.</div><div><br></div><div>I've deduced this is what I need to do:</div>

<div>
- Calculate the amount of samples I need to change the buffer length by</div><div>- Take the buffer, resample it to a larger / smaller amount of samples.</div><div>- Playback the samples as I normally would, except that there's more, and hence the audio will stay in sync.</div>


<div><br></div><div>Design choices:</div><div>1. should I re-sample the whole buffer, and then playback from that buffer?</div><div>this approach might cause a lot of CPU strain once the rate changes, as the *whole* buffer would</div>


<div>be re-sampled at the same time. Once done, the CPU has no strain from resampling.</div><div><br></div><div>2. Resample "nframes" amount of samples from the buffer, and play them back?</div><div>Less sudden CPU overhead, more constant CPU usage. </div>


<div><br></div><div>The other problem I'm faced with is that some libraries mention that they do *not* support "<span style="font-family:arial, helvetica, sans-serif">dynamically variable resampling ratios".</span></div>


<div><font face="arial, helvetica, sans-serif">Would I need this? I think I do, as to get the beat "on-time" sometimes I'd need to add 200 samples, while in other cases 210 samples</font></div>
<div><font face="arial, helvetica, sans-serif">might suit better... </font></div><div><br></div><div>I'm aware that Ardour uses SoundTouch, but I'm not sure is that the best lib for real-time use.</div>
<div>Mixxx is using LibSamplerate AFAIK, and does so quite well, but might not be as suitable as Soundtouch..</div><div><br></div><div><a href="http://www.surina.net/soundtouch/faq.html#sample_processing" target="_blank">http://www.surina.net/soundtouch/faq.html#sample_processing</a></div>


<div>These kind of paragraphs are what stop me from just choosing one and going with it...</div><div><br></div><div>Choices, Advice, Laughter, Help, etc all welcome! :-)</div><div>Cheers, -Harry</div>
<br>_______________________________________________<br>
Linux-audio-dev mailing list<br>
<a href="mailto:Linux-audio-dev@lists.linuxaudio.org">Linux-audio-dev@lists.linuxaudio.org</a><br>
<a href="http://lists.linuxaudio.org/listinfo/linux-audio-dev" target="_blank">http://lists.linuxaudio.org/listinfo/linux-audio-dev</a><br>
<br></blockquote></div><br></div>