Four momentary switches to set mode


#1

I've been banging my head against this for a couple hours now, maybe someone can help.

I have four momentary footswitches. Each one sets a mode which should remain constant until another footswitch is pressed.

I have tried things with sample and hold, however if the data changes at the same moment as the s_h trigger does it is very unreliable whether the data will be passed or not.

This should be simple but I am a bit lost at this point. Suggestions highly welcome!


#2

OK, my solution. Maybe there is a simpler way to do this but this is where I ended up.

The digital outs are LEDs to indicate current mode.


#3

So you want the mode as an index?

I would use something like encode for or triggerindex for this.


#4

Or if the separate outputs are needed, radio_switch_N can be used:


#5

are your switches debounced?


#6

Debouncing should not be needed for radio switches or other latched functionality.


#7

Yes, @DrJustice radio_switch looks like something very useful. I sent the instrument to the performer using the solution I came up with already, and it seems to work fine, but I will keep this in mind for the future.

Also @Blindsmyth it is an index, depending on the index number other things happen in other parts of the patch. I keep it modular, this way I can tinker with the footswitch inputs without touching the other DSP.