I’ve recently started using the flucoma objects in my Max patches. I want to build a simple recording device that will start recording when the loudness of the incoming sound is above a certain threshold and stop when it’s below another threshold . I was gonna use fluid.ampgate~ but came across extreme CPU load. Loading a single object generates an average of 90% CPU usage with peaks above 100%.
I dont’ know if I’m doing anything wrong in the instantiation of the object or if it relates to my system. Here’s the info that I can gather :
MacOS 10.14.6
Max 8.1.10
Attributes for the fluid.ampgate~ object : @minlengthabove 4410 @minlengthbelow 44100 @highpassfreq 80
After a bit of investigation : the @minlengthabove and @minlengthbelow attributes are extremely heavy on the CPU.
I’m not quite sure how different @rampup and @rampdown are to the attributes mentioned above. They seem to behave similarly but cost barely anything in terms of CPU usage.
Thanks for the report. The minlength<X> attributes do add CPU load, but spikes of that order sound worrying. The difference between these and the ramp<X> attributes is that the latter simply do, effectively, what slide~ does and apply (very cheap) exponential smoothing to the detection signal. The minlength<X> attributes, OTOH, are doing full lookback / ahead. I’ll make an issue on GitHub and run your settings with a profiler to see what’s up.