Interesting. I've included that in the test patch.
It exposes the same samplerate dependent timbre change. So far only the Sinc function solves the issue.


On 25.04.21 23:15, Sebastian Shader wrote:
I have a [vdhs~] object in my library that does hermite spline interpolation for a delay line (like tabread4c~).
https://github.com/sebshader/shadylib
(also on deken)

I had to re-make delread~ as delread4c~ because delread~s delay lines are not exposed in the .h files

-seb

-----Original Message-----
From: Max <abonneme...@revolwear.com>
To: pd-list@lists.iem.at <pd-list@lists.iem.at>
Sent: Sun, Apr 25, 2021 5:45 am
Subject: [PD] 4-point interpolation changes timbre depending on sample rate

Hi list,

the 4-point interpolation in tabread4~ has been a popular topic in the
past, going back to at least 2008. [1]

A similar issue is in delread4~. In fact a simple resonator changes its
timbre quite drastically by just changing the sample rate of the audio
interface. Attached is a test patch.

The issue becomes audible when choosing an odd delay time and compare
the result between an odd and an even sample rate (e.g. 44.1k vs. 48k).

This is not good. In fact this is a serious defect. Imagine you want to
market a product like a synth plugin (based on libpd) which sounds
different depending on if the daw is opened in 44.1 or 48 kHz.

Cyrille Henry has coded tabread4c~ with a four-point cubic interpolation
in the nusmuk library, but there is no delread4c~ equivalent in nusmuk.

Clemens Wegener has coded delreadsinc~ which implements a
Whittaker–Shannon interpolation (Sinc function). This implementation
does sounds consistent in any sample rate. It also sounds much better at
very slow speeds inside a pitch shifter where delread4~ produces serious
artefacts. The Sinc function requires a larger padding for the
interpolation.

There are a couple of questions regarding on how to contribute this to Pd.
Vanilla objects are currently:

delwrite~ = the sink
delread~ = control rate tap
delread4~ (vd~) = audio rate tap with a four-point interpolation

1. the code in delwrite~ isn't agnostic towards the interpolation since
it already provides the padding for the 4 point interpolation

2. if we add more interpolation methods to delread / tabread, the
cleanest way would be to just have one tap object and the interpolation
can be changed by a message and argument to it. currently there are
implementations for the miller 4pt, cubic 4pt and Sinc.

Unfortunately delread4 already carries the 4 from 4-point interpolation
in its name, so probably it would be the best to deprecate that and find
a new name like varidelay~ or so.



[1] Review of tabread4~ threads in the archive
https://lists.puredata.info/pipermail/pd-list/2019-06/125391.html <https://lists.puredata.info/pipermail/pd-list/2019-06/125391.html>

[2] https://github.com/chairaudio/pure-data/tree/feature/delreadsinc <https://github.com/chairaudio/pure-data/tree/feature/delreadsinc>

_______________________________________________
Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list <https://lists.puredata.info/listinfo/pd-list>

