Percussive (Audio Op)
Percussive — grab the drums and transients with HPSS
- signal
- SIGNAL
OpPercussive (display name "Percussive (Audio Op)") is the second half of the pack's harmonic-percussive pair. It returns the percussive component of the signal - the drums, the transient hits, everything that's short and broadband - with the sustained tonal layer (vocals, pads, melody) removed. Pair it with Harmonic and you've split your track into "what hits" and "what rings."
It's a straight port from dmarx's video-killed-the-radio-star notebook, same as the rest of the pack. And it's genuinely the more fun half: the percussive layer is where the beats live, which makes it the obvious input to an onset or RMS analysis if you want a drum-focused driver for your animation. If your goal is "pulse on the kick," analyze the percussive layer and you get the kick without the bass fighting it.
How it works
One call: librosa.effects.percussive(y=y). Same HPSS machinery as its sibling - median filtering of the spectrogram along time vs. frequency, Fitzgerald 2010. Percussive content is short-lived and broadband, so it survives the frequency-axis median filter; harmonic content is continuous in frequency and gets filtered out. Reconstruct, done.
The output is sample-level - the percussive component is a full audio signal, same length as the input. It is not a per-frame feature curve like Rms or Novelty produce. To get from "audio of drums" to "driver curve," run Rms or Novelty on it next. That two-hop chain - ARReadAudio → Percussive → Rms → SignalToCurve - is a legit, genuinely useful pipeline for beat-driven animation, and it's the same "separate the stems, drive the controls from the layers" pattern the audio-reactive AnimateDiff crowd runs, minus the heavy stem models.
Inputs and outputs
signal(SIGNAL) - fromARReadAudioor upstream of another operator.SIGNAL-yreplaced by the percussive component. Wire toARDrawSignalto hear/see what survived the split (well, see - you can't hear a node output), or into another operator to build a driver curve.
Installing it
Manager (search "AudioReactive") or:
cd ComfyUI/custom_nodes
git clone https://github.com/dmarx/ComfyUI-AudioReactive
Restart and wait through the first-load auto-install of scipy, scikit-learn, librosa, loguru (librosa pulls numba, so the first start is slow). If the pack won't load with ModuleNotFoundError: No module named 'keyframed', run pip install keyframed - imported at startup, missing from the auto-install list.
Common issues
- Output is as long as the input - correct; this one emits audio, not a feature curve. Length matching
Harmonic's output is a sign it's working. - High-hats sound thin or muffled - HPSS isn't magic; the split is heuristic. On dense mixes, artifacts creep in. Accept or use a stem model.
- Plot looks like noise in Draw Audio Signal - sample-resolution waveforms plot as solid blobs. Use the node as a layer, not a scope target.
- Early-port reality check - this is a working core op, but the pack is a fresh single-commit port; parameterized ops like
BandpassandSmoothare unwired stubs. Fine to build on the working set.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| signal | SIGNAL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SIGNAL | SIGNAL | — |