Hi,
I am trying to script a button to select the next switch of a Switches object.
Under the Switches object, I am using this script:
ON EXPRESSION: Button.x is greater than 0
firstof(x=Switches.x +1);
I realize my math is off because upon button execution it selects ALL of the switches. Do I need to use a fraction rather than a 1? Not exactly sure about the theory behind the math for this instance, any help or clarification with this would be much appreciated!
Cheers
Button Script to "Select Next Switch"
Re: Button Script to "Select Next Switch"
I would do it like that, maybe there's a simpler solution:
Code: Select all
decl n=firstof(Switches.x);//get the current position
Switches.x=fill(Switches.x,0,sizeof(Switches.x)); //reset
Switches.x=replace(Switches.x,1,n+1);//set the next position
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Re: Button Script to "Select Next Switch"
Works beautifully!
Phil999, I really appreciate your help! You have helped me by responding to several of my posts and I've also read your responses to questions of mine that I've had that were already asked/answer on the forum. A big thanks to you and the rest of this amazing Lemur community.
Cheers
Phil999, I really appreciate your help! You have helped me by responding to several of my posts and I've also read your responses to questions of mine that I've had that were already asked/answer on the forum. A big thanks to you and the rest of this amazing Lemur community.
Cheers