Pitch shift/reverse - delay line - explanation?

Curls_On_Keys's icon

Hello again,

I've got a question about pitch shifting/reversing incoming audio using a delay line. I managed to create a patch that works but I'm breaking my head over it as to know WHY it does what it does. And since I'm also teaching the basics of MAX to some curious students, I unfortunately can't only be satisfied with a working patch, I also need to be able to explain it.

So this is what I did:

route the audio from a groove-object towards a tapin- with a 5000 ms buffer. Tapin to tapout. In tapout I made a continiously variable delay time using a phasor-object. I scaled the output of the phaser by 1000 and connected this to the tapout-input, so that the delay time would continously go from 0ms to 1000ms. The rate at which this should happen (frequency of the phasor) is a variable number input that goes from .001 (Hz) up to 2 Hz.

Now here's the thing: when I increase the phasor frequency (and thus making the ramp go faster from 0 to 1000 ms) the pitch drops. First strange thing (to me): the pitch doesn't "drop" as the delay time varies (so it's not different when the ramp is at 200 ms or at 800 ms), but it only seems to depend on the rate of the ramp (the faster the delay time goes from 0 to 1000, the lower the pitch drops).

This happens up untill the point of a frequency of 1 Hz, then all you hear are 1 second clicks. When I raise the phasor frequency further my incoming audio starts reversing, slowly first, then up untill the point of 2 Hz, where I got a perfectly reversed continiously "refreshing" 1 second sample incoming audio.

Now I really tried to find the explanation myself ("reverse frequency" "digital delay line" "pitch shift", googled them all), but didn't find anything.
So if any of you guys could help me out (or give me a link), it would be great!

Thanks a lot
C.

mudang's icon

It's easier to understand if you imagine the delay line as a circular buffer (which it actually is). There is a write pointer and a read pointer, like the heads on the good old tape delay.

The delay time is determined by the distance between the write and the read pointer. If you continuosly increment the delay time, you effectively slow down the "playback speed" of the read pointer. This results in a downward pitchshift.

BTW, You already have a nice pitchshifter patch on your harddisk ;)
It's in Max5/examples/effects/transposer-folder

i hope this answered your question..