This is probably a very simple problem but I'm going nuts trying to find a solution.
Basically I want a knob on my hardware controller to modify x only when button y is pressed. I can patch this using a VCA : knob to in and button to gain. This works, except if I move the knob without pressing button y, then the next time I press button y, the VCA passes the current position of the knob to x. What I want is for the previous value of the knob (when button y was pressed) to pass to x.
I'm sure there is some clever trick to this using a flip-flop or sample-and-hold or such but I am thoroughly stumped. Any pointers would be greatly appreciated!
Dual function knob
You could try a multiplexer with a change detector object and a sample and hold to store the value of the knob when the button is pressed.
One Mux, 2 sample and holds and a logic inverter.
I've used a toggle switch instead of a momentary button here because you can't hold a button down and adjust the knob at the same time with the pc mouse, with hardware control you could use a momentary, the logic is the same.
https://drive.google.com/open?id=0BwUUyc6HJZwUOFA4WExDb240bjg
@apeirophobe , you'll want to use a mux and also its likely you'll find you then want to follow this with a hook object e.g. mux/mux2 and ctrl/hook
hook provides 'takeover functionality' which is pretty common on synths
( if you have a spare LED, its useful to use that to show the hook status, its good UI feedback)
this is a pretty common use-case, if you look at the help for ctrl/hook you will find an example to do exactly what you want
(this can easily be extended to a multi mode e.g. a button toggling between e.g. 4 modes using a counter)
@strum and @technobear, thank you very much for your help.
strum, unfortunately your solution exhibited the same behavior as mine, in that a second press of the button would immediately output the current position of the knob.
@thetechnobear, this is exactly what I was looking for, thank you!! My humble Axoloti controller is now infinitely more flexible.