# De-esser

> A de-esser device: three models, frequency, over body, ratio and range, a panel that draws what it does at each frequency, a Web Audio engine and tools for agents.

```tsx
import { useState } from "react";
import {
  type DeesserState,
  deesserDevice,
} from "@/components/audio-ui/devices/deesser/device";
import { createDeesserEngine } from "@/components/audio-ui/devices/deesser/engine";
import { DeesserPanel } from "@/components/audio-ui/devices/deesser/panel";
import { useDeviceLoop } from "@/hooks/use-device-loop";
import { useDeviceSignal } from "@/hooks/use-device-signal";
import { useMasterBus } from "@/hooks/use-master-bus";
import { useDemoSound } from "@/hooks/use-demo-source";

const MASTER_VOLUME = 0.7;

/**
 * A de-esser you can plug in: its state, a panel that draws what it does at
 * each frequency and an engine that plays it, each its own file and none
 * knowing the others. It plays a loop: lower
 * the threshold and the highs sit back, switch Listen on to hear the highs alone.
 */
export function BlockDeesser() {
  const [state, setState] = useState<DeesserState>(() =>
    deesserDevice.defaults()
  );
  const master = useMasterBus(MASTER_VOLUME);
  const sound = useDemoSound("groove");
  const { engine } = useDeviceLoop({
    create: createDeesserEngine,
    destination: master,
    sound,
    state,
  });
  const signal = useDeviceSignal(engine, deesserDevice);
  return (
    <div className="rounded-xl h-full w-full min-w-0">
      <DeesserPanel onValueChange={setState} signal={signal} value={state} />
    </div>
  );
}
```

Softens the sharp s and t of a voice. When the highs above a frequency get loud, they are taken down, never by more than the range. The split, band and wide band models, from [audio.js](https://audio.js.org), read how far they rise over the voice's body, so the same setting works at any recording level. It is a [device](/docs/devices): a state, a panel, an engine and tools, each its own file.

## Installation

**CLI**

```bash
npx shadcn@latest add @audio-ui/deesser
```

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

**Manual**

**1. Install the packages:**

```bash
npm install @ui-sdk/core@0.1.0-beta.14 @ui-sdk/react@0.1.0-beta.14
```

**2. Add the pieces you want. All of them, or only the state and the panel if your engine is elsewhere:**

```bash
npx shadcn@latest add @audio-ui/deesser-device @audio-ui/deesser-panel @audio-ui/deesser-engine
```

**3. Copy and paste the demo that wires them, if you want it.**

```tsx title="components/examples/block-deesser.tsx"
import { useState } from "react";
import {
  type DeesserState,
  deesserDevice,
} from "@/components/audio-ui/devices/deesser/device";
import { createDeesserEngine } from "@/components/audio-ui/devices/deesser/engine";
import { DeesserPanel } from "@/components/audio-ui/devices/deesser/panel";
import { useDeviceLoop } from "@/hooks/use-device-loop";
import { useDeviceSignal } from "@/hooks/use-device-signal";
import { useMasterBus } from "@/hooks/use-master-bus";
import { useDemoSound } from "@/hooks/use-demo-source";

const MASTER_VOLUME = 0.7;

/**
 * A de-esser you can plug in: its state, a panel that draws what it does at
 * each frequency and an engine that plays it, each its own file and none
 * knowing the others. It plays a loop: lower
 * the threshold and the highs sit back, switch Listen on to hear the highs alone.
 */
export function BlockDeesser() {
  const [state, setState] = useState<DeesserState>(() =>
    deesserDevice.defaults()
  );
  const master = useMasterBus(MASTER_VOLUME);
  const sound = useDemoSound("groove");
  const { engine } = useDeviceLoop({
    create: createDeesserEngine,
    destination: master,
    sound,
    state,
  });
  const signal = useDeviceSignal(engine, deesserDevice);
  return (
    <div className="rounded-xl h-full w-full min-w-0">
      <DeesserPanel onValueChange={setState} signal={signal} value={state} />
    </div>
  );
}
```

**Agent**

Paste this prompt to your agent. It does the rest: it installs the skill, adds the component and wires it to your audio.

```text
Install the audio/ui skill with `npx skills add ouestlabs/audio-ui`, then follow it to add the deesser from audio/ui to my project and wire it to my audio code. Read the docs at https://www.audio-ui.dev/llms.txt first.
```

To let the agent read the docs live, connect the [MCP server](/docs/mcp). More in [Agent Skill](/docs/agents).

## Controls

| Control | Range | Default | What it does |
| --- | --- | --- | --- |
| On | On or off | On | Turns the device on. Off, the signal passes through unchanged. |
| Model | Split, Band, Wide band | Split | What is taken down, and how an s is told. See [Models](#models). It is picked in the title bar, and the controls the model does not use are drawn off. |
| Frequency | 2 kHz to 12 kHz | 6.5 kHz | Where the highs start, or the centre of the band. Drag the handle on the plot across to set it. |
| Q | 0.30 to 10.00 | 1.40 | How narrow the band model's band is: 1.4 is about an octave. |
| Over body | -12 dB to 24 dB | 0 dB | How far the highs must rise over the voice's body, in dB, to be taken down. |
| Ratio | 1:1 to 20:1 | 6:1 | How much the highs are brought down above that. |
| Range | 0 dB to 24 dB | 12 dB | The most the highs are taken down. Drag the handle down to raise it. |

## Models

| Model | Tells an s by | Takes down |
| --- | --- | --- |
| Split | the highs rising over the voice's body | the highs over the frequency, by a linear-phase split |
| Band | the same | a band around the frequency, as wide as the Q |
| Wide band | the same | the whole sound, while the s lasts |

Split, Band and Wide band are the modes of `@audio/dynamics-deesser`, its processor as published in an `AudioWorklet`. They hear the sound 5 ms ahead of what they cut, so an s is taken down from its start: the device's [latency](/docs/devices#latency) is 5 ms. Until the worklet is ready, the highs pass unchanged. Their values change as they play. Their knee, attack and release are the package's: 6 dB, 1 ms and 15 ms.

## Panel

The panel draws what the device does at each frequency at full reduction. The handle sits on the curve at the frequency: drag it across for the frequency and down for the range. `deesserResponse(state)` is the curve the panel draws. Pass `signal`, the device's live sound from [`useDeviceSignal`](/docs/hooks/use-device-signal), to see the spectrum of what comes out behind the curve.

```tsx
import { DeesserPanel } from "@/components/audio-ui/devices/deesser/panel";
import { deesserDevice } from "@/components/audio-ui/devices/deesser/device";

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

<DeesserPanel onValueChange={setState} value={state} />;
```

## Engine

Create it, connect it and update it as for any device: see [The engine](/docs/devices#the-engine).

```ts
engine.reduction; // dB taken off the highs, read per frame
```

The panel draws the cut of the split with two Butterworth biquads in a row, a Linkwitz-Riley split, and the band with a band-pass of the same Q: at the frequency they match the package's linear-phase filters, which fall away faster around it. `engine.reduction` reads what is taken off the whole sound, which for a split or a band is less than what the highs lose.
