Stoatworks Labs

Relay

A relay's A/B cut, bounce and all, for Resolume

Betav0.2.0Plugin & ModuleC++ / GLSL
Relay — A relay's A/B cut, bounce and all, for Resolume
Relay

What it does

An FFGL mixer for Resolume Arena and Avenue, and the third mixer in the Stoatworks fleet. A cheap video switcher from the analogue days, a SCART box or an old routing switcher, cut with a relay, and every part of the relay did something to the picture, because a video frame is scanned out over time and a relay's events take milliseconds, about fifteen lines each.

The coil has hysteresis: it pulls in at one voltage and drops out at a much lower one. The layer's own opacity fader is the coil voltage (Resolume binds a mixer parameter named Opacity to it), so the fader cuts to B on the way up past Pull-in and back to A on the way down past Drop-out, and nothing in between is a dissolve. The contacts bounce. When the armature moves, the moving contact leaves A, flies over to B, hits, rebounds and hits again, each flight shorter by the coefficient of restitution, so the frame the switch lands on shows horizontal bands of A, black and B at the scanlines the bounce times set, cut mid-line at the pixel where the contact landed.

Then the receiver has to re-lock. If the two sources aren't genlocked, the new source's field timing is somewhere else entirely, and the monitor's vertical PLL pulls it in as a second-order step response, so the picture rolls and settles, overshooting if the loop is underdamped. And the open contact is a small capacitor, so the unselected input leaks through it high-passed, rising 6 dB an octave, and its edges ghost faintly into the selected picture. A good router switched in the vertical interval, and setting Switch Point to Vert Interval is that cure.

The relay runs on the CPU in double, in seconds of real elapsed time. The shader only asks, for each pixel, which line it's on and how far along, and so which contact the relay was on at that moment. You pick it as a layer's Blend Mode: the layer below is A, and the clip on this layer is B, which the energised coil selects.

Also available as an OpenFX transition for DaVinci Resolve and Vegas Pro. The relay works out its switch from the transition's own curve, switches at the midpoint by default, and has settled by the transition's last frame.

  • Chosen as a layer's Blend Mode in Resolume, installed in Extra Effects like any FFGL plugin
  • The layer's opacity fader is the coil: Pull-in and Drop-out hysteresis, Operate Time, plus Select and Take for hosts without that binding
  • Contact bounce: Bounce Time, Restitution and the Open Level, cut at the scanline and pixel
  • A vertical PLL that re-locks: Genlocked off, Phase Offset, Lock Time and Damping
  • Capacitive crosstalk with its corner in the signal's own MHz
  • PAL or NTSC raster timing; Switch Point Anywhere or Vert Interval
  • Universal macOS bundle and a Windows x64 DLL

Where it stands

v0.2.0, which adds the OpenFX build, and early days. It hasn't been loaded into Resolume on macOS yet. On Windows, Resolume Arena 7.27.1 (software rendering) loads it from Extra Effects, offers it as a layer Blend Mode and as a transition, initialises it cleanly, binds its Opacity to the layer's opacity fader and drives it from a layer transition, hiding only Standard. That was probed over REST and read from the plugin's own log, and nobody has looked at a frame of its output in Resolume yet. Resolume Arena hides a mixer's first parameter, so Relay's first is Standard (PAL) on purpose, which means NTSC can't be reached in Arena. The OpenFX build has been checked in DaVinci Resolve Studio 21.1 on macOS, on the Edit page; Vegas, Nuke and Natron are untried, and I haven't checked whether Nuke or Natron even list it. An offline harness drives the real plugin with two inputs at two different sizes and checks each claim against a closed form, on the GPU and on Apple's software renderer: the bounce bands land where the schedule puts them, with all 16 contact events within one line's blanking of when they happened, the coil switches at Pull-in and Drop-out on 41 of 41 frames, the re-lock follows the second-order step response, the crosstalk doubles per octave, and every check has a negative control that fails. All 17 sweepable controls change the picture. It costs 0.04 ms a frame at 1080p and 0.11 ms at 4K at rest, 0.13 ms at 4K with Crosstalk on. There's a user guide and a browser demo (a port, not the plugin), but no presets. The macOS build is signed and notarised. Try it in your own rig before you trust it in a show.

Watch it running

Relay video thumbnail

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