Turn "off" all switches in an array?
Posted: 19 Mar 2012 16:30
Is there a way turn "off" all the switches in an array of radio buttons?
I have an array of radio buttons that I'm using to send program change messages to a midi synth.
I use another array to send bank change messages. I'd like to have the Program buttons all return to "off" (null?) state whenever I press a bank change button.
For example: RIght now, if I have Bank 1 and Program 1 selected, and I press the Bank 2 button: The Program 1 button stays "on" but the synth doesn't change patches because it is still waiting for a Program Change message to follow the Bank Change (Program Change message are ony sent when I press a Program button). If I want Bank 2 Program 1, I can't simply press the Program 1 button, because Lemur thinks it is already "on." I need to press a different Program number button, and then press Program 1.
I tried this in a script that runs when I press a Bank_Change button:
decl current=firstof(Program_Change.x);
set(Program_Change.x,0,current);
It doesn't complain, but it doesn't work either. The currently "on" Program button stays "on." Maybe 0 isn't the right value to set? Is there a way to set the desired element's value to "null" (assuming "null" does not equal 0)?
Thanks!
I have an array of radio buttons that I'm using to send program change messages to a midi synth.
I use another array to send bank change messages. I'd like to have the Program buttons all return to "off" (null?) state whenever I press a bank change button.
For example: RIght now, if I have Bank 1 and Program 1 selected, and I press the Bank 2 button: The Program 1 button stays "on" but the synth doesn't change patches because it is still waiting for a Program Change message to follow the Bank Change (Program Change message are ony sent when I press a Program button). If I want Bank 2 Program 1, I can't simply press the Program 1 button, because Lemur thinks it is already "on." I need to press a different Program number button, and then press Program 1.
I tried this in a script that runs when I press a Bank_Change button:
decl current=firstof(Program_Change.x);
set(Program_Change.x,0,current);
It doesn't complain, but it doesn't work either. The currently "on" Program button stays "on." Maybe 0 isn't the right value to set? Is there a way to set the desired element's value to "null" (assuming "null" does not equal 0)?
Thanks!