Distortion in Delay Gen~ Oopsy

Hi folks, I’ve just got myself up and running with max/msp and the daisy patch. I created a very simple delay in Gen~ using “delay”. I was trying to send “Param knob1 @min 0 @max 44100” into the right inlet of the delay and I found that it was causing some kind of distortion. I think this may makes sense since its updating the delay value at audio rate. Any tips on how else I can assign a knob from patch to control the delay time.

Edit, dont mind the “clip -1 1” everywhere, I was trying to trace the distortion source :slight_smile:


----------begin_max5_patcher----------
942.3oc2YtsaZCCF.9ZpTeGrxkSTlOGmc0tnZOASZWLUMER7ZSK4fRBcfp16
9brIsPg5ZTLKabExNG982+4+vSWdwjf4kqjMAfOA9NXxjmT6LQuW2NS52XRP
d7pjEwM5aLnP9qx42GLcy0ZkqZ06mrHqBbEBfd9REKyyJVHa0OGZqcKW1t21
Yo52h5UeEW77qnJtM4trha+QsLo0bNoghYro.THcVj.SwHQnZICMCNEfwyff
a5eXiXZWWIMOYP.3F8k98kWz8q5mo+KgcnCXiQgmaXysgMlG0QHhyO2vlYCa
RHRasC0fNZ39yxEodBWpMbQzHcLMUnwE++u0kX05RzDRhHip00i3hshqNyEk
INWnEYiVAsiVVH6bgVnMZizF0yGaKKxJsZ.4iaXqRH.7QAJ7PfZsIKDA14Ey
4Z6Jg8BpdGmzj4KJSdXvVNB2kBpDx18QPiFIa3cYMsk0qGt6p05LLdnt4onc
ZUlRGIn+vgwEeD3RcorJIZabw5VKFAbyyVATQQCGZW5TDID6XiCGIarB5CCL
4HhjINTekXJ7.OwblTlmKKZ2GzuHkoyiOx7VGJQLwZuSLLWGBa.MzzYLbPIh
eSjtVtHdM3qY4xgCEztOq18z3jZFwYfL8VtiUw0w4fGJJmS.eVgB.p9ItKtT
bXFgt6lhsVAkPIlQZzFNjXrlo4EM.dGM.khfvgqCr9MKPg5tHnapBIFqX0qq
WC9H3ax1A6Wis1jACpCVoQZf4vSnicZWr5fKsfQtLUNT2v.Ibz8fQ63AiFr2
KxdKiX5VVST3XEAqH1CnZ2u0TiQCnXDGqAM3.T5625v6OTig7fEYE68ww0u0
tK7JDaJWVmzqd5yLB1RGlJaZyJhayJK19tTDCP1zltKPjKBr66vAfdQfciJ6
Hg9QfceTM2EX+ckmkVUlUz1zWWV2uLUPLlecT8tqPldKwD59qhLgJrn9E9gL
gKjwH9SU5j2Y2jGdx6r6q76n.8DgLmDn+BG5irdm3uWoGJqSk05jY+8NBv23
Hf7wQ.6xQf3QOYmR6wDmR0tSGA5oTqCcVq6mvYlSQW7SoV2si.geBU6L2h27
myNyoJf8I28f.INk1l6uz1D2HzeMUfENWmvOgNHtywpX+HPmzn3SXbhaonib
LYwltyiqpdTV2r4kXDtZRi6K0OjXpYcVgYsYDhfZ4iY8OxlaItVMlPqZFgk0
5ybvp9+q5f7R0QnXYVudnC+NQqGloHNW1TEa.MHsoZ1sxhfKuPcS+A.j80Im
-----------end_max5_patcher-----------

I am not hearing this in your patch
I removed all the clip -1 1
The only funny thing you got there that is “new” is the auto-magic low pass filter “dcblock”
feedback will continue even if the audio drops below audible frequency ranges. At high feedback levels, the low freqencies can linger for a while, causing intermodulational voodoo.
I made a test patch to test your thing with the standard Max file player
No extra distortion heard
Also, Daisy Gen does NOT operate at 44100. 96k, 48k, 32k only. You can call this with “samplerate” also, to lock your “maximum 1 second” delay to it. I did this in my reply patch

