← Khaled Messai

Rachmaniclaude

March 2026 · music

01

What is the test for a piece of music?

In early 2026, the way to get a coding agent to finish a job was to give it something to stop on. Write code until the tests pass. It wasn't perfect, but it kept the model from declaring victory early, and the exercise of getting there made the code better.

So take a completely different task, one people say a language model can't do at all. Claude had never written music. Ask it to compose, and give it a test for the music. That raises the real question: what would that test even be?

02

First, the music

Each of these was composed by Claude Opus 4.6 as written notation: a score, with no audio model anywhere. I scored every piece out of 100, blind, without knowing which version I was hearing. My notes from the time are beside each one, typos and all. Where I wrote down a time, it's a link.

0:00 / 2:10

The Wager, for cello and piano. cello piano. Written as notation by Claude; the sound is MuseScore playing the score.

The whole brief“A chess game between old friends in a park — the stakes are a bottle of wine”

Heard blind, 17 March 2026

90 / 100

  1. This is really quite pleasant to listen to, i wont lie. Its continuous and flowing, it has a strong melody, an answer response pattern between the piano and cello as they dance back and forth.
  2. a bit of a cello flub
  3. this is really quite nice. and the section from 1:02-1:16 is a standout.
  4. Wow! WOW!
  5. a mistake
  6. and the dimuendo to the end
  7. i dont have many words for this. im not a music critic. this was really good.

03

The test we built

There is a public dataset of 254,077 scores from MuseScore, and some of them carry ratings from the people who played them. We measured 42 things about each score, things like how far the melody ranges, how often the harmony moves, and whether a motif ever comes back, and trained a model on the 5,207 pieces with at least ten ratings to tell the better-rated half from the rest.

On pieces it had never seen it was right 61.5% of the time, where guessing gets 51%. That is a real signal and a weak one: star ratings on sheet music are noisy, and almost everything is rated between four and five.

A predicted rating turned out to be a blunt thing to hand a composer. What worked better was a profile: for each of the 42 measurements, where this piece sits among well-rated music, most important first. The composer reads it once, revises once, and writes down what it took and what it refused.

Revision notes · written by the composer

The Wine Gambit

Cello and piano, 3/4, D minor, 50 measures. Before revision: 35 of 42 features at or above the high-rated median. After: 36 of 42.

What I incorporated

Hairpin count 0 → 5

Added crescendo and diminuendo hairpins in the cello (mm. 10, 29, 39) and piano (mm. 29-30). These genuinely improve the phrasing — the crescendo into the gambit's peak and the diminuendo into the endgame's reflection are more expressive now.

Range utilization 0.264 → 0.305

Extended the cello down to C2 (open string, m. 41) and up to A5 (stratosphere, m. 30 — the peak of the gambit)… These extensions are dramatic moments that earn the extreme registers.

What I rejected

Modulation count 5 vs target 10

Ten modulations in 50 measures would make it frantic. The chess game is focused and deliberate, not a tour of key signatures.

Phrase length regularity 0.753 vs target 0.992

The sections are 12+12+8+12+6 measures. The 8-bar gambit is intentionally short — it's a surprise move, quick and decisive. The 6-bar coda is a handshake — warm, brief, final. Forcing 4/8-bar regularity would kill the narrative pacing.

Groove consistency 0.784 vs 0.839

The cello is a singing melodic voice — its rhythmic variety is the whole point… The piano provides the rhythmic backbone; the cello provides the soul.

04

What we heard

The first blind test was three songs, each heard three ways: the first draft, a revision guided by the model's predicted rating, and a revision guided by the profile. Nine recordings, shuffled, scored without the key.

No feedbackA predicted ratingThe profile
Waltz888293
Duet838684
Prelude556270
Average75.376.782.3

There were eleven experiments that month. What held up:

  • Two instruments, not twenty. The four cello-and-piano pieces scored 85 to 90. Given a free hand, the composer wrote for six to nine parts and scored 60 to 73. My note at the time: “everything happening at once in the same pitch.”
  • Less instruction, better music. The chess pieces above came from one sentence of brief. Rigid pipelines, contracts and mandatory targets all made things worse.
  • Obeying the test and arguing with it came out the same. Composers told to follow the profile averaged 87.5 on the chess pieces; composers free to refuse it averaged 87.0.

05

We gave it Beethoven's numbers

If targets from hobbyists' scores helped, targets from the masters should help more. So we built new profiles from 2,871 canonical scores, sonatas, quartets, art songs, and ran one brief four ways: three composers steered by the masters, one by the old profile. We wrote down five predictions first. Every one favoured the masters.

All five were wrong. The composers hit the numbers: 40 or 41 of the 42 measurements at or above the median on every piece. The old profile won by a distance. Hitting Beethoven's numbers without Beethoven's craft sounds like this.

0:00 / 2:11

Targets from the masters, for clarinet and piano. clarinet piano. Written as notation by Claude; the sound is MuseScore playing the score.

The brief, in short“First love at 17: summer work at a bakery in a village in the south of France, and a girl comes into the shop.”

Heard blind, 17 March 2026

3rd of 4

  1. Starts off on poor footing. Has the worst piano fundamentals of every single piece so far. There is not a chord that is in melody.
  2. It's like the first love between a very slow farmhand and the widowed butterchurner.
  3. From seconds 25-30 it ALMOST LOCKS IN
  4. It's almost like a clownhouse. Like something that would play in a horror film as a group of clowns gets ready to slaughter their unsuspecting audience.

A test you can pass without getting better is the thing every test is at risk of becoming. After this, the feedback became a suggestion the composer could refuse.

06

Then we tested the test

In August we went back and read the whole apparatus before running anything new. The test had been wrong in ways that were easy to check once someone looked:

  • It compared duets with symphonies. The reference music ran from 1 to 46 parts and from 4 to 5,661 beats, and nothing was scaled. A 75-beat waltz was being asked for the number of key changes you'd find in a full orchestral score.
  • One check could never fire. The test for notes outside an instrument's range had a condition that was always false. It ran in all eleven experiments and caught nothing.
  • One check invented errors. At every change of meter it read the previous bar's time signature. On one piece it reported 21 mistakes that weren't there, and the composer was handed them as real.
  • It couldn't hear what I heard. Nothing in it measured how the instruments were stacked, which was exactly what was wrong with the orchestral pieces.

So the honest answer to the question at the top: the test never judged the music. It pointed, loosely, and a composer that looked where it pointed often found something worth fixing. What moved the music most was the model. Opus 4.6 was okay at this. The models since have been a lot better.