CPCratePilot

Engineering case study · 2026

From a folder of tracks to a set worth rehearsing.

CratePilot is an explainable composition and rendering system for a first DJ performance: enough automation to escape the blank page, enough control to remain the DJ.

99passing workshop tests
48curated transitions
4recorded reference sets
1–30configurable strict drafts

01

The problem

A music folder is not a performance. A first-time DJ still has to choose an arc, find compatible neighbors, decide where phrases meet, prepare cues, and turn the result into something Rekordbox can safely export.

The product constraint was personal and concrete: reduce the anxiety of a first booth without removing authorship. Every recommendation therefore needs a reason, every override must be respected, and the result must survive the walk from laptop to USB.

Career context

After a career break, I returned to hands-on engineering by turning a long-standing goal—playing my first DJ set—into an applied audio product. The work spans product design, audio analysis, optimization, DSP, security boundaries, data modeling, and release engineering.

02

Architecture

The public and private experiences share the planning language but have intentionally different trust boundaries. The website ships a sanitized fixture and no upload, provider, or acquisition route. Local mode binds to 127.0.0.1, issues a per-launch token, and validates file access against selected roots or managed storage.

DiscoverCanonical identities merge Spotify, Shazam evidence, manual, and local sources into a bounded similarity graph.
ReviewExplainable version scoring produces an explicit acquisition queue with safe source links first.
VerifySongRec runs eleven random 12-second samples; six matching Shazam results are required before promotion.
AnalyzeLibrosa + FFmpeg derive tempo, Camelot key, energy, phrases, and audible bounds.
PlanBounded beam search returns up to 30 deterministic drafts under strict readiness constraints.
PerformPhrase-aware DSP renders previews, a reference mix, cue notes, and a Rekordbox-safe package.
PersistSQLite stores versioned catalog, provenance edges, jobs, smart crates, analyses, and plans.
ExplainStable schemas expose source evidence, component scores, tempo factors, and mix notes.
ProtectPrivate paths, audio, provider evidence, and the learning workspace never enter public assets.

03

Planning

Greedy ordering made locally attractive choices that stranded the final tracks. CratePilot instead explores a bounded beam of partial sets, pruning impossible duration and ordering states while preserving several globally promising arcs.

70% transitions20% energy5%5%

Transition compatibility blends tempo, Camelot harmony, energy, timbre, rhythm, artist spacing, and nearest examples from 48 curated transitions. Energy-curve fit encourages a confident opening, gradual rise, peak near 80%, and a controlled close. Duration and artist spacing supply smaller global corrections.

Locks and user ordering are hard constraints. A manual edit is never silently reversed: only its adjacent edges are rescored, and weak results become warnings with concrete repair options.

04

Rendering

The browser preview demonstrates transition geometry with lightweight Web Audio synthesis. The local renderer handles the work that matters for rehearsal: phase-aware time stretching, phrase alignment, equal-power fades, bass handoff, filter automation, loudness normalization, and true-peak limiting.

The reference master targets −14 LUFS and ≤−1 dBTP. It is a rehearsal and safety artifact, not a claim that the planned set replaces live mixing.

Rekordbox handoff

Export remains deliberately boring and non-destructive: sanitized numbered copies, a relative M3U8 playlist, versioned JSON, transition CSV, printable cue sheet, checksums, attribution manifest, and optional FLAC. CratePilot does not write proprietary Pioneer databases; Rekordbox remains responsible for device-library and USB export.

05

Tradeoffs

Explainability over mystique. Example-based learning improves recommendations, but the system is not branded as an “AI DJ.” The model augments explicit DSP heuristics and exposes its contribution.

Local processing over uploads. Browser-only analysis would simplify installation, but private collections are large, personal, and expensive to process. A localhost application creates a clearer privacy and performance boundary.

Safe interchange over database hacks. M3U8 and documented cue notes require a verification step in Rekordbox, but they avoid coupling a first performance to unsupported database mutation.

Warnings over vetoes. Compatibility is advice. The human may knowingly choose tension, surprise, or a difficult blend.

06

Validation

The extracted package preserves the proven transition-learning tests and adds coverage for identity collapse, bounded graph traversal, deterministic rankings, explicit approval, consensus mismatch quarantine, smart crates, strict draft diversity, schema persistence, path safety, and reproducible exports.

Recorded provider fixtures and generated beat/key audio keep personal music and live network calls out of CI. Product acceptance is equally concrete: a recruiter should discover, review, and inspect a set within 90 seconds; a first-time DJ should reach a rehearsable Rekordbox playlist without file repair.

Try discovery →