Compose Hardcore Synth Baroque Music with AI and a Custom Engine
Job to be done: Compose a hardcore synth baroque music piece with AI
🇳🇬 Ways to use this in Nigeria
Ideas to get you started, adapt to your situation.
- Student
Generate a 2-minute hardcore synth baroque music piece for a student film project using AI code generation.
What this is, in plain English
This workflow describes an advanced way to use an AI coding assistant, Claude Code, to help compose music. Instead of simply typing a request into a chat app and getting a song, this method involves guiding the AI to write or modify code for a custom-built music synthesis engine. The author used a programming language called Rust and a special library for sound processing called FunDSP to create their unique sound.
This is not a simple, copy-paste recipe for beginners. It requires significant technical skill, including comfort with programming (specifically Rust), understanding of digital audio concepts, and setting up a development environment. The AI acts as a coding partner, helping to generate the complex instructions that tell the custom engine how to create the music.
The exact instructions for this workflow live within the author’s specific code project and development setup. Because it relies on custom code and an evolving development process, there isn’t a single set of steps that everyone can follow directly. This entry explains the underlying ideas and how such a system works.
What you can use it for
- Generate unique music for games: Create custom soundtracks that blend different genres and styles, tailored to your game’s needs.
- Experiment with AI-assisted composition: Explore how artificial intelligence can help shape musical ideas, structures, and variations in a coding environment.
- Develop custom audio tools: Learn how to build your own music synthesis engines and audio processing tools using programming languages like Rust.
- Explore genre fusion: Combine unexpected musical styles, such as classical baroque and modern hardcore synth, with the guidance of an AI coding assistant.
Tools you need
- Claude Code (paid): An AI coding assistant that helps programmers write, debug, and understand code within a development environment.
- Rust (free): A powerful programming language used to build high-performance applications, including custom audio engines and digital signal processing tools.
- FunDSP (free): A Rust library (a collection of pre-written code) specifically designed for digital signal processing, making it easier to create and manipulate sounds.
How it actually works
To reproduce this, you would first need to set up a Rust development environment and integrate the FunDSP library into a new or existing project. This involves installing Rust, creating a new project, and adding FunDSP as a dependency. The author used Claude Code within this environment, likely in a virtual machine (a software-based computer running inside another computer) to keep their main project separate.
Once your development environment is ready, you would interact with Claude Code, providing it with prompts to guide the music generation. The AI would then help you write or modify the Rust code that uses FunDSP to create the desired musical output. The author’s process involved an iterative back-and-forth with Claude Code to refine the generative soundtrack.
The author provided a partial prompt they used to instruct Claude Code. This prompt gives the AI context about the desired musical style and technical requirements:
The music: I'm gonna ask something weird, lets waste some tokens. Some of the pieces that we arrived into.. I love then, its a nice mix between synths and canons. I like Bach, love his math music and canon pieces. I like this palette of sounds. I want you to go into a side quest and compose a hardcore synth baroque piece. around 2:00 duration. Dont clobber this repo, so use a new folder here in the vm ~ But use the same fundsp pipeline we have. Keep the modern sounding drum kit, i let you chose tempo. Go hardcore into number of voices, pattern variations and super dense arrangements.
Claude Code would then generate or suggest Rust code that implements these musical ideas using the FunDSP library. You would run this code, listen to the output, and then provide further prompts to Claude Code to refine the composition, adjust parameters, or explore new variations. The exact steps and code will depend heavily on your specific project and coding skills.
Words you’ll see, explained
- AI coding assistant: A software tool that uses artificial intelligence to help programmers write, debug, and understand computer code more efficiently.
- Rust: A modern programming language known for its speed, memory safety, and ability to handle complex tasks, often used for system programming and high-performance applications.
- FunDSP: A library for the Rust programming language that provides tools and functions for digital signal processing, which is the mathematical manipulation of digital signals like audio.
- Synth engine: The software component that generates and processes electronic sounds, similar to how a physical synthesizer creates music.
- Baroque music: A style of classical music from the 17th and 18th centuries, characterized by elaborate ornamentation, complex counterpoint, and a sense of grandeur, often associated with composers like J.S. Bach.
- Virtual machine (VM): A software-based computer that runs on top of another operating system, allowing you to run different operating systems or isolated development environments without needing separate physical hardware.
Original source
This concept was shared by Reddit user /u/guillermosan on the platform Reddit. The author described how they used Claude Code to compose a unique piece of music blending baroque and hardcore synth styles, leveraging a custom Rust and FunDSP synth engine.
Notes & variations
- Do you even need this? For simply generating music without coding, much simpler AI music tools exist, such as Suno, Udio, or Google MusicLM. These tools allow you to describe the music you want in plain language and generate it directly, without needing to write any code or set up a development environment. This workflow is for those interested in deep customization and programming their own audio tools.
- Free-tier limits: While Rust and FunDSP are free and open-source, Claude Code is a paid developer product. Setting up a full development environment and learning Rust and FunDSP requires a significant time investment, even if the core tools are free.
- Common pitfall: Expecting instant, perfect musical results without any coding knowledge or iterative refinement. This is a development process where the AI assists in writing code, not a magic button that produces finished songs.