A real-time modular synthesizer with a JavaScript DSL for live-coding audio patches.
- JavaScript DSL - Expressive, fluent API for building synthesis patches
- Real-time Audio - Low-latency audio processing in Rust
- Live Coding - Update patches on-the-fly with Alt+Enter
- WebSocket Streaming - Real-time audio streaming to browser
- Visual Feedback - Built-in oscilloscope for waveform visualization
- Module Library - Oscillators, filters, utilities, and more
- Rust (latest stable)
- Node.js 24.12+
- Yarn (latest)
cd modular_server
cargo runThe server will start on http://localhost:3000
cd modular_web
yarn install
yarn devThe frontend will be available at http://localhost:5173
- Open the web interface
- Write a patch using the JavaScript DSL (see examples below)
- Press Alt+Enter to execute and hear the result
- Press Alt+. to stop audio
Simple Sine Wave:
const osc = sine('440hz');
out.source(osc);Musical Note:
const osc = sine('a3');
out.source(osc);FM Synthesis:
const modulator = sine('a3');
const carrier = sine('a3')
.phase(modulator.scale(0.5));
out.source(carrier);- DSL Guide - Complete DSL reference and examples
- Migration Plan - Technical migration details
modular/
├── modular_core/ # Core audio engine (Rust)
├── modular_server/ # WebSocket server (Rust)
├── modular_web/ # Web frontend (React + TypeScript)
│ └── src/dsl/ # DSL runtime
└── docs/ # Documentation
- modular_core - Audio DSP engine with module system
- modular_server - WebSocket server, patch validation, audio streaming
- DSL Runtime - Executes JavaScript patches, generates PatchGraph JSON
- Editor - Monaco-based editor with autocomplete and oscilloscopes
- WebSocket Client - Communicates with server
After modifying Rust types:
cd modular_web
yarn run codegen# Backend
cargo build
# Frontend
cd modular_web
yarn run build# Backend tests
cargo test
# Frontend tests
cd modular_web
yarn testMIT