I have created a patch that takes two parameters: an audio signal and a threshold value (in dB). A screenshot of this patch is attached. Currently, it outputs audio when the signal is above the threshold level and no audio when the signal is below (a very basic gate).
What I want to do is trigger a fade of the audio 1) after a certain time has passed since the threshold was broken and 2) over a certain amount of time. For example, the audio would fall below the threshold, thus breaking the threshold, and trigger the timer that will fire the fade. If the signal goes back above the threshold, the timer would be reset.
I don't know what objects I should use to do this. What would you recommend? Should I be using `gate~` at all?
P.S.: I posted under Max4Live because I am working in Max under Live. This isn't really M4L specific, though.