Forums > MaxMSP

random distributions

January 30, 2010 | 10:20 am

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,,

January 30, 2010 | 5:31 pm

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. –



January 30, 2010 | 8:35 pm

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:

——————————————— /

January 31, 2010 | 2:23 am

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 = {, {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. –

January 31, 2010 | 8:34 am

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.


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