Simplifying "chained" rules

cawhitworth

2010-04-09 10:18:25

Hi;

I'd like to set up a bunch of rules such that a pair of MIDI pads (that currently send CC messages, but what they send is broadly irrelevant) send Ctrl+[number], where one pad decrements the number and the other pad increments it. An example:

Pad 0: Ctrl+0
Pad 0: Ctrl+1
Pad 0: Ctrl+2
Pad 1: Ctrl+1
Pad 1: Ctrl+0

At the moment, I've done this by setting up translators on Pad 0 and 1 to increment/decrement a global variable, and then another set of translators on the same pads that send ctrl+[number] if the global variable is equal to that number, ie:

if g0 != 1 then exit rules, skip outgoing action

The thing is, this means I've got 22 rules to achieve this relatively simple operation, which seems like a lot. Is there any way to do this more simply?

Attigo

2010-04-14 18:15:39

I'm sure there is Cawhitworth!

I'm not quite sure I understand you fully though..

Do you want Pad 1 for example when you hit it one time, it sends Ctrl+0 then a second time it sends Ctrl+1, and so on, until it reaches a certain number?

Scott

Attigo

2010-04-17 23:50:49

Hi,

Sorry, after reading over again, it makes a little more sense. Here is 2 Translators, the first Increments and the second Decrements...

For the example, I've used 2 CC messages, which would be your Pads. the first rule in each is just to allow any CC value above 0. I've basically set a range of 0-5 for your variable. If you wanted to make the range larger, just change '5' to whatever you want...

Code: Select all

Translator 0: Increment
Options: stop=false
Incoming: MIDI B0 01 oo 
Rules: 
  if oo<=0 then exit rules, skip Outgoing Action
  ga=ga+1
  if ga>=5 then ga=5
Outgoing: (none)

Translator 1: Decrement
Options: stop=false
Incoming: MIDI B0 02 oo 
Rules: 
  if oo<=0 then exit rules, skip Outgoing Action
  ga=ga-1
  if ga<=0 then ga=0
Outgoing: (none)
Hope this helps!!

Scott