Nodes/ComfyUI-AudioScheduler/Transient Amplitude Basic
ComfyUI Node

Transient Amplitude Basic

Give your curve an attack, hold, and release like a synth

By a1lazydog·Created 3 years ago·Updated 2 years ago· 112
Transient Amplitude Basic
  • amplitude
  • amplitude
frames_to_attack0
frames_to_hold6
frames_to_release6

A raw amplitude curve from BatchAmplitudeSchedule jumps. Every transient spikes and drops in a frame or two, and if you feed that straight into an animation parameter you get jitter, not motion. TransientAmplitudeBasic reshapes the curve with a classic envelope - attack, hold, release - applied frame by frame, so the output moves like it was designed instead of vibrating.

If you've ever used a synthesizer's ADSR envelope, you already know the shape. This is that idea applied to your amplitude schedule, and it's the difference between "the image flickers with the beat" and "the image swells with the beat."

How it works

The node walks the frames and, in priority order, applies one of three behaviors:

  • frames_to_attack (default 0) - used when the amplitude is rising. It's how many frames the curve takes to climb to the next peak. 0 jumps instantly; larger numbers mean a slow rise. A long attack smooths out sudden jumps.
  • frames_to_hold (default 6) - used when the amplitude starts falling. The curve holds at the current value for this many frames before letting go. If the signal starts rising again during a hold, the hold resets and it goes back to attacking.
  • frames_to_release (default 6) - used after the hold is exhausted and the amplitude is still falling. It's how many frames the curve takes to glide down to the lower value. Long releases turn drops into fades.

The README is honest that attack and release are linear-ish rather than perfectly linear (the target is picked greedily for simplicity), so on a complex waveform the result won't be a mathematically clean ramp - but visually it's exactly the smoothing you want.

The inputs

All three are optional INTs: frames_to_attack (0), frames_to_hold (6), frames_to_release (6). Output is amplitude, same type and length, ready to flow into NormalizeAmplitude or AmplitudeToNumber.

With the defaults (hold 6, release 6), a snare hit becomes a sustained swell rather than a blip - which is why the defaults already feel musical. That's the honest pitch: most people leave the defaults alone and only touch attack when a curve is too abrupt.

Gotchas

Negative values are rejected - the node raises rather than misbehaving. If all three are 0, or the series has one frame or fewer, it passes the input through unchanged. And remember this runs on frames, not seconds: with frames_per_second at 12, a hold of 6 frames is half a second. Adjust for your frame rate, not for intuition.

Install: ComfyUI Manager search ComfyUI-AudioScheduler, or git clone https://github.com/a1lazydog/ComfyUI-AudioScheduler into custom_nodes and restart. No models, CPU-only.

CategoryAudioScheduler/Amplitude

Inputs (4)

NameTypeDefaultDescription
amplitudeAMPLITUDE
frames_to_attackoptINT0
frames_to_holdoptINT6
frames_to_releaseoptINT6

Outputs (1)

NameTypeDescription
amplitudeAMPLITUDE