# Pattern emulator for dev without hardware

**URL:** <https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673>\
**Category:** Show and Tell\
**Created:** [April 20, 2026, 7:55am UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673 "2026-04-20T07:55:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarball](https://forum.electromage.com/user_avatar/forum.electromage.com/tarball/32/3561_2.png) [@tarball](https://forum.electromage.com/u/tarball)\
**Post date:** [April 20, 2026, 7:55am UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673/1 "2026-04-20T07:55:30Z")

</div>

Hi everyone! I’ve been building `pb_emu`, a browser-based Pixelblaze pattern  
emulator. It runs with .js / .epe patterns against pixel maps  
and renders the result live with Three.js. No hardware required.

Repo: [GitHub - tarballz/pixelblaze-pattern-emulator: A browser-based emulator for Pixelblaze patterns. Runs pattern JS against a user-supplied pixel map (2D or 3D) and renders the result live via Three.js. · GitHub](https://github.com/tarballz/pixelblaze-pattern-emulator)

Some of the features:

- Loads patterns from file, paste, URL, a built-in file browser, or  
drag-and-drop.
- Supports 1D, 2D, and 3D maps: Marimapper CSV, Pixelblaze JSON, or a  
mapper function. There’s also a Gen tab to spin up an ad-hoc matrix (e.g.  
16×16) so you can quickly test a 2D pattern.
- Auto-reload on save: point the `Path` tab at a file you’re editing in your  
editor and the preview updates within a second of hitting save. You can  
mount an external patterns directory via PB\_EMU\_EXTERNAL\_PATTERNS in  
.env.local so you don’t have to copy files into the project.
- Exported sliderX/hsvPickerX/rgbPickerX/toggleX/triggerX/inputNumberX  
controls render as live widgets; values persist per-pattern in localStorage.
- HUD: LED inspector (click a pixel to see index / raw / normalized coords /  
RGB), palette strip when setPalette is active, view presets  
(front/top/side/iso), speed slider + single-frame step, screenshot.
- Linter flags hardware-fidelity gotchas at load (e.g. time() in render,  
perlin/atan2/sqrt per frame).

Known fidelity gaps

- Math is Float64, not 16.16 fixed-point — patterns that deliberately  
overflow at ±32768 or exploit 32-bit bitwise fraction bits will diverge.  
Almost every published pattern I’ve tried is unaffected.
- Transform stack (translate/rotate) is tracked but not yet multiplied  
through per-pixel coords.
- Sensor-board globals (frequencyData, accelerometer, light) are  
zero-filled.

Why

Fast iteration loop when you don’t want to flash a board for every tweak or you’re away from your pb, and a way to preview 3D maps (egg-style scans, Marimapper outputs) before  
wiring them to hardware. Happy to hear feature requests, bug reports, or  
pattern compatibility issues.

---

<div class="post-metadata">

**Author:** ![GodmanchesterGoblin](https://forum.electromage.com/letter_avatar_proxy/v4/letter/g/65b543/32.png) [@GodmanchesterGoblin](https://forum.electromage.com/u/GodmanchesterGoblin)\
**Post date:** [April 25, 2026, 5:30pm UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673/2 "2026-04-25T17:30:19Z")

</div>

Hi,

This sounds very interesting and potentially very useful, but to me as mostly a hardware guy, I honestly have no clue how to use any of this. (Sorry!) I even built a couple of test fixtures in the past so I can debug patterns sometimes because, for me, that’s the easy approach.

I had a look at the docs, but was really unable to figure out what I would need to be able to start to use this. Is there some kind of minimal step by step guide? Or should I assume that if I don’t understand it to that extent then it’s perhaps not for me anyway? That’s a perfectly reasonable position, by the way - I don’t want to ask for anything that would be burdensome.

Thanks.

---

<div class="post-metadata">

**Author:** ![tarball](https://forum.electromage.com/user_avatar/forum.electromage.com/tarball/32/3561_2.png) [@tarball](https://forum.electromage.com/u/tarball)\
**Post date:** [April 27, 2026, 9:51pm UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673/3 "2026-04-27T21:51:00Z")

</div>

Hey there, for the simplest setup, just make sure you have `npm` installed. Then, you should just be able to run `npm install` and `npm run dev` to start the web server. Typically, the server should run at `localhost:5173`. Then, you would navigate to that link via a web browser. If you want to load your patterns and mapping into a directory so you can browse around them, you could copy `.env.example` to `.env.local` and fill in the values for `PB_EMU_EXTERNAL_MAPS` and `PB_EMU_EXTERNAL_PATTERNS`.

---

<div class="post-metadata">

**Author:** ![flipcorp](https://forum.electromage.com/user_avatar/forum.electromage.com/flipcorp/32/24_2.png) [@flipcorp](https://forum.electromage.com/u/flipcorp)\
**Post date:** [April 29, 2026, 2:10pm UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673/4 "2026-04-29T14:10:06Z")

</div>

This is fantastic, I’ve been wanting something like this for ages!

Do you think it is possible to render a 3D view of multiple pixelblazes, each with its own map, running the same .epe -that could simulate the leader/follower functionality? I think your example uses a single map for a single pixelblaze.

---

<div class="post-metadata">

**Author:** ![cjn566](https://forum.electromage.com/user_avatar/forum.electromage.com/cjn566/32/3029_2.png) [@cjn566](https://forum.electromage.com/u/cjn566)\
**Post date:** [May 3, 2026, 12:24am UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673/5 "2026-05-03T00:24:02Z")

</div>

Pretty Sweet!

The map is upside down.

 ![image](https://forum.electromage.com/uploads/default/original/2X/1/176b8a0ace644df027569ef590d790c3dbc4866b.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:** [May 3, 2026, 12:38am UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673/6 "2026-05-03T00:38:13Z")

</div>

Pixelblaze kinda mixes this up (intentionally but with unintended consequences).

For 2D it uses computer graphics convention where y starts at zero on the top and grows down. This is common for 2d.

For 3D it switches to y growing upward which is more common for 3d.

So just adding a 3rd dimension flips the preview.

The emulator is probably treating the y axis the same for 2d and 3d.

---

<div class="post-metadata">

**Author:** ![tarball](https://forum.electromage.com/user_avatar/forum.electromage.com/tarball/32/3561_2.png) [@tarball](https://forum.electromage.com/u/tarball)\
**Post date:** [May 31, 2026, 7:01pm UTC](https://forum.electromage.com/t/pattern-emulator-for-dev-without-hardware/4673/7 "2026-05-31T19:01:43Z")

</div>

there’s a swap-yz option that flips the y and z axes. Would that help flip the map?
