Check status of Live's audio engine (on/off) via M4L

Boris Uytterhaegen's icon

Hi!

I want a M4L device to turn a toggle OFF/(0) when audio in Live is not running and ON(1) when the audio engine is running. This seems to be an issue. The native Max [adstatus switch] object does not work in M4L.

The first workaround I tried was to use the live object model to observe the 'average_process_usage' property, assuming it would drop to 0 when the audio engine stops, but that is not the case, it keeps the last value from when the engine was still running.

Second workaround (see patch) is to use delay to bang a 0 when the 'average_process_usage' property stops outputting data. Unfortunately this doesn't work either as all timing inside M4L is stopped upon audio engine shut-off.

I'm starting to think there is just no way of doing this, but I hope I'm wrong. Any clues on getting this done would be very much appreciated!

Boris

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

Nil Hartman's icon

Not in the studio so I can't triple check right now but I use [plugsync] for that. You'll need to filter the output of its first socket (from memory) with a [zl.change] not to permanently trigger your toggle object.

I believe [live.thisdevice] can also output Live's status.

Boris Uytterhaegen's icon

Hi Nil,

Thanks for your reply!

[plugsync] is a good guess and it works if you want to know whether the transport is running.
But, since I want the M4L patch to know whether the Live Audio Engine is on/off, regardless of whether the transport is running or not, I end up in the same situation as using the 'average_process_usage' property in the above patch. Where, once data stops flowing out of the object there is no way of sending a 0 to indicate to the patch that the Live Audio Engine left the building.

I might be missing something though and if I do, please tell me :-)

Nil Hartman's icon

My bad, I misread your initial question. Sorry Boris.

Indeed, for my own usage (be it for a M4L device or a M4L/Max combo via UDP) I listen to Live's transport to set and/or reset various parameters / et and/or send LOM-related data.

But then, Live's engine isn't "OFF", off as in displayed for instance in Live's Transport bar if you happen to say, disconnect your DAC or turn your audio drivers off. Which, I realize, is most likely what you're describing.

Boris Uytterhaegen's icon

No worries Nil! Thanks for the interaction! It got me do dive a bit deeper into [plugsync] which I don't regret. In the mean time I've come to terms that it's not possible. Not even with a [js]. Making some sort of internal M4L timer watchdog is impossible because the timer can’t run when the Live Audio Engine is off. It would be nice to have something like [adswitch] available in M4L, but I'm not complaining :-)