{
  "patches": {
    "@/main": {
      "nodes": {
        "r1pv20Zao": {
          "id": "r1pv20Zao",
          "type": "@/eceiver",
          "position": {
            "x": 0,
            "y": 1,
            "units": "slots"
          }
        }
      },
      "path": "@/main"
    },
    "@/eceiver": {
      "nodes": {
        "Hy6jKAW6o": {
          "id": "Hy6jKAW6o",
          "type": "xod/patch-nodes/input-number",
          "position": {
            "x": 9,
            "y": 1,
            "units": "slots"
          },
          "label": "PWM1"
        },
        "rk5TtC-6o": {
          "id": "rk5TtC-6o",
          "type": "xod/patch-nodes/output-number",
          "position": {
            "x": 9,
            "y": 3,
            "units": "slots"
          },
          "label": "CH1"
        },
        "rk_W9RZaj": {
          "id": "rk_W9RZaj",
          "type": "xod/patch-nodes/input-number",
          "position": {
            "x": 10,
            "y": 1,
            "units": "slots"
          },
          "label": "PWM2"
        },
        "Skjb9Ab6s": {
          "id": "Skjb9Ab6s",
          "type": "xod/patch-nodes/input-number",
          "position": {
            "x": 11,
            "y": 1,
            "units": "slots"
          },
          "label": "PWM3"
        },
        "S1p-cRZ6s": {
          "id": "S1p-cRZ6s",
          "type": "xod/patch-nodes/input-number",
          "position": {
            "x": 12,
            "y": 1,
            "units": "slots"
          },
          "label": "PWM4"
        },
        "BkEfq0-Ti": {
          "id": "BkEfq0-Ti",
          "type": "xod/patch-nodes/output-number",
          "position": {
            "x": 10,
            "y": 3,
            "units": "slots"
          },
          "label": "CH2"
        },
        "B1UzqAZTo": {
          "id": "B1UzqAZTo",
          "type": "xod/patch-nodes/output-number",
          "position": {
            "x": 11,
            "y": 3,
            "units": "slots"
          },
          "label": "CH3"
        },
        "r1_fcRbas": {
          "id": "r1_fcRbas",
          "type": "xod/patch-nodes/output-number",
          "position": {
            "x": 12,
            "y": 3,
            "units": "slots"
          },
          "label": "CH4"
        },
        "S1Eho0W6s": {
          "id": "S1Eho0W6s",
          "type": "xod/patch-nodes/not-implemented-in-xod",
          "position": {
            "x": 10,
            "y": 2,
            "units": "slots"
          }
        }
      },
      "path": "@/eceiver",
      "attachments": [
        {
          "filename": "patch.cpp",
          "encoding": "utf-8",
          "content": "\n#include <xod/pwm.h>\n\nstruct State {\n  xod::pwm::PwmDecoder decoder1;\n  xod::pwm::PwmDecoder decoder2;\n  xod::pwm::PwmDecoder decoder3;\n  xod::pwm::PwmDecoder decoder4;\n};\n\n[[combinable]]\nvoid evaluate(Context ctx) {\n  auto state = getState(ctx);\n\n  int pwm1 = getValue<input_PWM1>(ctx);\n  int pwm2 = getValue<input_PWM2>(ctx);\n  int pwm3 = getValue<input_PWM3>(ctx);\n  int pwm4 = getValue<input_PWM4>(ctx);\n\n  state->decoder1.update(pwm1);\n  state->decoder2.update(pwm2);\n  state->decoder3.update(pwm3);\n  state->decoder4.update(pwm4);\n\n  emitValue<output_CH1>(ctx, state->decoder1.getValue());\n  emitValue<output_CH2>(ctx, state->decoder2.getValue());\n  emitValue<output_CH3>(ctx, state->decoder3.getValue());\n  emitValue<output_CH4>(ctx, state->decoder4.getValue());\n}"
        }
      ]
    }
  },
  "name": "rc-nod"
}
