random between two numbers
Hi all!
How is possible in max to do a random number between a minimum and a maximum?
For example if i want random numbers between 5 and 8, only in this range how can i?
Thanks!!
Hi
to get 4 random numbers you need [random 4], which will generate numbers between 0 - 3, use [+ 5] to bring those values up to the required range.
Brendan
Another method is to use the expr object. The random function allows you to determine the minimum and maximum range of numbers.
Marc P.
Great!!!
Last question... and if i want to save this patch and turn it in a mxo how can i do? thanks
Kind of lazy, but I always use the [between] object in the RTC library.
.mxo's are written in C.
If you want to reuse your patch as an abstraction, save it as a .maxpat inside your search path and instantiate it by using the file name. BTW, this is all covered with nice, simple explanations in the Tutorials.
I'm also kind of lazy and just use lp.tata from Litter Power.