[PD] Random number generation quest

Pierre Massat pimassat at gmail.com
Wed Nov 14 16:36:30 CET 2012


Hi,

You could use the [shell] object to run a little bash script that would ask
the current time in milliseconds from your system, and send it as a seed to
Pd using pdsend. This way you wouldn't need any extra command line
arguments. I don't know whether this is worth the trouble, though.

Pierre.

2012/11/14 Roman Haefeli <reduzent at gmail.com>

> On Wed, 2012-11-14 at 14:53 +0000, Enrique Erne wrote:
> > Hi List!
> >
> > Can a random number form 0 to 100 be generated with the following
> requirements:
> >
> >   - No externals / Vanilla Pd only
> >   - DSP must be off
> >   - The patch is loaded with Pd through command line interface i.e.
> > `pd -noprefs -nogui givemerandom.pd`
> >   - The output should not always be the same number
> >
>
> If you happen to start Pd always from bash / command-line, you do
> something like this:
>
> pd -noprefs -nogui givemerandom.pd -send "seed $RANDOM"
>
> and in your patch:
>
> [r seed]
> |
> [seed $1(
> |
> [random]
>
> However, I also would be interested in a solution that works without
> command-line arguments.
>
> Roman
>
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20121114/c5fb0a95/attachment.htm>


More information about the Pd-list mailing list