If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
unique random hits from the list
9 posts
• Page 1 of 1
unique random hits from the list
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.
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.
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
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
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
- philter5
- Posts: 11
- Joined: Fri Nov 12, 2010 9:11 am
Re: unique random hits from the list
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.
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.
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
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
I remember seeing a matrix of selector LED's back in one of the forums.
Keep us posted as you develop the idea
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: unique random hits from the list
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).
Right now, my unique randomizer looks like this. Input array represents matrix of leds (XYY).
- Attachments
-
- uniqueness.fsm
- (970 Bytes) Downloaded 912 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.
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
...
- Attachments
-
- Array Random (MyCo).fsm
- (727 Bytes) Downloaded 973 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: unique random hits from the list
Hey MyCo!
Could you add a filter on input, to remove "zero" values from the input list?
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.
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
Or - ideas how to improve that little fellow?
p.s.: not figured yet how to set the led list to fixed amount of items.
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 936 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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
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.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 91 guests