Project

apfelstrudel

experimental

Live coding music environment with AI agent chat — compose and perform with Strudel, talk to an agent mid-set.

Overview

Apfelstrudel wraps the strudel live-coding music environment with an embedded AI agent chat panel. You write and perform generative music patterns in Strudel's mini-language while an agent watches your code and answers questions, suggests variations, or helps you understand what a pattern does — all in real time without breaking your flow.

How it works

A Bun-based server hosts the Strudel editor and exposes a WebSocket channel to the AI backend. The agent receives the current code buffer as context on each message so it can reason about what's running. Changes the agent suggests can be applied directly to the editor with a single click. Audio runs entirely in the browser via the Web Audio API.

Features
🎵
Strudel live coding

Full Strudel pattern language in the browser — cycles, mininotation, sample triggering, and MIDI output.

🤖
Agent-assisted composition

Chat with an AI agent that sees your current pattern and can suggest rhythms, harmonies, or explain what each function does.

One-click apply

Agent code suggestions appear as clickable diffs — apply them to the editor without copy-pasting.

🔊
Web Audio output

All synthesis runs in the browser with zero latency configuration — connect to MIDI or use the built-in synths.

🧩
Extensible backends

Swap out the AI backend by pointing the WebSocket URL at any OpenAI-compatible endpoint.

Architecture
Strudel editor multi-tab · undo/redo AI chat panel Bun server static files · WebSocket session persistence LLM OpenAI · Azure LM Studio Web Audio synths · samples · MIDI Code suggestions one-click apply audio stays client-side · agent communicates over WebSocket
Posts