Skip to main content

Module tonal

Module tonal 

Source
Expand description

Tonal — real HPCP, tuning, key/scale, chord (declared assumptions, abstain).

This module supersedes the fake bin % 12 “chroma” that lived in music.rs: hpcp() performs a proper log2-based frequency → pitch-class mapping from spectral peaks. Every function that assumes 12-TET takes an explicit assumption flag and abstains rather than force a label — Qualia is modality-first and does not treat 12-TET as universal truth. Tuning (ref_freq_hz / n_pc) is a parameter throughout. Re-exports only (AU-TONAL).

Re-exports§

pub use chord::estimate_chord;
pub use chord::ChordEstimate;
pub use chord::ChordQuality;
pub use hpcp::hpcp;
pub use key::estimate_key;
pub use key::KeyEstimate;
pub use scale::estimate_scale;
pub use scale::ScaleEstimate;
pub use scale::ScaleProposal;
pub use tuning::estimate_tuning;
pub use tuning::TuningEstimate;

Modules§

chord
Simple triad chord proposal from a single HPCP frame (major/minor/dim).
hpcp
Harmonic Pitch Class Profile (HPCP) from spectral peaks.
key
Key estimation by Krumhansl–Schmuckler profile correlation over an HPCP.
scale
Scale / mode proposal from an HPCP (major / minor / other, with abstention).
tuning
Reference tuning estimation from spectral peaks — does not assume 440 Hz.