Stoatworks Labs

Atrac

A MiniDisc-style perceptual coder for Resolume

Betav0.1.0Plugin & ModuleC++ / GLSL
Atrac — A MiniDisc-style perceptual coder for Resolume
No screenshot — this one is configuration inside another application.

What it does

An FFGL effect for Resolume Arena and Avenue. ATRAC, the perceptual coder MiniDisc used, does not throw detail away by resolution. It throws it away by bits: the signal is cut into overlapping blocks, each goes through a modified discrete cosine transform, the coefficients are grouped into block floating units with a scale factor and a word length each, and a fixed budget of bits per block is shared out by a masking model, so a band next to a loud band gets few bits or none.

Atrac runs that coder on the picture, as a separable two-dimensional lapped transform with a fixed budget per cell. Every artefact is a consequence of that budget and that transform, and none of it is drawn: fine texture goes first because it is at the bottom of the queue; a hard edge rings one block either side because quantisation noise is a sum of basis functions over the whole window, and short blocks confine it; the allocation is recomputed every frame, so texture shimmers at low rates; and a cell that runs out of bits falls to grey.

On top sits the disc. A MiniDisc reads faster than it plays into a shock-proof buffer, and a knock stops the read. Here an audio onset, or the Knock button, is the knock: the buffer drains, and only if it empties does playback break and the picture hold until the buffer has refilled. Buffer, Read Speed and Knock Length are seconds and a multiplier, in double on the CPU.

Show Bits paints every cell as its own coefficient plane with each band's word length as heat, and Show Blocks draws the grid with the cells the transient detector switched to short blocks tinted. Modelled on ATRAC-style coding from the published description of the format; ATRAC and MiniDisc are trademarks of Sony Group Corporation, and this project is not affiliated with or endorsed by Sony.

  • A separable 2-D lapped transform (the MDCT) with exact long/short block switching
  • Block floating units with ATRAC1's scale-factor and word-length laws
  • A fixed bit budget per cell, spent by a greedy on noise-to-mask ratio
  • A masking model with a stated spread, offset and absolute floor
  • The shock-proof buffer: Buffer, Read Speed, Knock Length, a Knock button and audio onsets
  • Show Bits and Show Blocks diagnostic views
  • Universal macOS bundle and a Windows x64 DLL

Where it stands

v0.1.0, and honestly early. The coder is measured, not asserted, by an offline harness that drives the real plugin class headlessly at two rasters: at unlimited bits the lapped transform returns the input within a rounding bound derived from the arithmetic, through long, short and mixed blocks (0.3% of the bound); every cell spends at most its budget and wastes less than one increment, read from the allocation texture the plugin's own shader wrote; a step's quantisation noise reaches exactly one block before the edge in Long mode and within three eighths of a cell in Short; SNR rises strictly with Bit Rate; a band beside a louder one is zeroed with Masking on and coded with it off; and a knock breaks playback exactly when it outlasts the buffer, resuming on the closed form. Twelve negative controls and a one-character mutation of the shipped shader are caught. All 13 swept controls change the picture. Render cost on macOS at the defaults is 4.9 ms/frame at 1080p and 16 ms at 4K, a whole 60 fps frame; nothing has been optimised. It has not yet been loaded into Resolume on macOS. On Windows it has: a build of this source loads, registers and renders in Resolume Arena 7.27.1 on software rendering (win-lab, no GPU), with every parameter as declared; Buffer, Read Speed and Knock Length could not be shown moving there, because they act only during a knock and the gate cannot press the button, and the audio controls were skipped because that machine has no sound device. The masking model is stated, not tuned, and nobody has measured what Resolume's 64 FFT bins carry. There is a user guide and a browser demo (a port, with no audio); no presets and no OpenFX port. Check it in your own rig before trusting it in a show.

Watch it running

Atrac video thumbnail

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