A small local web interface for generating and curating short audio loops with Magenta RealTime 2 on Apple Silicon. Type a prompt, pull a few faders, get a batch of variations you can audition, save the good ones, and bin the rest — without touching the command line each time.
Unofficial. This is a third-party front-end. It runs Google's
mrtcommand under the hood; it does not include or modify Magenta itself. You install magenta-rt separately (see below). Not affiliated with Google.
A 2½-minute walkthrough — generating loops from two prompts ("Liquid 909" and "Gangster Rap"), auditioning them, and saving the keepers:
▶ Watch the demo on YouTube (or click the image above).
- Prompt → a batch of loops. One text prompt generates several clips at once, each at a slightly different temperature so they actually differ (the model uses a fixed seed, so identical settings would otherwise produce identical audio).
- Four faders, real units. Outputs (clip count), Length (seconds), Randomness (sampling temperature), Complexity (top-k).
- Audition in the browser. Looping playback with a waveform and playhead. Drag across a clip's waveform to select part of it and loop just that region.
- Crop on save. With a region selected, saving writes just that part (sample-accurate); with no region, the whole clip is saved.
- Curate. Tick the keepers and save them to a folder; delete the rest to the macOS Trash.
- Built-in guide. A collapsible panel covers the faders, prompt tips, and keeping vs binning clips.
- Matched levels. Every clip is loudness-normalised on generation, so drums and synths come out at a consistent volume.
Drag across a clip to loop just that region — and saving crops to it:
- An Apple Silicon Mac (M1 or later). Magenta RealTime's MLX backend does not run on Intel.
- Python 3.12.
- magenta-rt installed, with its models downloaded (steps below).
Loop Lab does not bundle Magenta — install it first, following the official instructions. In short:
uv venv --python 3.12
source .venv/bin/activate
uv pip install "magenta-rt[mlx]"
mrt models init # helper models (MusicCoCa, SpectroStream)
mrt models download # choose mrt2_small (real-time) and/or mrt2_baseConfirm it works on its own before going further:
mrt mlx generate --prompt "techno drum loop" --duration 4.0 --model=mrt2_smallIn the same activated environment (so mrt is on PATH):
pip install -r requirements.txt(If you used uv for the venv, use uv pip install -r requirements.txt.)
python loop_lab.pyOpen http://localhost:8765. Leave the terminal running — it's the server.
Ctrl+C stops it.
All optional, set as environment variables:
| Variable | Default | Purpose |
|---|---|---|
LOOP_LAB_MAGENTA_HOME |
~/Documents/Magenta/magenta-rt-v2 |
Your magenta-rt install (where models live) |
LOOP_LAB_KEEPERS |
~/Music/Loop Lab |
Where "Save selected" copies loops |
LOOP_LAB_PORT |
8765 |
Server port |
Example — save keepers straight into a synced folder:
LOOP_LAB_KEEPERS="$HOME/Dropbox/Loops" python loop_lab.py- Generated clips live in
<magenta-home>/outputs/loop-lab/. - Save copies selected clips to your keepers folder (the originals stay).
- Delete (✕) sends a clip to the macOS Trash — recoverable in Finder until you empty it.
- macOS only (the Trash routing and the MLX backend are both Mac-specific).
mrt2_smallruns in real-time on any Apple Silicon;mrt2_baseis higher quality but only runs offline on base chips — fine for batch loop rendering.- The four faders are deliberately simple mappings onto the two sampling
controls the CLI exposes (
--temperature,--top-k) plus count and duration. Tweak the ranges inmap_settings()if they don't suit your material. - The in-app region loop uses an audio-element seek at the loop point, so there is a tiny gap each cycle — fine for auditioning. The saved crop is gapless and sample-accurate.
MIT — see LICENSE. Magenta RealTime is Google's and is covered by its own (Apache 2.0) licence; this project only calls its CLI.

