[PD] random seed

Tim Blechmann TimBlechmann at gmx.net
Sun Apr 18 14:17:29 CEST 2004


> > To avoid this behaviour, it's best to NOT give a seed at all.  Or to
> > provide a seed that is always different (like the operating system's
> > clock time).
are you sure about this??? 
the initial seed is given by this function:

static int makeseed(void)
{
    static unsigned int random_nextseed = 1489853723;
    random_nextseed = random_nextseed * 435898247 + 938284287;
    return (random_nextseed & 0x7fffffff);
}

and this seems to be pretty deterministic ... doesn't it?

> Like I said, I remember it worked different on windoze, so I wonder if
> it has anything to do with PD's access to the random number pool in 
> Linux. I guess that's one for Miller or Guenter to puzzel over ;-)

although every random object you will create has a different seed, if
you load a patch at startup without giving seeds, the random objects
will return the same results every time the patch is started ... on
windows as on linux ...

cheers...

 Tim                          mailto:TimBlechmann at gmx.de
                              ICQ: 96771783
--
The only people for me are the mad ones, the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn,
burn, like fabulous yellow roman candles exploding like spiders across
the stars and in the middle you see the blue centerlight pop and
everybody goes "Awww!"
                                                          Jack Kerouac





More information about the Pd-list mailing list