Skip to content
Sign in
AudioMusic composerMenu

Music composerPro

One composer for a song: a description with genre, mood, tempo with tap tempo, key and length chips, an instrumental switch, and lyrics with section tags that autocomplete.

ProDescribe a song and set genre, mood, tempo with tap tempo, key and length in the line. Compose lands a card with two takes.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/music-composer

Usage

tsx
import { MusicComposer } from "@/components/ui/chatcn/pro/music-composer"

<MusicComposer status={status} onCompose={({ prompt, params }) => compose(prompt, params)} onStop={cancel} />

Every parameter is a chip in the line and anything left on its label is the model's choice: bpm and key are null for Auto. Tempo opens a stepper with tap tempo (the median of your last taps). Lyrics open the audio-tags editor with section tags like [Chorus]; Instrumental turns them off.

Examples

States

ProEmpty, with lyrics and section tags, instrumental, composing and disabled.

Props

PropTypeNotes
value, defaultValue, onValueChangestringThe description
params, defaultParams, onParamsChangeMusicParamsGenre, moods, bpm, key, instrumental, seconds, lyrics
genres, moods, lengths, maxMoods, tempoRangeThe choices offered
onCompose, status, onStopGenerating turns Compose into Stop
sectionsAudioTagInfo[]Section tags for the lyrics
labelsPartial<MusicComposerLabels>Every string the composer shows or announces, for translation

Keyboard

KeyAction
EnterCompose. Never while composing with an IME
Shift + EnterNew line
[ in the lyricsOpen the section tags
EscStop, or close a chip editor

Accessibility

  • Chips are buttons named with their value: "Tempo: 88 bpm", "Key: A minor".
  • Tap tempo announces the tempo it lands on. Instrumental and Lyrics are toggle buttons.

Motion

  • Chip menus and editors grow from their chip in 180 ms; a changed value swaps with a 150 ms blur crossfade. The lyrics panel opens at once.