/** * Find the true downbeat phase by analyzing onset patterns * Much simpler and more reliable than complex spectral analysis */ export function findDownbeatPhase(audioData: any, beats: any, tempo: any, sampleRate: any): { phase: number; downbeats: any[]; phaseScores: number[]; }; /** * Find the first strong downbeat in the track * This helps align loops to the actual musical phrasing */ export function findFirstDownbeat(audioData: any, tempo: any, sampleRate: any): number; /** * Simple loop finder that respects musical boundaries * * @throws {Error} when the analyzed region carries no signal evidence * (RMS at or below 1e3 × float32-tiny, i.e. silence or pure denormals). * Without this gate, scoreLoopConsistency() degenerates on silence — * all-zero chunk energies give zero variance and a PERFECT 1.0 score — * fabricating maximum confidence out of nothing. */ export function findMusicalLoop(audioData: any, sampleRate: any, tempo: any, { preferredBars, minBars, maxBars }?: { preferredBars?: number; minBars?: number; maxBars?: number; }): { start: number; end: number; bars: number; score: number; };