Reverb

A reverb device: a decay, a pre-delay, a damping and a mix, a panel that draws the tail with a handle, a Web Audio engine and tools for agents.

Audio UI

Puts the sound in a room. It is a device: a state, a panel, an engine and tools, each its own file.

Installation

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

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

Controls

Controls · 5

Panel

The panel draws the level of the tail falling in dB, from the end of the pre-delay to -60 dB. reverbDecay(state) is the curve it draws, and reverbImpulse(sampleRate, state) makes the impulse response of the room.

import { ReverbPanel } from "@/components/audio-ui/devices/reverb/panel";
import { reverbDevice } from "@/components/audio-ui/devices/reverb/device";

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

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

Engine

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

The room is a convolver fed an impulse response made from the decay and the damping. A convolver cannot change its impulse without a click, so the engine has two and cross-fades: a new room is built in the idle one, at most every 120 ms while a control moves.

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