Hi there LJ community,
I'm trying to figure out how to add a "momentary mode" to the radio-button grid-activation select grid.
Background
I'm using a bunch of momentary buttons in TouchOSC to allow the user to select 1-of-25 grids and OFF (which is just another grid actually)
The grids happen to be controlling a laser, but could be any kind of preset scene/palette/effect etc. where you only want 1 in a selection group to be active.
I've used a pattern I've seen on here (and been recommended by Mathieu previously)
Each "effect" grid is activated exclusively by the position of the emitter shown below.
using y=scale(osc.latest(159,184),159,184,0,100)
The TouchOSC momentary buttons are at address /lj/osc/159 through 184
Currently, the action of this control-grid (and momentary OSC inputs) is to "latch" the grid-activation emitter in a given position.
Challenge
I would like to have an option to toggle the mode of the radio-button matrix from a latching control to a momentary control that will reset to the y=0 position when the momentary button transitions from sending a 1 to zero.
I've tried adding an emitter to osc.send(159,pulse(0.1)) to keep pulsing the "OFF" OSC channel, but this doesn't work.
I don't understand the logic of the osc.latest command to make it detect the falling signal from the button (0--->1) and set y=0
Please can you suggest any edits.
I suspect I could do something smarter in TouchOSC with some lua script, but I don't have any lua script syntax experience and regardless, for other applications, I'd likelt o keep the logic in LJ and treat TouchOSC as a relatively dump button & fader device, with state feedback to the user.
Many thanks
Alex