AI-Powered Track Discovery & Intelligent Sampling Tool
State-of-the-art music structure analysis, harmonic mixing, and 6-stem separation optimized for Apple M4 Mini
| Feature | Description |
|---|---|
| Advanced Structure Analysis | Self-similarity matrix-based segmentation detects intro, verse, chorus, breakdown, drop, bridge, outro |
| Smart Sample Selection | AI avoids silence, picks energy peaks, aligns to beat grid, scores loop quality |
| Full Camelot Wheel | 24-key harmonic mixing with compatible key suggestions and energy boost mixing |
| Mashup Potential Scoring | Calculate compatibility between any two samples for mashups |
| Audio Fingerprinting | Chromaprint-inspired similarity detection across your sample library |
| Semantic Audio Search | Find samples by characteristics (bright, percussive, energetic, etc.) |
| DAW Export | Rekordbox XML, Serato crates, M3U playlists with metadata |
| Beat Quantization | Perfect bar-aligned loop points with downbeat detection |
- Search artists via MusicBrainz, Discogs, Spotify APIs
- Filter by date range (1990-2024)
- Track type filtering: Original, Remix, Collaboration, Production
- Best quality audio via yt-dlp (YouTube Music, SoundCloud, Bandcamp)
- Automatic source selection
- 24-bit WAV output format
- Self-similarity matrix segmentation
- Beat tracking with downbeat detection
- Section classification: intro, verse, chorus, breakdown, drop, bridge, outro
- Energy profile mapping
- Silence detection & avoidance
- Accurate key detection using Krumhansl-Schmuckler profiles
- Full Camelot wheel mapping (24 keys)
- Compatible key suggestions for mixing:
- Same key (100% match)
- +1/-1 (smooth transitions)
- Relative major/minor (mood change)
- Energy boost (+7 semitones)
- Configurable sample length: 4, 8, 16, 32, 64 bars
- Section preference (drop, chorus, breakdown, etc.)
- Score-based sample point ranking:
- Energy score
- Beat alignment score
- Silence avoidance score
- Loop quality score
- htdemucs_6s model
- Stems: drums, bass, vocals, guitar, piano, other
- Apple M4 MPS acceleration
- Per-sample or batch processing
- BPM compatibility analysis
- Harmonic compatibility scoring
- Energy level matching
- Structure complementarity
- Overall recommendation: Excellent / Good / Possible / Difficult / Avoid
- Spectral peak extraction
- Constellation map generation
- Multi-dimensional similarity scoring
- Duplicate detection
- Similar sample finder
- Rekordbox XML: Full metadata, cue points, colors
- Serato: CSV and M3U8 for Smart Crates
- M3U8: Universal playlist format
- JSON: Complete backup/transfer
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Electron Desktop โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ React + TypeScript Frontend โ
โ โโโ SearchPanel (Artist/Date/Type filters) โ
โ โโโ TrackList (Selection & batch) โ
โ โโโ SOTAPanel (Camelot wheel, structure viz) โ
โ โโโ MashupScorer (Compatibility calculator) โ
โ โโโ SampleCard (Waveform, play/grab/discard) โ
โ โโโ ExtractionSettings (Bars, stems, section) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Flask + SocketIO Backend (Python) โ
โ โโโ Metadata Service (MusicBrainz, Discogs, Spotify) โ
โ โโโ Download Service (yt-dlp multi-source) โ
โ โโโ SOTA Analyzer (Structure, beats, harmony) โ
โ โโโ Sample Extractor (Intelligent point selection) โ
โ โโโ Stem Separator (Demucs htdemucs_6s) โ
โ โโโ Harmonic Mixer (Camelot wheel, mashup scoring) โ
โ โโโ Audio Fingerprint (Similarity, duplicates) โ
โ โโโ DAW Exporter (Rekordbox, Serato, M3U) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Python 3.10+
- Node.js 18+
- FFmpeg (for audio processing)
# Clone repository
git clone https://github.com/k3ss-official/dj-sample-discovery.git
cd dj-sample-discovery
# Run setup script
./setup.sh
# Or manual setup:
npm install
cd backend && pip install -r requirements.txt && cd ..Create .env in backend/ directory:
# Optional API keys for enhanced metadata
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
DISCOGS_TOKEN=your_token
# Configuration
DJ_DATA_DIR=~/DJ_Samples
DJ_HOST=127.0.0.1
DJ_PORT=5555
DJ_DEBUG=false# Terminal 1: Start Python backend
cd backend
source venv/bin/activate # If using venv
python server_sota.py
# Terminal 2: Start React frontend
npm run dev
# Access at http://localhost:5173npm run dev # Starts both backend and Electron app- Enter artist name
- Set date range (optional)
- Filter track types
- Browse discovered tracks
- Select tracks for sampling
- Configure extraction settings:
- Bar count: 4/8/16/32/64
- Section preference
- Enable stem separation
- Watch progress in real-time
- Automatic download โ analysis โ extraction
- Waveform visualization
- Play/Stop with Web Audio
- Camelot key display
- Compatible keys for mixing
- Grab (download to folder)
- Discard (remove sample)
- Mashup Scorer: Compare any two samples
- Structure View: See track segments
- Export: Rekordbox/Serato/M3U
POST /api/sota/analyze
POST /api/sota/structure
GET /api/harmonic/compatible?key=Am
POST /api/harmonic/mix-score
POST /api/harmonic/mashup-score
POST /api/harmonic/suggest-order
POST /api/fingerprint/generate
POST /api/fingerprint/compare
POST /api/fingerprint/find-similar
POST /api/semantic/describe
POST /api/export/rekordbox
POST /api/export/serato
POST /api/export/m3u
POST /api/export/json
SAMPLE_BAR_OPTIONS = [4, 8, 16, 32, 64]
DEFAULT_SAMPLE_BARS = 16DEMUCS_MODEL = 'htdemucs_6s'
DEMUCS_DEVICE = 'mps' # Apple Silicon GPU
DEMUCS_STEMS = ['drums', 'bass', 'vocals', 'guitar', 'piano', 'other']SAMPLE_RATE = 44100
BIT_DEPTH = 24
AUDIO_FORMAT = 'wav'dj-sample-discovery/
โโโ backend/
โ โโโ server_sota.py # SOTA Flask server
โ โโโ server.py # Legacy server
โ โโโ config.py # Configuration
โ โโโ requirements.txt # Python dependencies
โ โโโ services/
โ โโโ sota_analyzer.py # SOTA structure analysis
โ โโโ harmonic_mixer.py # Camelot wheel & mashup
โ โโโ audio_fingerprint.py # Fingerprinting
โ โโโ daw_exporter.py # Rekordbox/Serato
โ โโโ audio_analyzer.py # BPM/Key detection
โ โโโ sample_extractor.py # Sample extraction
โ โโโ stem_separator.py # Demucs integration
โ โโโ download_service.py # yt-dlp downloader
โ โโโ metadata_service.py # API aggregation
โโโ src/
โ โโโ App.tsx # Main React app
โ โโโ main.tsx # Entry point
โ โโโ components/
โ โโโ SOTAPanel.tsx # SOTA features UI
โ โโโ MashupScorer.tsx # Mashup calculator
โ โโโ SearchPanel.tsx # Artist search
โ โโโ TrackList.tsx # Track selection
โ โโโ SampleCard.tsx # Sample preview
โ โโโ Waveform.tsx # Wavesurfer.js
โ โโโ ExtractionSettings.tsx # Settings panel
โโโ electron/
โ โโโ main.js # Electron main process
โ โโโ preload.js # IPC bridge
โโโ package.json # NPM dependencies
โโโ setup.sh # Installation script
โโโ README.md # This file
- Python 3.10+
- Flask + Flask-SocketIO
- librosa - Audio analysis
- Demucs - Stem separation
- yt-dlp - Audio download
- MusicBrainz/Discogs/Spotify APIs - Metadata
- React 18 + TypeScript
- Tailwind CSS - Styling
- wavesurfer.js - Waveform visualization
- Web Audio API - Audio playback
- Electron 28 - Desktop wrapper
| Operation | Time |
|---|---|
| SOTA Analysis (5min track) | ~15 seconds |
| Sample Extraction | ~2 seconds |
| Stem Separation (6 stems) | ~45 seconds |
| Fingerprint Generation | ~3 seconds |
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open a Pull Request
MIT License - see LICENSE file
- Demucs by Facebook Research
- yt-dlp maintainers
- librosa for audio analysis
- MusicBrainz, Discogs, Spotify APIs
- Real-time audio preview in browser
- Cloud sync for sample library
- Ableton/FL Studio export
- AI-powered "similar artists" discovery
- Batch stem export
- Mobile companion app
- Plugin versions (VST/AU)
Made with โค๏ธ for DJs and Producers
Built for M4 Mini โข Powered by AI โข SOTA Quality