wave-roll
Version:
JavaScript Library for Comparative MIDI Piano-Roll Visualization
29 lines • 1.31 kB
TypeScript
import { NoteData } from "@/lib/midi/types";
import { TranscriptionToleranceOptions } from "@/lib/evaluation/transcription/constants";
/**
* Describes the aggregated result of one overlap cluster.
*/
export interface OverlapResult {
/** Averaged onset time (seconds). */
onset: number;
/** Averaged duration (seconds). */
duration: number;
/** Averaged MIDI pitch - rounded to the nearest integer. */
pitch: number;
/** Zero-based indices of the MIDI files participating in the cluster. */
fileIndices: number[];
}
/**
* Group notes that are considered the same across different files.
*
* Two notes are deemed equal when both their onset and pitch lie within the
* provided tolerances. All notes fulfilling this condition form an undirected
* graph; connected components of size >= 2 are returned as overlap groups. For
* every group the function yields one representative note with averaged
* onset/duration/pitch alongside the list of contributing file indices.
*
* The algorithm runs in O(N²) time which is sufficient for the typical note
* counts encountered in a piano-roll visualiser.
*/
export declare function groupOverlappingNotes(notesByFile: NoteData[][], tolerances?: TranscriptionToleranceOptions): OverlapResult[];
//# sourceMappingURL=overlap.d.ts.map