LabDAW

Limiter

A limiter device: input gain, ceiling, release and true peak, a panel that draws its transfer curve with a handle on the ceiling, a Web Audio engine and tools for agents.

Audio UI

Keeps the sound under a ceiling. The input gain pushes the level against it, and what goes over is held down. It is the lookahead brickwall limiter of audio.js, which can hold true peaks. It is a device: a state, a panel, an engine and tools, each its own file.

Installation

pnpm dlx shadcn@latest add @audio-ui/limiter

It installs the device's state, its engine and its panel to components/audio-ui/devices/limiter/. The demo above, which wires them to a loop, is @audio-ui/block-limiter.

Controls

Controls · 6

Panel

The panel draws the transfer curve against the straight line of a clean sound. Drag the handle up and down for the ceiling and across for the input gain.

import { LimiterPanel } from "@/components/audio-ui/devices/limiter/panel";
import { limiterDevice } from "@/components/audio-ui/devices/limiter/device";

const [state, setState] = useState(() => limiterDevice.defaults());

<LimiterPanel onValueChange={setState} value={state} />;

Engine

Create it, connect it and update it as for any device: see The engine.

engine.reduction; // dB being taken off, read per frame

The limiter is the processor of @audio/dynamics-limiter's manifest as published, in an AudioWorklet. Until the worklet is ready, the signal passes at the input gain. The ceiling and the release change as it plays. A new look-ahead or true peak, which set its delay, builds it again: at most every 50 ms, the new one first playing the last 100 ms of sound, then taking over in a 30 ms fade. engine.reduction reads the gain it takes off, measured from its output against its input as late.

Its latency is the look-ahead, plus 96 samples with True peak on, and the device declares it, so a host that compensates latency keeps it in time. Measured on noise pushed 20 dB over the ceiling:

True peakSamplesBetween the samples
Offat the ceilingup to 1.5 dB over it
Onat the ceilingat it, read at 8 points a sample; 0.02 dB over, read at the 4 of BS.1770
Built by Ouest Labs, the source code is available on GitHub.
RSS