python random preset integers

Is there a way to randomize a parameter via Python, without loading random module via a script ? Or perhaps a way to load Rnd Module so it is accessible to all parameters ?
Basically I don’t want to have to write a script in a DAT and point it, but rather would like a quick way in the field to randomize certain variables in cloned containers. Just a single, initial value, rather than dynamic.
capice?

cod

You can use the built in tdu.rand() function, which takes a numeric value as a parameter and outputs a random (non-changing) value from it.

If you want your clones to each output their own unique values, you can base it on the containing parents digits.

For example:

tdu.rand(me.parent.digits * some_constant1)

-Rob

yes!

Better, Ive just changed the definition of tdu.rand(…) to accept any argument, not just numeric ones.
So in next build, you’ll be able to say:

tdu.rand(me.parent())

Which will return a unique random floating number based on string representation of the parameter passed in (op path, cell contents, etc).

I’ve been using:

tdu.remap(tdu.rand(absTime.frame * par.name), 0, 1, par.normMin, par.normMax)

to generate a random par value, but I’m noticing that this gets heavy if my session has been open for a while. Any suggestions on an alternative that isn’t dependant on absTime but still gets me a constantly unique value? Is throwing a modulo in there a good alternative?