{
  "format": "forge.graph/0",
  "name": "Note Synth",
  "author": "Chirp",
  "license": "CC-BY-4.0",
  "remixed_from": null,
  "description": "A monophonic synth that plays the notes you play: it tracks the pitch of each note and sounds an oscillator there (or an octave or two down, or one up), as loud as you pick it and only while a note sounds, through a low-pass filter. Glide sets how it slides between notes, from instant to a slow portamento. Play single notes; it lands about 40 ms after the pick.",
  "tags": ["pitch", "synth", "tracking", "octave"],
  "face": {
    "knobs": [
      { "id": "synth", "label": "Synth", "default": 0.6,
        "controls": [ { "target": "mixer.mix", "from": 0, "to": 1 } ] },
      { "id": "tone", "label": "Tone", "default": 0.5,
        "controls": [ { "target": "filt.freq", "from": 300, "to": 8000, "curve": "exp" } ] },
      { "id": "glide", "label": "Glide", "default": 0.2,
        "controls": [ { "target": "trk.glide_ms", "from": 1, "to": 300, "curve": "exp" } ] },
      { "id": "level", "label": "Level", "default": 0.5,
        "controls": [ { "target": "level.amount", "from": 0.5, "to": 1.5 } ] }
    ],
    "menus": [
      { "id": "octave", "label": "Octave", "options": ["Same", "Oct down", "2 down", "Oct up"], "default": 1,
        "controls": [ { "target": "mods.follow", "values": [1, 0.5, 0.25, 2] } ] },
      { "id": "wave", "label": "Wave", "options": ["Sine", "Triangle", "Square"], "default": 2,
        "controls": [ { "target": "shape.choice", "values": [0, 1, 2] } ] }
    ]
  },
  "nodes": {
    "trk": { "block": "track", "mono": true, "set": { "gate_db": -50 }, "in": { "x": "in" } },
    "floor": { "block": "value", "mono": true, "set": { "v": -1 } },
    "osc": { "block": "osc", "mono": true, "set": { "freq": 1 } },
    "square": { "block": "formula", "mono": true, "set": { "expr": "clamp(a * 30, -1, 1)" }, "in": { "a": "osc:tri" } },
    "shape": { "block": "select", "mono": true, "in": { "a": "osc:sine", "b": "osc:tri", "c": "square" } },
    "env": { "block": "envelope", "mono": true, "set": { "attack_ms": 3, "release_ms": 120 }, "in": { "x": "in" } },
    "amp": { "block": "formula", "mono": true, "set": { "expr": "a * b * c * 1.4" }, "in": { "a": "shape", "b": "env", "c": "trk:voiced" } },
    "filt": { "block": "svf", "mono": true, "set": { "q": 1.2 }, "in": { "x": "amp" } },
    "mixer": { "block": "blend", "in": { "dry": "in", "wet": "filt:lp" } },
    "level": { "block": "gain", "in": { "x": "mixer" } }
  },
  "mods": {
    "follow": { "from": "trk:hz", "target": "osc.freq", "amount": 0.5 },
    "floor": { "from": "floor", "target": "osc.freq", "amount": 1 }
  },
  "out": "level"
}
