StepSlider rand() function

Discuss problems and solutions.
Post Reply
MrCorba
Regular
Posts: 142
Joined: 02 Sep 2013 20:17
Location: Netherlands

StepSlider rand() function

Post by MrCorba »

Maybe anyone can help me with this. I'm trying to create a Random button that sets the StepSlider to random values everytime it reaches the first step. If I use the code posted below step 13 gets value 1 and the rest of the steps gets value 0. If I change rand() to another value, like (i/16), the stepslider takes a perfect saw so the formula seems to work. Anyone have a clue how to fix this?

I've added an example with a working and a not working script.

Code: Select all

decl i;
decl b=StepSlider.step;
decl length=sizeof(StepSlider.x);

if(b==0){	
	for(i=0; i<length; i++){
		 StepSlider.x[i]=rand();
	}
}
Attachments
Example.jzml
(5.55 KiB) Downloaded 44 times
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
MrCorba
Regular
Posts: 142
Joined: 02 Sep 2013 20:17
Location: Netherlands

Re: StepSlider rand() function

Post by MrCorba »

Solved it, shouldn't have called the script rand().... :oops:
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
Post Reply