-just wanted to add that as a mixing engineer, there is almost never any “good” reason to use a delay on any signal below 78hz, unless you are trying to make a mess of the freqency spectrum. “Most” delays (especially analog, BBD, and tape ones) high pass their input stages to avoid quickly over saturating and distorting. OR they use “emphasis/deemphasis” filters.

/shrug


----------begin_max5_patcher----------
2077.3oc0aszjiZCD97L+JnnxoTy3fj3YNsopT4VNkTUNjJkKYPFqcADEHOO
1s17aO5AfE1.lYhwd2CCCVsDc2ecqVcKDe496r2vdgTaa8yV+s0c28k6u6NU
SxFtq422YmieINCWq5lcA4Y1lOZ+flDm7BW0bFCmjSpqsbV40RrXeNaOOivU
iDzzptI9qkDMasss9mFRkXd7NZQ55JRLWS00KZkyCVgApqNxqP3JmtgPSTrW
HROB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XQ
me+AmWX7Y.NNhq82DNPn23LrF4s2YfUM59YEpOrHGK0MGYjSy8AZJDiHoFv0
ImJkYyHzLXj+kfQfYvHzkfQ8N+oimqF3BvGmYvm+25iyLXD3BvnvY.bQW.fK
bF5SzEPeBtR3l2UhO9yfOAW.93NC93cA3C7JgayIBG7D9nCgezwYSxhiNFaG
cD1N83qM9QW63isl5HqoO8NGsrwgC809DJ6OTG8p0+NoXud+JZOfX8AhMoao
YYwrL1Imdu18KxVSs6jx01W4Gh.LxE.BkeMBH.J.5qtSbimmY8D5w.ZGjqma
jCT1UWeXfqm5tPHxC06yZnYXvC7xADo4fSTniq9NQSfGr.lCCWj1bTyL9ZWj
e7Hkrptyb2JTTW+2yYoU3D42vzgLbZWq9gF+nJA0iOzT14B.k1NlV+gANKgx
c359ud++ARgZ.Y.
-----------end_max5_patcher-----------

Thanks ManySounds for having a look. I noticed a small typo in my original post, its knob 2, the delay time causing me issues. In your simulation your right there aren’t any noticeable issues. Ive recorded what I’m hearing. In the first part I leave all parameters at zero and only switch between dry and wet. You can hear the distortion especially in the highs. In the second part I disconnected knob 2, the delay time and reprogrammed the daisy. You can hear slight phasing as we go between dry and wet but not the distortion. I play with the feedback a bit and it sounds alright.

https://soundcloud.com/radiotech/gen-delay-distortion

Any thoughts

Ahhhhhhhh
YES maybe I have an idea.
The knobs don’t report a steady voltage SO some high pass and/or smoothing may correct this.
Basically, the analog components are introducing subtle noise to the delay time.
This may present itself as digital distortion.
Referring to the object oopsy.suggestions.gendsp:


----------begin_max5_patcher----------
247.3ocSQsraCCBD7L7Uf1ytVgnV2pbp+GUQUD6UtDYCHdj3nH2u8BKNQ8xt
ZGlgYX4NmAmrKX.DGDeIXr6bFifJ.rsYFLqV5mTAhFXvq1Smgl5QQbIRvin4
Wwm4pvZcgasgz3HFhZqIzlQGBtGRLoYaJNgQ59janUn3MGVCCDziF0DHNtQv
oh8+nMie6w9XkiT9V6tFgr68RauriZ6a28TjdfBWNvuH+m+ZyS6KXqbdoPp.
kycA8gbvokPYEjW.ms9x3GMzn1TGovCd7h9A+JAkOG0XNmIO8bfktWgpT6.5
MI8l2q7hkzx0nlwfS0WET9C3q7+.P4qZzA
-----------end_max5_patcher-----------

that’s it a oopsy.ctrl.smooth3 in between the knob and the delay worked! :slight_smile:

1 Like

