[chuck-users] random seed

Lars Ullrich mail at larsullrich.de
Fri Sep 10 14:02:08 EDT 2010


Hi Kassen & Hans,

That's very sad! A seed is perfect to get a repeating pattern, but  
sometimes it's nice to turn off the seed to get non repeatable values.

So the only way is to delete the seed and restart the sketch?

thanks!




Am 10.09.2010 um 01:53 schrieb Kassen:

> Hi Lars!
>
> if we use a random seed, f.e. Std.srand(120);
>
> will this affect all the random function inside the sketch?
>
> Yes, it will. And this does mean that periodically resetting the  
> seed (say at audio-rate) will turn the UGens that use noise into a  
> sort of wavetable players; it will affect all random functions and  
> noise-generators.
>
>
>
> and if so, how can we turn it off?
>
>
> Well, you can't. The whole point of ,srand() is affecting the  
> various random functions to create repeatable pieces.
>
> A alternative would be simply not setting it, though I do seem to  
> remember some issues with the initial seed under Windows not being  
> particularly random. In that case you could set the seed using a  
> amplified signal from the adc. A source like hiss from your mixer  
> should be as random a signal as you are likely to encounter in day  
> to day life and mak things utterly unpredictable.
>
> Hope that helps,
> Kas.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users


On 9 Sep 2010, at 20:49, Lars Ullrich wrote:

> if we use a random seed, f.e. Std.srand(120);
>
> will this affect all the random function inside the sketch? and if  
> so, how can we turn it off?

You do not have to seed - looking into the source code, if the seed is  
not given, time will be used as seed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20100910/f5777151/attachment.htm>


More information about the chuck-users mailing list