ComfyUI Node

Audio To Noise Parameters

The Invisible Middleman Between Your Song and Your Sampler

By Kayarte·Created 2 years ago·Updated about a year ago· 3
Audio To Noise Parameters
  • energy_levels
  • timestamps
  • analysis_type
  • noise_params
  • debug_info

Nobody searches for this node, and honestly, nobody needs to - it's the quiet workhorse in the middle of the Kayarte audio pack, and it does its job with zero widgets to touch. Audio To Noise Parameters ("AudioNoiseMapper") sits between the Librosa Audio Analysis node and the two latent generators, translating raw audio measurements into the NOISE_PARAMS dict they all consume. You'll probably never fiddle with it. But if you understand it, you'll understand why the whole pack hangs together.

Why it exists

The analysis node hands you two lists of numbers: energy_levels (how loud the audio is at each moment, normalized 0–1) and timestamps (when each measurement happened). Those are useful to a human reading a graph, but the latent generators don't want a time series - they want three dials per noise distribution: intensity, grain, and persistence. The mapper is the bridge that does that conversion, and it computes those dials for all three distributions (gaussian, salt_pepper, perlin) at once so you can pick your flavor downstream without re-running anything.

What it does under the hood

The math is a short, readable function, and it's tuned per analysis type. The code keeps a table with a scale and smoothing for each of the nine analysis types - onset gets scale 2.0 / smoothing 0.1, mel gets the biggest boost at 2.5 / 0.08, beat gets 1.8 / 0.2. From there it derives:

  • intensity - mean energy scaled up (gaussian) or the 90th percentile (salt_pepper) or the peak (perlin).
  • grain - the standard deviation of the energy, i.e. how much the loudness varies → texture fineness.
  • persistence - exp(-smoothing * std(diff(energy))), which is a fancy way of saying "how jumpy the energy is between frames." Smooth audio → high persistence; spiky audio → low.

The "persistence from temporal changes" line in the README is exactly this. That's the whole trick.

Inputs, outputs, and what to do with them

All three inputs - energy_levels, timestamps, analysis_type - come pre-wired from the Librosa Audio Analysis node. There's nothing to configure. The analysis_type is worth keeping straight because the mapper picks its scale/smoothing from it, and the downstream generators re-tune on it too; if you change it on the analysis node, let it flow through.

Outputs:

  • noise_params (NOISE_PARAMS) - the dict of per-distribution dials. Wire this into Audio Noise to Latent or Advanced Audio Noise Patterns.
  • debug_info (STRING) - a small text readout of the analysis type, scale, mean energy, and variance. Plug it into any text display node (or rgthree's Display Any) to sanity-check that the audio actually produced sensible numbers before you blame the sampler.

The gotcha that bites

This node is the flakiest link in the chain for one reason: if it receives empty energy_levels or timestamps - which happens when the analysis node failed on a bad file path - it returns an empty dict plus an error string in debug_info instead of crashing. The empty dict then flows downstream and the latent generator throws a KeyError that looks like its fault. So when the pack "breaks," read the debug_info output here first. The error almost always originates one node back, in the audio file path.

Installing

Same story as the rest of the pack: ComfyUI Manager (search "AudioDriven Latent Space Tools") or

cd ComfyUI/custom_nodes
git clone https://github.com/Kayarte/AudioDriven-Latent-Space-Tools-for-ComfyUI

then restart. The pack has no requirements.txt, so if you see No module named 'librosa' on load, pip install librosa in your ComfyUI environment. No models, no keys, fully offline.

One-line summary: it's the adapter that makes audio readable as noise. Set nothing, wire everything, and check debug_info when the pack gives you the silent treatment.

Categoryaudio/noise

Inputs (3)

NameTypeDefaultDescription
energy_levelsAUDIO_ENERGY
timestampsTIMESTAMPS
analysis_typeANALYSIS_TYPE

Outputs (2)

NameTypeDescription
noise_paramsNOISE_PARAMS
debug_infoSTRING