Songbird React UI (react_ui/src/)
The React frontend provides the full DAW interface for Songbird, running inside a JUCE WebView. Built with Vite, React 19, Tailwind CSS v4, and Zustand for state management.
Architecture Overview
Component Structure (Atomic Design)
Atoms (atoms/)
Reusable primitives built on Radix UI. Styled with Tailwind + class-variance-authority:
button,input,select,slider,knob,switch,tabs,toast,tooltip, etc.
Molecules (molecules/)
Composed components combining multiple atoms:
LevelMeter— per-track audio level visualizationPluginSlots— instrument/FX/strip slot managementMuteSoloButtons,PanControl,VolumeFader— mixer controlsStereoMeters— spectrum, stereo width, phase correlation metersRecordStrip— MIDI/audio recording controls per track
Organisms (organisms/)
Larger self-contained UI blocks:
MixerChannel/MasterChannel— full channel stripsTrackHeader/TrackLane— arrangement view rowsTimelineRuler— bar/beat rulerLoadingScreen/ExportProgressModal— overlays
State Management
Zustand Stores (data/)
| Store | ID | Purpose |
|---|---|---|
useTransportStore | songbird-transport | Playback position, BPM, key signature, scale, loop state |
useMixerStore | songbird-mixer | Track list, volumes, pans, mutes, solos, notes, sections, plugins |
useChatStore | songbird-chat | AI chat messages, threads, right panel state |
useLyriaStore | songbird-lyria | AI music generation config |
State Persistence Bridge (data/bridge.ts)
All Zustand stores persist through a custom StateStorage that routes to C++ via JUCE native functions:
Key Event Channels
| Event | Direction | Description |
|---|---|---|
rtFrame | C++ → JS | Batched real-time data at 30Hz: per-track levels, master levels, transport position, spectrum, stereo analysis, CPU stats. JS-side ballistic smoothing provides visual 60Hz. |
trackState | C++ → JS | Full track/section/note data after .bird load |
notesChanged | C++ → JS | Lightweight note update from MIDI editing |
trackMixerUpdate | C++ → JS | Per-track volume/pan/mute/solo from ValueTree listeners |
loadingProgress | C++ → JS | Loading progress messages during startup |
birdContentChanged | C++ → JS | Notifies BirdFilePanel of .bird file content changes |
Key Libraries
- React 19 — UI framework
- Tailwind CSS v4 — Utility-first styling (via
@tailwindcss/viteplugin) - Zustand — Lightweight state management
- Radix UI — Accessible primitive components
- class-variance-authority — Component variant styling
- @tonaljs — Music theory calculations (chord, note, tonal)
Development
Note: In production, the React app runs inside the JUCE WebView — not a browser. The window.__JUCE__ global is injected by JUCE and provides the native function bridge.