Decimally Accurate Sample Delay in Scriptnode
-
What is the best way to give sample delay with decimal accuracy in scriptnode?
For example I need a delay with 4.6 samples.
AFAIK the
jdelay
is good for sample delay, but is it accurate with decimal values? -
@orange Since a sample is the smallest indivisible block, you can't have decimal.
My guess would be to oversample this part and take a close multiple.
4.6 => approx 5 => 8.7% difference
4.6 oversampled x8 => 36.8 => approx 37 => about 0.5% difference -
@ustk sure you can that‘s how interpolating delay lines work.
-
@Christoph-Hart Hmm alright, so this is based on an internal oversampling or ?
I tried something similar a while ago and it seemed to be rounded to the closest sample... I might have made a mistake though
-
@Christoph-Hart This would be the way then ?
-
@ustk said in Decimally Accurate Sample Delay in Scriptnode:
@Christoph-Hart This would be the way then ?
That's what my predict, should we put this into a fix32 container?
-
An interpolating delay gets you a fractional delay, but it interpolates aka smears the signal:
100000000 => 4.6 sample delay: 0000 0.4 0.6 000
Whether this sounds better then a 5 ms delay without interpolating the values - I don't. know...
-
I have a SNEX node that gives 4.6 samples delay with 8x oversampling. So to handle the delay compensation what I think is:
- Define the 5 samples delay compensation (the nearest point to the 4.6)
Engine.setLatencySamples(5);
- Then back to SNEX container and for 8x Oversampling > 0.4 samples delay in scriptnode (5 - 4.6 = 0.4)
- For 1x (Oversampling is off) > 5.0 samples delay in scriptnode
Is this ok?
- Define the 5 samples delay compensation (the nearest point to the 4.6)
-
@Christoph-Hart said in Decimally Accurate Sample Delay in Scriptnode:
An interpolating delay gets you a fractional delay, but it interpolates aka smears the signal
I found that it does a bit more than smear the signal in my testing. Sub Sample interpolation creates a full on LPF.
This example uses a converter node + jdelay and a knob with 0.1 step. -
@Dan-Korneff said in Decimally Accurate Sample Delay in Scriptnode:
I found that it does a bit more than smear the signal in my testing. Sub Sample interpolation creates a full on LPF.
Well, that's what I mean with smearing the signal :) The interpolation method will probably be responsible for it, as this is just using linear interpolation.
I've spent a few weeks researching and creating alternative algorithms from scratch and managed to implement two other interpolators that have a better amplitude response. Just kidding, they were lying around in the JUCE DSP module waiting to be used. I've also added the possibility of using delay lines in polyphonic contexts, so you can use it to detune your synth voices.