Support

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

Random Number Limit?

For general discussion related FlowStone

Random Number Limit?

Postby Dugg Funnie » Tue Sep 03, 2013 3:46 pm

hey everybody, first post! woohoo!

So, I'm working on a plug-in that will randomly load two effects and assigned parameters to an XY pad. Here's the issue I'm running into:

I have a Random prim that's time seeded and using an AfterLoad prim to trigger the generation (and thus the FX selection/assignment) when the plug-in is loaded. However, I'll only have a grand total of 12 effects to choose from, and given that the random prim generates 0-32767, a good percentage of the time it ends up just loading the last plug-in in the Selector's index. So, what can I do to limit the Random's range to something like 0-12 or anything like that?
Dugg Funnie
 
Posts: 3
Joined: Tue Sep 03, 2013 3:35 pm

Re: Random Number Limit?

Postby CoreStylerz » Tue Sep 03, 2013 4:03 pm

Try this.
But is an workaround. :lol:
Seed max to 12.fsm
(386 Bytes) Downloaded 848 times
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
User avatar
CoreStylerz
 
Posts: 327
Joined: Sun Jan 22, 2012 2:19 am
Location: italy

Re: Random Number Limit?

Postby trogluddite » Tue Sep 03, 2013 8:46 pm

Much easier to use Ruby.
The randomness is automatically time/process seeded, and to get a random number 0-11 (assuming the FX are zero indexed), you need just one line...
Code: Select all
output rand(12)

Yup, that's it, just paste that into a Ruby box and change the input to a trigger and the output to an integer - done!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Random Number Limit?

Postby MyCo » Tue Sep 03, 2013 9:21 pm

...
Attachments
Reduced Rand (MyCo).fsm
(257 Bytes) Downloaded 799 times
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Random Number Limit?

Postby Dugg Funnie » Fri Sep 06, 2013 6:24 pm

/\ Wow. That was simple! Thanks!
Dugg Funnie
 
Posts: 3
Joined: Tue Sep 03, 2013 3:35 pm


Return to General

Who is online

Users browsing this forum: No registered users and 79 guests