home/ atoms/ hydra-fft-band-range

Hydra's audio FFT array has exactly 4 bands (indices 0..3); reading index 4 or higher produces NaN

The Hydra 4-bin AV contract exposes exactly four FFT bands: a.fft[0] (bass), a.fft[1] (low-mid), a.fft[2] (high-mid), a.fft[3] (highs). Reading a.fft[4] or any higher index returns undefined, which propagates as NaN through arithmetic and typically causes a black or frozen frame — with no error thrown. The fix is to clamp the index to 0..3, or guard the value with Math.min(1, a.fft[3]).

Examples

() => a.fft[4]*2.0 → NaN → black frame. Fix: () => Math.min(1, a.fft[3]*2.0).

Assessment

Name the four Hydra FFT band indices and their corresponding frequency ranges, then explain what a.fft[4] returns and why it causes a black frame.

“`a` band out of range → NaN** | reading `a.fft[4]` or higher (only `0..3` exist) | **No throw**; `undefined` → `NaN` → black/frozen frame”
context/ · L5-debug/hydra.md · chunk 1