unique random hits from the list

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

unique random hits from the list

Post by tester »

My brain is offline. I need some solution, to pick multiple (fixed amount) random hits from an array, but unique hits (i.e. no repeating values). Would be nice to ignore array elements with value = "0".

And some way with no "loop" prim, because this one (or related to it; queue?) seems to cause unpredictable delays.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
philter5
Posts: 11
Joined: Fri Nov 12, 2010 9:11 am

Re: unique random hits from the list

Post by philter5 »

to avoid the delay, you could use some kind of "pre-selection" for the next hit of arrays.
i am sure there is a way without using loop prim, but using this method,
you can maybe use the loop primitive without the delay. i´ll post a example later.
imagine like this: a after load primitive triggers the loop prim directly after loading - so the first bunch
of hits is allready available (without delay) when you need them. and every time you manually trigger the
loop prim, it will get the numbers from the array and keep them till the next trigger is received, but output
the previously selected numbers
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: unique random hits from the list

Post by tester »

I think I found a way, but my brain is still ofline.

Generally what I'd like to do is. Imagine XY matrix of leds (let say 7x12). User selects which leds are on, and which are off (for this purpose - lowest amount of leds-"on" is required). This defines "custom range" in which unique randomization is done. Within custom range - randomizer picks a fixed series of values, and sends them to new array. I think "array" primitive will do the job, because I saw you can delete values at selected index (so it would go like this: pick random index, send value, remove from source). Final array is distribited, and it's values are received individually then.

Some sort of like that. :-)

I'd like to add "tuned randomizer" to my project, to see whether it will help to harmonize some sonic results.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: unique random hits from the list

Post by RJHollins »

It would be interesting to see how efficient manipulating data inside an array can be.

I remember seeing a matrix of selector LED's back in one of the forums.

Keep us posted as you develop the idea 8-)
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: unique random hits from the list

Post by tester »

Well - right now I must figure out one thing. I have the matrix of leds. But I can turn leds on/off manually. Which means that I need an idea to the situation, when less than (fixed) N leds are on. Should there be partial array duplication, or auto led switching to fit the amount, or "empty" array should be added - I don't know yet.

Right now, my unique randomizer looks like this. Input array represents matrix of leds (XYY).
Attachments
uniqueness.fsm
(970 Bytes) Downloaded 991 times
Last edited by tester on Wed May 29, 2013 12:06 am, edited 1 time in total.
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: unique random hits from the list

Post by MyCo »

...
Attachments
Array Random (MyCo).fsm
(727 Bytes) Downloaded 1058 times
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: unique random hits from the list

Post by tester »

Hey MyCo!

Could you add a filter on input, to remove "zero" values from the input list?
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: unique random hits from the list

Post by tester »

Or - ideas how to improve that little fellow?

p.s.: not figured yet how to set the led list to fixed amount of items.
Attachments
tuned-random-list.fsm
(24.37 KiB) Downloaded 1022 times
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: unique random hits from the list

Post by tester »

I think the problem of "x<N" units solved itself. Octave sends value "0", which can be used for blocking randomization on non-used units. Acceptable solution. So now it's time to test it under load, because I'm not sure how these parsers, queues and loops will behave in real life conditions.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply