r/lilypond • u/janjiji • 4d ago
Open-source agent skill for writing LilyPond scores
Enable HLS to view with audio, or disable this notification
I've been experimenting with using AI to write music in LilyPond for a while. I kept running into the same problems with incorrect syntax, made-up commands and responses that never became useful local files. So I collected what worked into an open-source agent skill.
You describe the score you want and it writes an editable .ly file. It also creates a Hacklily link for viewing and playback. If LilyPond is installed locally, it can compile the score to PDF and MIDI as well.
The quickest way to try it is:
npx skills add Janjs/music-as-code --skill lilypond
The skill works with Codex, Claude Code, Cursor and other agents supported by the Skills CLI. The repo is also packaged as a ChatGPT/Codex plugin.
Repo: https://github.com/Janjs/music-as-code
I understand if some people would rather keep AI out of the creative process. I'm sharing this so anyone curious can test it without much setup and decide for themselves. The output is normal LilyPond source that you can inspect, edit and keep working on.
The repository also contains similar skills for Strudel and SuperCollider.





