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.
- 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.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Convert a full math program into a single-year path
Claude condensed a two-year math sequence into one year and assembled the lessons, tests, activities, and schedule.
Plan a monthly social calendar from live research
A Claude Code skill studies a brand, competitors, and audience chatter, then drafts 20 posts and 4 reels in an Excel calendar.
Have an agent assemble a first video rough cut
An agent can turn a transcript into a planned rough cut, render it, and inspect the cut points before finalizing.
Run Claude Code to build a coded animated musical
They let Claude Code work almost entirely on its own to keep creating and refining a fully coded animated musical.
Set the visual direction before building the site
Use Claude Design to shape the look first, then hand the decisions to Claude Code for implementation.
Use Claude Code to make a short film from script to export
One person had Claude Code handle the whole short-film pipeline, from script and voiceover to rendering, music, and final assembly.