rand primitive not so random ;-)

If you require help or assistance with anything then please post here

Moderators: electrogear, exonerate

rand primitive not so random ;-)

Postby tester on Sat Mar 31, 2012 11:06 am

I just found, that green rand primitive is not so random as it appears to be. When I start exported app - each time, the first "random" value is the same. So my question to those who are familiar with SM in details. Is the rand primitive using periodic clock to generate random values (on user interaction) or first shot just initializes reference point for some sort of time-based counting? I.e. how it works in SM?
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 695
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: rand primitive not so random ;-)

Postby MegaHurtz on Sat Mar 31, 2012 12:25 pm

This is a problem that has bothered mathematicians for ages. True random is impossible to make, so its just a way of tricking the brain into thinking it`s random. The closest thing to random is sampling the noise of an analog input. This being a cosmically large random series. Still its not random. Because random doesnt exist. SM`s is probably a list of some sort.
User avatar
MegaHurtz
smaniac
 
Posts: 1522
Joined: Mon Aug 11, 2008 5:29 pm
Location: Eindhoven/Netherlands

Re: rand primitive not so random ;-)

Postby tester on Sat Mar 31, 2012 12:41 pm

@MegaHurtz - stop! ;-) No philosophising :-)

When using "rand" primitive
and "editbox" to which "rand" value is sent
in => exported exe application

---> first manually triggered "random" value that is sent from "rand" to "editbox" is always the same.
(after application is turned off and on, over and over - first "random" value is always the same).

Which means, that rand primitive uses for the reference it's internal counter, that starts on first shot.

Rand could use PCs clock for calculating initial offset or anything else that is in motion.
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 695
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: rand primitive not so random ;-)

Postby aliasant on Sat Mar 31, 2012 12:44 pm

tester wrote:@MegaHurtz - stop! ;-) No philosophising :-)

When using "rand" primitive
and "editbox" to which "rand" value is sent
in => exported exe application

---> first manually triggered "random" value that is sent from "rand" to "editbox" is always the same.
(after application is turned off and on, over and over - first "random" value is always the same).

Which means, that rand primitive uses for the reference it's internal counter, that starts on first shot.

Rand could use PCs clock for calculating initial offset or anything else that is in motion.


You can use Time as a seed.
Or do as MH said, Sample a monophonic stream ie. an osc followed by a mono to float.
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: rand primitive not so random ;-)

Postby tester on Sat Mar 31, 2012 1:04 pm

Thanks. I just realized, that there is "system time" detector primitive, so I will use it for mixing randoms. But again a part of schematic beeds to be rebuilt ;-) Anyway good to know, how certain primitives behave in details, as Trog suggests on each opportunity.
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 695
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: rand primitive not so random ;-)

Postby philter5 on Sat Mar 31, 2012 1:19 pm

hehehehew the old story with the "random".....
i´ve seen a nice documentation about some experiments made by a german scientist.
when i remember right, they said you have to take a radioactive material and measure it with a geiger zähler to
get a real "random" signal ... :D
(i´ll search the link from the doku and post it here, it´s really interesting!)
another way to get some "random" values is http://www.random.org/ ....
you can easily create random float/int values or random float/int arrays.
---Yes, a piece of software CAN be your best friend---
User avatar
philter5
smaniac
 
Posts: 1480
Joined: Thu Jan 04, 2007 7:52 pm
Location: Germany

Re: rand primitive not so random ;-)

Postby tester on Sat Mar 31, 2012 1:34 pm

If we speak about non-randomness of randomness, here is something I usually deal with ;-)
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 695
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: rand primitive not so random ;-)

Postby oddson on Sat Mar 31, 2012 1:55 pm

Back to the original point... the random primitive should use the system time as a seed when seed input is zero and so should not come up with the same value on restart if it's conneted to an afterLoad primitive but that's what I'm seeing too.

Anyone else? Seems like a bug.
oddson
wiki guru
 
Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Re: rand primitive not so random ;-)

Postby MegaHurtz on Sat Mar 31, 2012 3:14 pm

philter5 wrote:hehehehew the old story with the "random".....
i´ve seen a nice documentation about some experiments made by a german scientist.
when i remember right, they said you have to take a radioactive material and measure it with a geiger zähler to
get a real "random" signal ... :D
(i´ll search the link from the doku and post it here, it´s really interesting!)
another way to get some "random" values is http://www.random.org/ ....
you can easily create random float/int values or random float/int arrays.


Hehe, COOL :p didnt know beta decay would be so non periodic it`s considered most random by ze Germans. Shows how little we know about the quantum world. Im sorry i dont really use those prims.
User avatar
MegaHurtz
smaniac
 
Posts: 1522
Joined: Mon Aug 11, 2008 5:29 pm
Location: Eindhoven/Netherlands

Re: rand primitive not so random ;-)

Postby aliasant on Sat Mar 31, 2012 5:25 pm

oddson wrote:Back to the original point... the random primitive should use the system time as a seed when seed input is zero and so should not come up with the same value on restart if it's conneted to an afterLoad primitive but that's what I'm seeing too.

Anyone else? Seems like a bug.


Reminds me. I noticed the same a while back. Didnt report it thoug :(
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: rand primitive not so random ;-)

Postby oddson on Sat Mar 31, 2012 6:36 pm

aliasant wrote:Reminds me. I noticed the same a while back. Didnt report it
It's funny I could swear this was working only last week. :S
oddson
wiki guru
 
Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Re: rand primitive not so random ;-)

Postby aliasant on Sat Mar 31, 2012 8:46 pm

oddson wrote:
aliasant wrote:Reminds me. I noticed the same a while back. Didnt report it
It's funny I could swear this was working only last week. :S


It seems if you trigger the (empty) seed input just before you trigger the Get Random it works.
Not very usefull though

I ended up creating a list with 32k random numbers in an array.
Then a random number picks one of those from the list and that got me a nice random function with equall dispersion all over. ( is that even english?)
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: rand primitive not so random ;-)

Postby oddson on Sat Mar 31, 2012 9:35 pm

Strange... I tried this from my laptop this morning and got same number over and over. Now I'm getting a different value each time?
oddson
wiki guru
 
Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Re: rand primitive not so random ;-)

Postby tester on Sat Mar 31, 2012 11:04 pm

I'm getting again and again the same value on load (SM is turned off and on; if SM is on, and only schematic is reloaded - then it works fine).
Need to take a break? Looking for relaxing sounds? I have something right for you.
(by purchasing, you are also supporting further development of related projects).
Thank you for your contribution.
tester
smanatic
 
Posts: 695
Joined: Wed Jan 18, 2012 9:52 pm
Location: Poland, internet

Re: rand primitive not so random ;-)

Postby philter5 on Sun Apr 01, 2012 1:24 am

the name of the german movie was "die Mechanik des Zufalls", a ARTE production, and the scientist was Helmut Schmidt.
it gets really weird when they tell you, that "randomness", created from/with computers, does somehow interact with our brain. for example, generated random numbers on university´s worldwide showed a clear reaction when something BAD happend in the world, events like 9/11 or the death of Lady Di had a HUGE influence to the random numbers....
---Yes, a piece of software CAN be your best friend---
User avatar
philter5
smaniac
 
Posts: 1480
Joined: Thu Jan 04, 2007 7:52 pm
Location: Germany

Next

Return to Help

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron