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
where/how to add trigger blocker here
18 posts
• Page 1 of 2 • 1, 2
where/how to add trigger blocker here
Question. Where/how in such thing add trigger blocking, so that the random generator does not produces output when input (values) is changed? And I don't mean clickable S&H on all inputs or on output; the question is - how to block generating itself, so that randomizer produces results only on request.
- Attachments
-
- blocker.fsm
- (656 Bytes) Downloaded 882 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: where/how to add trigger blocker here
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: where/how to add trigger blocker here
We misunderstood. The problem is, that whatever change on whatever value-based input (first 3 inputs) - produces trigger that generates output. I'd like to avoid that. But also I'd like to avoid multiple generations (if S&H is connected to each individual input - that sort of things will happen). So - individual silent changes on all 3 inputs, and trigger only on demand.
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: where/how to add trigger blocker here
You need to do this inside the Ruby itself...
The 'i' variable is the index of the input that has just caused an 'event'. Triggers on other inputs will still update the values of their variables, but by 'filtering' the 'i' value, won't cause any of the array output code to run.
You can't really do the same using 'external' trigger blockers, because the triggers are necessary in order for Ruby to know when to update the '@' variable values (there are no "backwards" triggers from Ruby prim's to request the current values).
You could also give the trigger input a name, and use its name for the 'i' comparison...
if i == "trigger_input" ...etc...
...this is safer, because the name won't change if you add/delete/re-order the inputs, whereas the numeric index might change if you decide to update the module. The 'i' parameter has a special data type that is both number and string, so you can mix numeric indexes and names any way you like.
The 'i' variable is the index of the input that has just caused an 'event'. Triggers on other inputs will still update the values of their variables, but by 'filtering' the 'i' value, won't cause any of the array output code to run.
You can't really do the same using 'external' trigger blockers, because the triggers are necessary in order for Ruby to know when to update the '@' variable values (there are no "backwards" triggers from Ruby prim's to request the current values).
You could also give the trigger input a name, and use its name for the 'i' comparison...
if i == "trigger_input" ...etc...
...this is safer, because the name won't change if you add/delete/re-order the inputs, whereas the numeric index might change if you decide to update the module. The 'i' parameter has a special data type that is both number and string, so you can mix numeric indexes and names any way you like.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: where/how to add trigger blocker here
Okay, thanks. I suspected that it must be something within ruby code.
I need to gather my thoughts...
I need to gather my thoughts...
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: where/how to add trigger blocker here
Yeah, the "no backwards trigger" thing is unlike almost all the other prim's. It's caught me out quite a few times!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
Re: where/how to add trigger blocker here
Generally the whole "ruby thing" is a headache maker for me. I'm so used to simple visual modularity, that when I watch at ruby and it's syntax, I simply feel dumb... I don't know if I'm able to cross that borderline.
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: where/how to add trigger blocker here
tester wrote:Generally the whole "ruby thing" is a headache maker for me. I'm so used to simple visual modularity, that when I watch at ruby and it's syntax, I simply feel dumb... I don't know if I'm able to cross that borderline.
come on, its you TESTER, you will! just open your mind for it the good thing is, after you got some basics it really makes fun exploring it, and its an endless world to test out, and you will see that things become more and more easy with it also more easy than making it the "graphical" way, and after some time you want to program everything in ruby, and i`m still at the beginning, just writing my first own methods.. just give yourself a little time and do small and easy code, it starts to grow by itself then
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: where/how to add trigger blocker here
mis-understood
Sorry tester...didnt read question properly.
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: where/how to add trigger blocker here
Nubeat7 wrote:come on, its you TESTER, you will! just open your mind for it the good thing is, after you got some basics it really makes fun exploring it, and its an endless world to test out, and you will see that things become more and more easy with it also more easy than making it the "graphical" way, and after some time you want to program everything in ruby, and i`m still at the beginning, just writing my first own methods.. just give yourself a little time and do small and easy code, it starts to grow by itself then
It's just too much for me. Open mind is not a trash. I repeat over and over - I do these little things in order to use created stuff. My fun is there. Having yet another syntax to deal with - I'm overloaded. If you remember the story/paradox of Pinocchio I posted recently, then you know what kind of computations are on my everyday basis... It's just difficult to flip back to things like... ruby
BTW - are in nature "divisions by zero" (in terms of programming solutions) present?
- Attachments
-
- divisions-by-zero.fsm
- (543 Bytes) Downloaded 869 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
18 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 70 guests