Yep, responded to this over on the c74 forum post too – there’s a little electronic noise on the control inputs, which is mostly imperceptible, but when mapping that to a delay line a little noise can have quite a significant effect as the delay read index is now jumping around in the delay buffer. Adding a smoothing filter to the parameter is all that’s needed, and [oopsy.ctrl.smooth3] was written for this, it’s a 3-pole high-pass filter – tested out different filter parameters for it against delay time usage for the very reason that long delays make it more apparent :slight_smile:

Yes @Manysounds is correct, you can use [param knob1 @max samplerate], and even small expressions like [param knob1 @max samplerate/2], [delay samplerate*3] etc. in gen~.

Also agree that dcblocking (high-shelf filtering) is pretty essential to almost any audio feedback delay. The [dcblock] object built into gen~ is a very minimal one-stage low-shelf/high-pass implemented per the code below. It’s frequency response is going to depend on the samplerate, but at 48kHz I believe the cutoff is about 2.5Hz, so it might be a bit low for a delay line. There’s plenty of examples of filters in the gen~ examples folder in Max, including one for designing biquads with which you could put together a lowshelf around 78Hz.

struct DCBlock {
	t_sample x1, y1;
	inline void reset() { x1=0; y1=0; }

	inline t_sample operator()(t_sample in1) {
		t_sample y = in1 - x1 + y1*t_sample(0.9997);
		x1 = in1;
		y1 = y;
		return y;
	}
};

I started playing with the biquad a little and copy and pasted this as a substituted to the dcblock. It sounds much better, getting the lows out of the delay line. There is a definite low pass sound as you approach 50% dry/wet or beyond, so it still needs tweaking. I’m just learning this stuff and am a bit over my head but am wondering what pole this represents. It may not sound so pronounced if the drop in db/oct was less, like maybe 6db/oct.


----------begin_max5_patcher----------
709.3ocwV01SaCCD9yEI9OXkOU1ZJwtukNnSZUSUiOreAioI2DCynT6tDGVx
P6+9ruyIjALnLfsJ0ZeO2K12yc1tWs+d8BVqqDEAj2P9DoWuqrH8.LGRuFfd
Aa3UIY7BvvfD8lMBkIXfWoQTY.EUjEjp9pCHGGRjpsklSUUTDKjBnzBCY0JR
pHiWaUx7JYfRlJsixZqtZevzkFHZ0TDrazV15.yqrSz7Ja2pYRkHQWpf86zF
zsbSxWkpy+RtHwfbwnYwCiFPXwicCzYT2P77gQjO23kpbiTkIL.oPaPOSqLE
xeH.Pl0qqs1lEMlG00bEeCXdv6xk7LxRcVJ4DCOSlztukofA50WDRGG.f+b+
8bi1gAO8JGPzKH7Hn78ZBm5qY1oLeEJjrl549PKJxzA2CGhj1n4ScCi8D5rG
IEF+RPgz+dJTI9tMD2lAs6LB89XC57NrwnY.Yv9GzOcmDPzyOAHU6R9OlAoe
zCj9QOtzuksPLS8VAtnAAWu.6F0vdJmtRENSdPRHFIgIT7JlmsaUd7zvweTq
zEa4Ihz2Fz0hyrP+Vgna2SqktLFfO7vToKKImoy2PNgrV9sRd5o4mpbe+frv
nyqIUz9QGLfTwfgZTp1IcjyL6c+KH86KUTxqHQCmOm4t+oekSLjNbd7LTl0p
F8Cdiw5EJ.uofysW+uv8hRnMp0sQYLDkZeTrAEiB71xpk3b3oDLHVtzooODm
UKO3nWfqeeORdqPxaIPdjUxLiH+g6lnifemLc3r3ISlFGgenLauUz+oKXt0a
T3t.d+8l+aCHwbJtA0UnKySZZfwilCHcRmTQgQp3FoV0wHJZzetFsyKGcmVt
n6b87oKe61KE4EdWvkx1RbgN2IGO.kkJTFKIA4hKkMt3MgmaK8FacuLGI9po
iC7daOBlqJkP.rHtj0szPWmqPAmtAmRK1N7bgxVZrF8KMjRSoB
-----------end_max5_patcher-----------
1 Like