Hello, I'm very very new to pd, and couldn't find an answer to this supposedly simple matter. I see that the "random" object generates random integers between 0 and its argument.
How do I generate a random float between floats a and b?
cheers, renato
i'm new to PD as well but have worked in Max - if by float you mean a decimal between 0.0 and 1.0 just use the [*] (multiply object ) after [random] and multiply by a decimal number (like .01). set the random to pick between 0 and 100 and you should be all set for 100 data points. as long as you have a clue of the number of data points between A and B you can set the range with the multiplier. you can also use the [drunk] object in PD-extended (cyclone) for a custom range but the decimal multiplier is still needed to convert that to float.
any other faster methods, PD'ers? i'm nowhere near the worlds greatest programmer, but that's what first comes to mind.
scott
On Fri, Jan 20, 2012 at 10:56 AM, Renato rennabh@gmail.com wrote:
Hello, I'm very very new to pd, and couldn't find an answer to this supposedly simple matter. I see that the "random" object generates random integers between 0 and its argument.
How do I generate a random float between floats a and b?
cheers, renato
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Use [randomF] from the markex library.
-Jonathan
From: Scott R. Looney scottrlooney@gmail.com To: Renato rennabh@gmail.com Cc: Pd-list@iem.at Sent: Friday, January 20, 2012 2:17 PM Subject: Re: [PD] random float
i'm new to PD as well but have worked in Max - if by float you mean a decimal between 0.0 and 1.0 just use the [*] (multiply object ) after [random] and multiply by a decimal number (like .01). set the random to pick between 0 and 100 and you should be all set for 100 data points. as long as you have a clue of the number of data points between A and B you can set the range with the multiplier. you can also use the [drunk] object in PD-extended (cyclone) for a custom range but the decimal multiplier is still needed to convert that to float.
any other faster methods, PD'ers? i'm nowhere near the worlds greatest programmer, but that's what first comes to mind.
scott
On Fri, Jan 20, 2012 at 10:56 AM, Renato rennabh@gmail.com wrote:
Hello, I'm very very new to pd, and couldn't find an answer to this
supposedly simple matter. I see that the "random" object generates random integers between 0 and its argument.
How do I generate a random float between floats a and b?
cheers, renato
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list