PB specific constant variable?

I have a number of PBs at the moment and keeping them in sync with patterns and maps is becoming more of a challenge.

I have a few different maps, and was wondering if there was a variable I could switch(eer, “if”) over in the Mapper code, to figure out which particular map to use.

Ideal world, there could be some PB specific device variables that I could set at will, which wouldn’t be overwritten by a backup/restore. In which case I’d say “petersMap = iso” or “petersMap = pyramid” and the map code could switch over petersMap as it saw fit to build the various maps.

backup plan would be to switch over the “name” or even the device code (eg: D4E24F) if that’s available…

Of course the better option is to have the ability to save maps, and configure them by name as a device setting. Though I also think a basic level of device variables is also useful.

Thankfully my patterns are chaotic enough that nobody noticed (including me) that my map was significantly off at the last event. Editing maps via phone on site sans internet sure is challenging. :-/

1 Like

Hey Peterd - out of curiosity, when you need a different map, is it because you’re plugging it in to a different set of LEDs? What’s the application? Just curious in order to suggest different solutions.

Hi Jeff,

in short… Multiple PBs, different sets of LEDs. Some LEDs are statically setup, others change for each event. And what at present is a mess of patterns which are not the same across all the PBs.

I’d love to have a “Golden PB” config, which I backup and restore to all of them (sans some internet method of syncing), which would work for the patterns and mapping without trumping the mapping config. Short of not being able to save mapping configs by name, this is the best I can come up with (at wizard’s suggestion actually)

Ultimately I also see the situation where a few PBs are working together for a single scene/setup for FPS and wiring purposes.

Any thoughts?

For some applications it would be nice to have access to device info and maps inside the pattern code, but we don’t.

One thing I have seen done to make map reconfiguration easier is to put multiple sections into the mapper function and switch between them with a single variable:

function (pixelCount) {
    // Select which of the available maps to use.
    whichMap = 0;

    // Build the appropriate map.
    var map = []
    if (whichMap == 0) {
        //  16x16 matrix.
        width = 16
        for (i = 0; i < pixelCount; i++) {
            x = Math.floor(i / width)
            y = i % width
            y = x % 2 == 1 ? width - 1 - y : y //zigzag
            map.push([x, y])
    else if (whichMap == 1) {
        //  7-bit hex ring.
        for (i = 0; i < pixelCount; i++) {
            c = i / pixelCount * Math.PI * 2
            map.push([Math.cos(c), Math.sin(c)])
   // ...and so on...

    return map

…which would allow you to maintain one map file that can be loaded onto all Pixelblazes and easily matched to the particular LED configuration each one is connected to. There’s no avoiding some level of customization when swapping devices because the pixel count (and possibly LED type and color order) need to be set anyway.

And if you need to manage patterns across multiple Pixelblazes, there are a few tools that might help.


@jeff I have a use case for this in my croquet set!

The first is that there are some patterns which I would like to be two-way symmetrical on the semicircular hoops but not symmetrical on the straight vertical end posts. It’s not a huge hassle to do this by hand in my case but if this were a larger project and I wanted to keep my patterns in sync it would get cumbersome quickly.

@pixie I’ll check out those pattern management tools you linked to, thank you!