rnd optimization

For general discussion related FlowStone
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: rnd optimization

Post by tester »

Hmm...
Attachments
distribution-related.fsm
(10.82 KiB) Downloaded 1002 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: rnd optimization

Post by MyCo »

tester wrote:What is the output range in your design? I see values going beyond 1 (I guess the upper range is 3?), but I don't know what is the min value here.


Well, there was a bug in the code. I reuploaded the schematic in my post above. The range is 0 to 1.

tester wrote:What is the purpose of setting the seed in (0.2,0.7) range? (or it does not matter for whitenoise-like distribution?).


It's the initial starting point for the random numbers. The random number calculation is similar to the one you posted. The "rand" function fills all for SSE channels with different values.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: rnd optimization

Post by tester »

Maybe it will sound stupid, but... what is the practical meaning of differences between these two distributions (over time)?
Attachments
distribution-related-1.fsm
updated
(10.78 KiB) Downloaded 1021 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: rnd optimization

Post by MyCo »

It shows that your version is wrong. I found the reason for that already:

You set the time interval to 9.9999997e-005 seconds witch is ~100 micro seconds... lets calculate how long each random step is in samples:

Code: Select all

Samplerate = 44100
Steplength = Samplerate * Interval
--> 4


You use hop(128) everywhere, so instead of updating the random number every 4 Samples, you only update every 128 Sample. Connect the stream ouputs to the Audio Output, and you'll hear the difference.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: rnd optimization

Post by tester »

Ah I see, I just realized too that my part works just slower, thanks!
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: rnd optimization

Post by tester »

...but I noticed one more thing. Each time when I start the schematic - the random series starts from the same position (it calculates the same irregular patttern of numbers each time). How to put there external seed correctly?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: rnd optimization

Post by MyCo »

That's actually how all random number generators work in FlowStone.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: rnd optimization

Post by tester »

Yes I know, but I have seed generator on start (time based; thus - it produces new results). That why I asked how to connect correctly and efficiently external seeding.
Attachments
seed-gen.fsm
(575 Bytes) Downloaded 999 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
MyCo
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany
Contact:

Re: rnd optimization

Post by MyCo »

your schematic always starts with the same values... as I said, the default random generator in FS works that way. You can use Ruby or set the seed input of the primitive explicitly to the current time.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: rnd optimization

Post by tester »

MyCo - just tested again. Always different values.

For some reason - first value is sometimes the same, but not always (I think it was more vriated in SM, or in larger design or under greater load, don't remember now). Values are different each start. Screenshot is made of 2 startups (no changes, just starting the schematic and external printscreen; to not make biliv's choices - plus video).

For green randomizer - it is a matter of seeding with time AND retriggering on start (I received this explanation from Malc some time ago).

But this similarity of seeds guides me to the question. If this FS randomnes = just irregularity (i.e. always the same pattern per seed), then maybe the random generator itself (before "latch") should be running in the background (I don't know - few per second? tkc rate?), to produce greter variation? (connected to interaction generated by user?). //edit: this one is just a thought; I don't know what difference (size) between seeds produces signifficant differences in output (as you see this is click-by-click related, not audio noise).
Attachments
diff_x264.zip
different
(466.48 KiB) Downloaded 1008 times
diff.png
diff.png (17.04 KiB) Viewed 17566 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply