{
  "description": "Nodes to work with WS2812 (NeoPixel). The main difference from the other libraries that this library does not use a buffer to light up the LEDs. So it gives a possibility to light up a really long LED strip with a small microcontroller without a huge amount of RAM.",
  "license": "AGPL-3.0",
  "name": "ws2812",
  "patches": {
    "@/clear": {
      "attachments": [
        {
          "content": "\nstruct State {\n};\n\n{{ GENERATED_CODE }}\n\nvoid evaluate(Context ctx) {\n    auto dev = getValue<input_DEV>(ctx);\n    if (isInputDirty<input_DO>(ctx)) {\n        dev->fill(0, 0, 0);\n        emitValue<output_DONE>(ctx, 1);\n    }\n    emitValue<output_DEVU0027>(ctx, dev);\n}\n",
          "encoding": "utf8",
          "filename": "patch.cpp"
        }
      ],
      "description": "Clears (turns off) of all pixels in the device.",
      "nodes": {
        "By6jbVYCB": {
          "description": "The device",
          "id": "By6jbVYCB",
          "label": "DEV",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "@/input-ws2812-device"
        },
        "Hk46jWVFAS": {
          "description": "Fires when the operation is done\n",
          "id": "Hk46jWVFAS",
          "label": "DONE",
          "position": {
            "x": 2,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-pulse"
        },
        "Symaj-NYCB": {
          "description": "The device",
          "id": "Symaj-NYCB",
          "label": "DEV'",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "@/output-ws2812-device"
        },
        "SyxTsWNFRr": {
          "id": "SyxTsWNFRr",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/not-implemented-in-xod"
        },
        "SyzTjbEKCH": {
          "boundLiterals": {
            "__out__": "Continuously"
          },
          "description": "Trigger to turn all pixels off",
          "id": "SyzTjbEKCH",
          "label": "DO",
          "position": {
            "x": 2,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-pulse"
        }
      },
      "path": "@/clear"
    },
    "@/color-pattern": {
      "attachments": [
        {
          "content": "{{#global}}\n#include <XColorPattern.h>\n{{/global}}\n\nstruct State {\n    Pattern pattern;\n};\nusing Type = Pattern*;\n\n{{ GENERATED_CODE }}\n\nvoid evaluate(Context ctx) {\n    auto state = getState(ctx);\n    emitValue<output_PAT>(ctx, &(state->pattern));\n}\n",
          "encoding": "utf8",
          "filename": "patch.cpp"
        }
      ],
      "description": "Pattern type constructor.",
      "nodes": {
        "BJBsHZ5gI": {
          "id": "BJBsHZ5gI",
          "position": {
            "x": 3,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/utility"
        },
        "HJqn9NzJU": {
          "id": "HJqn9NzJU",
          "label": "PAT",
          "position": {
            "x": 1,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-self"
        },
        "rkbhqEMy8": {
          "id": "rkbhqEMy8",
          "position": {
            "x": 1,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/not-implemented-in-xod"
        }
      },
      "path": "@/color-pattern"
    },
    "@/example-fill-controlled": {
      "comments": {
        "BJMAxa6eI": {
          "content": "This example shows how to control the color of whole LED strip with a potentiometer and turn it on or off with a button.",
          "id": "BJMAxa6eI",
          "position": {
            "x": -1,
            "y": -1,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 13,
            "units": "slots"
          }
        },
        "H1G-8pykU": {
          "content": "A button turns the LEDs on or off.",
          "id": "H1G-8pykU",
          "position": {
            "x": -1,
            "y": 0,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 4,
            "units": "slots"
          }
        },
        "S1CbJaalU": {
          "content": "A quick-start node to fill all LEDs with the selected solid color.",
          "id": "S1CbJaalU",
          "position": {
            "x": -1,
            "y": 3,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 4,
            "units": "slots"
          }
        },
        "SyzoyppgL": {
          "content": "When LEDs is turned off — just fill with the black color.",
          "id": "SyzoyppgL",
          "position": {
            "x": 9,
            "y": 2,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 4,
            "units": "slots"
          }
        },
        "rJ-r1aaeL": {
          "content": "Potentiometer to select the Hue of the color.",
          "id": "rJ-r1aaeL",
          "position": {
            "x": 8,
            "y": 0,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 4,
            "units": "slots"
          }
        }
      },
      "links": {
        "BJ2Vd3aeI": {
          "id": "BJ2Vd3aeI",
          "input": {
            "nodeId": "SyPVu3TgU",
            "pinKey": "S1yZIA_rDJZ"
          },
          "output": {
            "nodeId": "rJ7Pn21kI",
            "pinKey": "HkyxURuSPyW"
          }
        },
        "HkSmZ6pg8": {
          "id": "HkSmZ6pg8",
          "input": {
            "nodeId": "SyPVu3TgU",
            "pinKey": "ryTeUROHD1b"
          },
          "output": {
            "nodeId": "r1NE2hJk8",
            "pinKey": "BJyghZosm"
          }
        },
        "Sk1r_nTl8": {
          "id": "Sk1r_nTl8",
          "input": {
            "nodeId": "SJ3ZO2plL",
            "pinKey": "BJZY_6J1L"
          },
          "output": {
            "nodeId": "SyPVu3TgU",
            "pinKey": "S13xLCuHvkW"
          }
        },
        "r1wV2hk18": {
          "id": "r1wV2hk18",
          "input": {
            "nodeId": "r1NE2hJk8",
            "pinKey": "HJgyhboim"
          },
          "output": {
            "nodeId": "BybEn2kkI",
            "pinKey": "H1sM2A12-"
          }
        },
        "rkBvn2ykI": {
          "id": "rkBvn2ykI",
          "input": {
            "nodeId": "rJ7Pn21kI",
            "pinKey": "ryTIROHwkW"
          },
          "output": {
            "nodeId": "rJrUh31kL",
            "pinKey": "BJ--G1tI-"
          }
        }
      },
      "nodes": {
        "BybEn2kkI": {
          "boundLiterals": {
            "Hkry2AJhW": "A2"
          },
          "id": "BybEn2kkI",
          "position": {
            "x": 6,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/common-hardware/pot"
        },
        "SJ3ZO2plL": {
          "boundLiterals": {
            "rJ2uOpk1L": "16",
            "ryD_dp118": "A4"
          },
          "id": "SJ3ZO2plL",
          "position": {
            "x": 3,
            "y": 3,
            "units": "slots"
          },
          "type": "@/ws2812-mono"
        },
        "SyPVu3TgU": {
          "boundLiterals": {
            "r1AgIROHDJW": "#000000",
            "ryTeUROHD1b": "#000000"
          },
          "id": "SyPVu3TgU",
          "position": {
            "x": 5,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/core/if-else"
        },
        "r1NE2hJk8": {
          "boundLiterals": {
            "Symyhboj7": "1",
            "r1g7J3-ii7": "0.05"
          },
          "id": "r1NE2hJk8",
          "position": {
            "x": 6,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/color/color-hsl"
        },
        "rJ7Pn21kI": {
          "boundLiterals": {
            "HkyxURuSPyW": "True"
          },
          "id": "rJ7Pn21kI",
          "position": {
            "x": 2,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/core/flip-flop"
        },
        "rJrUh31kL": {
          "boundLiterals": {
            "ByNiWkt8Z": "A3"
          },
          "id": "rJrUh31kL",
          "position": {
            "x": 3,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/common-hardware/button"
        }
      },
      "path": "@/example-fill-controlled"
    },
    "@/example-fill-part": {
      "comments": {
        "SJe1xTTeI": {
          "content": "This example shows how to clear the whole LED strip and then fill with the red color only last four LEDs.",
          "id": "SJe1xTTeI",
          "position": {
            "x": 0,
            "y": -1,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 10,
            "units": "slots"
          }
        },
        "SJeBeTpl8": {
          "content": "<- Clear all LEDs.",
          "id": "SJeBeTpl8",
          "position": {
            "x": 5,
            "y": 1,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 5,
            "units": "slots"
          }
        },
        "SkUHe66gL": {
          "content": "<- Fill only last 4 LEDs.",
          "id": "SkUHe66gL",
          "position": {
            "x": 5,
            "y": 2,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 5,
            "units": "slots"
          }
        },
        "rkXNe66l8": {
          "content": "<- Setup the device.",
          "id": "rkXNe66l8",
          "position": {
            "x": 5,
            "y": 0,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 5,
            "units": "slots"
          }
        }
      },
      "links": {
        "Hy7HJmgceI": {
          "id": "Hy7HJmgceI",
          "input": {
            "nodeId": "rJ-Hymxqx8",
            "pinKey": "B1387L5RS"
          },
          "output": {
            "nodeId": "ByxryXe9e8",
            "pinKey": "Symaj-NYCB"
          }
        },
        "SyGrJQgqgL": {
          "id": "SyGrJQgqgL",
          "input": {
            "nodeId": "ByxryXe9e8",
            "pinKey": "By6jbVYCB"
          },
          "output": {
            "nodeId": "S1BkQl5e8",
            "pinKey": "SJxz8XtRS"
          }
        },
        "r1spDhTeU": {
          "id": "r1spDhTeU",
          "input": {
            "nodeId": "rJ-Hymxqx8",
            "pinKey": "rJWh8XIqAB"
          },
          "output": {
            "nodeId": "ByxryXe9e8",
            "pinKey": "Hk46jWVFAS"
          }
        }
      },
      "nodes": {
        "ByxryXe9e8": {
          "boundLiterals": {
            "SyzTjbEKCH": "On Boot"
          },
          "id": "ByxryXe9e8",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          },
          "type": "@/clear"
        },
        "S1BkQl5e8": {
          "boundLiterals": {
            "HyI-5XSAr": "A4",
            "S1C-cQBRB": "16"
          },
          "id": "S1BkQl5e8",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "@/ws2812-device"
        },
        "rJ-Hymxqx8": {
          "boundLiterals": {
            "SJxhUmIcCr": "#FF0000",
            "SkcHZece8": "-4"
          },
          "id": "rJ-Hymxqx8",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "@/fill-solid"
        }
      },
      "path": "@/example-fill-part"
    },
    "@/example-pattern-crawling": {
      "comments": {
        "HJhS-p6lI": {
          "content": "A crawling red dots example.",
          "id": "HJhS-p6lI",
          "position": {
            "x": -1,
            "y": -1,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 5,
            "units": "slots"
          }
        },
        "r1yLKRplL": {
          "content": "Increment a shift value and fill the LEDs each 200 milliseconds.",
          "id": "r1yLKRplL",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 4,
            "units": "slots"
          }
        }
      },
      "links": {
        "BynhtFDkU": {
          "id": "BynhtFDkU",
          "input": {
            "nodeId": "rkc3KFvyI",
            "pinKey": "HJAq-A_8-"
          },
          "output": {
            "nodeId": "Bke2KtwyI",
            "pinKey": "HJU8CE2lW"
          }
        },
        "H1BKla6lI": {
          "id": "H1BKla6lI",
          "input": {
            "nodeId": "Hkb3YRPGJL",
            "pinKey": "r1WVLv-9lL"
          },
          "output": {
            "nodeId": "SyzFlpplI",
            "pinKey": "__out__"
          }
        },
        "H1P69-5xU": {
          "id": "H1P69-5xU",
          "input": {
            "nodeId": "Hkb3YRPGJL",
            "pinKey": "Sy1uD-qx8"
          },
          "output": {
            "nodeId": "HyQQZuMJI",
            "pinKey": "HyxZiEGyL"
          }
        },
        "HJIYlT6gI": {
          "id": "HJIYlT6gI",
          "input": {
            "nodeId": "SyzFlpplI",
            "pinKey": "__in__"
          },
          "output": {
            "nodeId": "Bke2KtwyI",
            "pinKey": "HJU8CE2lW"
          }
        },
        "S176qZ9gU": {
          "id": "S176qZ9gU",
          "input": {
            "nodeId": "Hkb3YRPGJL",
            "pinKey": "Sk7EUvWceI"
          },
          "output": {
            "nodeId": "rkc3KFvyI",
            "pinKey": "r1yhZRd8W"
          }
        },
        "r1jCcW5eU": {
          "id": "r1jCcW5eU",
          "input": {
            "nodeId": "Hkb3YRPGJL",
            "pinKey": "H1xmDPZcxU"
          },
          "output": {
            "nodeId": "HyqAcb9gI",
            "pinKey": "SJxz8XtRS"
          }
        }
      },
      "nodes": {
        "Bke2KtwyI": {
          "boundLiterals": {
            "B13SCNhl-": "0.2"
          },
          "id": "Bke2KtwyI",
          "position": {
            "x": 4,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/core/clock"
        },
        "Hkb3YRPGJL": {
          "boundLiterals": {
            "HkGg2NGyL": "On Boot"
          },
          "id": "Hkb3YRPGJL",
          "position": {
            "x": -2,
            "y": 3,
            "units": "slots"
          },
          "type": "@/fill-pattern"
        },
        "HyQQZuMJI": {
          "arityLevel": 4,
          "boundLiterals": {
            "ByH-jEMk8": "#550000",
            "ByH-jEMk8-$1": "#150000",
            "ByH-jEMk8-$2": "#000000",
            "ByH-jEMk8-$3": "#000000",
            "ByH-jEMk8-$4": "#000000",
            "ByH-jEMk8-$5": "#000000",
            "ByH-jEMk8-$6": "#000000",
            "ByH-jEMk8-$7": "#000000",
            "ByH-jEMk8-$8": "#000000"
          },
          "id": "HyQQZuMJI",
          "position": {
            "x": -1,
            "y": 0,
            "units": "slots"
          },
          "type": "@/pattern"
        },
        "HyqAcb9gI": {
          "boundLiterals": {
            "HyI-5XSAr": "A4",
            "S1C-cQBRB": "16"
          },
          "id": "HyqAcb9gI",
          "position": {
            "x": -3,
            "y": 2,
            "units": "slots"
          },
          "type": "@/ws2812-device"
        },
        "SyzFlpplI": {
          "id": "SyzFlpplI",
          "position": {
            "x": 4,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/patch-nodes/jumper"
        },
        "rkc3KFvyI": {
          "id": "rkc3KFvyI",
          "position": {
            "x": 1,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/core/count"
        }
      },
      "path": "@/example-pattern-crawling"
    },
    "@/example-pattern-police": {
      "comments": {
        "BkgW2C6l8": {
          "content": "<- Convert values between 0...1 into values 0...3. The range of 0...3 corresponds to first...last position of the RED color in the pattern.\n\n<- Get an integer.",
          "id": "BkgW2C6l8",
          "position": {
            "x": 6,
            "y": 6,
            "units": "slots"
          },
          "size": {
            "height": 2,
            "width": 5,
            "units": "slots"
          }
        },
        "SkPGiCalL": {
          "content": "A police flashing light example.",
          "id": "SkPGiCalL",
          "position": {
            "x": -2,
            "y": 3,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 13,
            "units": "slots"
          }
        },
        "SkwAhRpeU": {
          "content": "<- Fill the LED strip.",
          "id": "SkwAhRpeU",
          "position": {
            "x": 6,
            "y": 8,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 5,
            "units": "slots"
          }
        },
        "rJPci06e8": {
          "content": "<- Pattern with colors: RED, BLUE, BLUE, BLUE",
          "id": "rJPci06e8",
          "position": {
            "x": 6,
            "y": 4,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 5,
            "units": "slots"
          }
        },
        "rkf2j0pgI": {
          "content": "<- The sine-wave generator is a shift value for the pattern.",
          "id": "rkf2j0pgI",
          "position": {
            "x": 6,
            "y": 5,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 5,
            "units": "slots"
          }
        }
      },
      "links": {
        "SyVnkyRxU": {
          "id": "SyVnkyRxU",
          "input": {
            "nodeId": "B1ynkJCgI",
            "pinKey": "Sky6-pTeU"
          },
          "output": {
            "nodeId": "SJZPh4z1L",
            "pinKey": "HyxZiEGyL"
          }
        },
        "rJmwqk9g8": {
          "id": "rJmwqk9g8",
          "input": {
            "nodeId": "HkMwqJcgU",
            "pinKey": "BJlzICOSv1-"
          },
          "output": {
            "nodeId": "rJ3L9JclL",
            "pinKey": "BJB_WYnYyM"
          }
        },
        "ryMzi19xI": {
          "id": "ryMzi19xI",
          "input": {
            "nodeId": "rkR-jk9eI",
            "pinKey": "BkF78AurDJW"
          },
          "output": {
            "nodeId": "HkMwqJcgU",
            "pinKey": "H12bIR_SPyZ"
          }
        },
        "rywnykRg8": {
          "id": "rywnykRg8",
          "input": {
            "nodeId": "B1ynkJCgI",
            "pinKey": "rJHdTRTeU"
          },
          "output": {
            "nodeId": "rkR-jk9eI",
            "pinKey": "rkO7L0uSP1Z"
          }
        }
      },
      "nodes": {
        "B1ynkJCgI": {
          "boundLiterals": {
            "Byd2jbapxU": "A4",
            "HymhoWTal8": "16"
          },
          "id": "B1ynkJCgI",
          "position": {
            "x": -2,
            "y": 8,
            "units": "slots"
          },
          "type": "@/ws2812-pattern"
        },
        "HkMwqJcgU": {
          "boundLiterals": {
            "HJCWLAdSwyW": "1",
            "rkpbU0OrwyZ": "3"
          },
          "id": "HkMwqJcgU",
          "position": {
            "x": 1,
            "y": 6,
            "units": "slots"
          },
          "type": "xod/math/map"
        },
        "SJZPh4z1L": {
          "arityLevel": 4,
          "boundLiterals": {
            "ByH-jEMk8": "#0000FF",
            "ByH-jEMk8-$1": "#0000FF",
            "ByH-jEMk8-$2": "#0000FF",
            "ByH-jEMk8-$3": "#FF0000"
          },
          "id": "SJZPh4z1L",
          "position": {
            "x": 0,
            "y": 4,
            "units": "slots"
          },
          "type": "@/pattern"
        },
        "rJ3L9JclL": {
          "boundLiterals": {
            "HyMdZFnYkf": "0.5"
          },
          "id": "rJ3L9JclL",
          "position": {
            "x": 1,
            "y": 5,
            "units": "slots"
          },
          "type": "xod/core/sine-wave"
        },
        "rkR-jk9eI": {
          "id": "rkR-jk9eI",
          "position": {
            "x": 1,
            "y": 7,
            "units": "slots"
          },
          "type": "xod/math/round"
        }
      },
      "path": "@/example-pattern-police"
    },
    "@/fill-pattern": {
      "attachments": [
        {
          "content": "{{#global}}\n#include <XColorPattern.h>\n{{/global}}\n\nstruct State {\n};\n\n{{ GENERATED_CODE }}\n\nvoid evaluate(Context ctx) {\n    auto dev = getValue<input_DEV>(ctx);\n\n    if (isInputDirty<input_DO>(ctx)) {\n        auto pat = getValue<input_PAT>(ctx);\n        uint32_t shift = (uint32_t)getValue<input_SHFT>(ctx);\n        dev->fillPattern(pat, shift);\n    }\n\n    emitValue<output_DEVU0027>(ctx, dev);\n}\n",
          "encoding": "utf8",
          "filename": "patch.cpp"
        }
      ],
      "description": "Fills the device LEDs with a repeative color pattern.",
      "nodes": {
        "H1xmDPZcxU": {
          "description": "The device",
          "id": "H1xmDPZcxU",
          "label": "DEV",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "@/input-ws2812-device"
        },
        "HkGEUDbqgI": {
          "id": "HkGEUDbqgI",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/not-implemented-in-xod"
        },
        "HyQPv-5xI": {
          "description": "The device",
          "id": "HyQPv-5xI",
          "label": "DEV'",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "@/output-ws2812-device"
        },
        "Sk7EUvWceI": {
          "description": "The number of pixels to shift/wrap in the pattern. It should be an integer. If it is negative or greater than the pattern length the shift is wrapped over. Use shift to create a crawler animation.",
          "id": "Sk7EUvWceI",
          "label": "SHFT",
          "position": {
            "x": 4,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-number"
        },
        "Sy1uD-qx8": {
          "description": "The color pattern. If the pattern is shorter than the number of LEDs it repeats.",
          "id": "Sy1uD-qx8",
          "label": "PAT",
          "position": {
            "x": 2,
            "y": 0,
            "units": "slots"
          },
          "type": "@/input-color-pattern"
        },
        "r1WVLv-9lL": {
          "boundLiterals": {
            "__out__": "Continuously"
          },
          "description": "Trigger to fill pixels of the device with the pattern",
          "id": "r1WVLv-9lL",
          "label": "DO",
          "position": {
            "x": 6,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-pulse"
        },
        "rklN8DZ9eL": {
          "description": "Fires when the fill is done",
          "id": "rklN8DZ9eL",
          "label": "DONE",
          "position": {
            "x": 2,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-pulse"
        }
      },
      "path": "@/fill-pattern"
    },
    "@/fill-solid": {
      "attachments": [
        {
          "content": "\nstruct State {\n};\n\n{{ GENERATED_CODE }}\n\nvoid evaluate(Context ctx) {\n    auto dev = getValue<input_DEV>(ctx);\n    if (isInputDirty<input_DO>(ctx)) {\n        auto color = getValue<input_C>(ctx);\n        auto num = getValue<input_NUM>(ctx);\n        if (isinf(num)) {\n            // Fill all the LEDs\n            dev->fill(color);\n        } else {\n            // Fill only specified number of LEDs\n            bool fromTail = num < 0;\n            uint32_t pixelsCount = (uint32_t) abs(num);\n            dev->fill(color, pixelsCount, fromTail);\n        }\n\n        emitValue<output_DONE>(ctx, 1);\n    }\n    emitValue<output_DEVU0027>(ctx, dev);\n}\n",
          "encoding": "utf8",
          "filename": "patch.cpp"
        }
      ],
      "description": "Sets the color of pixels in the device to the same value.",
      "nodes": {
        "B1387L5RS": {
          "description": "The device",
          "id": "B1387L5RS",
          "label": "DEV",
          "position": {
            "x": 1,
            "y": 0,
            "units": "slots"
          },
          "type": "@/input-ws2812-device"
        },
        "B1Qn8XUqCH": {
          "description": "Fires when the fill is done",
          "id": "B1Qn8XUqCH",
          "label": "DONE",
          "position": {
            "x": 3,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-pulse"
        },
        "SJxhUmIcCr": {
          "description": "The color",
          "id": "SJxhUmIcCr",
          "label": "C",
          "position": {
            "x": 3,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/color/input-color"
        },
        "SkcHZece8": {
          "boundLiterals": {
            "__out__": "Inf"
          },
          "description": "Number of LEDs to fill up with the solid color. Set `Inf` to fill all LEDs. Set to a negative value to fill from the tail.",
          "id": "SkcHZece8",
          "label": "NUM",
          "position": {
            "x": 5,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-number"
        },
        "SkplWUcRH": {
          "id": "SkplWUcRH",
          "position": {
            "x": 1,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/not-implemented-in-xod"
        },
        "r1znU7I9Ar": {
          "description": "The device",
          "id": "r1znU7I9Ar",
          "label": "DEV'",
          "position": {
            "x": 1,
            "y": 2,
            "units": "slots"
          },
          "type": "@/output-ws2812-device"
        },
        "rJWh8XIqAB": {
          "boundLiterals": {
            "__out__": "Continuously"
          },
          "description": "Trigger to fill pixels of the device",
          "id": "rJWh8XIqAB",
          "label": "DO",
          "position": {
            "x": 7,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-pulse"
        }
      },
      "path": "@/fill-solid"
    },
    "@/pattern": {
      "attachments": [
        {
          "content": "{{#global}}\n#include <XColorPattern.h>\n{{/global}}\n\nstruct State {\n  PatternNode node;\n};\n\n{{ GENERATED_CODE }}\n\nvoid evaluate(Context ctx) {\n    auto pattern = getValue<input_PAT>(ctx);\n    auto color = getValue<input_C>(ctx);\n    auto state = getState(ctx);\n\n    if (isInputDirty<input_C>(ctx)) {\n        state->node.setColor(color);\n    }\n    if (isSettingUp()) {\n        pattern->add(&state->node);\n    }\n\n    emitValue<output_PATU0027>(ctx, pattern);\n}\n",
          "encoding": "utf8",
          "filename": "patch.cpp"
        }
      ],
      "description": "Adds new colors to the tail of a given pattern.",
      "nodes": {
        "ByH-jEMk8": {
          "description": "The color to add.",
          "id": "ByH-jEMk8",
          "label": "C",
          "position": {
            "x": 2,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/color/input-color"
        },
        "HyRWoEMkL": {
          "id": "HyRWoEMkL",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/not-implemented-in-xod"
        },
        "HyxZiEGyL": {
          "description": "The resulting pattern.",
          "id": "HyxZiEGyL",
          "label": "PAT'",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "@/output-color-pattern"
        },
        "S19bjEzkL": {
          "id": "S19bjEzkL",
          "position": {
            "x": 4,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/variadic-1"
        },
        "SJhxjVMJI": {
          "description": "The pattern to extend. Leave empty to create a new pattern.",
          "id": "SJhxjVMJI",
          "label": "PAT",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "@/input-color-pattern"
        }
      },
      "path": "@/pattern"
    },
    "@/pulse-on-change(color-pattern)": {
      "attachments": [
        {
          "content": "\nstruct State {\n};\n\n{{ GENERATED_CODE }}\n\nvoid evaluate(Context ctx) {\n    // Storing all colors of \"previous\" pattern\n    // to compare with the \"next\" one is uneffective\n    // by the RAM. So it expects that the same pattern\n    // will not be sent at all.\n\n    if (isInputDirty<input_IN>(ctx))\n        emitValue<output_OUT>(ctx, 1);\n}\n",
          "encoding": "utf8",
          "filename": "patch.cpp"
        }
      ],
      "nodes": {
        "BJoGWJAxU": {
          "id": "BJoGWJAxU",
          "position": {
            "x": 1,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/utility"
        },
        "HyrhpC6lU": {
          "id": "HyrhpC6lU",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "@/input-color-pattern"
        },
        "SJcnT06l8": {
          "id": "SJcnT06l8",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-pulse"
        },
        "SyAnaAagI": {
          "id": "SyAnaAagI",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/not-implemented-in-xod"
        }
      },
      "path": "@/pulse-on-change(color-pattern)"
    },
    "@/ws2812-device": {
      "attachments": [
        {
          "content": "{{#global}}\n#include <WS2812.h>\n{{/global}}\n\nstruct State {\n    uint8_t mem[sizeof(WS2812)];\n};\n\nusing Type = WS2812*;\n\n{{ GENERATED_CODE }}\n\nvoid evaluate(Context ctx) {\n    State* state = getState(ctx);\n    auto port = getValue<input_PORT>(ctx);\n    uint32_t w = (uint32_t)getValue<input_W>(ctx);\n    Type t = new (state->mem) WS2812(port, w);\n    emitValue<output_DEV>(ctx, t);\n}\n",
          "encoding": "utf8",
          "filename": "patch.cpp"
        }
      ],
      "description": "Represents a chained sequence of WS2812 pixels.",
      "nodes": {
        "B1SEcQS0r": {
          "id": "B1SEcQS0r",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/patch-nodes/not-implemented-in-xod"
        },
        "HyI-5XSAr": {
          "description": "The board port DI is connected to",
          "id": "HyI-5XSAr",
          "label": "PORT",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-port"
        },
        "S1C-cQBRB": {
          "boundLiterals": {
            "__out__": "8"
          },
          "description": "Number of LEDs in the strip",
          "id": "S1C-cQBRB",
          "label": "W",
          "position": {
            "x": 2,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-number"
        },
        "SJxz8XtRS": {
          "description": "The device",
          "id": "SJxz8XtRS",
          "label": "DEV",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-self"
        }
      },
      "path": "@/ws2812-device"
    },
    "@/ws2812-mono": {
      "comments": {
        "Bk-MERVw-L": {
          "content": "<-- Throttle a color to avoid excessive refills, which causes skipping interrupts and other calculations.",
          "id": "Bk-MERVw-L",
          "position": {
            "x": 10,
            "y": 1,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 7,
            "units": "slots"
          }
        }
      },
      "description": "A quickstart node to control a LED strip which is always filled with a single color",
      "links": {
        "B1dkY6Jy8": {
          "id": "B1dkY6Jy8",
          "input": {
            "nodeId": "ByVkFakyL",
            "pinKey": "HyI-5XSAr"
          },
          "output": {
            "nodeId": "ryD_dp118",
            "pinKey": "__out__"
          }
        },
        "Bk0N0EPZU": {
          "id": "Bk0N0EPZU",
          "input": {
            "nodeId": "SkxM4CNDZI",
            "pinKey": "rkzZUUHLB"
          },
          "output": {
            "nodeId": "BJZY_6J1L",
            "pinKey": "__out__"
          }
        },
        "BkA2vxZ1L": {
          "id": "BkA2vxZ1L",
          "input": {
            "nodeId": "ByK2veb18",
            "pinKey": "H13R3IvGB"
          },
          "output": {
            "nodeId": "H1wKu611L",
            "pinKey": "__out__"
          }
        },
        "H1Z6Pl-JL": {
          "id": "H1Z6Pl-JL",
          "input": {
            "nodeId": "rJVqwxWkL",
            "pinKey": "ryv7IRdSP1b"
          },
          "output": {
            "nodeId": "rkijPgZk8",
            "pinKey": "H1fx68wzB"
          }
        },
        "H1z6wx-1L": {
          "id": "H1z6wx-1L",
          "input": {
            "nodeId": "rJVqwxWkL",
            "pinKey": "ByU7LRuSPkW"
          },
          "output": {
            "nodeId": "ByK2veb18",
            "pinKey": "H1fx68wzB"
          }
        },
        "HkkeYT1JI": {
          "id": "HkkeYT1JI",
          "input": {
            "nodeId": "rJlVJtpkyU",
            "pinKey": "B1387L5RS"
          },
          "output": {
            "nodeId": "ByVkFakyL",
            "pinKey": "SJxz8XtRS"
          }
        },
        "HklHAVPWU": {
          "id": "HklHAVPWU",
          "input": {
            "nodeId": "rJlVJtpkyU",
            "pinKey": "SJxhUmIcCr"
          },
          "output": {
            "nodeId": "SkxM4CNDZI",
            "pinKey": "H1H-LLHUr"
          }
        },
        "Hylawebk8": {
          "id": "Hylawebk8",
          "input": {
            "nodeId": "rkijPgZk8",
            "pinKey": "BytC28DfH"
          },
          "output": {
            "nodeId": "rJ2uOpk1L",
            "pinKey": "__out__"
          }
        },
        "SkfeKpky8": {
          "id": "SkfeKpky8",
          "input": {
            "nodeId": "rJAY_pJJ8",
            "pinKey": "__in__"
          },
          "output": {
            "nodeId": "rJlVJtpkyU",
            "pinKey": "B1Qn8XUqCH"
          }
        },
        "Sknhvg-k8": {
          "id": "Sknhvg-k8",
          "input": {
            "nodeId": "rkijPgZk8",
            "pinKey": "H13R3IvGB"
          },
          "output": {
            "nodeId": "H1wKu611L",
            "pinKey": "__out__"
          }
        },
        "rJmpvl-kU": {
          "id": "rJmpvl-kU",
          "input": {
            "nodeId": "rJlVJtpkyU",
            "pinKey": "rJWh8XIqAB"
          },
          "output": {
            "nodeId": "rJVqwxWkL",
            "pinKey": "ByHmL0uHPk-"
          }
        },
        "rkZSCEvZ8": {
          "id": "rkZSCEvZ8",
          "input": {
            "nodeId": "ByK2veb18",
            "pinKey": "BytC28DfH"
          },
          "output": {
            "nodeId": "SkxM4CNDZI",
            "pinKey": "H1H-LLHUr"
          }
        },
        "rkwyt6kkL": {
          "id": "rkwyt6kkL",
          "input": {
            "nodeId": "ByVkFakyL",
            "pinKey": "S1C-cQBRB"
          },
          "output": {
            "nodeId": "rJ2uOpk1L",
            "pinKey": "__out__"
          }
        }
      },
      "nodes": {
        "BJZY_6J1L": {
          "description": "Color value",
          "id": "BJZY_6J1L",
          "label": "C",
          "position": {
            "x": 2,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/color/input-color"
        },
        "ByK2veb18": {
          "id": "ByK2veb18",
          "position": {
            "x": 6,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/core/act"
        },
        "ByVkFakyL": {
          "boundLiterals": {
            "HyI-5XSAr": "A4",
            "S1C-cQBRB": "16"
          },
          "id": "ByVkFakyL",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "@/ws2812-device"
        },
        "H1wKu611L": {
          "boundLiterals": {
            "__out__": "True"
          },
          "description": "When set to True the LEDs follow changes of `C` as they happen",
          "id": "H1wKu611L",
          "label": "ACT",
          "position": {
            "x": 5,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-boolean"
        },
        "SkxM4CNDZI": {
          "boundLiterals": {
            "ByYWULHUr": "0.05"
          },
          "id": "SkxM4CNDZI",
          "position": {
            "x": 2,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/core/throttle"
        },
        "rJ2uOpk1L": {
          "boundLiterals": {
            "__out__": "1"
          },
          "description": "Number of LEDs in the strip",
          "id": "rJ2uOpk1L",
          "label": "W",
          "position": {
            "x": 1,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-number"
        },
        "rJAY_pJJ8": {
          "description": "Fires when an update operation is done",
          "id": "rJAY_pJJ8",
          "label": "OK",
          "position": {
            "x": 2,
            "y": 5,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-pulse"
        },
        "rJVqwxWkL": {
          "id": "rJVqwxWkL",
          "position": {
            "x": 4,
            "y": 3,
            "units": "slots"
          },
          "type": "xod/core/any"
        },
        "rJlVJtpkyU": {
          "boundLiterals": {
            "SkcHZece8": "Inf"
          },
          "id": "rJlVJtpkyU",
          "position": {
            "x": 1,
            "y": 4,
            "units": "slots"
          },
          "type": "@/fill-solid"
        },
        "rkijPgZk8": {
          "id": "rkijPgZk8",
          "position": {
            "x": 4,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/core/act"
        },
        "ryD_dp118": {
          "description": "The board port `DI` is connected to",
          "id": "ryD_dp118",
          "label": "PORT",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-port"
        }
      },
      "path": "@/ws2812-mono"
    },
    "@/ws2812-pattern": {
      "comments": {
        "HJ_36EvWU": {
          "content": "<-- Throttle a pattern to avoid excessive refills, which causes skipping interrupts and other calculations.",
          "id": "HJ_36EvWU",
          "position": {
            "x": 10,
            "y": 1,
            "units": "slots"
          },
          "size": {
            "height": 1,
            "width": 7,
            "units": "slots"
          }
        }
      },
      "links": {
        "B132iW6Tg8": {
          "id": "B132iW6Tg8",
          "input": {
            "nodeId": "rkB3iWT6g8",
            "pinKey": "ByU7LRuSPkW"
          },
          "output": {
            "nodeId": "Byg2sbpTlU",
            "pinKey": "H1fx68wzB"
          }
        },
        "B15oa4PZI": {
          "id": "B15oa4PZI",
          "input": {
            "nodeId": "rybsTEP-I",
            "pinKey": "rkzZUUHLB"
          },
          "output": {
            "nodeId": "Sky6-pTeU",
            "pinKey": "__out__"
          }
        },
        "BkAO6Rpe8": {
          "id": "BkAO6Rpe8",
          "input": {
            "nodeId": "rko_aRag8",
            "pinKey": "H13R3IvGB"
          },
          "output": {
            "nodeId": "S1M2jZTaxI",
            "pinKey": "__out__"
          }
        },
        "ByJha4wZ8": {
          "id": "ByJha4wZ8",
          "input": {
            "nodeId": "Byg2sbpTlU",
            "pinKey": "BytC28DfH"
          },
          "output": {
            "nodeId": "rybsTEP-I",
            "pinKey": "H1H-LLHUr"
          }
        },
        "H1tDpA6gI": {
          "id": "H1tDpA6gI",
          "input": {
            "nodeId": "Hyznb6axU",
            "pinKey": "r1WVLv-9lL"
          },
          "output": {
            "nodeId": "rkB3iWT6g8",
            "pinKey": "ByHmL0uHPk-"
          }
        },
        "HyvgGpTgU": {
          "id": "HyvgGpTgU",
          "input": {
            "nodeId": "B14hiWTalI",
            "pinKey": "__in__"
          },
          "output": {
            "nodeId": "Hyznb6axU",
            "pinKey": "rklN8DZ9eL"
          }
        },
        "SJKnoZTTxI": {
          "id": "SJKnoZTTxI",
          "input": {
            "nodeId": "By-hjWp6gU",
            "pinKey": "HyI-5XSAr"
          },
          "output": {
            "nodeId": "Byd2jbapxU",
            "pinKey": "__out__"
          }
        },
        "SJcnsbaTl8": {
          "id": "SJcnsbaTl8",
          "input": {
            "nodeId": "Byg2sbpTlU",
            "pinKey": "H13R3IvGB"
          },
          "output": {
            "nodeId": "S1M2jZTaxI",
            "pinKey": "__out__"
          }
        },
        "SJinob6aeU": {
          "id": "SJinob6aeU",
          "input": {
            "nodeId": "rkB3iWT6g8",
            "pinKey": "ryv7IRdSP1b"
          },
          "output": {
            "nodeId": "HkP3jb6aeI",
            "pinKey": "H1fx68wzB"
          }
        },
        "Sk6iTEwb8": {
          "id": "Sk6iTEwb8",
          "input": {
            "nodeId": "Hyznb6axU",
            "pinKey": "Sy1uD-qx8"
          },
          "output": {
            "nodeId": "rybsTEP-I",
            "pinKey": "H1H-LLHUr"
          }
        },
        "r1C3j-palL": {
          "id": "r1C3j-palL",
          "input": {
            "nodeId": "HkP3jb6aeI",
            "pinKey": "BytC28DfH"
          },
          "output": {
            "nodeId": "HymhoWTal8",
            "pinKey": "__out__"
          }
        },
        "r1bxhiWp6xI": {
          "id": "r1bxhiWp6xI",
          "input": {
            "nodeId": "HkP3jb6aeI",
            "pinKey": "H13R3IvGB"
          },
          "output": {
            "nodeId": "S1M2jZTaxI",
            "pinKey": "__out__"
          }
        },
        "rJNh-pae8": {
          "id": "rJNh-pae8",
          "input": {
            "nodeId": "Hyznb6axU",
            "pinKey": "H1xmDPZcxU"
          },
          "output": {
            "nodeId": "By-hjWp6gU",
            "pinKey": "SJxz8XtRS"
          }
        },
        "rJVg3jbpagL": {
          "id": "rJVg3jbpagL",
          "input": {
            "nodeId": "By-hjWp6gU",
            "pinKey": "S1C-cQBRB"
          },
          "output": {
            "nodeId": "HymhoWTal8",
            "pinKey": "__out__"
          }
        },
        "rkuO6CpgU": {
          "id": "rkuO6CpgU",
          "input": {
            "nodeId": "Hyznb6axU",
            "pinKey": "Sk7EUvWceI"
          },
          "output": {
            "nodeId": "rJHdTRTeU",
            "pinKey": "__out__"
          }
        },
        "ryMK6AaxI": {
          "id": "ryMK6AaxI",
          "input": {
            "nodeId": "rko_aRag8",
            "pinKey": "BytC28DfH"
          },
          "output": {
            "nodeId": "rJHdTRTeU",
            "pinKey": "__out__"
          }
        },
        "ryyqT0agL": {
          "id": "ryyqT0agL",
          "input": {
            "nodeId": "rkB3iWT6g8",
            "pinKey": "ByU7LRuSPkW-$1"
          },
          "output": {
            "nodeId": "rko_aRag8",
            "pinKey": "H1fx68wzB"
          }
        }
      },
      "nodes": {
        "B14hiWTalI": {
          "description": "Fires when an update operation is done",
          "id": "B14hiWTalI",
          "label": "OK",
          "position": {
            "x": 2,
            "y": 5,
            "units": "slots"
          },
          "type": "xod/patch-nodes/output-pulse"
        },
        "By-hjWp6gU": {
          "boundLiterals": {
            "HyI-5XSAr": "A4",
            "S1C-cQBRB": "16"
          },
          "id": "By-hjWp6gU",
          "position": {
            "x": 0,
            "y": 2,
            "units": "slots"
          },
          "type": "@/ws2812-device"
        },
        "Byd2jbapxU": {
          "description": "The board port `DI` is connected to",
          "id": "Byd2jbapxU",
          "label": "PORT",
          "position": {
            "x": 0,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-port"
        },
        "Byg2sbpTlU": {
          "id": "Byg2sbpTlU",
          "position": {
            "x": 6,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/core/act"
        },
        "HkP3jb6aeI": {
          "id": "HkP3jb6aeI",
          "position": {
            "x": 4,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/core/act"
        },
        "HymhoWTal8": {
          "boundLiterals": {
            "__out__": "1"
          },
          "description": "Number of LEDs in the strip",
          "id": "HymhoWTal8",
          "label": "W",
          "position": {
            "x": 1,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-number"
        },
        "Hyznb6axU": {
          "id": "Hyznb6axU",
          "position": {
            "x": 1,
            "y": 4,
            "units": "slots"
          },
          "type": "@/fill-pattern"
        },
        "S1M2jZTaxI": {
          "boundLiterals": {
            "__out__": "True"
          },
          "description": "When set to True the LEDs follow changes of `C` as they happen",
          "id": "S1M2jZTaxI",
          "label": "ACT",
          "position": {
            "x": 7,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-boolean"
        },
        "Sky6-pTeU": {
          "id": "Sky6-pTeU",
          "label": "PAT",
          "position": {
            "x": 2,
            "y": 0,
            "units": "slots"
          },
          "type": "@/input-color-pattern"
        },
        "rJHdTRTeU": {
          "description": "The number of pixels to shift/wrap in the pattern. It should be an integer. If it is negative or greater than the pattern length the shift is wrapped over. Use shift to create a crawler animation.",
          "id": "rJHdTRTeU",
          "label": "SHFT",
          "position": {
            "x": 3,
            "y": 0,
            "units": "slots"
          },
          "type": "xod/patch-nodes/input-number"
        },
        "rkB3iWT6g8": {
          "arityLevel": 2,
          "id": "rkB3iWT6g8",
          "position": {
            "x": 4,
            "y": 3,
            "units": "slots"
          },
          "type": "xod/core/any"
        },
        "rko_aRag8": {
          "id": "rko_aRag8",
          "position": {
            "x": 8,
            "y": 2,
            "units": "slots"
          },
          "type": "xod/core/act"
        },
        "rybsTEP-I": {
          "boundLiterals": {
            "ByYWULHUr": "0.05"
          },
          "id": "rybsTEP-I",
          "position": {
            "x": 2,
            "y": 1,
            "units": "slots"
          },
          "type": "xod/core/throttle"
        }
      },
      "path": "@/ws2812-pattern"
    }
  },
  "version": "0.33.0"
}
