[chuck-users] easy random numbers
Kassen
signal.automatique at gmail.com
Mon Nov 19 14:17:31 EST 2007
On 19/11/2007, David Powers <cyborgk at gmail.com> wrote:
>
> I guess you need some pseudo-random number to multiply by, such as the
> system time in milliseconds... However I'm not sure how one would get
> the system time into ChucK.
No, I'm nearly 100% sure you can't, in fact I put that on the wish-list last
time we were asked for wishes for exactly this reason (and to be able to
make a ChucKoo clock, of course!)
I suppose that you could run some sort of batch script, or say a
> couple lines of Python, that either gets the current system time, or
> creates some type of random seed number; then generates a ChucK file
> with that seed number as a global variable.
Perhaps a script could call the .ck with the system time as a parameter?
That sounds reasonable enough, I'm no BASH/ batch wizzard but that should be
quite possible.
It's a interesting problem.
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20071119/88a4a107/attachment.htm
More information about the chuck-users
mailing list