
PID Filter
Audio plug-in · VST3 / Standalone · macOSA band-pass filter that chases your sound, steered by the same control loop that steadies drones and robot arms.

Overview
Hands a band-pass filter to a control algorithm. A proportional–integral–derivative (PID) controller — the loop that steadies drones and robot arms — steers the filter's centre frequency towards a setpoint read from the input's spectrum, either its centroid or its strongest peak. The P, I and D gains decide how it chases the sound: gliding into place, overshooting and ringing, swinging slowly around the target, or, pushed past stability, cycling on its own. Bandwidth, slope, a setpoint offset and mix are live controls, and the window draws the untreated and treated waveforms above a trace of the setpoint against the cutoff it is pursuing.
How it works
PID Filter is a closed loop with three parts: something to aim at, a controller that steers, and the filter being steered.
- Setpoint. Every 256 samples a 2048-point, Hann-windowed FFT of the input is reduced to a single frequency: either the spectral centroid (the sound's brightness) or the dominant peak, refined by parabolic interpolation. An optional offset in octaves moves the target above or below it. When the input falls below about −56 dBFS the last setpoint is held, so the filter doesn't chase noise.
- Controller. The PID controller runs every sample, in octaves rather than hertz. Its output is a force acting on a “cutoff mass”, so the three gains behave physically: P is a spring that pulls the cutoff towards the setpoint (more P is faster and rings more); I accumulates error, clamped against wind-up, adding overshoot and slow swing; D damps the error's rate of change, so a sudden jump in the setpoint gives the cutoff a deliberate kick.
- Filter. A topology-preserving state-variable band-pass, unity gain at its centre, at 12 or 24 dB per octave, with its bandwidth set in octaves. Its coefficients update every sample to follow the controller.
The loop stays stable while (2 + 400·D)·P > I. Push the gains past that and it becomes a limit cycle: the cutoff swings back and forth on its own, bounded to 20 Hz–20 kHz. The control panel shows the loop's natural frequency, its damping ratio and whether it is currently stable, and the window plots the setpoint against the cutoff it is pursuing.