Some other useful random objects from the Extended library:
[urn]
[drunk]
[gauss]
Is there such a thing as "truly" random?
@LiamG is right, that trick of using CPU time or something like that does not output true random numbers: even with a randomly selected seed, there is still a deterministic formula behind the number generation. In some contexts (particularly people doing some computational physics) the aspects of a poor pseudonumber generator can be observed in the data (that is, they do not even look random to the trained eye).
If you want true randomness, you can use random.org, which uses atmospheric noise to generate numbers. Some Mr. smartpants could still point out that weather, though very complicated, is still deterministic. And that would be true, though this type of system is so dependent on initial states that it soon turns into a chaotic system. And given that the "formula" behind the weather system of the planet Earth is incomparably more complicated than any pseudonumber generator we can think of, we basically can assume that it's as random as it gets.
I have also seen some people generating true random numbers using some crazy experiments such as radioactive decay time.
Anyway, I digress.
Cheers!
Gilberto
Well, fundamentally any noise generator is a pseudonumber generator since it uses deterministic mathematical formulas to achieve randomness. What I wrote about not looking so random can't be perceived just by looking at a bunch of numbers. The example I gave was with computational physics, and the point is that sometimes they need to generate a billion or a trillion random numbers to simulate something, and if the formula starts repeating after a number of outputs smaller than that you get a repetition in the data, and those patterns may (or may not) be observable by a trained eye.
I hope it's clear I am just being pedantic here, for any regular mortals these pseudonumber generators with seeds selected via computer clock are more than enough
Cheers,
Gilberto
It is a predetermined series calculated from a $0 seed......... and probably only one series with a modified start point..... that guarantees at least the probability of each number occurring!
Reseeding every bang uses more cpu than the dsp solution, and unsurprisingly produces patterns.
true random.zip
David.
About testing PRNG ( http://www.johndcook.com/Beautiful_Testing_ch10.pdf ).
]]>However, you can use these control objects to generate some entropy:
[realtime]  use it to measure the time it takes to compute something (like iterating through a list, splitting a symbol, etc.). It tries to measure the actual time it took to do the calculation which will typically be different each time.
[textfile], [qlist], [soundfiler]  you can measure the time it takes to do file i/o with these objects using [realtime]. The time to do i/o can vary wildly on most OSes.
And this signal object:
[adc~]
You can use any or all of these to get a value that is different each time you run Pd. Once you have your value, send it as a seed to random:
[receive your_value]

[seed $1(

[random]
Now you can just bang random all you want. It's still just a pseudorandom number generator, but the point is that you seeded it with a value that is different each time you run the patch. So for most musical purposes you can assume it's a real randomnumber generator from that point on.
]]>It's still just a pseudorandom number generator, but the point is that you seeded it with a value that is different each time you run the patch. So for most musical purposes you can assume it's a real randomnumber generator from that point on.
Not too sure I agree with that, I also heard that reseeding is a bad idea because it easily leads to results that do not follow a probabilistic distribution (that is, the results will be all over the place). The proper way of using a PRNG is to seed once AFAIK.
]]>I'm talking about generating the initial seed once, using the objects I mentioned to get a little bit of entropy for the seed. Once seeded, you just bang the same [random] to get out the values you want to use. I don't see how this would result in a distribution any different than what you would get without specifying the initial seed.
@whaleav: If your seed is truly random then why does it matter that you are dealing with a fixed series? I'm not implying it doesn't matter, just that there are a sufficient number of usecases for this (like deterministic Bitcoin wallets) that it's not obvious why it wouldn't work in your case.
]]>There is absolutely nothing at all random about [random].......... every time you run it you get the same sequence (displaced if you seed it, and displaced if you have more than one instance).........
That's just how a PRNG works.
]]>@jancsika There is absolutely nothing at all random about [random].......... every time you run it you get the same sequence (displaced if you seed it, and displaced if you have more than one instance)......... proof.........testrandom.pd
Use the patch to start Pd (if you have random already open somewhere)...... i.e. please restart Pd from scratch to run the patch..........
There are two tests........... the top bang (manual) shows the sequence.
The "Test" bang shows the second occurrence of the first sequence is at exactly 237343 bangs.
Both tests have to be run from a new opening of the patch (the normal situation for a patch.
David.
So you are saying that the seed only displaces the series? This is worrying indeed. Do you know how the displacement works, though? It doesn't seem to be linear, ie. "seed 2" doesn't seem to be "seed 1" + 1.
Maybe you could do something like this:
Of course it is still determined, but at least it will break the series that you have described above, if seeded properly with [time]. And if that's not enough then you can easily create n number of parallel randoms, or n depth layers...
One more thing: if you are set on using [noise~] for this, you should consider using [switch~] to turn DSP off in the subpatch after the output, in order to save CPU. Of course there's a chance that this too will affect the randomness though! Does [noise~] restart every time DSP is switched on? I haven't tested this, but it would be easy to do.
]]>So you are saying that the seed only displaces the series? This is worrying indeed.
But that's the very definition of a seed!
]]>But as the author writes, notice that:
]]>Not many PRNGs will produce an obvious visual pattern like this, it just so happens to be a really bad combination of language (PHP), operating system (Windows), and function (rand()).