The Seed Message
I am just wondering what the seed message actually does and what the advantages are to specifying a specific seed (for random, urn, and drunk objects).
Quote: BlueGlass wrote on Wed, 11 February 2009 04:32
----------------------------------------------------
> I am just wondering what the seed message actually does and what the advantages are to specifying a specific seed (for random, urn, and drunk objects).
----------------------------------------------------
The first thing you need to understand is that 'random' just uses some simple arithmetic to produce something vaguely resembling a sequence of random numbers.
In the beginning (Max 0.1), random produced the same series of numbers every time you fired up Max. It started with zero, and performed the magic algorithm. This was good enough for some people.
A little later (Max 2.5 or 3.0), random added the seed message, so you could start the random number generator from something like the time&date, giving you a different sequence every time you used it. Or you could start the random number generator with a particular number to get a sequence of numbers that you had found and, for whatever reason, liked.
A little later still (Max 3.5?), the breathtakingly innovative enhancement was made that the random object seeded itself automatically with the date&time, so it produced different numbers every time you used it, all by itself. You can still use a fixed seed to reproduce a sequence of pseudo-random numbers, if that sort of thing turns you on.
The algorithm used by random and urn is simple, moderately efficient, and known to not be really random if you analyze its output carefully. If you want random numbers that are indistinguishable from plutonium atoms decaying, then you should take a look at the Litter Power Package. The Litter Starter Pack is free and available at the URI below. There is also information at the link below about the more extensive Litter Pro Bundle.
If you are serious about random numbers, you really ought to take a look at Litter Power.
There is, btw, a clever use of the seed message in a patch that's been posted to the list a couple of times. The idea is to use a random number generator to make decisions about which General MIDI percussion instruments to hit on every bang. Every 16 beats the RNG is reseeded with the same value. Hey, presto! you've got a generative drum machine.
Here's one version . It uses the Litter Starter Pack.
thanks to both of you. a great help this message board always is.
On Fri, 13 Feb 2009, nicolas wrote:
-&e->
-&e->thanks for info.
-&e->
-&e->Anybody know what kind of random generator is "Math.random" in javascript ?
It's a standard c-like pseudorandom number generator that uses I think a
modulo'd system time call for it's seed, and sadly, doesn't take seed
arguements so it can't mimick the tasty repeatable Markov chain gags
mentioned in why previous posters said you'd want a seed.
Some good discussion on this topic and some potential workarounds here:
http://www.webdeveloper.com/forum/showthread.php?t=140572
andyw