How kemoshumai/souon-editor works
1. Overall shape
- This is a Tauri + React + TypeScript application with a Rust backend.
- The product appears to be a music/chart editor for audio labeling and sequential note/event editing, rather than a general-purpose web app.
2. Frontend shell
- The UI lives under src/ and is built with Vite and React.
- src/main.tsx and src/App.tsx likely bootstrap the app, while src/global.css and the src/components/ui/ set provide the visual system and reusable controls.
3. Primary workspace layout
- src/SequentialEditor.tsx is the main editing surface.
- It is decomposed into tracks and timeline-specific views:
- TempoTrack
- MusicTrack
- StemTrack
- ChartTrack
- PlayingBarContainer
- TrackHeader
- This suggests a multi-lane timeline editor with synchronized audio, tempo, and note/event layers.
4. Chart editing domain
- The src/SequentialEditor/ChartTrack/ subtree contains the core chart interaction model:
- note rendering (Note/SingleNote.tsx, Note/LongNote.tsx)
- event overlays (EventsView/SpeedChangeEventView.tsx)
- previewing (ChartTrackPreview/PreviewCanvas.tsx)
- track background and menus
- The store layer under src/store/ holds the domain objects for charts, notes, tempo, lanes, temporal position, and speed-change events.
5. Global state and data model
- src/store/store.ts is the central state container.
- Domain stores are split by concern:
- project.ts
- chart.ts
- lane.ts
- tempoEvent.ts
- noteEvent.ts
- speedChangeEvent.tsx
- userSettings.ts
- This indicates the editor is state-heavy, with shared project state driving all timeline views.
6. Audio and waveform pipeline
- src/AudioSystem.tsx and src/AudioSystem/Stem.tsx indicate an audio subsystem for playback and stem management.
- src/utils/waveformRenderer.ts suggests waveform generation/rendering is part of the UI.
- public/moca/voice/ implies bundled local audio assets or sample voice material.
7. Project/file operations
- src/SaveSystem.tsx handles persistence and probably serialization of project/chart data.
- src/HeaderController/ contains file and project commands:
- file menu
- metadata window
- settings
- update check
- “plus” menu actions like generating a new chart
- The architecture suggests these are user-facing command entry points into the same underlying project state.
8. Floating panels and interaction primitives
- src/components/DraggableWindow.tsx plus the HeaderController/* windows show a desktop-style UI with movable dialogs/panels.
- src/components/ui/ provides a reusable component toolkit for form controls, drawers, dialogs, sliders, tooltips, toasters, and color mode.
9. Event and communication layer
- src/eventBus.tsx indicates an in-app event bus for cross-component coordination.
- This is likely used for editor actions that need to notify multiple panels without direct parent-child coupling.
10. Rust/Tauri backend
- src-tauri/src/ contains the native side of the app:
- audio_labeling.rs
- export_meta.rs
- language_model.rs
- python_env.rs
- stem.rs
- lib.rs, main.rs
- This is the boundary where the frontend calls into native commands for heavier work such as audio analysis, metadata export, model-backed operations, Python integration, and stem processing.
11. Platform and packaging boundaries
- src-tauri/tauri.conf.json, capabilities/, and icons/ define Tauri app configuration and permissions.
- src-tauri/gen/android/ shows an Android target is generated and maintained, so the app is not desktop-only.
- src-tauri/nsis/installer.nsi indicates a Windows installer packaging path.
12. Build and developer tooling
- The frontend uses TypeScript + Vite.
- The backend uses Rust/Cargo.
- bun.lockb suggests Bun is used for dependency management or scripting on the JS side.
- .github/workflows/main.yml provides CI automation for building/testing/releasing.
13. Likely runtime flow
- User actions start in the React UI.
- State updates happen in the store and event bus.
- Timeline widgets render against the shared project/chart state.
- File/audio/export actions cross the Tauri bridge into Rust for native processing and integration with platform capabilities.
14. What to diagram
- A good architecture diagram should center on:
- the React editor UI
- the shared store/event bus
- the audio/chart timeline subsystem
- the Tauri Rust services
- the platform packaging outputs for desktop and Android
- The key boundary is the frontend ↔ native backend split, with the editor’s state and rendering on one side and processing/export/integration on the other.
Main entry points: lib.rs Native core · SequentialEditor.tsx Editor · App.tsx Root app · HeaderController.tsx Header
Components 26
Frontend
React/Vite editor UI and shared client-side state
- App shell · Bootstraps the application UI
src/main.tsx - Root app · Top-level app composition and routing
src/App.tsx - Editor · Main sequential chart editing surface
src/SequentialEditor.tsx - Tempo track · Tempo markers and timing lane
src/SequentialEditor/TempoTrack.tsx - Music track · Music/audio lane in the editor
src/SequentialEditor/MusicTrack.tsx - Stem track · Stem-aware audio lane
src/SequentialEditor/StemTrack.tsx - Chart track · Note and event editing surface
src/SequentialEditor/ChartTrack.tsx - Playing bar · Current playback position overlay
src/SequentialEditor/PlayingBarContainer.tsx - Header · Project and editor commands
src/HeaderController.tsx - Dialogs · Draggable editor windows and popovers
src/components/DraggableWindow.tsx - UI kit · Reusable controls and overlays
src/components/ui - Audio system · Playback, stem handling, and waveform rendering
src/AudioSystem.tsx - Save system · Project serialization and file persistence
src/SaveSystem.tsx - Stores · Shared chart, project, tempo, lane, and settings state
src/store/store.ts - Event bus · Cross-component editor notifications
src/eventBus.tsx - Waveform utils · Waveform generation and drawing helpers
src/utils/waveformRenderer.ts
Native backend
Rust/Tauri commands and platform integrations
- Native entry · Rust application entry and command wiring
src-tauri/src/main.rs - Native core · Backend command definitions and shared native logic
src-tauri/src/lib.rs - Audio labeling · Audio labeling and analysis routines
src-tauri/src/audio_labeling.rs - Meta export · Metadata and export generation
src-tauri/src/export_meta.rs - Language model · Model-backed native functionality
src-tauri/src/language_model.rs - Python env · Python environment setup and access
src-tauri/src/python_env.rs - Stem processing · Stem-related native processing
src-tauri/src/stem.rs
Platform
Packaging, permissions, and generated targets
- Tauri config · Capabilities and app configuration
src-tauri/tauri.conf.json - Android target · Generated Android project and wrappers
src-tauri/gen/android - Installer · Windows installer packaging definition
src-tauri/nsis/installer.nsi
Connections 30
- App shell → Root app: mounts · Entry point mounts the root app
- Root app → Editor: opens · Main application presents the editor workspace
- Root app → Header: hosts · Root app includes top-level commands and header
- Root app → Audio system: wires · Root app wires audio playback into UI
- Editor → Tempo track: renders · Editor composes the tempo lane
- Editor → Music track: renders · Editor composes the music lane
- Editor → Stem track: renders · Editor composes the stem lane
- Editor → Chart track: renders · Editor composes the chart editing lane
- Editor → Playing bar: overlays · Editor shows current playback position
- Chart track → Stores: reads/writes · Chart interactions mutate shared chart state
- Tempo track → Stores: reads/writes · Tempo lane uses shared timing state
- Music track → Audio system: syncs · Music lane stays synchronized with playback
- Stem track → Audio system: controls · Stem lane controls stem playback
- Header → Save system: invokes · Header commands trigger persistence actions
- Header → Dialogs: opens · Header launches dialogs and panels
- Dialogs → UI kit: uses · Floating panels use shared UI primitives
- Chart track → Event bus: publishes · Chart interactions broadcast editor events
- Header → Event bus: publishes · Commands notify the rest of the UI
- Stores → Event bus: coordinates · Shared state and events coordinate editor subsystems
- Audio system → Waveform utils: uses · Audio UI relies on waveform rendering helpers
- Save system → Native core: calls · Persistence bridges to native commands when needed
- Audio labeling → Native core: exposed by · Audio labeling is exposed through the native core
- Meta export → Native core: exposed by · Export routines are exposed through the native core
- Language model → Native core: exposed by · Model integration is exposed through the native core
- Python env → Native core: exposed by · Python integration is exposed through the native core
- Stem processing → Native core: exposed by · Stem processing is exposed through the native core
- Native entry → Tauri config: configured by · Native runtime follows Tauri app configuration
- Tauri config → Android target: generates · Configuration includes generated Android target
- Tauri config → Installer: packages · Configuration includes desktop installer packaging
- Native core → Android target: targets · Native backend is shared with Android packaging