>_ZPWR-ALGO-PRODUCTION
A Rust engine that generates a complete, professionally-arranged track from one action — song structure (intro / build / drop / breakdown), key + tempo, per-section MIDI, and an exported Ableton Live Set (.als), with per-genre engines on top. Ported faithfully from the Audio-Haxor generators; the library-scanner coupling is abstracted behind a host-provided sample source. Powers zpwr-daw's one-click production (INVENTIONS #5). Private — internal engine of the MenkeTechnologies audio stack.
Engineering Report
Scale, the module breakdown, the architecture, and the port status. (HTML)
Source
Build instructions, the generator modules, the sample-source trait, and the C ABI.
Overview
One action drives the whole pipeline — pick key / tempo / samples, lay out the arrangement, generate the notes for every section, and write a host-loadable Ableton project. Generation is the workflow, not an assist bolted onto a linear DAW.
- One action → a finished track — structure + key/tempo, per-section MIDI, and an exported
.als. - Faithful port — the generators are lifted verbatim from the Audio-Haxor
src-tauribackend; behaviour is preserved. - Standalone — the library-scanner coupling is abstracted behind a host-provided
SampleSourcetrait, so the engine runs without the scanner. - Library crate — consumed natively by
Audio-Haxorand over a C ABI (capi) byzpwr-daw.
Pipeline & Modules
The orchestrator (track_generator) selects key, tempo, and samples (the latter from the host-provided sample_source), then als_project lays out the arrangement; midi_generator fills each section with notes; genre engines such as trance_generator apply genre-specific arrangement and MIDI; finally als_generator writes the Ableton Live Set from bundled ALS/XML templates.
| Stage | Module | Role |
|---|---|---|
| Song structure + theory | als_project | section lengths / starts, key compatibility, section overrides |
| Per-section MIDI | midi_generator | note-event generation per arrangement section |
| Ableton export | als_generator | writes a full .als (MIDI + audio clips, automation) |
| Genre engine | trance_generator | genre-specific arrangement + MIDI |
| Orchestrator | track_generator | picks key / tempo / samples, drives the whole generation |
| Audio analysis | bpm, similarity | tempo estimation + audio fingerprint / similarity (symphonia, dep-light) |
| Support | midi, sample_analysis, sample_filters | self-contained MIDI parser, sample name/manufacturer signals, filtering |
| Host surface | sample_source, capi, run | host-library trait, C ABI for zpwr-daw, run orchestration |
Standalone By Design
Audio-Haxor's generators reached into its library scanner (sample picking, blacklist / whitelist, key / BPM extraction). Here those couplings are abstracted behind a host-provided sample-source trait (sample_source), so the engine runs without the scanner — the host (Audio-Haxor, zpwr-daw) supplies samples; the engine supplies the music. The host installs its library and data dir at startup (set_data_dir), then drives generation.
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):
bpm,similarity— audio analysis (symphonia), zero external deps.als_project,midi_generator,als_generator,trance_generator,track_generator— structure / MIDI / ALS / genre / orchestration.- Support:
SampleSourcetrait (host sample library),sample_analysisname parsers + manufacturer signals,sample_filters, self-contained MIDI parser, host-setdata_dir+write_app_logshim, thecapiC ABI, and therunorchestrator.
See the engineering report for the module-by-module breakdown and architecture notes.
Build
cargo build cargo test
Library crate (rlib), consumed natively by the Tauri host and over the capi C ABI by zpwr-daw. Vendored as a git submodule inside the consuming apps and the umbrella MenkeTechnologiesMeta repo.
References: Engineering Report · Source.