wave-roll
Version:
JavaScript Library for Comparative MIDI Piano-Roll Visualization
24 lines • 1.14 kB
TypeScript
import { type ScaleLinear } from "d3-scale";
import type { NoteData } from "@/lib/midi/types";
import type { PianoRollConfig } from "../types";
/**
* Object returned by createScales.
* pxPerSecond is included so the caller can cache it
* and feed it back on the next call to preserve spacing.
*/
export interface Scales {
timeScale: ScaleLinear<number, number>;
pitchScale: ScaleLinear<number, number>;
pxPerSecond: number;
}
/**
* Derives time- and pitch-axis scales for the piano-roll visualiser.
*
* @param notes MIDI notes already loaded
* @param options State of the piano roll
* @param currentPxPerSecond Previously computed px/sec ratio (or null)
* @param TARGET_VISIBLE_SECONDS How many seconds the viewport should show
* when zoomX === 1 (default = 8 seconds)
*/
export declare function createScales(notes: NoteData[], options: Required<Pick<PianoRollConfig, "width" | "height" | "noteRange" | "showPianoKeys">>, currentPxPerSecond?: number | null, TARGET_VISIBLE_SECONDS?: number, reservedBottomPx?: number): Scales;
//# sourceMappingURL=scales.d.ts.map