General
Easy way to add multiple fader numbers to script?
Started by alloedee on .
Sign in or create an account to join the conversation.
Hello there.
Iam an working on some templates, with many multisliders and faders. In the template there is some reset/normalize buttons.
Iam using this script for resetting the sliders:
Example of that I have done so far for one reset button:
Iam an working on some templates, with many multisliders and faders. In the template there is some reset/normalize buttons.
Iam using this script for resetting the sliders:
MultiSlider.x=0.0;
But I was wondering if it is possible to make some kind of specific interval, like MultiSider1-Multislide32.x=0.0; so I dont need to inset all the numbers manually.Example of that I have done so far for one reset button:
MultiSlider33.x=0.0;
MultiSlider34.x=0.0;
MultiSlider35.x=0.0;
MultiSlider36.x=0.0;
MultiSlider37.x=0.0;
MultiSlider38.x=0.0;
MultiSlider39.x=0.0;
MultiSlider40.x=0.0;
MultiSlider41.x=0.0;
MultiSlider42.x=0.0;
MultiSlider43.x=0.0;
MultiSlider44.x=0.0;
MultiSlider45.x=0.0;
MultiSlider46.x=0.0;
MultiSlider47.x=0.0;
MultiSlider48.x=0.0;
MultiSlider49.x=0.0;
MultiSlider50.x=0.0;
MultiSlider51.x=0.0;
MultiSlider52.x=0.0;
MultiSlider53.x=0.0;
MultiSlider54.x=0.0;
MultiSlider55.x=0.0;
MultiSlider56.x=0.0;
MultiSlider57.x=0.0;
MultiSlider58.x=0.0;
MultiSlider59.x=0.0;
MultiSlider60.x=0.0;
MultiSlider61.x=0.0;
MultiSlider62.x=0.0;
MultiSlider63.x=0.0;
MultiSlider64.x=0.0;Bump,
I really need to find out if this is possible or not. Before I use alot of time on something stupid.
Plz help
I really need to find out if this is possible or not. Before I use alot of time on something stupid.
Plz help
Hi
One way to do it is by using the findobject(name) or getfirst(object) functions to locate where you want to start . . .
And then use getnext(object) to step through the hierarchy . . .
Have a look at the while loop example in the User Manual . . .
MM
One way to do it is by using the findobject(name) or getfirst(object) functions to locate where you want to start . . .
And then use getnext(object) to step through the hierarchy . . .
Have a look at the while loop example in the User Manual . . .
MM
I have bumped into a lot of occations where I needed such a function and I cant for the life of me, figure out what Im coding wrong here....
I've used 5 knobs in the example template but of course I would use such a code on a larger scale (more objects to be set)
What the hell am I doing wrong??
button, on expression x, risign from 0
here's the example template....6 knobs are in there, I want to make the 5 change (I put the 6th in there just to be sure I have the code correct, its supposed to stay untouched)
repeated_expression_setting.jzml
I've used 5 knobs in the example template but of course I would use such a code on a larger scale (more objects to be set)
What the hell am I doing wrong??
button, on expression x, risign from 0
decl obj,i;
obj=findobject(Knob1);
i=0;
while (i<5)
{
setexpression(obj,x,0.2);
getnext(obj);
i++;
}
I then press the button but the knobs do not change expression x.here's the example template....6 knobs are in there, I want to make the 5 change (I put the 6th in there just to be sure I have the code correct, its supposed to stay untouched)
repeated_expression_setting.jzml
Attached an example, try with objects inside of container.
I got a finished project I wanted to release full of examples with kind of code,
Hope that helps,
Cheers,
Example.jzlib
I got a finished project I wanted to release full of examples with kind of code,
Hope that helps,
Cheers,
Example.jzlib
Ok I think I 've figured it out....
This works!
the example template for anyone needing it...
Oooops just saw your post AB, thanks I 'll definitely check it out!
repeated_expression_setting-fix.jzml
This works!
decl obj,i;
obj=findobject('Knob1');
i=0;
while (i<5)
{
setexpression(obj,'x',0.2);
obj=getnext(obj);
i++;
}
Is there a more elegant, shorter code for this function or is this the best it can get?the example template for anyone needing it...
Oooops just saw your post AB, thanks I 'll definitely check it out!
repeated_expression_setting-fix.jzml
I saw your example AB...Dont think Im a lazy guy - I have already seen this approach in the Lemur manual - i wanted to make it work outside a container! 
EDIT: I think this one is even better than my previous one.....
EDIT: I think this one is even better than my previous one.....
decl obj = Knob1;
while (obj!=Knob6)
{
setexpression(obj,'x',0.2);
obj=getnext(obj);
}Ah no problem, so you are ready to go now 