{
  "format": "forge.graph/0",
  "name": "Slicer",
  "author": "Chirp",
  "license": "CC-BY-4.0",
  "remixed_from": null,
  "description": "Chops the sound into a rhythm locked to the tempo: hold a chord and it plays the pattern for you. Division sets the note value of each slice, Pattern which slices sound (straight, gallop, off-beat or a stutter), Length how long each slice lasts and Smooth how hard its edges are.",
  "tags": ["rhythm", "tempo", "gate", "slicer"],
  "face": {
    "display": { "kind": "lamp", "label": "Chop", "source": "smoothed", "range": [0, 1] },
    "knobs": [
      { "id": "length", "label": "Length", "default": 0.6,
        "controls": [ { "target": "duty.v", "from": 0.15, "to": 1 } ] },
      { "id": "smooth", "label": "Smooth", "default": 0.15,
        "controls": [ { "target": "steps.smooth", "from": 0.02, "to": 0.6 } ] },
      { "id": "mix", "label": "Mix", "default": 1,
        "controls": [ { "target": "mixer.mix", "from": 0, "to": 1 } ] }
    ],
    "menus": [
      { "id": "division", "label": "Division", "options": ["1/8", "1/16", "1/16T", "1/32"], "default": 1,
        "controls": [ { "target": "steps.rate", "unit": "per_beat", "values": [2, 4, 6, 8] } ] },
      { "id": "pattern", "label": "Pattern", "options": ["Straight", "Gallop", "Off-beat", "Stutter"], "default": 0,
        "controls": [ { "target": "steps.pattern", "values": [255, 221, 170, 215] } ] }
    ]
  },
  "nodes": {
    "steps": { "block": "rhythm", "mono": true, "set": { "steps": 8 } },
    "duty": { "block": "value", "mono": true },
    "chop": { "block": "formula", "mono": true, "set": { "expr": "a * clamp((c - b) * 25, 0, 1)" },
              "in": { "a": "steps:gate", "b": "steps:ramp", "c": "duty" } },
    "smoothed": { "block": "onepole", "mono": true, "set": { "cutoff": 400 }, "in": { "x": "chop" } },
    "sliced": { "block": "formula", "set": { "expr": "a * b" }, "in": { "a": "in", "b": "smoothed" } },
    "mixer": { "block": "blend", "in": { "dry": "in", "wet": "sliced" } }
  },
  "out": "mixer"
}
