seed-message in the [random]-helpfile

o s's icon

Can someone please explain to me what the seed-message in the [random]-helpfile does?

thank you

ole

LoneMonad aka don malone's icon

random is actually a formula
starting from a specific place
the seed resets the random generator
[random] will produce the exact same sequence of numbers
after every reseeding

o s's icon

thanks

ole

Peter Castine's icon

Some history may explain this more fully. (Caveat: this is from memory going back almost 20 years, and even my memory is not infallible, so grain of salt)

Original random object: the formula for generating pseudo-random numbers always started with zero. So you got the same 'random' sequence when you ran your patch on Monday, Tuesday, Wednesday, Thursday, etc. The sequence looked sort of random but was always the same every time you ran your patch.

First improvement: 'seed' message added, so you could write a patch that started the RNG with a different number every day (a startbang to the date object is one option).

Second improvement: auto-seeding added... the startbang->date sequence (or something similar) was made internal to the object. So now the only use for the seed message is to allow generation of repeatable sequences (which some people want to do sometimes).

I may have the order of the improvements muddled, but we finally got to where we are now.

Almost forgot... final improvement: Litter Power.

LoneMonad aka don malone's icon

peter's objects are excellent

also
gary nelson's [Randum]
http://www.timara.oberlin.edu/~gnelson/maxdownloads/downloadmax.htm
incorporates an important and useful development
indexing
multiple reseedable independent random streams

Jean-Francois Charles's icon

> First improvement: 'seed' message added, so you could write a patch that
> started the RNG with a different number every day (a startbang to the date
> object is one option).

The other thing to try was to generate the seed with a [random]... ;-)
J-F.

eirik.lie's icon

>Second improvement: auto-seeding added... the startbang->date
>sequence (or something similar) was made internal to the object. So
>now the only use for the seed message is to allow generation of
>repeatable sequences (which some people want to do sometimes).
>
>I may have the order of the improvements muddled, but we finally got
>to where we are now.

I seem to recall that the the seed is taken from the internal Mac
system clock, the number of milliseconds since your last boot?

--
Eirik Lie, Bjornerabben 9, N-0383 Oslo, Norway
Email: eirik.lie@notam02.no - Tel +47 22 50 23 14 / +47 90 67 18 17
Check out my CD "12 Bilder": http://home.online.no/~eiriklie/Visual.html
Yamaha CX5M FAQ: http://home.online.no/~eiriklie/CX5MFAQ.html

Gary Lee Nelson's icon

My objects date from 93-94 era. I wrote them before max' random had a seed.
They accept an index message that will attach them to one of 256 random
streams. All of the random objects that share the same index access a
common random number generator. The result is that a patch with many
different flavors of random generators will produce the same results given
the same seed. My help file and document tell the whole story.

It seems that each instance of max' random has its own random series
unrelated to the others.

My idea was to use random numbers but to be able to repeat results exactly
by starting with the same seed. I made compositions that exist in multiple
variants. When I am touring with my MidiHorn, I play these pieces in
concert using the local postal code as the seed. In the UK, Canada and
places with alphanumeric post codes, I used the concert date - 111907 today
for example. When I commit one of these pieces to CD, I use the birthdays
of my three daughters then pick my favorite - variant that is. All my
daughters are favorites.

CAVEAT... Adding or deleting any of my objects changes the order that the
random stream is accessed. Likewise, moving them in the patch if the order
of execution is changed. It is best to fully debug a patch before setting
the seed for the final product.

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

On 11/19/07 10:59 AM, "don malone" wrote:

> also
> gary nelson's [Randum]
> http://www.timara.oberlin.edu/~gnelson/maxdownloads/downloadmax.htm
> incorporates an important and useful development
> indexing
> multiple reseedable independent random streams
> --
> it takes all of us
> LoneMonad
> http://faculty.roosevelt.edu/malone/default.htm

Gary Lee Nelson's icon

PS. The names of some of my objects had to be changed when some new version
of Max began confusing them with standard objects thus Randum and Dronk.

On 11/19/07 10:59 AM, "don malone" wrote:

>
> peter's objects are excellent
>
> also
> gary nelson's [Randum]
> http://www.timara.oberlin.edu/~gnelson/maxdownloads/downloadmax.htm
> incorporates an important and useful development
> indexing
> multiple reseedable independent random streams
> --
> it takes all of us
> LoneMonad
> http://faculty.roosevelt.edu/malone/default.htm

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

Peter Castine's icon

Quote: Gary Lee Nelson wrote on Mon, 19 November 2007 18:15
----------------------------------------------------
> It seems that each instance of max' random has its own random series
> unrelated to the others.
----------------------------------------------------

I _thought_ all [random] instantiations shared a single Linear Congruence sequence. But that would have been before the seed message was introduced. I'm not sure how it's done nowadays.

