Stoatworks Labs

Compander

Video through a radio mic's compander

Releasedv0.1.4Plugin & ModuleC++ / GLSL
Compander — Video through a radio mic's compander
Rendered by the plugin's own offline harness in a headless GL context — not a Resolume screen capture. Real frames through the real shipped shaders, on a synthetic scene built to make companding measurable: a flat band, hard vertical edges, two one-pixel combs at ninety degrees to each other, and a ramp.

What it does

An analogue radio mic link can't carry the dynamic range of what goes into it. So the transmitter squashes it, with pre-emphasis to lift the quiet top end above the link's noise and then a compressor that halves the signal's swing in dB, and the receiver does the exact opposite, expanding it back out and de-emphasising. In between sits a link with a noise floor, a ceiling, and no opinion about either.

Get every stage right and almost nothing happens, which is rather the idea: a working radio mic sounds like a cable. Everything this plugin is for comes from the two ends failing to cancel. Compress with nothing expanding and the picture goes flat and bright, shadows lifted off the floor and edges screaming where the pre-emphasis never got taken back off. Expand with nothing compressed and it goes contrasty and dead, blacks crushed below the floor and fine detail sucked out of anything dim.

What makes it a video effect, and not just an audio compressor pointed at a picture, is that a signal on a wire has one axis, time, and when the signal is a picture, time is the scan. So a compander's attack and release turn straight into a distance along the line: the active picture is 52 microseconds of a 64 microsecond line. That's why one control runs from a halo tight to every edge, through a smear off the side of things, to streaks pulling down the frame and finally the whole picture pumping.

Taking that seriously has two consequences, and both give away that it's modelling a circuit. It's causal, so a bright object drags its gain change out behind it across the scan and leaves its left-hand edge alone. That's the lopsided tail every analogue video level artefact has; a symmetric halo is the sign of an effect that was never a circuit. And it wraps from line to line, because the right-hand end of the line above is where the signal was a moment ago.

The compressor's control signal can come from real audio instead of from the picture. A compander is a circuit whose gain is driven by an audio envelope anyway, so this is just the circuit being fed the kind of signal it was built for, with the picture standing in for the carrier.

Ten presets model real systems: a broadband two-to-one VCA compander, a high-density two-band one, a digital hybrid, a receiver fading out on the wrong side of the room, something cheap off a market stall, a consumer tape format's luma channel, a satellite up-link and an ENG microwave truck. They're named for what they are, not for whose trademark they are.

  • Compression and expansion set independently, so half the chain can be run on its own — the encode-only and decode-only characters are settings, not modes
  • Time Constant from 0.1 microseconds to 40 milliseconds, which on a picture is a distance along the scan: edge haloing, horizontal smear, line-to-line streaking, whole-frame pumping
  • A causal detector that trails to the right of bright objects and wraps line to line, the way a serial signal does
  • Pre-emphasis in dB, with Tilt as the mismatch between the transmitter's network and the receiver's — matched, none at all, or applied twice
  • A modelled link with its own noise floor, ceiling and level error, because companding exists to hide a noise floor and without one the decode stage has nothing to show for itself
  • Audio-driven sidechain: hand the compressor a real spectrum instead of the picture's own envelope, leaning on any part of the band — FFGL only, because OpenFX has no audio input
  • Chroma decides whether the colour crossed the link at all — bypassed like a radio mic's single channel, or carried through together like a composite video link
  • Ten factory presets from one table shared by both builds, so a preset cannot mean different things in Resolume and Resolve
  • Universal macOS bundle, a Windows x64 DLL, and an OpenFX bundle for macOS, Windows and Linux

Where it stands

Built, measured and released as v0.1.4. v0.1.2 gives the effect a proper description in the field Resolume shows, v0.1.3 put SW in front of its name there, and v0.1.4 tells OpenFX hosts its output changes every frame. None of the three changed a pixel. The signal model is checked with no GPU anywhere in the loop: the compander's round trip cancels to three millionths of a decibel wherever its gain law is unbounded and stops cancelling where the boost runs out, as it should, and a flat field comes back byte-identical through a matched pair. The GPU's parallel envelope detector matches a strictly serial version of the same law to float precision, and a control case with a wrong coefficient disagrees, as it must. Detail along the scan moves 6.7 times while detail across it moves 1.5, which is the check that catches it turning into an ordinary detail compressor. That testing caught four modelling errors during development, each by a number rather than by eye, and a bundle-loading probe caught a fifth that would have shipped every control declared to the host as zero, wet/dry mix included. It has since been put on a layer in Resolume Arena 7.27.1 and run on real footage, where all 24 controls, all eight groups and the ten factory presets were read back out of the running host, including the presets holding up while the host pushed parameters at them, which an offline harness can't tell you. Still open: no audio spectrum has ever reached the plugin. The test machine's Arena had its composition audio muted, so the audio-reactive controls are wired up and Resolume recognises them, but they've never been driven. The OpenFX build has only been run by a test probe and never opened in Resolve, and the Windows build is made in CI and has never been run.

Watch it running

Compander video thumbnail

Nothing loads from YouTube until you press play.Watch it there instead