Random Phase

For general discussion related FlowStone
Post Reply
TheOm
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Random Phase

Post 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.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Random Phase

Post 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...

TheOm
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Random Phase

Post by TheOm »

Oh, nice. I forgot there was a rand function. Thank you!
Post Reply