// ZPWR-ALGO-PRODUCTION — ENGINEERING REPORT

Algorithmic music-production engine · one action → structure + MIDI + Ableton .als · host-provided sample source · ported from Audio-Haxor

>_EXECUTIVE SUMMARY

zpwr-algo-production is a Rust engine that turns one action into a finished, professionally-arranged track: song structure, key and tempo, per-section MIDI, and an exported Ableton Live Set (.als), with per-genre engines layered on top. It is the algorithmic-production core behind zpwr-daw's one-click production (INVENTIONS #5), ported faithfully from the Audio-Haxor src-tauri generators with the library-scanner couplings abstracted behind a host-provided sample source. Private — internal engine, version v0.1.0.

~ Scale & Position

MetricValueNotes
RoleAlgorithmic music-production engineGeneration as the workflow, not an assist bolted onto a linear DAW
LanguageRust (library crate)rlib; consumed natively by Audio-Haxor and over a C ABI by zpwr-daw
OutputAbleton .als + MIDIFull project: structure, per-section notes, audio clips, automation
External depsserde, rand, regex, symphoniaAudio analysis (bpm, similarity) is dependency-light
Sample sourceHost-provided traitRuns without the Audio-Haxor library scanner
Tests280 (ported suite)build + fmt + clippy + doc clean

# Module Breakdown

ModuleResponsibilityStatus
bpmTempo estimation from audio (symphonia)LANDED
similarityAudio fingerprint / similarityLANDED
als_projectSong structure + theory: section lengths / starts, key compatibility, section overridesLANDED
midi_generatorPer-section MIDI note-event generationLANDED
als_generatorWrites a full .als (MIDI + audio clips, automation)LANDED
trance_generatorGenre engine: trance-specific arrangement + MIDILANDED
track_generatorOrchestrator: picks key / tempo / samples, drives generationLANDED
sample_sourceHost-provided sample-source trait (decouples from the scanner)LANDED
midi, sample_analysis, sample_filtersSupport: self-contained MIDI parser, sample name/manufacturer signals, filteringLANDED
capi, runC ABI for zpwr-daw + run orchestrationLANDED

~ Architecture

The orchestrator (track_generator) selects key, tempo, and samples (the latter from the host-provided sample_source), then als_project lays out the arrangement (sections, key compatibility, overrides). midi_generator fills each section with notes; genre engines such as trance_generator apply genre-specific arrangement and MIDI. Finally als_generator writes a complete Ableton Live Set — MIDI and audio clips with automation — from XML/ALS templates bundled in the crate.

The key design decision is the sample-source trait: Audio-Haxor's original generators were coupled to its library scanner; here the host supplies samples and the engine supplies the music, so the same crate runs inside Audio-Haxor (native) and zpwr-daw (over the capi C ABI) alike.

# Port Status

Faithful port complete — all seven generator modules plus the support layer build, and the ported test suite (280 tests) passes (build + fmt + clippy + doc clean). The audio-analysis modules (bpm, similarity), the generation modules, the sample_source decoupling, and the capi C ABI are all in. See the documentation hub for the overview.