When the brass in a piece sounds wrong, there are two different things that could be wrong. The brass part could be badly written. Or the brass samples that play it could be bad.
The distinction exists because of how MIDI works. A MIDI file holds instructions, not sound: this note, at this time, this hard, for this long, on this instrument. To hear it, a synthesiser looks each instrument up in a soundfont, a bank of recorded samples, and plays the instructions through them. The same file played through two soundfonts can sound like two different ensembles.
I build Battuta, a command-line MIDI editor that an AI agent can use to inspect, change and compare a piece with me while I listen. In that loop the two diagnoses are easy to confuse, and confusing them has a particular cost. If the samples are the problem and nobody says so, the natural move is to change the part until it sounds right: soften it, move it, give it to another instrument. It will genuinely sound better. A well-written part has been made worse to cover for a recording, and nothing in the result shows it.
Fixing whatever sounds wrong
The obvious approach is to treat everything that affects the sound as fair game. A listener hears one result. If a passage improves, it seems not to matter whether the improvement came from the notes or from the playback.
It matters when the work continues. The edited file outlives the setup it was tuned against. On another soundfont, or on a real instrument, the compensation remains and the bad sample does not. And when two versions are compared, a difference in playback can be heard as a difference in the music. An agent that reasons from that comparison has learned something false about the piece.
The test is literal: is it in the file?
Battuta has a charter that is mostly a set of postures. One part of it is a rule, and its test is mechanical:
What is inside a Take belongs to the Piece. What is required to turn a Take into air belongs to the Rig.
A Take is one MIDI file. The Piece is the music written in it; the Rig is the apparatus that turns it into sound.
Most splits like this, such as what a spec says against what the code does, get argued case by case. This one a program can check, which is why the agent and I can hold it as a rule instead of renegotiating it every session.
To decide which side something is on, check whether it is in the file:
| In the file? | Side | |
|---|---|---|
| Velocity, how hard a note is struck | yes | Piece |
| Channel volume (CC7) | yes | Piece |
| Program change, which instrument a part uses | yes | Piece |
| Soundfont | no | Rig |
| Synthesiser and its version | no | Rig |
| Playback gain | no | Rig |
The program change row is the one that looks misplaced. Choosing whether a part is played by brass or strings feels like a question of sound, and what a trumpet program sounds like is the Rig’s business. But which program is selected is written in the file, so it belongs to the Piece. Orchestration is composition. Editing it is legitimate work for the tool, and its result should appear in a comparison like any other change to the music.
What the line forces the tool to record
A rule about attribution is only useful if attribution survives. The charter turns the line into a few consequences, and each became behaviour in the tool.
A comparison never reports Rig differences. A diff between two Takes describes the music, even if they were heard through different setups.
Every audition names its Rig. mid play states which soundfont it used, on stderr for a person and in the structured output for an agent. There is no flag whose purpose is to hide it.
There is no implicit Rig. If no soundfont is supplied, playback refuses rather than falling back to one on the system. A setup nobody named cannot be referred to later, and a setup that cannot be referred to cannot serve as the control in a comparison.
A rendered file carries its own attribution. play discloses the Rig at the moment it runs, but an audio file outlives that moment and the terminal it ran in. Commit 29c98ad added mid render, which writes a metadata chunk into the WAV naming the Take and the soundfont by SHA-256 hash, the passage, and the Battuta and FluidSynth versions. Hashes rather than paths, because a path names a file on one machine and says nothing about its contents.
That record has limits, and the tool says so. FluidSynth’s own configuration files are not recorded. Any program may strip the chunk. The record is a claim about how the file was made, not evidence: the check is to render again from it and compare. A file without the record is unattributed, and it is not to be read as having been made with whatever setup is in use now.
Two cases, both in the file
The line does not say which side is at fault. It makes the question answerable. In both cases so far, the answer was in the file.
In one early test I asked Battuta to change a note to a trumpet. Inspection showed the change; playback still gave me a violin. Bad samples would have been a reasonable first guess. The cause was in the file: the instrument change and the note shared a timestamp on different tracks, with no stated order between them, and the player started the note first. It was a Piece problem, and the fix was to state the order in the file. (That case has its own entry.)
In a later session on a recorded performance of Bach’s Duet BWV 802, the problem was that the left hand only echoed the right and never answered. Two versions of a fix were tried and combined: six left-hand notes held longer, four notes struck harder or softer. After one listen, knowing which version was which, I kept the combination. The diff of the result lists nine notes and ten changes, all of them durations and velocities. Nothing about the sound appears in it, because nothing about the sound is in the file. Whatever was heard differently between the original and the result came from those ten changes, heard through the same named setup.
What the line does not claim
Putting the soundfont on the Rig side does not make it unimportant. A bad brass sample is a real problem, and fixing it is real work. It is a different job, done somewhere else, and it should not leave marks in the music.
What the line provides is narrower. When something sounds wrong, it lets a person and an agent ask the right first question, and it keeps the answer attached to the files after the session is over.