pianoize turns a song into a piano arrangement. A model called tsumugi transcribes the recording into notes, Claude writes the piano score from those notes, and code builds and checks it. Claude never hears the song. If the transcription is wrong, Claude is arranging a wrong song, and the only ears in the loop are mine.

This is about one song, 光の道標 (Beacon of Light) by 鹿乃 (Kano). It’s the song I debugged chordotomy with, but the trouble this time was the transcription.

Rewriting a wrong line only moved it further away

After the second chorus there’s an interlude, about 3:25 to 3:40, where strings carry the tune. In the arrangement it sounded off, and I couldn’t say why.

Over one evening Claude tried three things. It undid some octave jumps it had added itself. It rewrote the passage as an even line that suits the piano, which was tidier and further from the song. Then it put the strings back as transcribed, and that was when I was sure the transcription itself was wrong.

I asked whether getting the original out of a broken transcription was simply impossible. For a line that happens once, close to it, Claude said. Where a phrase comes back, the repeats can be compared, but here there was nothing to compare with, and all it could write was a plausible guess.

Measuring the recording

The third option on its list was to check the notes against the audio as numbers, and the next evening we tried it. tsumugi comes with a splitter that separates a recording into stems, one track per group of instruments. Claude cut out 45 seconds, separated them, and measured how loud every pitch was, a 32nd note at a time. One line stood at least 10 dB above everything around it, and it disagreed with the transcription in five places. At 3:28 the transcription holds a long G5. There’s no G5 in the recording; the line moves C#5, D5, C#5 and up to F#5. At 3:32 it holds C#6, where the recording comes down C#6, A5, G#5.

Written into the score, it was the best version so far.

Reading those tables by eye cost about 10,000 tokens for the 15 seconds of interlude, so doing a whole song that way was out. What I wanted was for code to do the comparing and hand Claude a short list.

Most of the first list wasn’t notes

A quick trial on the sung melody looked promising. Of 361 transcribed notes, 353 agreed with the vocal stem. Eight didn’t, and there were 14 places where the voice sounded and the transcription had nothing.

I went through the 14 and recognised one: a D at 0:17 that I was sure was missing. The rest I wasn’t sure about. Claude added the D where the list had it, and the rhythm was wrong. Looking frame by frame, the sound at 0:17.4 was the previous long D fading out. It moved the note to where the voice comes back in, just before the next bar, which still didn’t fit, and I had it taken out.

About ten of the 14 turned out not to be notes at all. They were tails of held notes, slides into the next one, and faint high readings that could be breath.

So check-line, the command that came out of this, lists an untranscribed sound only if it has a start of its own (its level has to rise) and isn’t a slide. Its list never fails the build. The pitch reading has errors of its own, such as octave slips and backing voices. Claude reads each line as something to weigh.

A fresh run lost to the one fixed by hand

The next day a fresh agent arranged the whole song with the check. On its own it caught a G5 at 3:27 that wasn’t there. But in the interlude, of eight places we had settled by then, it got two right. The old version was better, and I did wonder whether the check had been a waste.

It had flagged more than it fixed: four of those places were on the list, and the agent kept the transcription. The list says things like “A5, but D5 sounds for 26% of it”, one note at a time. Reading the table by hand, we had seen an order: A5, then down to C#5. The order was what made the fix obvious.

Two changes came out of this and a guitar lead on another song. read-stem prints what a stem sounds through a few bars, and the rules now say to read a lead’s listed notes together, as a line. The rule alone didn’t do it: a new arrangement on November 22 had it and still kept most of the listed notes. On December 2 I asked for the passage again, Claude reread it with read-stem, and after that only one B in its melody changed.

What the check can’t see

With the interlude done, I heard what was wrong with the sung melody. In verse 1, around 0:16, the melody should go A, D, E, D, D, with the last D sung twice. Verse 2 had it and verse 1 didn’t.

check-line had read the melody of that version too. It listed four notes, and none of them needed changing.

It couldn’t have found this one. Two syllables on one pitch and one long note give the same pitch reading. The transcription had merged them into a held D, and the recording supports a D all the way through. The second strike belongs at 0:16.8, in the same bar where the first list had pointed at 0:17.4, the tail.

There were more, some that I heard and some that Claude found by comparing the repeats, and they got lost in different ways:

  • 0:21.9. The transcription had both Ds. Claude dropped one: the broken bars earlier in verse 1 didn’t have it, and pianoize’s rules called a quick restrike of the same pitch transcription noise.
  • 3:16 and 4:37. A phrase that goes D, C#, D, D comes four times, and twice the transcription lost the C#. The first time, it sits inside one long D. The C# takes up about a quarter of it, so most of the note still agrees with the recording, and it passes.

That phrase had got past Claude’s own comparison too. It had set verse against verse and chorus against chorus, and this is a tag after the chorus, outside every pair.

Comparing the repeats

The rules already said to compare the repeats. Nothing checked that it was done, so I turned it into a command.

compare-repeats lays the melody over itself one bar later, two bars later, and so on. Wherever the same phrase lines up, it pairs the notes and lists the ones that one repeat has and another lacks. It finds phrases from the notes, so a tag counts as much as a verse. Run on this song’s transcribed melody, without the stem table, it prints this among others (pos is the sixteenth within the bar, and the number in brackets is the note’s length in sixteenths):

bar 81 pos 6.5  1:52.82  D4 (6)
bar 89 pos 6  2:04.06  D4 (6)
  not at bar 13 pos 6.5  0:16.81  D4 from bar 13 pos 4
  not at bar 21 pos 6  0:28.06  D4 from bar 21 pos 4
  not at bar 85 pos 6  1:58.41  D4 from bar 85 pos 4

That’s the D I had asked for: two bars of verse 2 strike it again, and three other bars just hold it.

It lists 11 notes on this song. Eight point at something that was changed that day, and the other three needed no change. Three of the eight are the one tag, though, and one of those is misleading: it says bar 198 lacks a D that bar 140 has only because the transcription lost the C# there. And it’s no test: I heard only some of the eight, Claude found the rest by comparing repeats, two of them with no attack in the recording to confirm them, and the command was built on this very song. That evening it listed 18 on a second song, one it had also been run on during the build. The agent changed most of them, and I haven’t judged the result by ear yet.

It has its own blind spots. A note lost in every repeat isn’t in any of them to be compared. Nor can it find one at the very edge of a repeat, or a line that happens only once, like the interlude. And singers do add or drop a syllable between verses, so a listed note can be real in one place only.

Command Compares Can’t see
check-line each transcribed note with the stem a repeated syllable merged into one note; a short wrong turn inside a long one
read-stem nothing: prints the stem for a few bars anything in bars nobody doubts
compare-repeats the melody with its own repeats a line that comes once; a note lost every time

The sung-melody rules changed along with it. A quick restrike is noise only if no repeat of the phrase has it. And the fact that one repeat lacks a note is no longer a reason to drop it from the others, because that repeat may be the one that lost it.

Most of this started with me hearing something wrong, and the last word is still mine. The next song starts with these lists in hand. This is how Beacon of Light came out:

The comparison is in repeats.py, the stem reading in stems.py, and the rules Claude follows in audio-check.md and reading-the-dump.md.