import { Seconds } from "../global"; declare type IOICluster = { ioi: Seconds; size: number; score?: number; }; /** * An object which collects an histogram of inter onset interval (ioi) clusters * based on series of time points. */ declare class IOIHistogram { widthThreshold: Seconds; maxIOI: Seconds; minIOI: Seconds; maxTempi: number; mergeOnTheFly: boolean; minBeatInterval: Seconds; maxBeatInterval: Seconds; i: number; buffer: Seconds[]; clusters: IOICluster[]; constructor({ widthThreshold, // 25ms maxIOI, // seconds minIOI, // seconds mergeOnTheFly, maxTempi, minBeatInterval, // 200bpm maxBeatInterval, }?: { widthThreshold?: number | undefined; maxIOI?: number | undefined; minIOI?: number | undefined; mergeOnTheFly?: boolean | undefined; maxTempi?: number | undefined; minBeatInterval?: number | undefined; maxBeatInterval?: number | undefined; }); /** Pass peak data to the IOI histogram */ data(t: Seconds | Seconds[]): this; /** Flush the buffer at the end of passing peak data to the histogram. */ flush(): this; /** Process (and remove) the first data point in the buffer. */ private processForward; /** Merge all similar clusters. */ mergeClusters(): void; /** * Recursizely merges adjacent clusters to the given index if they are within the widthThreshold. * Returns the new index of the index argument */ mergeAdjacent(i: number): number; /** * Calculate/recaculate salience scores for each cluster. */ refreshScores(): void; /** * Shortlist indexes of the largest clusters. */ readonly shortlist: number[]; /** * Creates a list of hypothetical tempos (expressed as beat intervals in * seconds). */ createTempoList(): number[]; } export default IOIHistogram;