Battuta
A command-line MIDI editor for working on music with an AI agent. The agent inspects notes, writes an edit request, compares the files, and plays the result. The human listens and decides whether to keep the change.
v0.1.2 — published crate · Active development and self-use
The linked audio example reconstructs a regression fixture on one player and soundfont. It demonstrates the edit and its repair under those conditions.
Compare the two recordings →What you can try
Why the instrument change didn’t change the sound
Play two clips and follow their event order. Moving the instrument change before the note makes the intended trumpet audible in the second version.
- Two audio clips, corresponding MIDI files, and a reproduction script
- Event order explains why a successful edit did not change the sound
- Inspection reports the condition; edits refuse it unless explicitly allowed
The problem behind it
I wanted to take apart a few bars of MIDI and hear whether a change made them better. The trouble is that an agent can report it changed a note or an instrument without anyone knowing what the listener will hear. So the edits have to be inspectable, and I have to be able to hear the result and decide.
Battuta gives that experiment a concrete form: a request, a new file, a comparison and playback.
From a requested edit to a file ready to hear
The agent inspects the file and writes a request for specific edits. Battuta applies that request to a new file, keeping the original available. Its comparison names the changed notes and places them at a bar and beat, so the next experiment can address a particular part of the music.
- The musical content is kept separate from the soundfont used to play it. A different sample bank can change the sound without changing a note.
- Edit requests specify concrete changes to notes, instrument selections, or MIDI controllers. Choosing what would make the music better happens outside the core.
- File inspection and comparison show changes to MIDI instructions. Playback lets the human hear the result and decide whether to keep it.
What I want to examine next
Document a creative iteration from the initial musical intention through an agent's edit to the human's listening decision. That decision has not yet been recorded in these examples.
Technical details, assumptions and verification
The core accepts concrete edit requests and leaves musical choices to the human and agent. That makes the requested changes available for review, but the human or agent must first translate an intention into specific operations. Inspecting the resulting file and listening to its playback are both part of deciding whether the edit worked.
The audio reconstruction establishes an execution defect and its repair on the stated renderer. It is not the original debugging recording, a test across players or evidence of improved musical judgment. The linked article includes the MIDI, measurements and reproduction method.
- Type
- Human-agent MIDI collaboration core
- Domains
- MIDI / human-agent collaboration / Rust / creative tooling
Available material
- Published Rust crate on crates.io (battuta v0.1.2)
- Reproducible instrument-change case with A/B audio, MIDI inputs, edit requests, and measured output
- CLI binary: mid info / inspect / apply / diff / play
- Source repository with test suite