{
  "format": "forge.graph/0",
  "name": "Auto Filter",
  "author": "Chirp",
  "license": "CC-BY-4.0",
  "remixed_from": null,
  "description": "A resonant filter that sweeps up and down by itself, in time with the song: Division sets how long one sweep takes, Freq where it's centred and Depth how many octaves it travels. Low-pass for a synth-like throb, band-pass for a talking wah, high-pass for a thin, airy pulse.",
  "tags": ["filter", "auto filter", "tempo", "synth", "sweep"],
  "face": {
    "display": { "kind": "trace", "label": "Sweep", "source": "sweep:sine", "range": [-1, 1] },
    "knobs": [
      { "id": "freq", "label": "Freq", "default": 0.45,
        "controls": [ { "target": "centre.v", "from": 0.2, "to": 3, "curve": "exp" } ] },
      { "id": "depth", "label": "Depth", "default": 0.6,
        "controls": [ { "target": "octaves.v", "from": 0, "to": 3 } ] },
      { "id": "resonance", "label": "Reso", "default": 0.4,
        "controls": [ { "target": "f.q", "from": 0.7, "to": 8, "curve": "exp" } ] },
      { "id": "mix", "label": "Mix", "default": 1,
        "controls": [ { "target": "mixer.mix", "from": 0, "to": 1 } ] },
      { "id": "level", "label": "Level", "default": 0.5,
        "controls": [ { "target": "level.amount", "from": 0.6, "to": 1.6 } ] }
    ],
    "menus": [
      { "id": "division", "label": "Division", "options": ["1 bar", "1/2", "1/4", "1/8"], "default": 1,
        "controls": [ { "target": "sweep.rate", "unit": "per_beat", "values": [0.25, 0.5, 1, 2] } ] },
      { "id": "mode", "label": "Mode", "options": ["Lowpass", "Bandpass", "Highpass"], "default": 0,
        "controls": [ { "target": "pick.choice" } ] }
    ]
  },
  "nodes": {
    "sweep": { "block": "lfo", "mono": true },
    "centre": { "block": "value", "mono": true },
    "octaves": { "block": "value", "mono": true },
    "khz": { "block": "formula", "mono": true, "set": { "expr": "b * exp2(a * c) - 0.02" },
            "in": { "a": "sweep:sine", "b": "centre", "c": "octaves" } },
    "f": { "block": "svf", "set": { "freq": 20 }, "in": { "x": "in" } },
    "pick": { "block": "select", "in": { "a": "f:lp", "b": "f:bp", "c": "f:hp" } },
    "mixer": { "block": "blend", "in": { "dry": "in", "wet": "pick" } },
    "level": { "block": "gain", "in": { "x": "mixer" } }
  },
  "mods": {
    "track": { "from": "khz", "target": "f.freq", "amount": 1000 }
  },
  "out": "level"
}
