Filter envelope sustain problem

bennyfromtheblock's icon

Hi everyone,

I'm building a synth and have come across a problem introducing an adsr as a filter envelope. Everything works fine except that whilst holding a note down, if the cutoff is changed nothing happens. I have been trying to solve this for quite a while and not managed to find any solution to what is surely a simple problem. I'm getting the feeling that I'm missing something blindingly obvious.

Max Patch
Copy patch and select New From Clipboard in Max.

I have pasted a patch to demonstrate the problem. Any help would be much appreciated.

Cheers Benny

David's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You are using the output of the adsr~ object to directly control the the cutoff frequency. While you hold a note the adsr~ object will stay in the sustain phase and output a constant value.
Try to make the adsr~ with an amplitude of 1 and multiply the output with the cutoff-frequency parameter. Like this:

P.S.: it should work, but i didn´t test it

bennyfromtheblock's icon

Great stuff, works a treat! Thank you so much David