gabriels
2009-04-24 13:14:16
I've devised a very clunky way of defining an input range by using two translators. I actually want to define multiple ranges for a single input, and can imagine I can extend this general concept, but I think there must be a better way to achieve my goal. Can someone help?
Here's what I have now:
As a test, I want to
- move cursor to location x=100 y=100 if the input from a pot =<31
- move cursor to location x=200 y=200 if the input from the pot =>32
so I created these this preset:
--------------- Preset create range and execute
Translator 1: execute if less
Options: stop=false
Incoming: MIDI B0 0E ga
Rules: limit input
if ga<=31 then Goto "was less than or equal to"
if ga>=32 then Goto "was more than or equal to"
Label "was less than or equal to"
exit rules, execute Outgoing Action
Label "was more than or equal to"
exit rules, skip Outgoing Action
Outgoing: Mouse move to X=100 Y=100
Translator 2: execute if more
Options: stop=false
Incoming: MIDI B0 0E ga
Rules: limit input
if ga>=32 then Goto "was greater"
exit rules, skip Outgoing Action
Label "was greater"
exit rules, execute Outgoing Action
Outgoing: Mouse move to X=200 Y=200
Well, this works, but there must be an easier way? In the long run, I'd like to do more complex outgoings, but that's not the problem. I'd like to divide up the entire range of the pot into several "sub-ranges" and execute different outgoings depending on the input value. This would really start getting complicated if done my way...so please help me see an easier way of doing this.
Thanks,
Gabriel
Here's what I have now:
As a test, I want to
- move cursor to location x=100 y=100 if the input from a pot =<31
- move cursor to location x=200 y=200 if the input from the pot =>32
so I created these this preset:
--------------- Preset create range and execute
Translator 1: execute if less
Options: stop=false
Incoming: MIDI B0 0E ga
Rules: limit input
if ga<=31 then Goto "was less than or equal to"
if ga>=32 then Goto "was more than or equal to"
Label "was less than or equal to"
exit rules, execute Outgoing Action
Label "was more than or equal to"
exit rules, skip Outgoing Action
Outgoing: Mouse move to X=100 Y=100
Translator 2: execute if more
Options: stop=false
Incoming: MIDI B0 0E ga
Rules: limit input
if ga>=32 then Goto "was greater"
exit rules, skip Outgoing Action
Label "was greater"
exit rules, execute Outgoing Action
Outgoing: Mouse move to X=200 Y=200
Well, this works, but there must be an easier way? In the long run, I'd like to do more complex outgoings, but that's not the problem. I'd like to divide up the entire range of the pot into several "sub-ranges" and execute different outgoings depending on the input value. This would really start getting complicated if done my way...so please help me see an easier way of doing this.
Thanks,
Gabriel