From 8a4bca986c57062e96f1e58281b3eff52a856ee6 Mon Sep 17 00:00:00 2001 From: rekado Date: Tue, 6 Sep 2016 22:13:03 +0200 Subject: Initial commit. --- objects/read-interp-slow.axo | 76 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 objects/read-interp-slow.axo (limited to 'objects/read-interp-slow.axo') diff --git a/objects/read-interp-slow.axo b/objects/read-interp-slow.axo new file mode 100644 index 0000000..2919a1f --- /dev/null +++ b/objects/read-interp-slow.axo @@ -0,0 +1,76 @@ + + + delay read slow, linear interpolated + Johannes Taelman + BSD + delay.axh + + + + + + + + + + + + + + + 256 (5.33ms) = 8 + 512 (10.66ms) = 9 + 1024 (21.33ms) = 10 + 2048 (42.66ms) = 11 + 4096 (85.33ms) = 12 + 8192 (170ms) = 13 + 16384 (341ms) = 14 + 32768 (682ms) = 15 +(/ 32768.0 48000) +48000 = 1000ms + + ,*/ + // Example: set LENGTHPOW to 12 + // shift tmp_d right by (- 27 12) = 15 + // This is supposed to give a number of samples in the past, before writepos + // As this runs in a loop over the input buffer we have BUFSIZE samples to process. + // Hence (- BUFSIZE + buffer_index -1) starts at -BUFSIZE and is the last sample at the end of the srate loop. + uint32_t tmp_di = attr_delayname.writepos - (tmp_d>>(27-attr_delayname.LENGTHPOW+1)) - BUFSIZE + buffer_index -1; + + // get delayed value from delay line + int32_t tmp_a1 = attr_delayname.array[tmp_di&attr_delayname.LENGTHMASK]<<16; + // get next delayed value from delay line + int32_t tmp_a2 = attr_delayname.array[(tmp_di+1)&attr_delayname.LENGTHMASK]<<16; + + // ? what does this value represent? + // shift tmp_d left by 18, then mask with max value. + uint32_t tmp_w1 = (tmp_d<<(attr_delayname.LENGTHPOW+3)) & 0x3FFFFFFF; + + // ? opposite of w1 + uint32_t tmp_w2 = (1<<30) - tmp_w1; + + // is this what's happening? + // out = (tmp_a2 * tmp_w2) + (tmp_a1 * tmp_w1) + + // multiply value with ...? + int32_t tmp_r = ___SMMUL(tmp_a1,tmp_w1); + + // ? + // multiply the values from tmp_a2 and tmp_w2, then add the value of + // tmp_r to the most significant 32 bits of the product + tmp_r = ___SMMLA(tmp_a2,tmp_w2,tmp_r); + outlet_out= tmp_a1;//tmp_r; +]]> + + -- cgit v1.2.3