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
Comparing identical values in Ruby
4 posts
• Page 1 of 1
Comparing identical values in Ruby
Hi,
Once again, a Ruby challenge:
I need a simple ruby module with 1 in-1out floats that responds to the incoming data whenever a value is sent to it, even if the sent value has sent twice in raw. For instance, if i press a key that sends the float value "2" twice, the module should recognize that. On the first press, it should output "2", but on the second, it should output "3", if any other new key is pressed ( even if its "2" again!) after the the double press, then it will output the new value, untill this value is double-pressed again. Any suggestion?
Once again, a Ruby challenge:
I need a simple ruby module with 1 in-1out floats that responds to the incoming data whenever a value is sent to it, even if the sent value has sent twice in raw. For instance, if i press a key that sends the float value "2" twice, the module should recognize that. On the first press, it should output "2", but on the second, it should output "3", if any other new key is pressed ( even if its "2" again!) after the the double press, then it will output the new value, untill this value is double-pressed again. Any suggestion?
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
Re: Comparing identical values in Ruby
You mean something like this?
- Attachments
-
- ifequaltoprev.fsm
- (337 Bytes) Downloaded 668 times
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Comparing identical values in Ruby
Sorry for the late respond. Just tested it; Works amazing!
Thanks a lot KG. And from 1 example to another, I'm slowly learning how Ruby's logic translated into an actual code.
Really great
Thanks a lot KG. And from 1 example to another, I'm slowly learning how Ruby's logic translated into an actual code.
Really great
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
Re: Comparing identical values in Ruby
Last principle question for today: how do we block values in ruby from passing out? Lets say we have a code with 1 midi in+1float in and1 midi out, and we want to completely block the midi signal from passing out when the float value =1. How do we do it? As far as i understand, "else 0" doesnt blocks, but just sends a zero to the output (bad solution, dont it )
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 20 guests