# Midi Massage x-Touch

**URL:** <https://forum.bome.com/t/midi-massage-x-touch/5488>\
**Category:** Bome Products\
**Created:** [September 18, 2023, 3:32pm UTC](https://forum.bome.com/t/midi-massage-x-touch/5488 "2023-09-18T15:32:46Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [September 20, 2023, 6:48pm UTC](https://forum.bome.com/t/midi-massage-x-touch/5488/7 "2023-09-20T18:48:04Z")

</div>

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](https://youtu.be/g4AoEyq3qGw) discusses scaling.

```auto
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](https://forum.bome.com/t/bitwise-operations-and-reference/1862) for information on bit mapping.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

_[View the full topic](https://forum.bome.com/t/midi-massage-x-touch/5488)._
