Overdrive

An overdrive device: a band-pass before a soft clip, a drive, a tone and a mix, a panel that draws the band that reaches the clip, a Web Audio engine and tools for agents.

Audio UI

A pedal-style distortion. A band-pass filter picks what is pushed into the soft clip, so the lows do not turn to mud. It is a device: a state, a panel, an engine and tools, each its own file.

Installation

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

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

Controls

Controls · 6

Panel

The panel draws the band-pass that picks what reaches the clip, with a handle on its centre. overdriveBand(state) is the curve it draws.

import { OverdrivePanel } from "@/components/audio-ui/devices/overdrive/panel";
import { overdriveDevice } from "@/components/audio-ui/devices/overdrive/device";

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

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

Engine

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

Only what the band-pass lets through goes into the clip, and the clean sound goes round it in the dry path. The drive is a gain before one fixed soft-clip table, and the shaper oversamples 4x to keep the clip from aliasing. That oversampling is the latency of the device.

Built by Ouest Labs, the source code is available on GitHub.
RSS