How to smooth out the output when delay time of tap changes
I’m new to Gen and I’m building a simple delay. I’ve attached a screenshot of my gen patch. Basically out1 sends unmodified signal that comes into inlet 1 while out2 delays the signal based on the delay time (in ms) provided by inlet 2. In my test Max patch I have a slider sending values to inlet 2 of the Gen patch. If I move the slider to modify the delay time I hear crackling/glitchy noise coming out the gen patch.
How do I go about smoothing this out? I tried interpolating the current output value with the previous one, but clearly that’s not a correct way to do this, as it still sounds glitchy.
Thanks for help
no need to explain why this is happening, as you will already know. While I am not a gen-guru, the options I see are as follows:
1. smooth out the changing values
2. only pass the destination value (ignore changes)
The first introduces pitch shifting due to the Doppler effect, and the second relies on more mathematical extraction of velocity (than I can muster), but here is my humble example of both approaches:
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1645.3oc6ZssjahCD8Ymp1+AUruNYJj3hs2sxC6Ov9CjJ0TxfrsR.IJj7bIo 17su5hALXvfmw3EOadvXWRBn6Se5iZIqe7aeXlyJ9yDgC3O.eFLa1OTsLyzl tkYEMLyIE+bTBVXFny5DNaWpyc66aMmIY3Thou+JmhSJ6RML9NYBQZtQTQyz XyX4q95G8BKGbFVFskx17PNIRZsHOOz8t2Al6puFXthTWAeo5dxUuYII+ABC uJwXCtGZXB52MMB0OnJmglpb.cytttGzAkUzwAspbBJqvGfEsZ8K4KYDqopQ Erz4NfyJLaiC3Klw8O+1Gzeq95tACuIzGI2uASY+rDZdDmWhvUc+YzW5.o8a Co8OIR6t79.E5hlqAY+E5qPuv9v5R3HZKlwHI0wnAhbB5Fllz.bzeJwwDpPY bkudA9QR7CXoLmtZmjT8Kwdvr.M0vUxNBecQ6kcbnOn3vaNMlVa3hs7bYKiu 0AW3ats0YpBSzc9w4UbrFC.a3Ggs2shiJ04XFr6vjgZiZmZTB4K1nj+9ArmM V8iWC8jQdRQmJ4RRxyx8XBi7yKjnf2.DEfHn9KMGsopPWI903inAvGeqoxcg UY3nuAVqTzNe7B1FdgF.dsboQ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6xeYDv0dmvBY+CE1iq9guqzV0EOgt7EO0qp5 B6pvtIKcZTKlOXXH26yR4oLvXHc1GjZOTX1Eb549FQT2oFhhFgp7G3VgACeG BoZIS3kWxzeXrzwVx7f8wVuUPcsWsF6SOfNPSAeWdTQDpXdVPCiMlHjTV496 +4pJcZNxsz33FaktcWmE5sw19uGLbRv4a7dC13cugM9.8+52jx10a59YvZlV FObn1tdC7lZjlgZ692tldvzyzCFLce9zy3Gdt5zSnoM7rijU2omJ4fs8vIGq A4dVpjSLfe3HOb5g7mW95MqwGdCa7noW4jCdJpKKtWrHuiOfj1WQ8Uqr+Do0 z4JNWZsVyPkzxvJSqEuoEOo0SJ2YYWn9rKO++SrK29rqfquY4ND655GFQCwr fWeyZP1UX8biqfc4MH6xy6pCXMekcGHux.l+PCjWY7JbPAxqeBo+zTmHX7Ci 6msrwoJ1XQMOMwMOIwscJh67DDadipK+K8BDubA -----------end_max5_patcher-----------
Thanks for providing me with the sample patch. It’s much appreciated.
I think I will stick with the first approach, as I’m trying to design a tape delay type effect. Also, mstosamps is a useful operator, I was doing the conversion myself.
Quick question. I want to generate C code from the patch. Say, if I’m designing a delay and I want a maximum of 1 second delay settable by user, but I don’t know a sample rate until the runtime of the code.. is it possible to specify delay time dynamically as opposed to hardcoding 44100 or 48000 inside the gen patch?
In gen~ there is a macro called SAMPLERATE.
Regarding your original question, I think maybe what you want is a quick amplitude crossfade between the old delayed signal (with the old delay time) and the new delayed signal (with the new delay time). You’d have two delayed signals, and fade the old one out as you fade the new one in. Here’s a non-gen~ version of what I mean.
I didn’t realise you could just just type SAMPLERATE as one of the arguments. That worked perfectly.
And thanks for the link! It has a lot of interesting patches. I’ll look into it.
Hey everyone ,
I’m starting now to learn max 4 live and i am in the midle of making a simple delay and i have the same problem with the delay time. Can someone explain exactly how i can use this "SAMPLERATE" insade the gen~ ?
Forums > Gen