Page 1 of 1

How do I send a increment value to a fader with a button?

Posted: 29 Mar 2013 20:36
by jenz
I have multiple faders that controls paning. I would like to have a button that sends de value of 17 on a grided fader(33) to put the values back to the center. (reset Paning)

Thanx!

Re: How do I send a increment value to a fader with a button

Posted: 29 Mar 2013 21:27
by Traxus
The grid steps have very little to do with the value of the fader. All lemur objects range from 0 to 1.

So, a centered fader with a gird of 33 steps would be grid step 17, but the x value would be 0.5
A fader with 11 steps, would be centered on step 6, but the x would still be 0.5.

on your object, make a script on execution x, if x == 1, Fader.x = 0.5;

Re: How do I send a increment value to a fader with a button

Posted: 30 Mar 2013 03:08
by jenz
Thanx for your time and sorry I'm new to this...

Do you mean, create a script on the button that I want to send information to the fader?

If yes, it dosen't work and the spelling of the name of the fader is good.

What am I doing wrong?

Thanx

Re: How do I send a increment value to a fader with a button

Posted: 30 Mar 2013 08:10
by Softcore
Slight coding error there..... the if statement should be included in parenthesis....

so....

Code: Select all

if (x==1) KICKdr.x=0.5;
will work!

As a sidenote, you can add multiple actions for the evaluation of the script with the use of { }

So for exampe, if you had two objects to set to 0.5 you would type

Code: Select all

if (x==1) 
{
KICKdr.x=0,5;
AnotherObject.x=0.5;
}
Finally, another note is that 1 (or any value besides 0) returns true, and 0 returns false. What this means is that the statements

Code: Select all

if (x==1)  ...

Code: Select all

if (x>0) ... 

Code: Select all

if (x != 0) ...
can all be replaced by the shorter

Code: Select all

if (x) ...
while the statement

Code: Select all

if (x==0) ...
can be replaced by

Code: Select all

if (!x) ...
;)

Re: How do I send a increment value to a fader with a button

Posted: 30 Mar 2013 15:41
by jenz
Thanx Softcore!!! I'm learning!!!