signal/data switch
I have managed to cobble together some bits from old threads to create a simple yet fully functional signal/data switch (that also serves to stop signal flow completely when sig is switched off- yay!)
question: why do I have create and destroy (any) audio~ object in order to enable/disable signal flow?
haven't worked in this space for awhile(the space of developing 3rd party externals in C to understand certain 'undocumented'/'unsupported' behaviors of objects), so the semantics I use might not be correct/accurate...
...but based on what i learned long ago from the SDK(see: 'Objects In C: A Roadmap' -> "MSP objects make use of Creating and Using Proxies when receiving multiple audio inputs, so familiarity with that concept could be helpful."), my best guess is that it's any audio 'connection/disconnection'(not necessarily 'object' instantiation/deletion) that will enable/disable signal flow, because under-the-hood it will rebuild a certain symbol-table that's associated with signal connection proxies:

here's that version of your patch so you don't have to create extraneous objects, just the connection between 'sig~' and 'prepend 1' alone... additionally i 'clear' console window because if you don't already have 'sig~' connected and then attempt disconnect, you'll get an error there... i wish there was a way using 'thispatcher'-scripting to detect whether connections already exist or don't exist, so we could script based on what patching already exists, but i don't know of one:
hope it can help 🎩
thanks - this works, I rarely use something like this
but recently created a situation where I want to switch between same synths
where both synths are receiving messages from the same sensor
but the first synth amplitude is 'freestyle' (signal = sensor distance scaled 0.-1 . then inverted and converted to signal, louder as I move closer, fade out as I move away from the sensor)
second synth amplitude is shaped (data = sensor distance scaled 0.-1 , then some fancy footwork using change 0. + - -> trigger onebang phasor/ signal envelope -> synth)
You could use [typeroute~] on one of your synths and make it process incoming data differently depending on if it is an audio signal or event rate data.