Architecture

trail mix is a Rust workspace for tempo, key, beat, and waveform analysis. beat-salad, key-lime, and sampler-platter are independent analyzer crates that can be used on their own. trailmix is an optional facade that runs all three and returns one combined result. trailmix-codecs handles file decoding.

Audio input APIs

trailmix_codecs::analyze_path() starts from an audio file and handles decoding. trailmix::analyze() starts from mono PCM supplied by the application. Both produce the same Analysis result.

Tradeoffs

The default analyzers use deterministic DSP rather than bundled neural-network weights. The core build remains small, inspectable, and fully offline, but will not match specialized ML systems on every dataset.

References

beat salad

Estimates global BPM, beat positions with downbeat inference, and local tempo segments using autocorrelation with harmonic scoring and a gentle octave prior.

returns
BPM, beat grid, tempo segments

key lime

Estimates global and local major or minor keys with dual chroma extraction, averaged key-profile scores, median aggregation, and confidence-gated segmentation.

returns
Key, confidence, key segments

sampler platter

Generates compact waveform columns with raw min, max, and RMS values plus display height and band-energy color hints.

returns
Waveform columns with raw values and display hints