Nodes/ꘇ Genereti/ꘇ mod.spectrum
ComfyUI Node

ꘇ mod.spectrum

Frequency bins, not a waveform — and why that matters

By languel·Created about a month ago·Updated 3 days ago· 1
ꘇ mod.spectrum
  • input
  • audio
  • channels
  • rms
  • peak
  • image
◄fft_size1024►
◄smoothing0.50►
◄display_gain2.00►
◄width512►
◄height256►

ꘇ mod.spectrum is the FFT tap of the Genereti audio family. It draws the familiar spectrum analyser view, exposes the bins as CHOP channels (magnitude, frequency), and passes the audio bus through untouched. Use it when you want to know which frequencies are present, not just how loud things are.

What it is

Genereti's mod.* nodes form a live Web Audio patching layer that runs in the browser tab, with chop.* control signals to match. The analysis taps - mod.scope, mod.spectrum, mod.lissajous, mod.analyze - all share the same five outputs and the same trick: they sit inline on a GENERETI_AUDIO_BUS, forward it unchanged, and additionally publish measurements. So you can insert one into a working patch without rewiring your signal path, or hang it off as a parallel tap.

The spectrum exists for the case where amplitude isn't the interesting number. A hi-hat and a kick can have the same RMS and completely different spectra; if you want a visual parameter that reacts to brightness rather than loudness, this is the tap.

How it works

Left and right are split, each goes into an AnalyserNode, and the node reads getFloatFrequencyData from both - then averages left/right power (not dB, which would be wrong) and converts back. The drawing is scaled to a linear frequency axis labelled −90 to 0 dB, which is why it looks like the analyser in an audio editor rather than a log-scale studio display.

The detail that trips people up: the channels on the channels output are not a time series. frequency is the bin centre frequency of each slot in Hz, and magnitude is the linear amplitude in that bin. Bin spacing is sampleRate / fft_size - at 48 kHz with the default 1024-point FFT, that's roughly 47 Hz per bin, so bin 5 is about 235 Hz. Index n is a frequency, not a moment in time.

fft_size (256 to 4096) trades time resolution for frequency resolution. smoothing is the analyser's smoothing constant and affects spectral bins only - it does not touch waveform or RMS. display_gain scales the drawing only.

The inputs and outputs that matter

Inputs: input (bus, passed through), fft_size (default 1024), smoothing (0–0.99, default 0.5), display_gain (0.1–20, default 2).

Outputs: audio (the bus, unchanged - keep chaining toward mod.output), channels (CHOP: magnitude, frequency), rms (FLOAT), peak (FLOAT), and image (an IMAGE of the spectral view you can feed into the image side of the graph).

If you just want "react to how loud it is", don't use this node - take rms off any of the taps. If you want "react to how bright it is", select the higher bins out of channels. The bundled example does exactly this shape with chop.select and chop.math: pick a channel, scale it, drive a parameter.

Install

Manager, search Genereti - or from your ComfyUI directory:

git clone https://github.com/languel/genereti.git custom_nodes/genereti
./.venv/bin/python -m pip install -r custom_nodes/genereti/requirements.txt

Restart ComfyUI and reload the browser page - the pack's audio guide specifically calls out one restart plus a browser reload to register the analysis node schemas. requirements.txt is a single line (comfyui-frontend-package>=1.53.6), with torch/NumPy/Pillow/aiohttp supplied by ComfyUI. No model downloads; the audio stack needs no external service. Comfy ≥ 0.38.2, Python ≥ 3.11.

Common issues

Flat spectrum, zeros in the CHOP. If you queued, that's by design: queued runs of these taps return silent channels and a placeholder IMAGE rather than reading live output. Start a connected mod.output and watch it live.

Bins look wrong as a "signal". They're frequency bins, not samples over time - plotting magnitude against its index gives you a spectrum, which is correct, not a bug.

Nothing reacts to the drums. FFT smoothing and a large fft_size both slow the visible response; try fft_size 512–1024 and lower smoothing for percussive material. Also remember the tap reads whatever passes through it, so an upstream lowpass with a low cutoff means genuinely nothing above it to see.

display_gain has no effect on the sound. It only scales the picture, never the audio or the reported measurements.

Measurements don't update while the tab is backgrounded. Snapshot rate is tied to the control timer, and browser throttling can interfere with the event lookahead. Keep the tab focused for anything you're timing by eye.

As with the rest of this pack - a solo MIT alpha by Liuboto, v0.1.4, whose README calls it "super alpha - early classroom testing" - back up workflows before updating.

CategoryGenereti / Modular audio

Inputs (6)

NameTypeDefaultDescription
inputGENERETI_AUDIO_BUS—
fft_sizeCOMBO10245 options: 256, 512, 1024, 2048, 4096
smoothingFLOAT0.500–0.99—
display_gainFLOAT2.000.1–20—
widthoptINT51264–2048—
heightoptINT25664–2048—

Outputs (5)

NameTypeDescription
audioGENERETI_AUDIO_BUS—
channelsGENERETI_CHOP—
rmsFLOAT—
peakFLOAT—
imageIMAGE—