Can I assign a variable to the incoming channel ?

Dadith1

2009-10-18 22:32:49

Can I assign a variable to the incoming channel ?

For example:
Incoming: pp 33 7F
Rules : pp = 130

130 is decimal of 82 HEX
82 is button that I use on my Akai apc40 for BeatRepeat

Thank you all for the information
:|

ruediger

2009-10-19 10:09:04

Hi,

yes, you can do this. This is a little bit mathematical. You need the bitwise & operator for that.

Incoming:

pp 33 7f

Rules:

oo=pp&0x7f

The variable oo is assigned to the channel number.

Cheers,
Rüdi

Dadith1

2009-10-19 19:36:21

ruediger wrote:Hi,

yes, you can do this. This is a little bit mathematical. You need the bitwise & operator for that.

Incoming:

pp 33 7f

Rules:

oo=pp&0x7f

The variable oo is assigned to the channel number.

Cheers,
Rüdi

Ok thank you very much for the help but you could tell me how did you calculate this rule ?
oo=pp&0x7f

What steps should I follow to this mathematical formula?

Thanks in advance :)

ruediger

2009-10-19 20:58:56

Hi,

don't know what you mean with:

>What steps should I follow to this mathematical formula?

1. Create a Translator
2. Create the MIDI incoming as pp 33 7f
3. Open Rules and select Expression in the drop down
4. Set the rule like: oo=pp&0x7f
5. oo has the value 0 if input was B0 = channel 1, value 1 if input was B1 and so on.

Hope that helps!
Rüdi

Dadith1

2009-10-19 22:13:32

ruediger wrote:Hi,

don't know what you mean with:

>What steps should I follow to this mathematical formula?

1. Create a Translator
2. Create the MIDI incoming as pp 33 7f
3. Open Rules and select Expression in the drop down
4. Set the rule like: oo=pp&0x7f
5. oo has the value 0 if input was B0 = channel 1, value 1 if input was B1 and so on.

Hope that helps!
Rüdi
What mathematical formula must be used to obtain:
oo = pp & 0x7f

I ask to do it alone these expressions in the future

Excuse my English but I use Google Translation

Thanks again Rüdi :)

ruediger

2009-10-20 09:50:30

Hi,

the formula can be created via the drop down menus in the Rules section.

Cheers,
Rüdi

Dadith1

2009-10-20 15:05:01

ruediger wrote:Hi,

the formula can be created via the drop down menus in the Rules section.

Cheers,
Rüdi
Me explain 'better ..
So 'that the rules are set in the section Rules
But my question and 'why' use 0x7f ?
Sorry but 'only to learn
What does 0x7f ?
Thanks for the help they give me !!! :)

ruediger

2009-10-20 15:28:08

He man,

sorry, I typed it wrong:

It's 0x0f :

oo=pp&0x0f

This is a hexadecimal number.

You can also write:

oo=pp&15

Cheers,
Rüdi