Oversampling and buffer sizes

I am working on a delay plugin using the dsp oversampling module. Since the buffer reading/writing happens within the oversample block (which processes 16x normal rate at oversample factor 4) - to get the timing right, the buffer has to be increased by the oversampling rate (16x the sample rate for 1 second for a factor of 4). I am wondering if I am doing this correctly, or if there is a better way to get the benefits of oversampling without creating huge buffers? Thanks!

//Example 48k * 4 * 4 = 768,000 buffer length
delayBuffer.setSize(2, sampleRate * overSampleFactor * overSampleFactor);

nope. it’s correct that the buffers increase with oversampling

If you just want to make a delay you could first delay by an integer amount of samples without oversampling, then oversample and do a short fractional delay to get the full delay time from the combined delays.

1 Like

Interesting! Since there would be not enough data in the buffer, would you crossfade (or LERP) between the previous sample and the current one by the oversample loop sample# / oversample getNumSamplesr?

Thanks! I was wondering if I was doing something exceptionally daft - since 2 delays * stereo * oversampling 16x * 96k = 6,144,000 samples a second!

Why would there not be enough data in the buffer? As you can choose where to split, you can make sure there are always enough samples available.

1 Like

Ok I think I understand what you are saying, make one main delay buffer that is normal resolution, then add an additional delay in the oversampled samples loop to add in the finer detail.