There was a problem with noise~, in that each object was auto-seeded at instantiation time with the system time (the clock that counts time since Januay 1, 1904 at a resolution of 1/60 second). The problem being that if two objects were instantiated within the time resolution, they produced identical signals (instead of triangular noise, which is what one might hope for).

There's a grammatical error in the above: wrong tense. The problem still exists.

Max Patch
Copy patch and select New From Clipboard in Max.

The issue with noise~ has been mentioned in the past, it may percolate up the priority list at some stage. In the mean time, I use lp.shhh~ to avoid the problem (and lp.trrr~ for triangular noise).

--

Thanks for the recommendation, Don!

Gary Lee Nelson's icon

I did a test patch with two instances of random. They do not seem to be
linked.

Max Patch
Copy patch and select New From Clipboard in Max.

On 11/19/07 5:13 PM, "Peter Castine" wrote:

>
> Quote: Gary Lee Nelson wrote on Mon, 19 November 2007 18:15
> ----------------------------------------------------
>> It seems that each instance of max' random has its own random series
>> unrelated to the others.
> ----------------------------------------------------
>
> I _thought_ all [random] instantiations shared a single Linear Congruence
> sequence. But that would have been before the seed message was introduced. I'm
> not sure how it's done nowadays.
>
> There was a problem with noise~, in that each object was auto-seeded at
> instantiation time with the system time (the clock that counts time since
> Januay 1, 1904 at a resolution of 1/60 second). The problem being that if two
> objects were instantiated within the time resolution, they produced identical
> signals (instead of triangular noise, which is what one might hope for).
>
> There's a grammatical error in the above: wrong tense. The problem still
> exists.
>
> #P user meter~ 341 268 421 281 50 0 168 0 103 103 103 255 153 0 255 0 0 217
> 217 0 153 186 0 12 3 3 3 3;
> #P user ezdac~ 306 71 350 104 0;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 340 223 27 196617 -~;
> #P newex 360 187 40 196617 noise~;
> #P newex 346 169 40 196617 noise~;
> #P connect 2 0 4 0;
> #P connect 1 0 2 1;
> #P connect 0 0 2 0;
> #P window clipboard copycount 5;
>
> The issue with noise~ has been mentioned in the past, it may percolate up the
> priority list at some stage. In the mean time, I use lp.shhh~ to avoid the
> problem (and lp.trrr~ for triangular noise).
>
> --
>
> Thanks for the recommendation, Don!
> --
> Peter Castine
> --
> Peter is in dire need of a new Facebook tagline. Not to mention a new .sig

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

barry threw's icon

Hiding in examples there is also a java class that queries hotbits
for a true random value.

b

Barry Threw
Media Art and Technology

San Francisco, CA    Work: 857-544-3967
Email: bthrew@gmail.com
IM: captogreadmore (AIM)
http:/www.barrythrew.com

Peter Castine's icon

With all due respect: Hotbits has serious limitations. You can't use it to generate a noise signal (limit of 2048 bits/request, only enough for about 2ms of mono audio). Algorithms like Tausworthe 88, TT800, and Mersenne are in many ways more 'random' than radioactive decay. They will all generate far more random numbers than there are Cesium-137 atoms in the entire universe (Hotbits feeds on Cs-137, and there are only so many of them). Also, the named algorithms are not susceptible to the "Global Consciousness" phenomenon .

People are right to be wary of the Linear Congruence algorithm implemented in Numeric Recipes and used by noise~, random & Co. But that doesn't mean all algorithmic RNGs are bad.

Which is why I built Litter Power: for seriously random numbers.

The Java example is useful for learning how to access data on the web. If Hotbits is good enough for your random number needs, then fine. But be aware of its limitations.

barry threw's icon

Just an option.

Everyone buy litter. Its good.

b

On Nov 20, 2007, at 3:14 AM, Peter Castine wrote:

>
> With all due respect: Hotbits has serious limitations. You can't
> use it to generate a noise signal (limit of 2048 bits/request, only
> enough for about 2ms of mono audio). Algorithms like Tausworthe 88,
> TT800, and Mersenne are in many ways more 'random' than radioactive
> decay. They will all generate far more random numbers than there
> are Cesium-137 atoms in the entire universe (Hotbits feeds on
> Cs-137, and there are only so many of them). Also, the named
> algorithms are not susceptible to the "Global Consciousness"
> phenomenon .
>
> People are right to be wary of the Linear Congruence algorithm
> implemented in Numeric Recipes and used by noise~, random & Co. But
> that doesn't mean all algorithmic RNGs are bad.
>
> Which is why I built Litter Power: for seriously random numbers.
>
> The Java example is useful for learning how to access data on the
> web. If Hotbits is good enough for your random number needs, then
> fine. But be aware of its limitations.
> --
> Peter Castine
> --
> Peter is in dire need of a new Facebook tagline. Not to mention a
> new .sig

Barry Threw
Media Art and Technology

San Francisco, CA    Work: 857-544-3967
Email: bthrew@gmail.com
IM: captogreadmore (AIM)
http:/www.barrythrew.com