# Pattern for Manual Control of Pixels via WebSockets?

**URL:** <https://forum.electromage.com/t/pattern-for-manual-control-of-pixels-via-websockets/1240>\
**Category:** Patterns and Code\
**Created:** [May 14, 2021, 4:49pm UTC](https://forum.electromage.com/t/pattern-for-manual-control-of-pixels-via-websockets/1240 "2021-05-14T16:49:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [May 14, 2021, 6:21pm UTC](https://forum.electromage.com/t/pattern-for-manual-control-of-pixels-via-websockets/1240/2 "2021-05-14T18:21:29Z")

</div>

Hi @xd1936 ,

Unfortunately setVars doesn’t support nested arrays, so you can’t use it to set a 2 dimensional array (array of arrays) in order to structure it like you have in your pattern above.

Check out the work @zranger1 has done for an sACN proxy, which does something similar.

> **[zranger1/pb-sacn-proxy](https://github.com/zranger1/pb-sacn-proxy)**
>
> Enables sending e1.31 (sACN) data to a Pixelblaze LED controller

The idea is to pack the 3 RGB bytes into a single value and use setVars API to fill the array, then use a pattern to [unpack the value](https://github.com/zranger1/pb-sacn-proxy/blob/main/rgb-sacn-listener.js) back into RGB.

With some more [context here](https://forum.electromage.com/t/pixelblaze-client-python-3-library-for-pixelblaze/756/10)

You could also use unpacked RGB values, where you create an array that is `3 * pixelCount` where each pixel is 3 elements apart - similar to how a bitmap might be arranged in a byte array.

---

_[View the full topic](https://forum.electromage.com/t/pattern-for-manual-control-of-pixels-via-websockets/1240)._
