Hey guys got a scripting question.
I've got a StepSlider object and I would like a button, that will set the Sliders in a Sine form. Probably if someone gives the answer I'll be like Dôh! but for now I'm just not seem to get it working.
Sine Sliders
Sine Sliders
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
https://soundcloud.com/mrcorba
Re: Sine Sliders
Assuming the StepSlider object in your template is named "StepSlider" add a script on expression x, rising from zero, inside the button (preferably of Pad nature and not switch).
Type in the script
if you want it to start with the max value of the sine
if you want it to start with the half value of the sine
Type in the script
Code: Select all
decl i,length=sizeof(StepSlider.x);
for (i=0;i<length;i++){
StepSlider.x[i]=(1 + sin(i*2*pi/(length)-(pi*.5)))*.5;
}
Code: Select all
decl i,length=sizeof(StepSlider.x);
for (i=0;i<length;i++){
StepSlider.x[i]=(1+sin(i*2*pi/(length)+(pi*.5))*.5;
}
Code: Select all
decl i,length=sizeof(StepSlider.x);
for (i=0;i<length;i++){
StepSlider.x[i]=(1+sin(i*2*pi/(length)))*.5;
}
Last edited by Softcore on 28 Mar 2014 12:32, edited 3 times in total.
Re: Sine Sliders
Awesome! Thanks!
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
https://soundcloud.com/mrcorba
Re: Sine Sliders
Dont thank me - thank Mark Strauss (LFO Studio template) and Antonio Blanca (AB faderlab template)....You can find more maths in those (tri, sawtooth, etc).