Hyphon is a sophisticated web-based audio workstation featuring:
- 32-step pattern sequencer with dual synths, drums, and sampler
- Hardware-inspired interface (Korg Electribe EA-1 ER-1 inspired)
- Web Audio API + WebAssembly audio engines
- TTS voice synthesis via ONNX Runtime
- Real-time effects and voice designer (GPU-accelerated)
- XM module export capability
Status: Complex, mature codebase with multiple interdependent systems
- Frontend: React 19 + TypeScript 5.9
- Build: Vite 5 + npm
- Styling: Tailwind CSS
- 3D Graphics: Three.js + React Three Fiber
- Audio Engines:
- Web Audio API native elements
- AssemblyScript WASM (oscillators, track freezer)
- Rust WASM (via wasm-pack)
- Emscripten C++ (JC303 synth, RubberBand time-stretcher)
- AI/ML: ONNX Runtime Web (v1.23.2) for TTS
- Testing: Vitest + Playwright + React Testing Library
- Linting: ESLint with React plugins
src/
├── components/ # React components (sequencer UI, hardware controls)
│ ├── sequencer/ # Core sequencer UI components
│ └── assets/ # Asset/sample management
├── stores/ # Global state management
├── hooks/
│ └── audioEngine/ # Audio engine integration hooks
├── engines/ # Audio engine implementations
│ ├── rubberband/ # Time-stretching engine
│ └── __tests__/
├── audio/ # Audio processing utilities
│ └── playback/ # Audio playback system
├── services/ # Business logic services
├── importers/ # Format importers (RBS, AI song)
├── types/ # TypeScript type definitions
└── __tests__/ # Integration tests
- Node.js 18+
- For TTS models: Run
bash download_models.sh(~235 MB) - Emscripten/C++ tooling (for audio engine compilation)
# Development (builds WASM + runs Vite dev server)
npm run dev
# Build everything (WASM, Emscripten, Rust, optimizations)
npm run build
# Run tests
npm test
# Preview production build
npm run preview
# Lint code
npm lint
# Optimize assets
npm run optimize
# Deploy
npm run deployThe project has multiple WASM builds with specific purposes:
build:wasm:oscillators- AssemblyScript oscillator enginesbuild:wasm:freezer- Track freezer/time-stretch prepbuild:wasm:rust- Rust audio modulesbuild:wasm:jc303- JC303 synth (C++ via Emscripten + OpenMP)
dev and build commands handle this, but specific engine changes may require targeted rebuilds.
-
Audio Engine Integration (
src/hooks/audioEngine/)- Manages lifecycle of audio engines
- Handles playback state and timing
- Integrates WASM modules
-
Sequencer State (
src/stores/)- Pattern data (32 steps, 8 pattern slots per track)
- Track configuration (synth params, drum samples)
- Song arrangement mode
- Per-bank TTS text storage
-
Voice Designer (
src/components/)- GPU-accelerated DSP via WebGPU
- CPU fallback for unsupported browsers
- Geometric transformations (mirror, invert, shift)
- Real-time heatmap visualization
-
TTS System
- ONNX Runtime inference pipeline
- Per-bank text phrases (separate for each of 8 sample banks)
- Requires ONNX models + voice style files
- Gracefully disabled if models unavailable
- WebAssembly is critical for real-time audio performance
- GPU-accelerated DSP in Voice Designer uses WebGPU with CPU fallback
- Track freezer (WASM) used to render complex patterns as audio
- Memory-intensive: WASM modules configured with specific initialMemory values
Before committing:
npm test # Run all Vitest tests
npm lint # Check code style
npm run build # Ensure production build succeedsTest files: Located alongside source files with .test.ts(x) suffix
- Unit tests in
src/__tests__/ - Component tests in
src/components/__tests__/ - Engine tests in
src/engines/__tests__/
- TypeScript strict mode - Use proper types, avoid
any - React best practices - Functional components, hooks over classes
- Component naming - PascalCase for components
- Utility functions - camelCase, kept in
services/or colocated - Constants - UPPER_SNAKE_CASE
- WASM imports - Use dynamic
import()to handle loading
Designated branch: claude/create-claude-docs-cHGb2
Important Git Rules:
- Develop on the assigned branch (starts with
claude/and ends with session ID) - Use
git push -u origin <branch-name>for first push - Branch validation: Must match pattern
claude/.*-cHGb2 - Commit with clear, descriptive messages
- Never push to main/master without explicit permission
- Understand the audio engine pipeline in
src/hooks/audioEngine/ - Test with Web Audio context lifecycle (suspend/resume)
- WASM modules must be properly imported async
- Changes to JC303 require recompilation:
npm run build:wasm:jc303 - Parameter changes propagate through audio engine hooks
- Test with both pre-allocated and real-time synthesis
- Be careful with event handlers on step buttons (touch + mouse events)
- Knob interactions use custom canvas rendering or Three.js
- Hardware-style interface expects specific visual feedback
- Per-bank text is stored in sequencer state
- Generation is async and uses Web Workers via ONNX Runtime
- Voice Designer requires WebGPU context (with CPU fallback)
- Models download on first TTS use or via
download_models.sh
- Audio Issues: Check Web Audio context state and analyser values
- WASM Loading: Verify CORS headers and module paths in network tab
- State Management: Use React DevTools to inspect store contents
- Performance: Profile with DevTools, check for excessive re-renders
- TTS: Check browser console for ONNX Runtime initialization
README.md- Quick start and feature overviewTTS_DEPLOYMENT.md- Complete TTS setup and troubleshootingDEVELOPER_CONTEXT.md- Additional development contextINTEGRATION_SUMMARY.md- Technical architecture details- Various
*_IMPLEMENTATION_SUMMARY.mdfiles - Feature-specific docs
- Multiple engineers have contributed (ford442 most recent)
- Uses structured issue/PR workflow with meaningful descriptions
- Complex features are documented in markdown files before/after implementation
- Pay attention to existing patterns and conventions when extending features