Page 1 of 1

Random Phase

Posted: Fri Jul 18, 2014 8:17 pm
by TheOm
How can I get one (or several) random values per triggered voice?
I'm trying to achieve random initial phase for every oscillator in a synth.

Re: Random Phase

Posted: Fri Jul 18, 2014 9:55 pm
by KG_is_back
In code component you can initialize Array with random values on startup. If you use it in poly stream, new values will be initialized on every new voice.

Code: Select all

streamout out;
float x[10]=rand(0,1); //initializes array x with 10 random values from range (0,1)
out = x[0]; //outputs first value form the array. You may add additional outputs...


Re: Random Phase

Posted: Fri Jul 18, 2014 10:18 pm
by TheOm
Oh, nice. I forgot there was a rand function. Thank you!