/** * Windowed BPM detection — spectral-flux onset detection, autocorrelation * tempo estimation, Fourier-tempogram validation. */ /** * Main analysis orchestrator with progress yielding */ export function analyzeWithProgress(y: any, sr: any, windowSize?: number, hopSize?: number): Promise<{ globalTempo: number; globalConfidence: number; globalCandidates: { bpm: number; score: number; }[]; tempo: any[]; confidence: number[]; times: number[]; onsetEnvelope: Float32Array; tempogram: { data: Float32Array[]; frequencies: number[]; peakTempos: { bpm: any; strength: number; }[]; }; }>; /** * Compute onset strength using spectral flux */ export function computeOnsetStrength(y: any, sr: any): Promise>; /** * Estimate global tempo using autocorrelation */ export function estimateGlobalTempo(onsetEnvelope: any, sr: any): Promise<{ bpm: number; confidence: number; candidates: { bpm: number; score: number; }[]; }>; /** * Compute Fourier tempogram */ export function computeFourierTempogram(onsetEnvelope: any, sr: any): Promise<{ tempogram: Float32Array[]; frequencies: number[]; peakTempos: { bpm: any; strength: number; }[]; }>; /** * Estimate tempo within constrained range * * REPAIR (2026-07-02 proof-of-work): the original reduced a 4s window to an * ~15-point energy downsample (8 sub-buckets, half-bucket hop) while the BPM * search needed lags >= ~17, so the autocorrelation loop never executed and * every window silently returned globalTempo — the window-by-window "tempo * stability" output was constant regardless of actual tempo changes. Now the * raw onset-envelope window is mean-centered and autocorrelated directly * (normalized correlation, same estimator as estimateGlobalTempo) over the * constrained lag range. Confidence is the best normalized correlation * (measured, in [0, 0.95]); if the window is too short to search any lag the * global tempo is returned with confidence 0 — never a fabricated confidence. */ export function estimateConstrainedTempo(window: any, sr: any, globalTempo: any): Promise<{ bpm: any; confidence: number; }>; /** * Compute simple spectrum using decimated FFT */ export function computeSimpleSpectrum(frame: any): Promise>; /** * Compute simple FFT */ export function computeSimpleFFT(signal: any): Promise>; /** * Convert FFT bins to tempo frequencies */ export function computeTempoFrequencies(windowLength: any, sr: any): number[]; /** * Analyze tempogram for peak tempos */ export function analyzeTempogram(tempogram: any, frequencies: any): Promise<{ bpm: any; strength: number; }[]>;