random distributions

Jan 30, 2010 at 10:20am

random distributions

hi,
i’d like to create a list of random numbers with an exponential distribution in a range (i.e. 100 – 1000).
i was looking at the randdist object from cnmat, in particular the exponential or the exppow options,
but neither seem to do what i want. unless i’m doing it wrong, is there a better approach to acheive what i want somewhere?
many thanks,,

#48122
Jan 30, 2010 at 5:31pm

As long as you express the random in a linear domain, and do the scaling afterwards, it will all work out well. Is this what you have in mind:

– Pasted Max Patch, click to expand. –

?

_
johan

#173079
Jan 30, 2010 at 8:35pm

check out the beta distribution with randist. it will return values in the range 0-1., which you can scale – you can adjust the parameters a and b to get a range of different distributions, see here:

http://www.xycoon.com/beta.htm

———————————————
http://www.olilarkin.co.uk / http://olilarkin.blogspot.com

#173080
Jan 31, 2010 at 2:23am

hi,
thanks for the help. seems i forgot about the scaling objects in max (silly).
the following comes close to the sound i was after,
which was to be the same as the sc3 command
x = { Ringz.ar(PinkNoise.ar(0.5), {exprand(300, 20000)}.dup(100)).mean}.play;
for some reason the sc3 version sounds “brighter”, for lack of a better word,
any ideas why?
cheers again,,

– Pasted Max Patch, click to expand. –
#173081
Jan 31, 2010 at 8:34am

Brighter would mean more higher frequencies. What if you’d draw random numbers as note values and then scale them to frequencies with mtof? It could also mean louder higher frequencies.

_
johan

#173082

You must be logged in to reply to this topic.