signal/data switch

Wil's icon

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?

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

👽'tW∆s ∆lienz👽's icon

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:

...perhaps i could've used 'proxy-based symbol-table' to be more clear... see the SDK for all the most proper semantics ;p

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:

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

hope it can help 🎩

Wil's icon

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)

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

TFL's icon

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.

Wil's icon

TFL thanks - tried that

but different modules play synths differently