# Function Placement for Mapping Pixel Arrays

**URL:** <https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096>\
**Category:** Uncategorized\
**Created:** [March 30, 2022, 11:30pm UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096 "2022-03-30T23:30:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveB](https://forum.electromage.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@DaveB](https://forum.electromage.com/u/DaveB)\
**Post date:** [March 30, 2022, 11:30pm UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/1 "2022-03-30T23:30:17Z")

</div>

I figured out how to map all my 32 LED Strings that I will be using in a new art installation using PixelBlaze.

Question: Where does the pixel render function have to go, before the map or after the map?  
I tried playing with the code in the examples but I can’t seem to get it to work.  
Please see image attached. Any help much tips, hints, or nudges much appreciated.

[Array Example|690x293](https://forum.electromage.com/uploads/short-url/3xyhIQGjo61oAErRz3z97hAYJuv.jpeg)

---

<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:** [March 30, 2022, 11:36pm UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/2 "2022-03-30T23:36:48Z")

</div>

Neither, you won’t mix pattern and mapping code. Each have their own top-level tab and editor. Since you have a json for you map, you won’t need code at all in the map. It can look like this in the editor on the Mapper tab:

```auto
[
[5,1,0],
[5,1,1],
... the rest of your map
]

```

(don’t forget to save!)

Then on the Edit tab, you code patterns. That is where the `export function render3D(index, x, y, z) {}` stuff goes. The x, y, and z will be fed coordinates (in world units) based on your map.

---

<div class="post-metadata">

**Author:** ![DaveB](https://forum.electromage.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@DaveB](https://forum.electromage.com/u/DaveB)\
**Post date:** [March 30, 2022, 11:57pm UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/3 "2022-03-30T23:57:01Z")

</div>

That is smart! Great news to my ears! Question: Will my file save even if I turn off the controller? I’ve seen it where in Mapping after restarting controller and loading pattern it doesn’t save. I could be wrong.

---

<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:** [March 31, 2022, 12:18am UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/4 "2022-03-31T00:18:20Z")

</div>

The map and patterns do NOT save automatically. On the map page the Save button is right below the editor. For patterns, right above. You’ll need to name your pattern and give it 5 seconds to generate a preview before saving.

---

<div class="post-metadata">

**Author:** ![DaveB](https://forum.electromage.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@DaveB](https://forum.electromage.com/u/DaveB)\
**Post date:** [March 31, 2022, 9:07pm UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/5 "2022-03-31T21:07:04Z")

</div>

It does!

I got all the pixels mapped and in the mapping tabs. For some reason the strips of light I can see and I have the brightness tab turned all the way up.

Anyway to make the pixels show up brighter?

---

<div class="post-metadata">

**Author:** ![sorceror](https://forum.electromage.com/user_avatar/forum.electromage.com/sorceror/32/735_2.png) [@sorceror](https://forum.electromage.com/u/sorceror)\
**Post date:** [April 1, 2022, 10:12pm UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/6 "2022-04-01T22:12:01Z")

</div>

If you have the max brightness at 100 on the settings tab and the brightness slider all the way to the right, and your pattern is outputting 1’s, then that’s as bright as your LEDs go.

---

<div class="post-metadata">

**Author:** ![DaveB](https://forum.electromage.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@DaveB](https://forum.electromage.com/u/DaveB)\
**Post date:** [April 4, 2022, 11:52am UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/7 "2022-04-04T11:52:44Z")

</div>

I’m trying to render 21,000 pixels in the mapping program so they are not going to be that bright. That is what I come to guess.

---

<div class="post-metadata">

**Author:** ![sorceror](https://forum.electromage.com/user_avatar/forum.electromage.com/sorceror/32/735_2.png) [@sorceror](https://forum.electromage.com/u/sorceror)\
**Post date:** [April 4, 2022, 12:45pm UTC](https://forum.electromage.com/t/function-placement-for-mapping-pixel-arrays/2096/8 "2022-04-04T12:45:40Z")

</div>

This post mentions some kinda-hidden tunables for the previews:

> [@V3.21 preview](https://forum.electromage.com/t/v3-21-preview/1973/35):
>
> exploding_head OK, how do we get everyone running the Pixel Teleporter browser, because that is clearly the best looking out of the bunch wink I don’t get the same issue, I do get the same preview, here on FF 98.0.1, Chrome 99.0.4844.74, Safari Preview 15.4 (15613.1.16.31.2, 15613): I wonder if the page itself didn’t quite reload after the update? I’ve had that happen if I press the back button from the recovery page. BTW you may be interested t…
