Skip to content
Sign in
AudioStem mixerMenu

Stem mixerPro

Stems in sync with mute, solo, a fader and a live meter each, export per stem with its state, and the mix meter.

ProFour stems in sync on a loop with mute, solo, faders, live meters and export per stem.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/stem-mixer

Usage

tsx
import { StemMixer } from "@/components/ui/chatcn/pro/stem-mixer"

<StemMixer stems={stems} onExport={exportStem} exports={exportStates} />

A stem is { id, name, detail, source }; every stem loads into one engine and plays sample accurate, looping by default. Solo wins over everything and mute over its fader; switches ramp the gain over 10 ms so they never click. Meters read after the fader.

The examples play a demo synthesizer built on the Web Audio API (renderStem and renderSong in @/lib/chatcn-pro-music): drums, bass, keys and a sung line in a key and tempo, rendered offline. Pass your own audio as URLs or buffers instead.

Examples

States

ProSolo and mute with export results, separating and failed.

Props

PropTypeNotes
stemsStem[]Required
mix, defaultMix, onMixChangeStemMixVolume, mute and solo per stem
loopbooleanDefault true
status, error, onRetryReady, separating or error
onExport, onExportAll, exportsExport per stem and its state
labelsPartial<StemMixerLabels>Every string the mixer shows or announces, for translation

Keyboard

KeyAction
M in a rowMute that stem
S in a rowSolo that stem
← → on a faderChange its volume

Accessibility

  • Mute and solo are toggle buttons named with their stem. Each meter is a meter with its value in dB.
  • Export state is in the button's name and tooltip, with an icon as well as a color.

Motion

  • Meters follow the audio. Separating shows the text shimmer after 300 ms. Nothing else moves.