{
  "format": "forge.graph/0",
  "name": "Tempo Tremolo",
  "author": "Chirp",
  "license": "CC-BY-4.0",
  "remixed_from": { "id": "5b4ca3f087a7cff2", "name": "Classic Tremolo", "author": "Chirp",
                    "note": "Locks the tremolo to the tempo: the Rate knob became a Division menu (half notes to eighth-note triplets), so the pulse stays in time with the band, the DAW or the tapped tempo." },
  "description": "Amp-style tremolo that pulses in time with the song: choose quarter notes, eighths or triplets instead of a speed, and change the tempo without retuning it.",
  "tags": ["tremolo", "modulation", "tempo"],
  "face": {
    "display": { "kind": "trace", "label": "Wave", "source": "shape", "range": [-1, 1] },
    "knobs": [
      { "id": "depth", "label": "Depth", "default": 0.6,
        "controls": [ { "target": "amp.amount", "from": 1, "to": 0.5 },
                      { "target": "mods.trem", "from": 0, "to": 0.5 } ] },
      { "id": "level", "label": "Level", "default": 0.55,
        "controls": [ { "target": "level.amount", "from": 0.5, "to": 1.5 } ] }
    ],
    "menus": [
      { "id": "shape", "label": "Shape", "options": ["Smooth", "Triangle", "Square"], "default": 0,
        "controls": [ { "target": "shape.choice" } ] },
      { "id": "division", "label": "Division", "options": ["1/2", "1/4", "1/8", "1/8T"], "default": 2,
        "controls": [ { "target": "lfo.rate", "unit": "per_beat", "values": [0.5, 1, 2, 3] } ] }
    ]
  },
  "nodes": {
    "lfo": { "block": "lfo", "mono": true },
    "square": { "block": "formula", "mono": true, "set": { "expr": "clamp(a * 4, -1, 1)" }, "in": { "a": "lfo:sine" } },
    "shape": { "block": "select", "mono": true, "in": { "a": "lfo:sine", "b": "lfo:tri", "c": "square" } },
    "amp": { "block": "gain", "in": { "x": "in" } },
    "level": { "block": "gain", "in": { "x": "amp" } }
  },
  "mods": {
    "trem": { "from": "shape", "target": "amp.amount", "amount": 0 }
  },
  "out": "level"
}
