UNPKG

@logic-pad/core

Version:
65 lines (64 loc) 2.79 kB
import { AnyConfig } from '../config.js'; import Configurable from '../configurable.js'; export declare class Row extends Configurable { /** * The note to play at this row, or null to keep the current note from the previous control line. * If this is null from the first control line, the note will be silent. */ readonly note: string | null; /** * The velocity to play the note at, or null to keep the current velocity from the previous control line. * Ranges from 0 to 1 */ readonly velocity: number | null; private static readonly CONFIGS; constructor( /** * The note to play at this row, or null to keep the current note from the previous control line. * If this is null from the first control line, the note will be silent. */ note: string | null, /** * The velocity to play the note at, or null to keep the current velocity from the previous control line. * Ranges from 0 to 1 */ velocity: number | null); get configs(): readonly AnyConfig[] | null; copyWith({ note, velocity, }: { note?: string | null; velocity?: number | null; }): this; } export declare class ControlLine extends Configurable { readonly column: number; readonly bpm: number | null; readonly pedal: boolean | null; readonly checkpoint: boolean; readonly rows: readonly Row[]; private static readonly CONFIGS; /** * Configure playback settings, taking effect at the given column (inclusive) * @param column The column at which the settings take effect * @param bpm The new beats per minute, or null to keep the current value from the previous control line * @param pedal Whether the pedal is pressed, or null to keep the current value from the previous control line * @param checkpoint Whether this control line is a checkpoint * @param rows The notes to play at each row. This list is automatically resized to match the height of the grid. You may pass in an empty list if none of the rows need to be changed. */ constructor(column: number, bpm: number | null, pedal: boolean | null, checkpoint: boolean, rows: readonly Row[]); get configs(): readonly AnyConfig[] | null; copyWith({ column, bpm, pedal, checkpoint, rows, }: { column?: number; bpm?: number | null; pedal?: boolean | null; checkpoint?: boolean; rows?: readonly Row[]; }): this; withColumn(column: number): this; withBpm(bpm: number | null): this; withPedal(pedal: boolean | null): this; withCheckpoint(checkpoint: boolean): this; withRows(rows: readonly Row[]): this; equals(other: ControlLine): boolean; get isEmpty(): boolean; } export declare const instance: undefined;