Lilypond is a TeX-like typesetting language for sheet music. I’ve had good outcomes asking AI to generate Lilypond code, which is stunning given the obscurity of the language. There can’t be that a lot publicly accessible Lilypond code to coach on.
I’ve largely generated Lilypond code for posts associated to music idea, such because the publish on the James Bond chord. I used to be curious how effectively AI would work if I uploaded a picture of sheet music and requested it to provide corresponding Lilypond code.
In a nutshell, the outcomes have been hilariously dangerous so far as the sheet music produced. However Grok did a superb job of recognizing the supply of the clips.
Check photographs
Listed here are the 2 photographs I used, one in every of classical music
and one in every of jazz.

I used the identical immediate for each photographs with Grok and ChatGPT: Write Lilypond code equivalent to the connected sheet music picture.
Classical outcomes
Grok
Right here’s what I received once I compiled the code Grok generated for the primary picture.

This bears no resemblance to the unique, turning one measure into eight. Nevertheless, Grok accurately inferred that the excerpt was by Bach, and the music it composed (!) is within the type of Bach, although it’s not in any respect what I requested for.
ChatGPT
Right here’s the corresponding output from ChatGPT.

Not solely did ChatGPT hallucinate, it hallucinated in two-part concord!
Jazz outcomes
One purpose I needed to attempt a jazz instance was to see what would occur with the chord symbols.
Grok
Right here’s what Grok did with the second sheet music picture.

The notes are nearly unrelated to the unique, although the chords are right. The one distinction is that Grok makes use of the notation Δ for a serious seventh chord; each notations are frequent. And Grok accurately inferred the title of the tune.
I edited the picture above. I didn’t change any notes, however I moved the title to middle it over the music. I additionally minimize out the music and lyrics credit to make the picture match on the web page simpler. Grok accurately credited Johnny Burke and Jimmy Van Heusen for the lyrics and music.
ChatGPT
Right here’s what I received once I compiled the Lilypond code that ChatGPT produced. The chords are right, as above. The notes bear some similarity to the unique, although ChatGPT took the freedom of adjusting the important thing and the time signature, and the final measure has seven and a half beats.

ChatGPT didn’t speculate on the origin of the clip, however once I requested “What tune is that this music from?” it responded with “The fragment seems to be from the jazz customary ‘Misty.’”
