{
  "id": "audio_reactive_basic",
  "name": "Audio Reactive Basic",
  "description": "Minimal audio-reactive starter mirroring the standalone shape of create_audio_reactive (Layer-1): an audio source feeds both an Audio Spectrum CHOP (for FFT visuals) and an Analyze CHOP (for an overall RMS level). The spectrum is published as a CHOP-to-TOP texture that a downstream visual chain can sample; the RMS level is exposed as a stable Null CHOP ready for bind_to_channel. A Constant TOP placeholder is modulated by the level via a manual expression wire (set by the artist) to demonstrate the level→visual handshake. Offline-validated against RecipeSchema; live cook-check UNVERIFIED pending TD run. Manual-wire: set out_color.colorr expression to op('level_null')['chan1'] to make the placeholder color react to audio.",
  "tags": ["audio-reactive", "spectrum", "rms", "starter", "performable"],
  "difficulty": "beginner",
  "td_version_min": "2022",
  "nodes": [
    {
      "name": "audioin",
      "type": "audiodeviceinCHOP",
      "comment": "Live audio input. Replace with audiofileinCHOP if you prefer a file source."
    },
    {
      "name": "spectrum",
      "type": "audiospectrumCHOP",
      "parameters": { "outputmenu": "setmanually", "outlength": 256 },
      "comment": "FFT spectrum. outlength clamped into TD's 128–4096 range to keep choptoTOP within GPU limits."
    },
    {
      "name": "level",
      "type": "analyzeCHOP",
      "parameters": { "function": 6 },
      "comment": "Function 6 = RMS power. One stable amplitude channel for downstream modulation."
    },
    {
      "name": "level_null",
      "type": "nullCHOP",
      "comment": "Stable ref for bind_to_channel ('chan1' = RMS amplitude)."
    },
    {
      "name": "audio_tex",
      "type": "choptoTOP",
      "comment": "Spectrum as a 1-row texture. Sample sTD2DInputs[0] in a downstream GLSL TOP."
    },
    {
      "name": "sensitivity",
      "type": "levelTOP",
      "parameters": { "brightness1": 1 },
      "comment": "Sensitivity gain on the spectrum texture before any visual chain consumes it."
    },
    {
      "name": "out_color",
      "type": "constantTOP",
      "parameters": { "alpha": 1.0 },
      "comment": "Visual placeholder. Manual-wire: set colorr/colorg/colorb expressions to op('level_null')['chan1'] (or combinations) to react to audio RMS. colorr/g/b intentionally omitted here so artist expressions aren't overwritten by constants."
    },
    {
      "name": "out1",
      "type": "nullTOP",
      "comment": "Final output of the audio-reactive system."
    }
  ],
  "connections": [
    { "from": "audioin", "to": "spectrum" },
    { "from": "audioin", "to": "level" },
    { "from": "level", "to": "level_null" },
    { "from": "spectrum", "to": "audio_tex" },
    { "from": "audio_tex", "to": "sensitivity" },
    { "from": "out_color", "to": "out1" }
  ],
  "parameters": [],
  "controls": [
    {
      "name": "Sensitivity",
      "type": "float",
      "min": 0,
      "max": 4,
      "default": 1,
      "bind_to": ["sensitivity.brightness1"]
    }
  ],
  "preview_description": "A dim violet placeholder frame with the spectrum + RMS analysis chain in place behind it, ready for the artist to wire the level into the visual color or feed the spectrum texture into a custom shader."
}
