ok, this is straightforward, though has a couple of twists
demux.axp (2.6 KB)
so the basics of the solution is a demux object
the flip-flop simply converts the momentary switches into on/off
the demux does the what you are after, routes the single signal to an output depending on s. (we connect the defaults to the last value)
if we left it at that we would have an issue where every time we switched the, the new output would get the current knob position. (try it by connecting the demux directly to the dials in the example its useful to see it happening)
to prevent this we use a hook object...
the factory has one, but we need to use a community variant, so that we can unhook the value whenever the switch is changed. (if you disconnect the unhook in the example, you will see why this is necessary)
one small note: the axo controls dont got to zero... not really an issue, but it does mean the initial value (on the dial) of the unhook much not be zero, otherwise you wont be able to 'pick it up'... its value in a patch, would be the initial value you want the thing its controlling to be (e.g. filter pitch value)
from here you can go all sorts of directions (such is the fun of axoloti
- have multiple demux one of each knob, using the same toogle, so then its like 2 pages for knobs.
- extend the above to multiple 'pages' of objects by using different versions of demux, simply replace the flipflop with a counter (in fact i could have used a counter, with the count set to 2, and the above example would work).... of course you will then have to decide on the 'representation' of the LEDs to track... but you could for example have on/off/flashing...
but i'll leave that to you to have fun with
enjoy
Mark