I have a set of processes that should create random delays before starting. I have noticed that the order of the processes starting is the same each time and the delays are the same. i.e. random numbers come from a list of random numbers held somewhere within PD and they are read off the list each time a random number is triggered. I encountered this problem years ago when programming in Basic. In Basic there was a randomiser that reset the numbers to guarantee a truly random sequence, or at least a much less predictable one. Is there an equivalent "randomise" object in PD?
-
Random numbers are not random
-
Use [zexy/time] to generate a seed for [random]. You'll still have to alter the seed for each [random], because if they have the same seed, of course, they'll give you the same sequence. But simply adding a different offset to the seed for each [random] should give you good results.
-
Can you read the timer (seconds since the computer was turned on) in pd and feed it to the seed?
That's how it is done in BASIC:
RANDOMIZE (TIMER)Note the Yankee spelling
There are 10 kind of people in the world: Those who understand binary and those who don't!
-
I think I just found the answer to my question.
You can use theThere are 10 kind of people in the world: Those who understand binary and those who don't!
-
(Psst...that's kind of exactly what I typed)
-
here's a vanilla random generator that abuses minor fluctuations in cpu timing. You could cascade some more sections to get a greater range, but this one seems to give pretty good random numbers between 0-99