I don’t know of a very immediate way, but you can use the mutemap message to know which voices are on, and [zl sum] to check if they’re below the threshold. then you take your actions according to that…
I mean, what if I create a sample synth that uses long samples from a pedal depressed grand piano pitch adjusted with gizmo. I design it with a poly object, I get it to mute the unused notes so that it doesn’t completely demolish the cpu and it plays OK. Then someone does a glissando all the way up the keyboard and all the notes are decaying at the same time.
Maybe the best thing to do is keep track of the number of busy instances with the busymap, and dynamically adjust the latency when the number gets over some limit. Any ideas how to do that?