r/musicprogramming • u/nucleicaudio • 29d ago
Thoughts on using coding agents and LLM's for experimental music production?
I first posted this question in r/musicproduction, but I quickly realized the discussion probably wouldn’t be very constructive over there. I’m not here to argue for or against this method, and I don’t want to spend time defending it against traditional ways of doing things. I just want to talk about it with anyone who’s interested.
I am not talking about the typical, write a prompt and a polished turd plops out as an audio file of a fully arranged track.
What I am talking about is describing music in code and leverage coding agents to help write that code?
It might still be turds, and even unpolished one, but that's what i have been doing the last year?
For context, I’m a coder first and a musician second, so expressing musical ideas through code feels natural to me. I also want to use the same score and data to drive both music and visuals.
My music often leans ambient, repetitive and hypnotic. What interests me is creating an almost inhuman amount of microvariation within that repetition: small changes in timing, velocity, note length, articulation, timbre and spatial position, while keeping a recognizable groove.
Code lets me define how those changes interact through controlled randomness, slow cycles and relationships between parts. Programming every detail individually in a DAW would be incredibly tedious. It also opens up experiments like “what would a pendulum wave sound like?”, where the same system could generate both the notes and the graphics.
That combination of coding, sound synthesis, music and visual experimentation is why I’m exploring this workflow.
3
u/ApoplecticAndroid 29d ago
I’ve been playing with something like this for a while - currently working on a more advanced version of my engine
A Double Pendulum Plays Piano | Generative Music in F♯ Minor
https://youtu.be/nrf9Kt7CmGo
1
u/muikrad 29d ago
Funny, I started a project yesterday about this. It's a tracker interface (similar to Impulse Tracker and famitracker) but it has an API that can provide context and functions to an agent, so kinda like selecting code in your IDE and asking the agent to edit it. So I can select e.g. the drums column and say "make the hats busier" and it will happily oblige.
It's fun. Claude can definitely write music, it's really good at creating small 16 bars looping patterns, but it's not really good at doing leads, melodies or structure unless explicitly told.
1
u/guigouz 29d ago
Check https://simedw.com/2026/08/20/midi-autocomplete/ it seems related to your idea
Jordan Rudess is using a custom trained AI to jam, he explains it in this video https://www.youtube.com/watch?v=fA12-rR1vUk
1
u/adanoslomry 29d ago
I've been working on an AI assistant interface for my DAW (Ableton Live) for a long time, and at some point I realized you shouldn't actually need AI to use it, so I exposed the interface via a standard HTTP REST API: https://producer-pal.org/guide/rest-api
This means you can write scripts or local webapps to manipulate Ableton, including generating and editing MIDI clips. I experiment with having Claude Code make scripts that can algorithmically generate MIDI into my DAW instead of asking the LLM to generate it directly. Of course, I could write that code myself, but I like trying out lots of ideas quickly and don't have time to do it all myself.
I was using this to play around with cellular automata patterns recently. I didn't like the results so I didn't record it. but it's fun and interesting to generate music with code, so I'm going to keep experimenting.
1
u/Opus589 28d ago
I would separate AI from the "rest of the world" and feed it only with my music. Herewith, the LLM would know only my music and the generation of a new ideas would be only in the domain of my music.
So would I do.
1
u/Opus589 27d ago
You don't need AI nor LLM for that.
What you need, as you say you are a coder, is SuperCollider---it is precisely the tool that you are talking about.
SC has its own language, and I guess you will master it quickly. SC is particularly suited for that type of music you have described.
0
u/alibloomdido 29d ago
Surely people vibe code different tools for music (like VSTs), IDK about the quality, never tried them, but probably some of them are good.
However "coding music" is most likely going to be clunky and not worth the time. If you want microvariation it's not hard to do with existing tools and it's not tedious at all. If you want randomness, controlled or not, try some synths with randomization, for example Opsix (hardware or VST) produces really wild sounds this way which you can then tweak and if you make samples with them you can easily make hours and hours of weird noise.
"A pendulum wave" is just sine wave, no? Or you mean a system of pendulums? Nothing really interesting.
0
u/wassertim 29d ago
I've been doing it as well for a while. Claude is able to write Bach's style fugues for me, so anything else is just peanuts :D I like the process and that you can ask it to change every little detail. Works for me already pretty well.