Genlock
An Amiga genlock for Resolume

What it does
An FFGL mixer for Resolume Arena and Avenue, and the first mixer in the Stoatworks fleet. It takes two pictures: the layer below is the incoming video, and the clip on this layer is the computer's picture — fill, and the colour 0 the key is cut from. An Amiga genlock keyed the palette's background colour over video, and the video set the timing. The computer did not follow it.
That is the whole design: the key is cut on the Amiga's own pixel clock, the PAL lores 7.09379 MHz, which free-runs a few parts per million away from the video's. So the key is fetched a small distance from the fill it belongs to. Where the key says computer and the fill is still colour 0, the background lands on the video; where it says video and the fill is already the graphic, video cuts into the graphic. The sign of Key Delay says which edge gets which, and both are things that really happened.
Because the clocks differ, that distance walks. Clock Error is in parts per million, geometric from 0.01 to 50, and the crawl rate falls out of it: the pixel clock times the fractional error. A real genlock re-locks on every line sync, so only the remainder survives — the fringe walks as far as Crawl Wrap allows, one Amiga pixel by default and up to the sixteen-pixel length of the PAL colour burst, and snaps back. Drop Sync Quality below half and the overlay loses vertical lock, rolls at Roll Rate and tears at the seam; the video underneath does not move.
Amiga Mode sets what an Amiga pixel is — 1/320, 1/640 or 1/1280 of the picture width at any raster — and moves only what the computer counts in its own pixel clocks: Key Delay and Crawl Wrap are half the distance in hires and a quarter in superhires, while the crawl's speed across the picture and the tear's throw, which are time errors in the video, stay the same. A three-position Video, Overlay, Dissolve fader with a dissolve pot is there because the hardware had one.
resolume-luma-keyer is the keyer that works. Here the flaws are the product.
- Chosen as a layer's Blend Mode in Resolume, installed in Extra Effects like any FFGL plugin
- A true FFGL mixer: the layer below is the video, this layer is the computer, each read at its own resolution
- Key on Colour 0 (Workbench blue by default), with tolerance, softness and invert; Luma and Alpha keys in hosts that expose Key Source (Resolume does not)
- A signed Key Delay of up to eight Amiga pixels: colour 0 laid over the video, or video cut into the graphic
- Clock Error in parts per million, 0.01 to 50, and a crawl that follows the rate it predicts
- Crawl Wrap from one Amiga pixel to the sixteen-pixel PAL colour burst
- Lores, Hires and Superhires, scaling what is counted in pixel clocks and nothing else
- Loss of vertical lock: the overlay rolls and tears while the video stays put
- A three-position Video, Overlay, Dissolve fader, and an Edge Tint for the fringe's chroma crosstalk
- Universal macOS bundle and a Windows x64 DLL
Where it stands
v0.1.0, and honestly early. The timing is measured, not asserted: an offline harness drives the real plugin class headlessly with two inputs at two different sizes and checks each claim against an independent statement of the same arithmetic. Two padded inputs resolve with 0 padding pixels reaching the picture; a whole-pixel key delay translates the key exactly, 0 of 164 bytes different, and a fractional one is recovered from partial coverage at 0.4941 output texels against 0.5000; the crawl follows its closed form to 0.0176 texels over 30 frames and wraps 3 times as predicted; the roll lands within 0.0000 rows at two rasters; the crawl's speed across the picture is bit-identical in lores, hires and superhires; at Fader Video the output is the layer below, bitwise; and a one-character mutation of the shipped shader is caught. All 21 sweepable controls measurably change the picture. Render cost on macOS is under 0.12 ms/frame at 4K. It has not yet been loaded into Resolume on macOS. On Windows, Resolume Arena 7.27.1 (software rendering, win-lab) loads it from Extra Effects, offers it as a layer Blend Mode, calls it every frame with both inputs and its clock in milliseconds, and binds its Opacity to the layer's opacity fader — read from the plugin's own log; no frame of its output in Resolume has been looked at yet. Arena does not show Key Source, the first control, so in Resolume the key is always Colour 0; Luma and Alpha keying are unreachable there. Whether Resolume ever calls a mixer with one input is still open. Hires and superhires are arithmetic rather than observation, PAL only with no NTSC, the tear at the roll seam is a look rather than a model, and premultiplied alpha is assumed. There is a user guide and a browser demo, which is a port rather than the plugin; no presets and no OpenFX port. Check it in your own rig before trusting it in a show.
Watch it running
Nothing loads from YouTube until you press play.Watch it there instead