Midi Massage x-Touch

You will need 3 bytes as

Byte 1 - The control Byte is 8 bits B0 Hex is 1011 0000
Byte 2 and 3 - will each require 7 bits
A value of 0-127 requires 7 bits so for the 3rd byte the Mackie MCU only uses 4 bits for the LED value, 2 bits is to tell it the LED type and 1 bit for center LED state.

For scaling 0-127 to be 0-11, I used the following to get the last 4 bits.
This tutorial discusses scaling.

qq=qq*12
qq=qq/128

Now qq should contain a number between 0 and 12

For the othert 3 bits I just created the value I want and shifted it 4 bits to the left
tt=1<<4

Then you OR these bits with qq to get the final result
qq=qq|tt

Now qq should contain the bits you want

This was all shown in the rules of my previous project example, although I may have used different variables.

You can also look at this post for information on bit mapping.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz