LLM-Orchestrated Music Production Platform - Generate professional-quality music using AI with natural language prompts.
MusicForge is an AI-powered music production platform that transforms natural language descriptions into full audio tracks. Using a hybrid C#/.NET 9 orchestration layer and Python AI workers, it combines the power of:
- AudioCraft MusicGen - AI music generation
- Bark - AI vocal synthesis
- Demucs - Audio stem separation
- LLM Orchestration - Intelligent task planning via Groq/OpenRouter
"Create an energetic electronic track with a catchy synth melody, 128 BPM"
β
π΅ Full audio track + stems
| Feature | Description |
|---|---|
| πΉ Natural Language Control | Describe music in plain English |
| π€ LLM Orchestration | AI plans and coordinates generation |
| ποΈ Stem Separation | Separate vocals, drums, bass, melody |
| π€ AI Vocals | Generate realistic vocal tracks |
| π Real-time Progress | SignalR streaming updates |
| π³ Docker Ready | One-command deployment |
| π REST API | Easy integration with any frontend |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MusicForge System β
βββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ€
β C# .NET 9 API Layer β Python AI Worker Layer β
β (Port 5001) β (Port 50051 gRPC) β
βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββ β βββββββββββββββββββββββββββββββββββ β
β β Minimal API + SignalR β β β gRPC Server (MusicWorkerSvc) β β
β β REST + WebSocket β β β β β
β βββββββββββββ¬ββββββββββββββ β βββββββββββββββββ¬ββββββββββββββββββ β
β β β β β
β βββββββββββββΌββββββββββββββ β βββββββββββββββββΌββββββββββββββββββ β
β β MediatR CQRS Layer β β β AI Components β β
β β Commands & Handlers ββββββΌβββββΊ β’ MusicGen (AudioCraft) β β
β βββββββββββββ¬ββββββββββββββ β β β’ Bark (Vocals) β β
β β β β β’ Demucs (Stems) β β
β βββββββββββββΌββββββββββββββ β β β’ Theory Engine (music21) β β
β β Agent Orchestrator β β βββββββββββββββββββββββββββββββββββ β
β β LLM-Powered Planning β β β
β βββββββββββββ¬ββββββββββββββ β β
β β β β
β βββββββββββββΌββββββββββββββ β β
β β SQLite Persistence β β β
β β EF Core + Repository β β β
β βββββββββββββββββββββββββββ β β
βββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| API | .NET 9 Minimal API | REST endpoints, SignalR |
| Domain | Clean Architecture | DDD aggregates, value objects |
| Application | MediatR | CQRS command/query handling |
| Infrastructure | gRPC, EF Core | Worker communication, persistence |
| AI Workers | Python 3.11 | MusicGen, Bark, Demucs, music21 |
| LLM | Groq/OpenRouter | Intent parsing, task planning |
| Database | SQLite | Project persistence |
| Container | Docker Compose | Multi-service orchestration |
- Docker & Docker Compose
- Groq API Key (free tier available)
- 8GB+ RAM recommended
- GPU optional (CPU fallback available)
git clone https://github.com/csa7mdm/MusicForge.git
cd MusicForge
# Set your API key
echo "GROQ_API_KEY=your_groq_api_key_here" > .envdocker compose up -d# Create a project
curl -X POST http://localhost:5001/api/projects \
-H "Content-Type: application/json" \
-d '{
"name": "My First Track",
"description": "An energetic electronic track",
"genre": "Electronic",
"mood": "Energetic",
"tempoBpm": 128,
"key": "C Minor",
"durationSeconds": 60
}'
# Generate music
curl -X POST http://localhost:5001/api/projects/{projectId}/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "Create an uplifting intro with synth arpeggios"}'| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Health check |
GET |
/api/health/worker |
Worker health |
GET |
/api/projects |
List all projects |
GET |
/api/projects/{id} |
Get project details |
POST |
/api/projects |
Create new project |
POST |
/api/projects/{id}/generate |
Start generation |
POST |
/api/projects/{id}/iterate |
Iterate with feedback |
DELETE |
/api/projects/{id} |
Delete project |
Create Project
Request:
{
"name": "Summer Vibes",
"description": "A chill summer track",
"genre": "Electronic",
"mood": "Chill",
"tempoBpm": 110,
"key": "F Major",
"durationSeconds": 180,
"hasVocals": true,
"lyrics": "Feel the summer breeze..."
}Response:
{
"projectId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "Project created successfully"
}Generate Music
Request:
{
"prompt": "Add a groovy bassline and soft pads"
}Response:
{
"success": true,
"masterFilePath": "/output/summer-vibes-master.wav",
"stemPaths": [
"/output/stems/drums.wav",
"/output/stems/bass.wav",
"/output/stems/melody.wav"
]
}# Run all tests
dotnet test
# Run specific test suites
dotnet test tests/MusicForge.Domain.Tests # 28 tests
dotnet test tests/MusicForge.Application.Tests # 9 tests
dotnet test tests/MusicForge.Integration.Tests # 5 testsTest Coverage:
- Domain Layer: Value objects, entities, aggregates
- Application Layer: Command handlers, state machine
- Integration: API endpoints, worker communication
| Service | Port | Description |
|---|---|---|
api |
5001 | C# REST API |
worker |
50051 | Python gRPC worker |
ollama |
11434 | Optional local LLM |
| Variable | Required | Description |
|---|---|---|
GROQ_API_KEY |
Yes | Groq API key for LLM |
OPENROUTER_API_KEY |
No | Alternative LLM provider |
MusicWorker__Address |
No | Worker address (default: http://worker:50051) |
MusicForge/
βββ src/
β βββ MusicForge.Domain/ # Domain entities, value objects
β βββ MusicForge.Application/ # CQRS commands, interfaces
β βββ MusicForge.Infrastructure/ # gRPC, EF Core, LLM clients
β βββ MusicForge.Api/ # REST API, SignalR hub
β βββ MusicForge.Cli/ # Command-line interface
βββ tests/
β βββ MusicForge.Domain.Tests/
β βββ MusicForge.Application.Tests/
β βββ MusicForge.Integration.Tests/
βββ workers/
β βββ python/
β βββ src/
β β βββ components/ # MusicGen, Bark, Demucs wrappers
β β βββ server.py # gRPC server
β βββ Dockerfile
βββ protos/
β βββ worker.proto # gRPC service definition
βββ docker-compose.yml
We welcome contributions! See CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
dotnet test - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
Found a bug? Please open an issue with:
- Title: Clear, concise description
- Steps to reproduce: Numbered list
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Environment: OS, Docker version, .NET version
- Logs: Relevant error messages
Use the Bug Report Template.
This project is licensed under the MIT License - see the LICENSE file for details.
- AudioCraft - Meta's audio generation
- Bark - Suno's text-to-speech
- Demucs - Meta's source separation
- music21 - MIT's music theory toolkit
Built with β€οΈ for the music creation community
Quick Start β’ API Docs β’ Contributing β’ Issues