Delay Playing Back at Wrong Pitch

I’m trying to create a delay line using an audio file read into a buffer. I’m doing this as a demo of what will eventually be a live delay line. However, whenever I try to play it back, it is at about a whole step higher, for no clear reason. This is the case with both DelayL/DelayC and Tap.

p = "filename";
b = Buffer.read(s, p);
{DelayC.ar(PlayBuf.ar(2, b.bufnum), 3, 0.5, 0.5)}.play;

{Tap.ar(b.bufnum, 2, 3)}.play;

Hey Reiny,

Perhaps your sound file is at a different sample rate than the server?

Try this:

{DelayC.ar(PlayBuf.ar(2, b.bufnum, BufRateScale.kr(b)), 3, 0.5, 0.5)}.play;

FYI - your code sounds at pitch on my machine.

Sam

1 Like

That works! Thanks Sam!