Nodes/ComfyUI_Fill-Nodes/FL Audio Reactive Envelope
ComfyUI Node

FL Audio Reactive Envelope

Drum hits become ADSR curves for the whole reactive family

By filliptm·Created 3 years ago·Updated a day ago· 628
FL Audio Reactive Envelope
    • kick_envelope_json
    • snare_envelope_json
    • hihat_envelope_json
    drum_times_json
    fps30
    kick_attack_frames1
    kick_decay_frames8
    kick_sustain_level0.20
    kick_release_frames10
    snare_attack_frames1
    snare_decay_frames6
    snare_sustain_level0.10
    snare_release_frames8
    hihat_attack_frames1
    hihat_decay_frames4
    hihat_sustain_level0.00
    hihat_release_frames5

    This is the hub node of Fill-Nodes' whole audio-reactive family. FL_Audio_Drum_Detector gives you a list of instants - a kick happened at 1.243 seconds. That's a spike, not something you can smoothly drive a visual effect with. FL_Audio_Reactive_Envelope converts those spikes into classic synth-style ADSR (Attack, Decay, Sustain, Release) curves, one per drum type, sampled per-frame at your chosen fps - exactly the shape of data every other reactive node in the pack (brightness, saturation, speed, edge glow, and FL_Ascii's audio hook) expects.

    How it works

    For every detected hit of a given type, the envelope spikes toward 1.0 over attack_frames, then falls off over decay_frames toward sustain_level, and finally fades to zero over release_frames once the hit's influence ends. It's the same shaping logic a synthesizer applies to a note - attack is how fast the hit "opens," decay is how fast it settles, sustain is where it settles to, release is how long the tail lingers. Kicks default to a longer decay and release than hi-hats (kick: decay 8 / release 10 vs hi-hat: decay 4 / release 5) because a kick is meant to read as a slower "thump" and a hi-hat as a quick "tick" - that asymmetry is deliberate, not an oversight.

    The inputs and outputs that matter

    Required: drum_times_json - straight from FL_Audio_Drum_Detector; fps (1–120, default 30) - this has to match your actual output framerate, or every downstream envelope-driven effect will drift out of sync with the real beat.

    Optional, independently for kick/snare/hi-hat: *_attack_frames (default 1 for all three), *_decay_frames (kick 8, snare 6, hi-hat 4), *_sustain_level (kick 0.2, snare 0.1, hi-hat 0), *_release_frames (kick 10, snare 8, hi-hat 5). Twelve knobs total, but you'll usually only touch a handful - most tuning happens on decay and release, since those control how "punchy" versus "smeared" the resulting pulse feels.

    Outputs: three separate JSON strings - kick_envelope_json, snare_envelope_json, hihat_envelope_json - wire whichever you need into downstream reactive nodes. You can drive different effects off different drums in the same graph: brightness off the kick, edge glow off the snare, for instance.

    How to install it

    ComfyUI Manager: search ComfyUI_Fill-Nodes, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
    

    then restart. No extra dependencies for this node - it's pure curve math over JSON, no librosa, no models.

    Common issues & troubleshooting

    Effect feels "off" from the beat. The single most common cause is an fps mismatch - check this node's fps field actually matches your real output framerate rather than a default you forgot to set. Every reactive node downstream inherits that timing error.

    Only one drum type ever fires, or all three look identical. That traces back to FL_Audio_Drum_Detector's per-type sensitivity, not this node - this node only shapes curves around whatever hits it was given, it doesn't detect anything itself. Go tune sensitivities upstream first, then use FL_Audio_Envelope_Visualizer to confirm the shaped curve looks right before wiring it further.

    Pulses feel too sudden or jarring. Increase decay_frames/release_frames on the relevant drum for a smoother, more musical falloff instead of a hard on/off flash - the defaults favor a punchy, tight response, which isn't always what a slower or more ambient piece of music calls for.

    Category🏵️Fill Nodes/Audio

    Inputs (14)

    NameTypeDefaultDescription
    drum_times_jsonSTRING
    fpsINT301–120
    kick_attack_framesoptINT10–30
    kick_decay_framesoptINT81–60
    kick_sustain_leveloptFLOAT0.200–1
    kick_release_framesoptINT101–60
    snare_attack_framesoptINT10–30
    snare_decay_framesoptINT61–60
    snare_sustain_leveloptFLOAT0.100–1
    snare_release_framesoptINT81–60
    hihat_attack_framesoptINT10–30
    hihat_decay_framesoptINT41–60
    hihat_sustain_leveloptFLOAT0.000–1
    hihat_release_framesoptINT51–60

    Outputs (3)

    NameTypeDescription
    kick_envelope_jsonSTRING
    snare_envelope_jsonSTRING
    hihat_envelope_jsonSTRING