Stoatworks Labs

Compander

Radio mic companding for video

Releasedv0.1.2Plugin & ModuleC++ / GLSL
Compander — Radio mic companding for video
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 wireless microphone link cannot carry the dynamic range of what is sent down it. So the transmitter squashes it — pre-emphasis to lift the quiet top end above the link's noise, then a compressor that halves the signal's excursion 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 the point: 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, edges screaming where the pre-emphasis was never taken back off. Expand with nothing compressed and it goes contrasty and dead, blacks crushed below the floor, fine detail sucked out of anything dim.

One idea makes it a video effect rather than an audio compressor pointed at a picture: a signal on a wire has one axis, time, and when that signal is a picture, time is the scan. So a compander's attack and release converts exactly into a distance along the line — the active picture is 52 microseconds of a 64 microsecond line. One control therefore runs from haloing tight to every edge, through a smear off the side of things, to streaks pulling down the frame and finally the whole picture pumping.

Two consequences follow from taking that seriously, and both are the give-away that a real circuit is being modelled. It is causal, so a bright object drags its gain change out behind it across the scan and leaves its left-hand edge untouched — the asymmetric tail every analogue video level artifact has, where a symmetric halo is the signature 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. That is not a gimmick bolted onto a video effect: a compander is a circuit whose gain is driven by an audio envelope, so this is 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 on the wrong side of the room, something cheap from a market stall, a consumer tape format's luma channel, a satellite up-link and an ENG microwave truck — named for what they are rather than 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.1; the point release changed nothing but the Windows installer, which no longer touches the system PATH — the earlier one could overwrite it. The signal model is checked without a GPU anywhere in the loop: the compander's round trip cancels to three millionths of a decibel wherever its gain law is unbounded and provably stops cancelling where the boost runs out, and a flat field comes back byte-identical through a matched pair. The envelope detector is the part that could most easily be wrong, so the parallel version the GPU runs is compared against a strictly serial implementation of the same law — one that could never run on a GPU, which is exactly why it is worth having as the ground truth — and they agree to float precision, with a control case using a deliberately wrong coefficient that must and does disagree. Detail along the scan moves 6.7 times while detail across it moves 1.5, measured from two combs identical at source, which is the check that catches the effect quietly becoming an ordinary detail compressor. That testing found four modelling errors during development, each caught by a number rather than by eye: a mistracking control that was really a brightness control, a colour control whose two branches were algebraically identical, a tilt that could reach neither of the characters it promised, and an emphasis crossover wrongly tied to the detector. A fifth would have shipped every control declared to the host as zero, including the wet/dry mix, and was caught by a bundle-loading probe reporting that a frame came back unchanged. 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 preset behaviour holding under the host pushing parameters at it, which is the one thing an offline harness cannot establish. Still open, and stated plainly: 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 and recognised by Resolume but have never been driven. The OpenFX build has only been exercised by a test probe, 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