# Exciter

> An exciter device: a frequency, a drive and an amount, a panel that draws the band it excites, a Web Audio engine and tools for agents.

```tsx
"use client";

import { useState } from "react";
import {
  type ExciterState,
  exciterDevice,
} from "@/components/audio-ui/devices/exciter/device";
import { createExciterEngine } from "@/components/audio-ui/devices/exciter/engine";
import { ExciterPanel } from "@/components/audio-ui/devices/exciter/panel";
import { useDeviceLoop } from "@/hooks/use-device-loop";
import { useMasterBus } from "@/hooks/use-master-bus";

const MASTER_VOLUME = 0.7;

/**
 * An exciter you can plug in: its state, a panel that draws the band it
 * excites and an engine that plays it, each its own file and none knowing the
 * others. Play the loop and raise the amount: it comes forward.
 */
export function BlockExciter() {
  const [state, setState] = useState<ExciterState>(() =>
    exciterDevice.defaults()
  );
  const master = useMasterBus(MASTER_VOLUME);
  useDeviceLoop({
    create: createExciterEngine,
    destination: master,
    state,
  });
  return (
    <div className="rounded-xl h-full w-full min-w-0">
      <ExciterPanel onValueChange={setState} value={state} />
    </div>
  );
}
```

Adds presence and air. It takes the highs above a frequency, saturates them into new harmonics above, and adds those to the sound: a voice or a mix comes forward and opens up without a boost that only makes it louder. 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/exciter
```

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

**Manual**

**1. Install the packages:**

```bash
npm install @audio-ui/react @audio-ui/core
```

**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/exciter-device @audio-ui/exciter-panel @audio-ui/exciter-engine
```

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

```tsx title="components/examples/block-exciter.tsx"
"use client";

import { useState } from "react";
import {
  type ExciterState,
  exciterDevice,
} from "@/components/audio-ui/devices/exciter/device";
import { createExciterEngine } from "@/components/audio-ui/devices/exciter/engine";
import { ExciterPanel } from "@/components/audio-ui/devices/exciter/panel";
import { useDeviceLoop } from "@/hooks/use-device-loop";
import { useMasterBus } from "@/hooks/use-master-bus";

const MASTER_VOLUME = 0.7;

/**
 * An exciter you can plug in: its state, a panel that draws the band it
 * excites and an engine that plays it, each its own file and none knowing the
 * others. Play the loop and raise the amount: it comes forward.
 */
export function BlockExciter() {
  const [state, setState] = useState<ExciterState>(() =>
    exciterDevice.defaults()
  );
  const master = useMasterBus(MASTER_VOLUME);
  useDeviceLoop({
    create: createExciterEngine,
    destination: master,
    state,
  });
  return (
    <div className="rounded-xl h-full w-full min-w-0">
      <ExciterPanel onValueChange={setState} value={state} />
    </div>
  );
}
```

**Agent**

Give your agent the skill, and it picks the component, installs it and wires it to your audio:

```bash
npx skills add ouestlabs/audio-ui
```

Then ask it:

```text
Add the exciter from audio/ui to my project and wire it to my audio code.
```

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. |
| Frequency | 500 Hz to 8 kHz | 3 kHz | Where the highs it excites start: lower takes more of the sound, higher only its air. |
| Drive | 0 % to 100 % | 50 % | How hard the highs are saturated: more makes more, and brighter, harmonics. |
| Amount | 0 % to 100 % | 50 % | How much of the harmonics is added to the sound. At 0 the sound is as it was. |

## Panel

The panel draws the band of highs it makes its harmonics from. `exciterBand(state)` is what it draws.

```tsx
import { ExciterPanel } from "@/components/audio-ui/devices/exciter/panel";
import { exciterDevice } from "@/components/audio-ui/devices/exciter/device";

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

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

## Engine

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

The exciter runs on the audio thread: the exciter of `@audio/effect-exciter` in an `AudioWorklet` loaded from a blob (`EXCITER_WORKLET` is its source), 128 frames at a time: a high-pass, a state-variable filter with a Q of 2, then a soft saturation whose harmonics are added to the sound. A worklet cannot import, so the device carries the kernel as published (`EXCITER_KERNELS`, in its `kernels.ts`). Until it is ready, and in a context with no worklets, the sound passes clean: `ready` resolves once it is in the graph.
