UNPKG

@logic-pad/core

Version:
83 lines (82 loc) 3.8 kB
import { AnyConfig } from '../config.js'; import Configurable from '../configurable.js'; import { Instrument } from '../primitives.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 instrument to play the note with, or null to keep the current instrument from the previous control line. * If this is null from the first control line, the instrument will be "piano". * This has no effect if the current note is a drum sample. */ readonly instrument: Instrument | 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; readonly title = "Music Grid - Row"; readonly configExplanation = "Configure the playback settings from this tile onwards."; 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 instrument to play the note with, or null to keep the current instrument from the previous control line. * If this is null from the first control line, the instrument will be "piano". * This has no effect if the current note is a drum sample. */ instrument: Instrument | 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, instrument, velocity, }: { note?: string | null; instrument?: Instrument | 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[]; readonly title = "Music Grid - Control Line"; readonly configExplanation = "Configure the playback settings from this point onwards."; 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;