Equalizer Pro
One payment, every Pro piece. $9 tomorrow.
Install
npx shadcn@latest add @mu-pro/equaliserPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/equaliser/ with the shared foundation.
Usage
import { useRef } from "react";
import { Equaliser } from "@/components/mu/equaliser/Equaliser";
// on an <audio> or <video> element
const audio = useRef<HTMLAudioElement>(null);
<>
<Equaliser media={audio} />
<audio ref={audio} src="/music.mp3" controls />
</>
// on an AudioNode of your own (it plays to that context's speakers)
<Equaliser source={myNode} playing={isPlaying} />
// as a control only: no audio, just the gains
<Equaliser value={gains} onValueChange={setGains} />Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/equaliserOptional. An AI agent in your app can read and set this piece by name, and you can ask before anything it can’t undo. The piece itself doesn’t change; installs with your Pro key, like the piece. Built on UI SDK 0.1.0-beta.23, which is in beta too, so this add-on follows its releases.
Source
How it works
Building with an agent? Hand it a ready prompt for this piece.
Input and reduced motion
- Pointer / touch: press a knob and drag: it follows your hand from where it is. A press on the slot that doesn't travel glides the knob there; a drag that starts on the slot moves the knob by your hand's travel, never jumping to the pointer. Release settles to 0.5 dB (0.1 with Shift). A press anywhere on the bank goes to the nearest fader, so each fader's target is its whole column; the drag keeps the pointer (pointer capture), and a cancelled touch puts the band back. Double-click a fader to reset it to 0 dB.
- Keyboard: each fader is a slider in tab order: arrows step 0.5 dB (Shift: 0.1), Page Up and Page Down 3 dB, Home and End −12 and +12, Enter resets the band, Escape cancels a drag. The faders say their value ("+4.5 dB"); the preset display is a polite live region. ◀ ▶, On (
aria-pressed) and the round keys are buttons; Compare isaria-pressedwhile on B. - Motion: a preset, a reset or an A/B swap moves every fader on one glide, staggered from the preamp to 16 kHz (0.35s), and the line of light moves with them, landing exactly.
- Reduced motion: the faders jump to presets, keys and releases; a drag still tracks the hand. The line of light follows the faders the same way.
- Off-screen: the spectrum pauses; the music plays on.
Props
| Prop | Default | What it does |
|---|---|---|
media | — | element or ref | the <audio>/<video> to equalise |
source | — | AudioNode | or a node of yours, in place of media; the equaliser connects it to its context's destination |
playing | true | boolean | with source only: whether it plays, so the spectrum listens only then (with media it follows the element) |
value | — | { preamp, bands } | controlled gains in dB: the preamp and the ten bands (31, 62, 125, 250, 500, 1k, 2k, 4k, 8k, 16k Hz), each −12 to 12 |
defaultValue | flat | as value | uncontrolled start |
onValueChange | — | — | every change, by hand, key, preset, A/B or reset, rounded to 0.1 dB (every step of a drag, and the place a cancelled drag goes back to); never an echo of value |
onValueCommit | — | — | a change that has landed: a release, a key, a preset, A/B or reset. Save here |
presets | five | EqualiserPreset[]: { name, preamp?, bands } | what ◀ ▶ step through: Flat, Bass boost, Vocal, Treble, Loudness by default (PRESETS is exported). Gains that match none read "Custom"; [] hides the display and ◀ ▶ |
on, defaultOn, onOnChange | true | boolean | on (filtering) or bypassed, controlled or not; onOnChange hears a person's press |
labels | English | — | EqualiserLabels: { title, model, preset, custom, prev, next, on, preamp, reset, compare }: the words on the face and the keys' names |
sound | off | true or 0–1 | key sounds (see Sound) |
className | — | — | added to the root |
Sound
None. It loads in silence.
Off by default. With sound (or a volume, sound={0.5}) ◀ ▶, On, Reset and Compare give a soft key tock; the faders are silent, so a sweep is heard through the music only. Nothing plays on hover, on mount or from a prop change. setMuted(true) from components/mu/sounds.ts silences every cottoncandy item at once.
Licence
Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.
A ten-band graphic equaliser in the tape recorder's satin body: drag a fader and the one amber line of light in the smoked glass, and the music, follow it. Ten real Web Audio filters at 31 Hz–16 kHz, a preamp, presets, bypass and an A/B compare; the glass shows the live spectrum of what you hear.
For audio settings and sound tuningMore in Audio & media