Strudel Desktop: Bringing Live Coding Music to Desktop Platforms
I stumbled across live coding music on Twitter when I saw Switch Angel. Code-to-music live?! I started playing around with Strudel.cc once I saw it. Around the same time, I was working on some Rust and Tauri applications, so I thought "eh, why not?" and decided to finish what someone had started in the repo with Tauri 1 to Tauri 2, and well, adding AI to it because it's 2025 and that's just what we do now.
What is Strudel Desktop?
Strudel Desktop is basically a desktop version of Strudel, the JavaScript-based live coding environment inspired by TidalCycles. The original runs in browsers, but a native desktop app offers better performance and offline capability. And gives me a little room to build in parts you wouldn't be able to depend on in a pure webapp. Also, I hated constantly clicking "update" instead of my code just going at it live.
Key Features
- šµ Live Coding: Write music patterns in real-time using JavaScript
- š„ļø Desktop Native: Full desktop app experience with file system access
- š Audio Engine: Built-in Web Audio API for synthesis and effects
- š Local Samples: Load samples from your local file system
- šļø MIDI Support: Connect MIDI controllers and devices
- š OSC Integration: Connect to SuperCollider and other audio software
- ā” Offline-First: Work without internet connectivity
The Technology Stack
I built this with Tauri since I was already working with Rust. It wraps modern web technologies in a native desktop shell:
- Frontend: JavaScript/TypeScript with modern web APIs
- Desktop Framework: Tauri (Rust-based alternative to Electron)
- Audio Processing: Web Audio API
- Package Management: pnpm with Lerna for monorepo management
- Build System: Modern JavaScript tooling with Vite
Architecture Overview
The project follows a monorepo structure with several key packages:
strudel-desktop/
āāā packages/ # Core JavaScript packages
āāā src-tauri/ # Rust/Tauri backend
āāā website/ # Web frontend (used by desktop app)
āāā examples/ # Sample patterns and usage examples
āāā docs/ # Documentation
āāā samples/ # Audio samples for music creation
Getting Started
Prerequisites
- Node.js >= 18
- pnpm package manager
- Rust (for Tauri development)
Development Setup
# Clone the repository
git clone https://github.com/nukleas/strudel-desktop.git
cd strudel-desktop
# Install dependencies
pnpm install
# Run in development mode
pnpm desktop
Building for Production
# Build the desktop app
pnpm tauri:build
The built application will be available in src-tauri/target/release/bundle/.
Live Coding Examples
Strudel Desktop uses a pattern-based approach to music creation. Here are some basic examples:
Simple Drum Pattern
d1("bd hh sd hh");
Melodic Pattern
d2("c3 e3 g3 b3");
Pattern with Effects
d3("c3 e3 g3 b3").saw().lpf(800);
Loading Local Samples
// Load samples from your music directory
samples("~/music/my_samples");
// Use them in patterns
d1("kick snare kick snare");
Why Desktop Matters
A desktop version offers some practical advantages:
- Performance: Native apps use system resources more efficiently
- File System Access: Load samples directly from your computer
- Offline Capability: Make music without internet
- System Integration: Better MIDI and audio device support
- Customization: More control over the environment
Contributing and Community
It's open source under the AGPL-3.0 license, to follow what Strudel's license is, so if you want to contribute or just check it out, feel free! The repository has documentation and examples to help get started.
Future Directions
There's a lot of potential here:
- Better audio processing
- Integration with professional audio software
- Customizable interfaces
- Plugin systems
- Cross-platform deployment
Conclusion
I really enjoyed building this project. It was a fun way to combine my interest in Rust/Tauri development with the fascinating world of live coding music. If you're curious about making music through code, or if you're a developer looking for a creative outlet, Strudel Desktop might be worth checking out.
The combination of web technologies with native desktop capabilities creates a pretty solid tool for live coding music.
Strudel Desktop is available on GitHub and is based on the original Strudel project by uzu and contributors.