[PD] vanilla solution for random float

Alexandre Torres Porres porres at gmail.com
Wed Jun 1 05:08:56 CEST 2016


apparently no one knows as it is not documented, but [expr] has a range
random function, so you can do something like.

[expr random(0, 1000)/1000.0)]

just bang it

cheers

2016-05-31 11:44 GMT-03:00 Raphaël Ilias <phae.ilias at gmail.com>:

> Hello list,
>
> I want to do a simple task : pick a random float in a defined range (let's
> say between 0.0 and 1.0).
> I know there are this kind of objects in external libraries (something
> like [randomF] if remember), but since the collapse of Pd-Extended, I
> generally prefer to make vanilla abstractions.
>
> The two solutions i foresee are :
>
> solution #1 :
>
> [random 1e+06]
>  |
> [/ 1e+06]
>
> but this way, it doesn't use the full floating-point resolution ?... and
> going over that range (like 1e_07) will result in errors (outputs 0) I
> guess because of floating-point complexity.
>
>
> # solution #2 :
>
> [noise~]
>   |
> [snapshot~]
>
> but this won't work if DSP/audio is turned off.
>
>
>
> so I wondered if there are other vanilla and efficient solutions?
> ...or if I just have to get the external from deken... ?
> :)
>
> thanks,
>
> Raphaël
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20160601/1dce98d1/attachment.html>


More information about the Pd-list mailing list