{
  "format": "forge.graph/0",
  "name": "Volume Swell",
  "author": "Chirp",
  "license": "CC-BY-4.0",
  "remixed_from": null,
  "description": "Takes the pick attack off every note and fades it in, like rolling the volume knob up by hand: violin-like swells. Two envelope followers race each other; the slow one's lead over the fast one is the fade.",
  "tags": [
    "swell",
    "dynamics",
    "ambient"
  ],
  "face": {
    "display": { "kind": "meter", "label": "Swell", "source": "swell", "range": [0, 1] },
    "knobs": [
      {
        "id": "attack",
        "label": "Attack",
        "default": 0.4,
        "controls": [
          {
            "target": "slow.attack_ms",
            "from": 30,
            "to": 500,
            "curve": "exp"
          }
        ]
      },
      {
        "id": "level",
        "label": "Level",
        "default": 0.85,
        "controls": [
          {
            "target": "level.amount",
            "from": 0.7,
            "to": 2
          }
        ]
      },
      {
        "id": "blend",
        "label": "Blend",
        "default": 1,
        "controls": [
          {
            "target": "mixer.mix",
            "from": 0,
            "to": 1
          }
        ]
      }
    ]
  },
  "nodes": {
    "fast": {
      "block": "envelope",
      "mono": true,
      "set": {
        "attack_ms": 1,
        "release_ms": 90
      },
      "in": {
        "x": "in"
      }
    },
    "slow": {
      "block": "envelope",
      "mono": true,
      "set": {
        "release_ms": 90
      },
      "in": {
        "x": "in"
      }
    },
    "swell": {
      "block": "formula",
      "mono": true,
      "set": {
        "expr": "clamp(a / (b + 0.002), 0, 1)"
      },
      "in": {
        "a": "slow",
        "b": "fast"
      }
    },
    "fade": {
      "block": "formula",
      "set": {
        "expr": "a * b"
      },
      "in": {
        "a": "in",
        "b": "swell"
      }
    },
    "level": {
      "block": "gain",
      "in": {
        "x": "fade"
      }
    },
    "mixer": {
      "block": "blend",
      "in": {
        "dry": "in",
        "wet": "level"
      }
    }
  },
  "out": "mixer"
}
