[chuck-users] Audio Scrubbing???

Kassen signal.automatique at gmail.com
Thu May 20 08:35:30 EDT 2010

On 20 May 2010 03:29, Brutus Gates <brutusgates at gmail.com> wrote:

> Hi,


> I don't think "audio scrubbing" is the correct technical term for what
> I want to do... Maybe someone can suggest a better term?

I think "scrubbing" refers to the process of setting your playback position
dynamically. Keeping the pitch correct would likely be called
"time-stretching". Either term sounds fine to me.

> Of course the devil is in the details... If anyone has a link to math
> or code that could help me that would be great... Or better yet, maybe
> Chuck has some UGens that can make this easier...
We do; LiSa is perfect for this (LiSa is perfect for a lot of stuff, as we
recently saw!). If you look at /examples/special (in your Chuck dir) you
should find a series of examples that do this sort of thing.

To quickly explain the technique; to have a continual sound we will need to
playback half a second worth of sound every half second (duh!). If we want
to stretch the file to twice it's normal duration then after half a second
we should have playback at .25 second (also obvious, right?). We could
simply do that; first play the bit of the buffer ranging from 0 to .5
second, then follow that with the bit from .25 to .75 second, etc. This will
work, but it will sound bad. The solution is to use two or three "playback
heads" (to use tape recorder terminology) and fade one out while fading the
next in. This is where LiSa comes in, unlike SndBuf she has fades and
several voices.

Clearly this means that we can independently control the position in the
buffer at which we start playback of a given grain (the official term for
such a snippet of sound plus it's volume envelope) and the rate at which
it's played back. These control the length of the eventual output and the
perceived pitch, respectively. The half second I picked at random above will
result in a sort of timbre, which may or may not end up sounding musical so
some care needs to be taken picking a good duration for the material in
question. Something between 50 to 100 ms might be a good starting point.

This is just one thing you can do with granular synthesis (and it's actually
how most pitch-shifters work too). You can certainly use a ready made
pitch-shifter but doing it yourself like this will give a lot more control
and options. I suggest you google "granular synthesis" to read a bit about
it and get some background to better understand those examples. If you turn
out to like it a lot you could consider ordering Curtis Roads's book
"Microsound" which covers nearly everything there is to know about this type
of technique.

Shout if you get stuck or if some of this sounded incomprehensible.

Kas (proud member of the LiSa fanclub)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20100520/7bf06f92/attachment-0001.html>

More information about the chuck-users mailing list