ep133-studio
by Loosand
README.md
# EP-133 Studio
**Connect any AI Agent directly to your Teenage Engineering EP-133 K.O. II.**
[简体中文说明](README.zh-CN.md) · [Online Preview](https://ep133-studio.vercel.app) · [Notation](NOTATION.md) · [Device Setup](DEVICE.md) · [Sound Design](SOUND_DESIGN.md)
<p>
<img src="./screenshots/en/overview.png" alt="EP-133 Studio Beat Workbench: 1:1 EP-133 K.O. II hardware replica, clean 45px top bar, and step sequencer" width="900">
</p>
**EP-133 Studio** is a free, open-source **MCP server**, **1:1 physical-device workbench**, and **46.875 kHz sound designer** for the Teenage Engineering EP-133 K.O. II (evolved from upstream [`benjaminr/mcp-koii`](https://github.com/benjaminr/mcp-koii)). Connect **Claude Code**, **Cursor**, **Antigravity**, **Windsurf**, **Codex**, **Claude Desktop**, or any MCP-speaking AI Agent directly to your hardware over USB-C MIDI and Audio.
```text
@bpm 92
@swing 58
kick: x... ..x. x... ....
snare: .... x... .... x..o
hat: x.x. x.x. x.x. x.xX
```
> **Optional Browser Preview**: Want to explore the UI before plugging in a physical EP-133 or installing Python? An experimental browser preview is hosted at [ep133-studio.vercel.app](https://ep133-studio.vercel.app) (`/studio`). The full hardware workflow—USB SysEx sample uploads, OS 2.5 auto-chopping, checksum-verified backups, USB-C live audio bounce, and MCP agent integration—runs locally via this repository.
---
## Key Capabilities
- **Any AI Agent × Physical EP-133 (35+ MCP Tools)**: Your Agent authors compact `@bpm` patterns, validates line/column syntax (`check_pattern`), layers multi-part arrangements (`save_song`), synthesizes or chops custom sounds, and hot-swaps edits **seamlessly at bar boundaries** while the groove plays.
- **1:1 Hardware Surface (All Keys Active + Bidirectional Feedback)**: Physical EP-133 pad taps light the UI in hardware blue (`#5394b5`), while Agent & software notes flash signal orange (`#f15a22`). Switch Groups `A–D`, drag `VOLUME` / `X` / `Y` / `Fader`, latch `SHIFT`, toggle chromatic `KEYS`, cycle `TIMING`, arm `RECORD`, or jam via computer keyboard (`123 / QWE / ASD / ZXC`).
- **46.875 kHz Layered Synth & OS 2.5 Auto-Chopper**: Build drum & instrument sounds across `Analog`, `FM`, `Pluck`, `Modal`, `Metal`, `Noise`, and `Sample` layers; iterate with locked `Vary ×6` & `Morph`; record directly over USB-C audio and slice loops via onset detection or even intervals (`chop_source`).
- **Safety-First Hardware SysEx Management**: Browse all 999 device slots, manage Project 1–9 pad maps, install standalone 12-pad kits or packs, and enforce **mandatory full device backups & slot checksum verification** before custom sample writes.
- **Guide Mode & Pro Mode (`EN / 简体中文`) + Interactive Screen Atlas**: Stay in **Guide Mode** for on-demand control tooltips, 5 playable beginner lessons, and an interactive **Super Segment Screen Atlas** (`?` drawer)—or flip to **Pro Mode** for a zero-clutter 45px production bench.
---
## Workbench Views (`overview`, `guide`, `sounds`, `song`)
| View | Purpose | Highlights |
|------|---------|------------|
| **Beat** (`#beat`) | Rhythm & hardware jam | 1:1 EP-133 unit, Step Grid / SVG Music Score / Text Notation, bidirectional track↔pad highlight |
| **Song** (`#song`) | Arrangement & export | Vertical sections layering multiple patterns (`intro x2, verse+bass x4`), `.mid` & `.musicxml` export |
| **Sounds** (`#sounds`) | Synthesis, sampling & kits | 46.875 kHz 6-layer synth + FX chain, `Vary ×6`, `Morph`, USB audio bounce, OS 2.5 chop, Project 1–9 Pad Map |
| **Device** (`#device`) | Hardware ops & safety | MIDI port & clock state, live IN/OUT MIDI monitor, all 999 internal samples, checksum backups, custom aliases |
<details>
<summary>More workbench screenshots: Interactive Lessons & 66-Icon Atlas, Sound Designer, and Song Arranger</summary>
#### 1. Interactive Beginner Lessons & Super Segment 66-Icon Atlas
<img src="./screenshots/en/guide-atlas.png" alt="Interactive Beginner Lessons and EP-133 Super Segment Screen Atlas" width="900">
#### 2. Pad Map & 46.875 kHz Sound Designer
<img src="./screenshots/en/sounds.png" alt="EP-133 Studio Sounds View: Pad Map and Sound Designer" width="900">
#### 3. Song Timeline & MIDI / MusicXML Export
<img src="./screenshots/en/song.png" alt="EP-133 Studio Song View: Timeline Arranger and MIDI / MusicXML Export" width="900">
</details>
---
## Install & Connect Any AI Agent
Requires **Python 3.9–3.12** and an EP-133 K.O. II over USB-C (when traveling without hardware, switch connection to **Browser simulator** for instant WebAudio fallback). The compiled React frontend (`web/dist/`) ships ready to run.
```bash
git clone https://github.com/Loosand/EP133-studio.git
cd EP133-studio
uv venv --python 3.12 .venv
uv pip install -r requirements.txt
```
### Option A: Claude Code CLI
```bash
claude mcp add ep133-studio -- /ABSOLUTE/PATH/TO/EP133-studio/.venv/bin/python /ABSOLUTE/PATH/TO/EP133-studio/koii_studio_server.py
```
### Option B: Antigravity / Cursor / Windsurf / Claude Desktop (MCP JSON)
Add to your Agent's MCP server configuration:
```json
{
"mcpServers": {
"ep133-studio": {
"command": "/ABSOLUTE/PATH/TO/EP133-studio/.venv/bin/python",
"args": ["/ABSOLUTE/PATH/TO/EP133-studio/koii_studio_server.py"]
}
}
}
```
### Option C: Standalone Local Studio (No AI Agent Required)
```bash
.venv/bin/python -m koii_studio.visualiser
```
Opens automatically at `http://127.0.0.1:8133` (override port with `KOII_STUDIO_WEB_PORT`, disable auto-tab with `--no-browser` or `KOII_STUDIO_WEB=off`).
---
## Typical Hardware Agent Workflow
Ask your Agent: *"Connect to my EP-133, write a dusty 90 BPM boom-bap drum beat, add a bassline, and open the visualiser"*:
1. `connect()` locates your EP-133 USB MIDI port automatically, and `open_visualiser()` launches the live local studio.
2. Your Agent authors patterns in compact notation, validates via `check_pattern()`, and calls `play(..., loop=True)`.
3. Iterate conversationally while the groove plays—every updated `play` swaps seamlessly **at the end of the current bar**.
4. `save_pattern()` / `save_song()` persist your library to `~/.koii-studio/library.json`, and `export_midi()` / `export_musicxml()` export for DAWs or sheet music.
---
## Notation Quick Reference
Full spec: **[NOTATION.md](NOTATION.md)**
| Syntax | Meaning |
|--------|---------|
| `kick: x...x...` | One line per sound; **one character = one step** (default 1/16) |
| `x` `X` `o` `1`–`9` | Hit (`100`), accent (`127`), ghost (`50`), velocity levels `1–9` |
| `.` `-` | Rest / hold previous note |
| `@bpm` `@swing` `@grid` | Tempo (`40–240`), Swing (`50–75`), step subdivision |
| `@map bass = ch2` + `bass notes: C1 Eb1 G0` | Pitched basslines & melodies on a dedicated MIDI channel |
| `verse x4, chorus+bass x2` | Section repeats (`xN`) and pattern layering (`+`) |
---
## Available MCP Tools (35+)
| Area | Tools |
|------|-------|
| **Connection** | `list_midi_ports`, `connect`, `disconnect`, `status`, `open_visualiser` |
| **Composition & Playback** | `check_pattern`, `play`, `stop`, `audition`, `save_pattern`, `save_song`, `show`, `list_library`, `delete` |
| **Export** | `export_midi`, `export_musicxml` |
| **Sound Design & Kits** | `sound_presets`, `sound_design_schema`, `design_sound`, `vary_sound`, `morph_sounds`, `save_design`, `list_designs`, `upload_design`, `change_sound_settings`, `make_kit`, `kit_status`, `chop_source` |
| **Device Samples, Pads & Packs** | `list_device_sounds`, `play_sample`, `backup_device`, `cancel_backup`, `upload_sample`, `delete_upload`, `open_project`, `get_pads`, `set_pad`, `undo_pad_change`, `list_packs`, `install_pack`, `remove_pack`, `pack_status` |
| **Kit Aliases** | `show_kit`, `set_alias`, `remove_alias`, `list_factory_sounds` |
---
## Repository Structure & Development
- `koii_studio/`: Python MCP server (`server.py`), notation parser, sequencer, 46.875 kHz DSP synth (`synth/`), USB SysEx file & backup protocol (`files.py`, `backup.py`, `samples.py`), and HTTP/SSE backend (`visualiser.py`).
- `web/`: React 19 + TypeScript + Tailwind v4 local hardware workbench UI (`pnpm test:run`, `pnpm build`).
- `crates/`: Rust core rewrite workspace (`koii-notation`, `koii-studio`, `koii-studio-server`) under active development.
- `site/`: Experimental browser preview & project homepage (`ep133-studio.vercel.app`).
```bash
# Python tests
.venv/bin/python -m pytest
# Local workbench tests & production build
pnpm --dir web install && pnpm --dir web test:run && pnpm --dir web build
# Rust workspace check/tests
cargo test --workspace
```
---
## Acknowledgements & Disclaimer
- Evolved from the upstream open-source foundation by **[benjaminr/mcp-koii](https://github.com/benjaminr/mcp-koii)** (`koii studio`, MIT License).
- Reverse-engineered EP-133 SysEx sample/pad protocol by **[ep-series-sysex](https://github.com/kmorrill/ep-series-sysex)** (MIT License; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)).
- Built on [MIDO](https://mido.readthedocs.io/) and the [Model Context Protocol](https://modelcontextprotocol.io/).
**100% Free, Educational & Open Source ([MIT License](LICENSE))**: Besides MIDI notes, EP-133 Studio reads/writes EP-133 sample & pad storage over an undocumented USB protocol. It enforces full backups before custom uploads and verifies slot checksums, yet firmware differences can still affect device state—keep regular backups and close Teenage Engineering's EP Sample Tool while running EP-133 Studio. Not affiliated with or endorsed by Teenage Engineering AB.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues