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
Turn a newsletter into a LinkedIn carousel
A newsletter writer used Claude Code to turn newsletter text or links into a branded LinkedIn carousel in minutes.
Create songs and studio tooling by chat
Claude Code helped a developer write music, lyrics, and Bitwig tools, with one honky-tonk track made entirely in conversation.
Analyze a piano clip for tempo and structure
Claude Code installed audio tools, then analyzed a short MP3 and wrote a report on tempo, form, and stems.
Generate Strudel music and prep it for live performance
A developer used Claude to draft Strudel code from a style description, then cleaned it up and reshaped it for live performance.
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.
Index your archive and turn essays into new drafts
A writer used Claude Code to search a large archive, then reused essays as newsletter and thread drafts with a review step.