AI-Powered Music Analysis & Generation Platform - Production-ready platform for music studios, producers, and enterprises.
π Status: MVP Complete β | Ready for Azure Deployment
A comprehensive music analysis and generation platform leveraging state-of-the-art AI models (Demucs, MusicGen) to analyze audio structure, separate stems, extract musical features, and generate new music programmatically.
π Deployment Plan | π Quick Start Guide | π MVP Status
- Stem Separation: Demucs v4 (htdemucs) - 4-stem isolation (vocals, drums, bass, other)
- Musical Analysis: BPM detection, key/scale detection, chord extraction, beat tracking
- Metadata Extraction: ID3 tags, album artwork, duration, format
- Real-Time Updates: SignalR WebSocket notifications for job progress
- Model: Meta's MusicGen-small (300MB, 8-second load time)
- Text-to-Music: Generate music from text prompts
- Controllable Parameters: BPM, key, style, duration
- Training Pipeline: Fine-tune on custom stems for personalized generation
- Output: 32kHz generation, resampled to 44.1kHz WAV
- Async Job Processing: Service Bus queues with auto-scaling workers
- Blob Storage: Azure Storage for audio files, stems, and training data
- Database: PostgreSQL 16 with Entity Framework Core
- API: .NET 8.0 REST API with Swagger documentation
- Cross-Platform UI: .NET MAUI desktop app (Windows/Mac)
- .NET 8.0: Web API, Entity Framework, SignalR, MAUI
- Python Workers: FastAPI microservices (analysis + generation)
- AI Models: Demucs v4, MusicGen, librosa, essentia, madmom
- Azure: Container Apps, PostgreSQL, Blob Storage, Service Bus
- Containerization: Docker Compose (local), Azure Container Apps (production)
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β .NET API ββββββΆβ PostgreSQL β β Blob Storage β
β (Port 5000)β β (Port 5432) β β (Azurite) β
ββββββββ¬βββββββ ββββββββββββββββ ββββββββββ¬βββββββββ
β β
βββββββββββββ¬ββββββββββββββββββββββββββββββββ€
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Analysis β β Generation β β Service β
β Worker β β Worker β β Bus β
β (Port 8001) β β (Port 8080) β β Queues β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
Customer Subscription
βββ Container Apps Environment
β βββ API (1-10 replicas, always-on)
β βββ Analysis Worker (0-5 replicas, auto-scale)
β βββ Generation Worker (0-3 replicas, auto-scale)
βββ PostgreSQL Flexible Server (B2s)
βββ Blob Storage Account (LRS/GRS)
βββ Service Bus Namespace (Standard)
βββ Container Registry
βββ Application Insights + Log Analytics
βββ Key Vault (secrets management)
βββ Managed Identity (RBAC security)
- Docker Desktop
- .NET 8.0 SDK
- Git
# Clone repository
git clone https://github.com/TheManInTheBox/DirectAI.git
cd DirectAI
# Start all services
docker compose up -d
# Check service health
docker compose ps
docker compose logs api --tail=20
# Access services
# API: http://localhost:5000
# Swagger: http://localhost:5000/swagger
# PgAdmin: http://localhost:5050# Set customer context
azd env new customer-acme-music
azd env set CUSTOMER_NAME "acme-music"
azd env set AZURE_SUBSCRIPTION_ID "customer-sub-id"
# Deploy infrastructure + apps
azd up --subscription "customer-sub-id"
# Verify deployment
azd show
azd monitor --logsβ Backend Infrastructure
- .NET 8.0 API with async job processing
- PostgreSQL database with EF Core migrations
- Blob storage integration (Azurite local, Azure production)
- SignalR real-time job updates
β Analysis Worker
- Demucs v4 stem separation (~30s per track)
- BPM detection, key/scale analysis
- Chord extraction with timeout handling
- Beat tracking and metadata extraction
- MP3 album artwork support
β Generation Worker
- MusicGen-small integration (8s startup)
- Text-to-music generation
- 32kHz β 44.1kHz resampling
- Compatible with analysis worker output
β Deployment Ready
- Docker Compose for local development
- Azure Container Apps deployment plan
- Bicep infrastructure-as-code templates
- Per-customer isolation architecture
π In Progress
- Training pipeline for MusicGen fine-tuning
- Stem selection UI for dataset creation
- Parameter-controlled generation (key, BPM, bars)
- Customer onboarding automation
π Detailed MVP Status | π§ͺ Testing Guide
- Get Started Guide - Local setup and first analysis job
- MVP Status - Current implementation status and roadmap
- Testing Guide - How to test all features
- Deployment Plan - Azure Container Apps deployment strategy
- Architecture Overview - System design and data flow
- API Reference - REST endpoints documentation
- Worker Documentation - Analysis & generation workers
- Upload tracks β Get separated stems in 30 seconds
- Analyze chord progressions and key signatures
- Extract BPM and beat grids for remixing
- Generate new stems matching your musical style
- RESTful API with OpenAPI/Swagger
- Real-time WebSocket updates via SignalR
- Async job processing with retry logic
- Comprehensive logging and telemetry
- Isolated Azure deployment per customer
- Managed identity security (no credentials)
- Auto-scaling workers (cost-efficient)
- Centralized monitoring via Azure Lighthouse
DirectAI/
βββ src/
β βββ MusicPlatform.Api/ # .NET 8.0 REST API
β βββ MusicPlatform.Domain/ # Core business logic
β βββ MusicPlatform.Infrastructure/ # Data access, external services
βββ workers/
β βββ analysis/ # Python FastAPI (Demucs, analysis)
β βββ generation/ # Python FastAPI (MusicGen)
βββ infrastructure/
β βββ main.bicep # Azure IaC templates
β βββ kubernetes/ # K8s manifests (optional)
βββ database/
β βββ schema.sql # PostgreSQL schema
βββ .azure/
β βββ plan.copilotmd # Deployment plan
βββ docker-compose.yml # Local development
# .NET API tests
dotnet test tests/DirectML.AI.Tests/
# Test analysis worker locally
docker compose up -d analysis-worker
curl http://localhost:8001/health
# Test generation worker locally
docker compose up -d generation-worker
curl http://localhost:8080/health# Build all Docker images
docker compose build
# Push to Azure Container Registry
az acr login --name <registry-name>
docker tag directai-api <registry>.azurecr.io/directai-api:latest
docker push <registry>.azurecr.io/directai-api:latestThis is a commercial product under active development. For partnership opportunities, licensing, or technical inquiries:
- GitHub Issues: Bug reports and feature requests
- Discussions: Architecture and design conversations
- Pull Requests: Welcome for bug fixes (requires CLA)
Proprietary - All rights reserved. Commercial licensing available.
Contact: GitHub Profile
Built with: .NET 8.0 β’ Python 3.10 β’ Azure β’ Docker β’ PostgreSQL β’ MusicGen β’ Demucs
Powered by: Meta AI (MusicGen) β’ FAIR (Demucs) β’ MTG (Essentia) β’ madmom