one button multiple tasks

nsamaras2

2015-04-20 16:50:43

Hello everyone My name is nick and I am new to Bome's software. There are a few things that are coming easy to me. Then other situations are not as easy to figure out. I have been reading the hell out of this forum to find answers to what I am looking for. Where there is staggering amount of information on this forum, it seems that MT software conforms it's self to fit individual situations and needs!

How would I go about making one button on my apc20 scroll trough multiple abs positions, for example. Lets say I was going to use
90 35 03, I would press it once, it would go to the first abs position 0f x105 - y345, press it again will go to next abs position of
x570 - y690, press it again it will move to abs position x850 - y670, etc etc for as many positions I would need to scroll trough??

For rite now the only other situation I need some help with would be to have buttons change led colors. I can get the buttons to light up any color no problem, but when I press the same button again to go from green to red it stays green. I have tried different methods of achieving this via timers preset changes, no luck I'm not really sure what I'm doing wrong???

Any help on these tasks would be much appreciated!! Looking forward to hearing something soon, thanks in advance for anyone spending their time with this!!! 8)

DvlsAdvct

2015-04-22 22:53:15

Hi Nick, sorry for the delay in responding. :)

Okay, so there are two different situations, so we'll deal with the easy one first.

If you want to toggle LEDs on your controller between two different colors you want to use global variables to do it. It would look something like this:

Code: Select all

Translator 1: LED Switch
Incoming Message: 90 30 7F
Rules: g1=g1+1
if g1>1 then g1=0
if g1==0 then pp=0
if g1==1 then pp=127
Outgoing Message: 90 30 pp
Swap the values I have up there for pp (0, 127) for the values of your colors and it should swap back and forth.

As far as the absolute position values, there are a number of ways to do this, but we're going to focus on the one with the fewest translators. You're going to need one translator to count up a global variable and trigger a timer, and another to reference that global variable and set the abs position.

I don't have MT in front of me right now, so for the mouse positions you may need to work out where the put the variables. I also guessed at 3 different positions since that's how many examples you gave, but you can increase them as you need.

Code: Select all

Translator 1: Variable Count
Incoming Message: 90 35 03
Rules: g0=g0+1
if g0>2 then g0=0
Outgoing Message: Timer 0ms Delay: Position Change

Transator 2: Mouse Position
Incoming Message: Timer: Position Change
Rules: if g0==0 then Goto "0"
if g0==1 then Goto "1"
if g0==2 then Goto "2"
Label "0"
pp=105
qq=345
Exit rules, execute outgoing action
Label "1"
pp=570
qq=690
Exit rules, execute outgoing action
Label "2"
pp=850
qq=670
Exit rules, execute outgoing Action
Outgoing Message: Mouse Position - Abs - X: pp Y: qq
Does all of that make sense?
Jared

nsamaras2

2015-04-22 23:26:20

Hey Jarid
Thanks for the reply. I'm all out of Tylenol and don't have much hair left to pull out! The first question I have for the led is when I define the global variable, do I write a translator that says just those rules and nothing else? and then write a midi message that says incoming: 80 35 7f Outgoing: 90 35 01 for green. and then another midi message that says Incoming: 90 35 01 and Outgoing: 80 35 03 for red. sorry I just seem to get a bit confused when it comes to putting this together??

DvlsAdvct

2015-04-26 20:41:02

Hi again

Each group of code I put together represents one translator. So, where it says Rules:, that information goes in the rules section of the translator. Since your controller requires a different outgoing message, we just need to tweak some stuff.

For example, the incoming message would read

90 35 01

And the outgoing message would read

80 35 pp

And in that same translator, the rules would read:

g1=g1+1
if g1>1 then g1=0
if g1==0 then pp=1
if g1==1 then pp=3

So whenever you press the button it counts the global variable and changes the velocity of the message so the color changes. That all goes in one translator.

nsamaras2

2015-04-26 20:53:29

Thanks Jared
I appreciate all your time. That was a huge help! I think I have enough stuff to work with for now, so I will let you know how it goes. I like the way that no matter what kind of idea you can come up with, there is a way to program it!! I hope this thread helps someone else too.
Cheers :mrgreen:

DvlsAdvct

2015-04-26 20:59:47

Glad to hear it works. Don't hesitate to bring your questions to us. :)