Is there a good reason why you can't put a float into [random]'s left inlet?
hjh
[random] hot inlet doesn't allow float
Is there a good reason why you can't put a float into [random]'s left inlet?
hjh
@ddw_music what would the function of that be? To set the range & then generate a value?
@ddw_music you can put a float into the left inlet with the seed message.
@seb-harmonik.ar said:
@ddw_music what would the function of that be? To set the range & then generate a value?
Exactly. In SC I can write x.rand
but in Pd I am forced to do number -> [t b f] -> random with 2 connections...? Pointless roadblock.
hjh
@ddw_music You can make an abstraction that does this.
I made a pull request to add it.. why not https://github.com/pure-data/pure-data/pull/1366
What would be very welcome is to be able to put min and max range as a list... and arguments.
Because I always use [expr random(10 , 100)]
I made a pull request to add it.. why not
Cool
What would be very welcome is to be able to put min and max range as a list... and arguments. Because I always use [expr random(10 , 100)]
Sure, for usability... though it's pretty standard for older programming languages to provide only random(n) returning 0 <= x < n. SC has rrand(lo, hi)
and it is indeed very helpful to have it at one's fingertips, without building any abstractions.
You can make an abstraction that does this.
That's always the thing with Pd, isn't it? You have to make abstractions to address deficiencies... well, I've beaten on this door before, I'm tired, won't repeat it today.
hjh
That's always the thing with Pd, isn't it? You have to make abstractions to address deficiencies... well, I've beaten on this door before, I'm tired, won't repeat it today.
hjh
I agree with you, but using ceammc lib, you have all and even more in one package.
Just to say last ceammc lib 0.9.4 have random.i, random.f, random.atom (random atom from specified list with weights) etc...
You can have min, max and also ask for a list of generative random values using [gen n( message. You can also use expressions in any argument of any ceammc object.
@60hz said:
Just to say last ceammc lib 0.9.4 have random.i, random.f, random.atom (random atom from specified list with weights) etc...
Indeed, this looks fantastic. Wouldn't have found it on my own.
Btw I had a student on Monday complain precisely "in SC I can just ask for a random number in a range, but in Pd I have to do math" and I did point to ceammc at that point. Still, it suggests that many programming environments have become more articulate in their access to rngs while vanilla Pd hasn't. It's like, integer rands were good enough for your grandparents so they should be good enough for you "back in my day, we had to..." (though it was kinda cool when Pd's always-quantized random numbers led me to stumble across a really crazy artefact when summing sine waves -- wouldn't have found that if I'd been using random floats ).
hjh
Oops! Looks like something went wrong!