Skip to main content

Musical plans, deterministic execution

The offline B2B renderer now compiles validated transition plans into frame-scheduled commands. Versioned beat-based recipes, controlled auditions, per-transition measurements and human ratings are implemented; see AI DJ analysis and learning. The live four-CDJ adapter remains future work. The requirements below describe the broader target contract, including controls not yet implemented.

Track prerequisites

Every eligible library track has a content hash, duration/source sample rate, BPM/tempo map, ordered beatgrid, phrase boundaries, key, cue positions, and energy estimate. Store confidence, analysis provenance, and analysis version. MVP-0 may use manually verified sidecars. Track selection rejects missing required analysis; uncertain phrase boundaries do not become authoritative by inference from BPM alone.

Energy can begin as a coarse normalized annotation. Key and energy are planning signals; correctness is not guaranteed merely by having non-null fields. Variable-tempo tracks need tempo maps and can be excluded from the first implementation with an explicit reason.

Plan envelope

A plan identifies actor, turn ID, expected state revision, outgoing/incoming decks, incoming track, cue source frame, outgoing phrase/beat anchor, target BPM, transition length in beats, and a bounded list of automation actions. Phrase numbering must reference the specific outgoing track analysis; a bare “phrase 64” is not a universal time coordinate.

Actions include play incoming, set/ramp EQ gain, ramp channel gain/filter, bass swap, and stop outgoing. Gains declare units (linear or dB), filters declare their parameterization, and ramps declare curve/interpolation. A generic scalar called value is insufficient for an EQ contract. Beat-to-frame conversion records tempo-map identity and a defined rounding rule.

Validation

Validate known assets/cues, expected turn and revision, resource grants, feasible remaining duration, phrase anchor confidence, target tempo range, bounded automation count, supported controls, value ranges, and non-overlapping conflicting ramps. Expand a bass swap into explicit complementary low-band envelopes. Validate the entire plan atomically before scheduling; no partially applied invalid plan.

The orchestrator gives the transition executor a bounded grant for both channels. This avoids contradicting the fixed deck ownership of DJ A and B. Actor identities remain separate in decision records. Revocation cancels future actions under that grant generation.

Actor context and isolation

Each actor has its own ID, profile, memory, history, strategy, and energy target. Context includes the partner's current track and accepted decision, recent played tracks, remaining usable phrases, eligible library, turn ID, and constraints. There is no crowd sensor in the MVP; a crowd-energy field would be a labelled simulated input.

A structured model response is untrusted input. Record raw response provenance, validation outcome, accepted plan, model/configuration identity, and fallback decision. The executor follows only validated plans. Timeouts never block rendering or cause an actor to issue high-frequency parameter commands.