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 20.19+ or 22.12+
- pnpm
cd modular_server
cargo runThe server will start on http://localhost:3000
cd modular_web
pnpm install
pnpm 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('osc1').freq(hz(440));
out.source(osc);Musical Note:
const osc = sine('osc1').freq(note('a4'));
out.source(osc);FM Synthesis:
const modulator = sine('mod').freq(note('a4'));
const carrier = sine('carrier')
.freq(note('a4'))
.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
pnpm run codegen# Backend
cargo build
# Frontend
cd modular_web
pnpm run build# Backend tests
cargo test
# Frontend tests
cd modular_web
pnpm testMIT