#N struct 1005-xt float x float y;
#N struct 1005-yt float x float y;
#N canvas 233 237 885 727 10;
#N canvas 587 527 827 434 smallblock 0;
#X obj 21 25 inlet~;
#X obj 199 389 outlet~;
#X obj 71 26 inlet;
#X obj 549 90 inlet;
#X obj 640 11 block~ 1 1 1;
#X obj 41 232 hip~ 50;
#X obj 72 181 *~ -0.999;
#X obj 202 179 *~ -0.999;
#X obj 202 158 *~;
#X obj 72 157 *~;
#X obj 611 106 inlet;
#X obj 207 230 hip~ 50;
#X obj 93 133 == 0;
#X obj 224 135 == 1;
#X obj 71 61 delread4~ miller;
#X obj 20 254 delwrite~ miller 100;
#X obj 417 61 delreadsinc~ sinc;
#X obj 204 58 shadylib/vdhs~ hermite;
#X obj 420 222 hip~ 50;
#X obj 418 252 delwrite~ sinc 100;
#X obj 419 184 *~ -0.999;
#X obj 419 163 *~;
#X obj 487 151 == 2;
#X obj 208 257 shadylib/delwritec~ hermite 100;
#X connect 0 0 15 0;
#X connect 0 0 19 0;
#X connect 0 0 23 0;
#X connect 2 0 14 0;
#X connect 2 0 16 0;
#X connect 2 0 17 0;
#X connect 3 0 6 1;
#X connect 3 0 7 1;
#X connect 5 0 15 0;
#X connect 6 0 5 0;
#X connect 6 0 1 0;
#X connect 7 0 1 0;
#X connect 7 0 11 0;
#X connect 8 0 7 0;
#X connect 9 0 6 0;
#X connect 10 0 12 0;
#X connect 10 0 13 0;
#X connect 10 0 22 0;
#X connect 11 0 23 0;
#X connect 12 0 9 1;
#X connect 13 0 8 1;
#X connect 14 0 9 0;
#X connect 16 0 21 0;
#X connect 17 0 8 0;
#X connect 18 0 19 0;
#X connect 20 0 1 0;
#X connect 20 0 18 0;
#X connect 21 0 20 0;
#X connect 22 0 21 1;
#X restore 45 336 pd smallblock;
#X obj 91 71 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X obj 337 31 loadbang;
#X floatatom 189 231 5 0 1 0 - - -;
#X floatatom 137 233 5 0 0 0 - - -;
#X obj 193 605 dac~;
#X obj 46 174 *~, f 8;
#X obj 91 138 vline~;
#X msg 91 116 0 \, 1 5 \, 0.02 50 5 \, 0 1000 55;
#X obj 333 455 helmholtz~ 1024 1;
#X floatatom 354 490 5 0 0 0 - - -;
#X text 394 490 pitch;
#N canvas 675 22 263 214 filters 0;
#X obj 47 41 inlet~;
#X obj 47 176 outlet~;
#X text 103 79 DC filter;
#X text 140 140 sibilant filter;
#X obj 125 41 inlet;
#X text 165 40 freq;
#X obj 47 80 hip~ 160;
#X obj 47 140 lp6_cheb~ 3000;
#X connect 0 0 6 0;
#X connect 4 0 7 1;
#X connect 6 0 7 0;
#X connect 7 0 1 0;
#X restore 337 424 pd filters;
#X obj 394 397 nbx 4 14 1000 3000 1 1 empty empty empty 0 -8 0 10 -262144
-1 -1 3000 256;
#X text 393 380 lo pass filter freq;
#X obj 47 137 *~ 0.5;
#X obj 648 45 r pd;
#X obj 760 105 print;
#X obj 368 246 s pd;
#X msg 539 157 48000;
#X msg 454 158 32000;
#X msg 368 158 16000;
#X msg 410 158 22050;
#X msg 496 158 44100;
#X msg 586 157 96000;
#X msg 137 207 4;
#X obj 46 114 noise~;
#X obj 648 78 route ping watchdog;
#X obj 196 512 *~;
#X obj 222 481 hsl 95 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 300 1;
#X obj 25 500 audiolab/pp.spectrum~;
#X text 264 273 4-pt;
#X text 266 318 Sinc;
#X obj 91 95 metro 1500;
#X msg 189 208 -0.999;
#X obj 194 573 hip~ 4;
#X obj 197 542 *~ 0.6;
#X floatatom 528 310 10 0 0 0 - - -;
#X obj 528 286 samplerate~;
#X obj 527 260 r pd-dsp-started;
#X msg 368 223 audio-dialog 2 0 0 0 2 0 0 0 2 0 0 0 2 0 0 0 \$1 25
-1 64;
#X obj 238 273 vradio 20 1 0 3 empty empty empty 0 -8 0 10 -262144
-1 -1 1;
#X text 266 295 Hermite;
#X connect 0 0 28 0;
#X connect 0 0 30 0;
#X connect 1 0 33 0;
#X connect 2 0 34 0;
#X connect 2 0 25 0;
#X connect 2 0 1 0;
#X connect 3 0 0 2;
#X connect 4 0 0 1;
#X connect 6 0 0 0;
#X connect 7 0 6 1;
#X connect 8 0 7 0;
#X connect 9 1 10 0;
#X connect 12 0 9 0;
#X connect 13 0 12 1;
#X connect 15 0 6 0;
#X connect 16 0 27 0;
#X connect 19 0 40 0;
#X connect 20 0 40 0;
#X connect 21 0 40 0;
#X connect 22 0 40 0;
#X connect 23 0 40 0;
#X connect 24 0 40 0;
#X connect 25 0 4 0;
#X connect 26 0 15 0;
#X connect 27 2 17 0;
#X connect 28 0 36 0;
#X connect 29 0 28 1;
#X connect 33 0 8 0;
#X connect 34 0 3 0;
#X connect 35 0 5 0;
#X connect 35 0 5 1;
#X connect 36 0 35 0;
#X connect 38 0 37 0;
#X connect 39 0 38 0;
#X connect 40 0 18 0;
#X connect 41 0 0 3;
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to