Detecting Gate State

Hello JUCE Community,

I am currently working on customizing the standard JUCE gate for a project and find myself in need of some help. I am facing a specific challenge in creating a function that accurately detects whether the gate is open or closed based on the current envelope and threshold. While exploring JUCE’s DSP capabilities, I noticed the setLevelCalculationType function, and I’m wondering if it can be leveraged to simplify this process. If anyone in the community has experience with similar customization or can provide guidance on efficiently detecting the gate state, your insights would be highly appreciated.

Thank you in advance for your time and expertise.