How can I make Live aware of real-time state changes in an M4L patch ?
Hello,
I'm new with Max For Live and I'm trying to build a simple device that gates the sound going through the right channel. It is simply a gswitch2 object that either routes the audio through the plugout~ object, or to a useless outlet. I use a button as a way to toggle the switch.
It works well, but if I try to toggle the switch in real-time, Live is unaware that the switch state has changed. Live only considers the change when I edit the M4L patch, toggle the switch in it and save the patch.
I suppose it is the expected behavior, but I don't understand why, and I would like to know how to make it work in real-time.
Any ideas ?
Thanks,
Thomas

I found another way to achieve what I want : I used a gain object and I send it either 0 or 127 in order to let the sound go through or to simply cut it.
I still don't understand what wasn't working in the previous example though, if anyone knows the answer, i'd be glad to hear it.
Thomas
set "Parameter Mode Enable" to save and recall values in the Live-Set
Thank you !
gswitch2 is not a signal object (no ~ at the end), so not recommended to route/gate/switch signals.
gain~ or live.gain~ give you the additional fade-in/out that will avoid clicks.
Or use [*~] and [line~] as described in MSP "Basics Tutorial 2".