{
  "format": "forge.graph/0",
  "name": "Sustainer",
  "author": "Chirp",
  "license": "CC-BY-4.0",
  "remixed_from": null,
  "description": "A compressor built from a formula: the louder you play, the more it turns you down, so notes ring longer and chords even out. Blend keeps some of the attack from the dry signal.",
  "tags": ["compressor", "dynamics", "sustain"],
  "face": {
    "display": { "kind": "meter", "label": "Squash", "source": "reduce", "range": [1, 0.5] },
    "knobs": [
      { "id": "sustain", "label": "Sustain", "default": 0.5,
        "controls": [ { "target": "amount.v", "from": 0, "to": 20, "curve": "square" } ] },
      { "id": "level", "label": "Level", "default": 0.45,
        "controls": [ { "target": "level.amount", "from": 0.5, "to": 2 } ] },
      { "id": "attack", "label": "Attack", "default": 0.3,
        "controls": [ { "target": "env.attack_ms", "from": 1, "to": 40, "curve": "exp" } ] },
      { "id": "blend", "label": "Blend", "default": 0.8,
        "controls": [ { "target": "mixer.mix", "from": 0, "to": 1 } ] }
    ]
  },
  "nodes": {
    "env": { "block": "envelope", "mono": true, "set": { "release_ms": 180 }, "in": { "x": "in" } },
    "amount": { "block": "value", "mono": true },
    "reduce": { "block": "formula", "mono": true, "set": { "expr": "1 / (1 + a * b)" }, "in": { "a": "env", "b": "amount" } },
    "squash": { "block": "formula", "set": { "expr": "a * b" }, "in": { "a": "in", "b": "reduce" } },
    "level": { "block": "gain", "in": { "x": "squash" } },
    "mixer": { "block": "blend", "in": { "dry": "in", "wet": "level" } }
  },
  "out": "mixer"
}
