Case Studies
Engineering Case Study · Part of MixLab

MixLab: Playlist Completion

A constrained curation mode for DJs who have already started. Take four or five seed tracks that belong together. The vibe is clear, the direction is set. Generate three sequenced completions from the unplayed pool. Each variant follows a different structural logic and receives a deterministic DJ practicality score. The winning playlist loads directly into Rekordbox.

Type Engineering Case Study
Domain AI · Music Tools · Data Pipelines
Stack Python · Rekordbox XML · Claude Sonnet · Discord
Status Active
3
variants generated per run
3
seed tiers (anchor, supporting, optional)
4
scoring dimensions
6
set roles mapped per run

The Problem It Solves

The core MixLab pipeline starts from scratch. It takes the unplayed pool, clusters it by genre and harmonic character, and generates fully sequenced concepts from nothing. Playlist completion is a different problem.

You have already started to build your set. You have four or five tracks in a playlist that belong together. You know the vibe. You do not have enough tracks to fill a set, and you are not sure which of the hundreds of tracks belong alongside what you have already chosen.

Trawling the pool manually to find compatible additions is the same analytical grind the original pipeline was built to eliminate. Playlist completion runs the same engine on a smaller problem.

How It Works

The feature takes a named Rekordbox playlist as input alongside the existing unplayed pool. It classifies the seed tracks, analyses the intent behind what is already chosen, and generates three sequenced variants (practical, balanced, and adventurous), each with a deterministic quality score.

Stage 0: Intent Extraction

Before any curation happens, the existing seeds are analysed as a unit. The system extracts the overall vibe (the sonic and emotional character shared by the seeds) alongside the energy shape (single arc, double peak, plateau, flat, or unclear), the implied risk tolerance inferred from BPM spread, harmonic spread, and genre coherence, and which set roles are not yet covered.

This intent brief reaches the variant generation stage as context, not a target. The seeds define the boundaries. Completion fills within them.

Seed Classification

Each seed track is classified into one of three tiers. Anchors define the set’s character and are protected across all variants. They cannot be dropped. Supporting tracks contribute meaningfully but could be displaced by a stronger option from the library pool. Optional tracks can be replaced if a candidate clearly serves the arc better.

Strong adjacency pairs (two seeds that sit well together harmonically and by BPM) are identified and flagged. Variants are penalised for breaking them without justification.

Three Variants

Stage 2 produces three concepts from the same candidate pool, each following a different structural logic.

  • Practical: maximises harmonic continuity, prefers adjacent Camelot keys, keeps BPM moves small. All strong adjacency pairs preserved. No unearned key jumps.
  • Balanced: permits one major key jump or a single deliberate BPM arc. Anchors protected. Optional seeds can be swapped when a library track clearly serves the arc better.
  • Adventurous: prioritises set narrative and role completeness. Chapter pivots and peak impacts are permitted when the mechanism is named. Anchors protected; everything else is negotiable if the reasoning is explicit.

DJ Practicality Score

Each variant is scored deterministically in Python from the returned track sequence across four dimensions. No narrative labels, no seed-retention count.

30%
BPM smoothness: even consecutive BPM steps across the sequence
30%
Harmonic ratio: proportion of zero or one Camelot step transitions
25%
Risk justified: named mechanisms earn risky transitions; unearned cuts are penalised
15%
Fragment preserved: strong adjacency pairs from seed analysis survived into the final sequence

The winning variant is the one with the highest combined score. If scores are tied, practical beats balanced beats adventurous; safer is the correct tiebreak.

Variants that drop too many anchors or supporting tracks are excluded before scoring reaches them. A variant that retains optional seeds but drops all anchors does not pass the floor check, regardless of its numeric score. The scoring phase never sees candidates that fail the retention floor.

This design keeps the scoring objective and reproducible. The same input always produces the same winner. There is no randomness, no prompt-guided winner selection, and no subjective ranking. The LLM generates the variants; Python picks between them.

Example Output

The run below was against a WIP house playlist with seven seed tracks. One seed was dropped, harmonically isolated from the rest of the opening run. Three library tracks were added. The winning variant was Practical.

Sample output · Practical variant · Winner
Grooves & Gradients

A tightly stitched journey that earns its peak through patience. Every step earns the next one, no shortcuts taken. The room is asked to commit gradually and rewarded for doing so.

Track order (Camelot / BPM / Role)
  1. 1 Mousse T. - All I Want Is The Bass 10A · 124.0 · opener
  2. 2 Dusky - LF10 10A · 125.0 · builder
  3. 3 Dusky - L.I. 9A · 127.0 · pivot
  4. 4 Steve Darko & Claude VonStroke - How Many Times 9A · 127.0 · builder
  5. 5 Kerri Chandler - Ladbroke Grove 8A · 127.76 · peak
  6. 6 Xpansions - Move Your Body (Shadow Child Extended Remix) 8A · 127.0 · peak
  7. 7 John Tejada - Who’s Afraid 3A · 127.95 · cleanser
  8. 8 Cadence. - Coastin’ 9A · 130.0 · builder
  9. 9 John Tejada - Reverie 8A · 130.03 · closer

6 retained · 1 dropped (harmonically isolated from the opening run) · 3 library tracks added

L.I. → How Many Times (9A → 9A, 127.0 → 127.0)

One-step key drop into same key, a mood shift that needs a clean phrase boundary to land. The adjacency pair is preserved from the original seeds.

Xpansions → Who’s Afraid (8A → 3A, 127.0 → 127.95)

A 5-step Camelot jump, the largest risk in the sequence. Post-peak commitment earns it; the stripped intro of Who’s Afraid buys the adjustment time needed.

Who’s Afraid → Coastin’ (3A → 9A, 127.95 → 130.0)

A 6-step jump paired with a BPM push to 130; the rhythmic momentum of the BPM lift provides cover for the harmonic distance.

“Grooves & Gradients”, the winning Practical variant from a seven-seed house run. Camelot key, BPM, and role annotated per track. Risky transitions are named with their justification mechanism. The balanced and adventurous variants were also generated; all three load directly into Rekordbox as named playlists.

Where This Fits

The full MixLab pipeline starts from a blank slate. Playlist completion starts from a handful of tracks you already believe in. Two entry points, same engine, same output: Rekordbox XML and a Discord report, ready for CDJs.

No additional tooling, no change to the workflow. The difference is what you hand it at the start.

← MixLab: AI-Powered Mix Curation for DJs

Tech Stack

MixLab: Playlist Completion GitHub ↗
Python lxml Rekordbox XML Camelot wheel algorithm Claude Sonnet (variant generation) Discord webhooks
Case Studies
Get in touch

Building something similar?

The playlist completion pattern (classify existing inputs, generate constrained variants, score deterministically, pick the winner) applies well beyond DJ tooling. Wherever you have a partial solution that needs principled completion, the same structure holds.

If you are working on something in this space, get in touch.