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? Here's what I want to do: I want to be able to move through a sound file along the time (or sample) "axis" while maintaining the pitch of the original. Here's how I think I would do it: The rate at which I am "scrubbing" through the sound file (using a wacom tablet for example) would be mySampleRate. I would then pitch shift by a factor of: originalSampleRate/mySampleRate 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... B
On 20 May 2010 03:29, Brutus Gates
Hi,
Hello!
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. Yours, Kas (proud member of the LiSa fanclub)
participants (2)
-
Brutus Gates
-
Kassen