Synth Pro
One payment, every Pro piece. $10 tomorrow.
Install
npx shadcn@latest add @mu-pro/synthPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/synth/ with the shared foundation.
Usage
import { Synth } from "@/components/mu/synth/Synth";
<Synth onNoteOn={(note) => console.log("on", note)} onPatchChange={(i) => save(i)} />Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/synthOptional. 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: knobs drag vertically; keys press, glide and chord; the round keys press (44px targets). On a phone the audio starts on the first touch's lift as well as its press.
- Keyboard: every knob is a slider (arrows step, Page Up/Down step further, Home and End go to the ends); the round keys are buttons; the keyboard is one stop whose computer keys play notes.
- Reduced motion: knobs jump to their values, the patch name swaps without travel and the flare goes; a drag still tracks, and the lamps, bead and meter still show the sound.
Props
| Prop | Default | What it does |
|---|---|---|
presets | 8 patches | SynthPatch[] | the patches the Preset knob steps through: { name, wave, cutoff, res, attack, decay, sustain, release, octave } (SYNTH_PRESETS is exported); [] is an empty state ("No patches" on the screen, data-empty) |
patch / defaultPatch | — / 6 | an index | the patch, controlled or uncontrolled (6 is Patch 07, Soft brass); a new patch moves every knob to it on a spring |
onPatchChange | — | — | (index): the hand chose a patch (never an echo of patch) |
params / defaultParams | — | Partial<SynthParams> | the knobs, controlled or uncontrolled: cutoff Hz 60–12000, res 0–1, attack s 0.002–2, release s 0.02–4, wave "sine" \ | "triangle" \ | "sawtooth" \ | "square", octave −2…2. Controlled knobs glide to the values you pass |
onParamsChange | — | — | (params): the six knob values, whenever they change by a hand or a patch (every move of a drag), controlled or not |
onNoteOn / onNoteOff | — | — | (note): a MIDI note number started or stopped sounding, arpeggiated notes too |
tempo | 110 | BPM | the arpeggiator's tempo, in 16th notes |
sound | on | true, 0–1 or false | the synth's voice and the knobs' detent clicks; false plays nothing, so it can drive your own engine through onNoteOn |
onAudio | — | (node \ | null) => void | the synth's output node, once the first press makes it, and null on unmount: tap it into the equaliser or a visualiser |
midi | off | true | listen to Web MIDI keyboards (the browser asks on the first press) |
model | "SY-04" | — | the model code in the header |
labels | English | — | SynthLabels: { title, cutoff, res, attack, release, wave, octave, preset, patch, hold, arp, down, up, keys, waves, empty, error }; keys is the keyboard's accessible name |
className | — | — | added to the root |
Sound
None. It loads in silence.
On by default, because it is an instrument (owner's call): sound={0.5} for half volume, false for silence. One note peaks about 7 dB over FOUNDATION's held-sound ceiling, by design for an instrument (the output is halved); a change of sound or the mute fades over about 15ms, never a click. The AudioContext is made on the first press or key, never on load. Clicks come only from a person's turn or press. setMuted(true) from components/mu/sounds.ts silences it with every other cottoncandy item.
Licence
Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.
Play a two-octave polyphonic synth with real sound: turn machined knobs that follow your hand and land on their detents, pick a patch and watch its envelope light up on the smoked glass, hold a chord or arpeggiate it, and every key you press tilts and lights in amber as its note sounds.
For music tools and playful instrumentsMore in Music & audio