Use Claude Code to generate music with Python

Josh Cohenzadeh had Claude Code write Python that synthesized songs, made videos, and assembled a 5-track album.

Done with Claude CodeΒ· Advanced

What they did
Josh Cohenzadeh tested Claude Code with one-shot instructions only: no iteration, no outside packages, no follow-up questions, and a finished audio file as the goal. In response, the agent generated Python that built melodies from basic waveforms and put together full songs. For one rock piece, Josh explicitly asked for vocals, and Claude Code used macOS say to add them. He also had it turn the audio into videos and package multiple tracks into an album.
How it went
The setup produced a new song, an EDM piece, a rock track with lyrics, music videos, and a 5-track album. Attempts to mimic an existing song performed badly. Getting usable singing was the toughest part; one run even sounded robotic and used a different language.
Tips
If you want vocals, say so clearly; Claude Code left them out unless asked. Repeated runs may drift toward the same ideas, including recurring terms like β€œNeon.”

Try it yourself with Claude Code

Create Python code for an original [genre] track built from simple waveform synthesis, with no third-party libraries and no questions back to me. The script should write a playable audio file named [output_filename] and stay fully self-contained. If you add lyrics or sung lines, use [system voice / local speech tool] and stop to ask for approval before any irreversible action such as overwriting files, sending output, deleting data, or submitting anything. Afterward, show me how to run it and how to adjust the tempo, length, and instruments.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Read the original on josh.ing β†—

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.