[PD] [random] and seed value

Dan Wilcox danomatika at gmail.com
Sun Dec 11 22:06:27 CET 2022


Related: https://github.com/pure-data/pure-data/issues/1717 <https://github.com/pure-data/pure-data/issues/1717>

> On Dec 11, 2022, at 9:59 PM, pd-list-request at lists.iem.at wrote:
> 
> Message: 2
> Date: Sun, 11 Dec 2022 16:55:40 +0100
> From: Thomas Mayer <thomas at residuum.org <mailto:thomas at residuum.org>>
> To: pd-list at lists.iem.at <mailto:pd-list at lists.iem.at>
> Subject: [PD] [random] and seed value
> Message-ID: <478be1b4-8f1c-ee0f-d11c-889b51371243 at residuum.org <mailto:478be1b4-8f1c-ee0f-d11c-889b51371243 at residuum.org>>
> Content-Type: text/plain; charset=UTF-8; format=flowed
> 
> Hello,
> 
> currently [random] uses a fixed value for initialisation. This leads to 
> the same sequence of values all the time.
> 
> https://github.com/pure-data/pure-data/blob/c0cd34924a50bdd1cc37dfb6b01f9be02ad8a78b/src/x_misc.c#L55 <https://github.com/pure-data/pure-data/blob/c0cd34924a50bdd1cc37dfb6b01f9be02ad8a78b/src/x_misc.c#L55>
> 
> My guess is, that most users probably expect at least different seed 
> values every time.
> 
> Maybe the help file should explicitely state the behaviour or a 
> different way for deriving the initial seed should be used, e.g. taking 
> the local time. Or a better PRNG could be used as well.
> 
> If we take the solution to initialize [random] with a different seed 
> each time, an explanation on how to revert to the old behaviour of a 
> seed value of 1489853723 should be mentioned in the help.
> 
> I could tackle that, but would like a discussion about that before coding.
> 
> Thanks,
> Thomas
> -- 

--------
Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20221211/3cba4cf1/attachment-0001.htm>


More information about the Pd-list mailing list