Forums > MaxMSP

Changing the [Random] objects range?

Mar 28 2008 | 7:10 pm

I want the [Random] object to output a number between 36 and 60. I tried to set random to 60 and then use a number box to limit the values between 36 and 60 but the trouble is that 36 keeps coming up (obviously becasue every time the random object outputs a figure below 36 the number box cant handle deal with it so it just shows 36).

So I’m a little baffled, is there anyway to change the range of the random object effectively? Or am i barking up the wrong tree?

Mar 28 2008 | 7:25 pm

Hi James,

Set [random] to 24, then offset (i.e. add) 36 to the output.

Owen

James wrote:
> I want the [Random] object to output a number between 36 and 60. I
> tried to set random to 60 and then use a number box to limit the
> values between 36 and 60 but the trouble is that 36 keeps coming up
> (obviously becasue every time the random object outputs a figure
> below 36 the number box cant handle deal with it so it just shows
> 36).
>
> So I’m a little baffled, is there anyway to change the range of the
> random object effectively? Or am i barking up the wrong tree?
>
>

Mar 28 2008 | 7:39 pm

[random 24]
|
[+ 36]

On Fri, Mar 28, 2008 at 9:10 PM, James wrote:

>
> I want the [Random] object to output a number between 36 and 60. I tried
> to set random to 60 and then use a number box to limit the values between 36
> and 60 but the trouble is that 36 keeps coming up (obviously becasue every
> time the random object outputs a figure below 36 the number box cant handle
> deal with it so it just shows 36).
>
> So I’m a little baffled, is there anyway to change the range of the random
> object effectively? Or am i barking up the wrong tree?
>

Mar 28 2008 | 7:39 pm

Your range is 24. 60 – 36.

Random 25 (because it goes from 0 to n-1) + 36.

In before litter power.

bt

On Mar 28, 2008, at 12:10 PM, James wrote:
>
> I want the [Random] object to output a number between 36 and 60. I
> tried to set random to 60 and then use a number box to limit the
> values between 36 and 60 but the trouble is that 36 keeps coming up
> (obviously becasue every time the random object outputs a figure
> below 36 the number box cant handle deal with it so it just shows 36).
>
> So I’m a little baffled, is there anyway to change the range of the
> random object effectively? Or am i barking up the wrong tree?

barry threw
Media Art and Technology

San Francisco, CA
Work: 857-544-3967
Email: bthrew (at) gmail (dot) com
Web: http://www.barrythrew.com

Mar 28 2008 | 10:04 pm

Quote: barry threw wrote on Fri, 28 March 2008 20:39
—————————————————-
> In before litter power.
—————————————————-

Maybe, but isn’t [lp.tata 36 60] easier?

Litter Starter Pack. Free. URL below.

Best,
Peter

Mar 29 2008 | 1:43 am

Many thanks to all the replies, got it sussed now.

Cheers,
James.

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP