Is there a way to choose between 2 paths of execution flows as a result of a control signal?
Some kind of a controlled de multiplexer?
For modules without a specific control pin, you can use the "Param Set" module to set a variable like the value of a multiplexor. Logic compare const is another good module to determine the state of a multiplexor for example.
Thanks for the quick replay, Kyle!
Just to sharpen the point, I want to give a wire the ability to choose between 2 flow paths.
Like a conditional execution in software. If a condition is true, do this, else, do that.
I want to know how one signal can go through 2 different modules depending on a value of a control signal.
Sure, it could be done a few ways. If the control signal were just carrying a 0 or 1, you could directly connect it to Param set, otherwise "Logic Compare Const" could output whether its input is equal to , less than or greater than a set value. Happy to demonstrate this if you find yourself stuck.
A few more related questions if I may.
1. Do you have a module that do the opposite of the multiplexer? like maybe a de-multiplexer? (Instead of multiple inputs to choose from, multiple outputs to feed)
2. Can I use the 'Param set' module to change the run-time status of another module from 'Active' to 'Muted'? And if so, can you give an example on how to achieve this?
I am looking for a way to control the audio flow according to a control signal, and in the same time the other flow paths, that could have been chosen with different control signal, will be muted and will not consume (or consume but very little) MIPS.
Thanks in advance,
Similar to the ParamSet module, you can use the StatusSet module to control the run-time status of other modules or subsystems. To save MIPS, you can set the status to Inactive to avoid calls to processing functions. Using StatusSet along with a bit of math and logic in Audio Weaver, you can create parallel processing paths and only have one path set to Active given the control signal value.
The wire buffers leaving an Inactive module or subsystem are left in an indeterminate state, so to be safe I also suggest adding a Copier module to the end of each parallel path and setting the status to Muted whenever the preceding chain is Inactive. This will ensure that the wire buffer output is full of zeros.
That is exactly what I was looking for.
Thank you very much.