import * as Tone from 'tone'; import { RecursivePartial } from './Types'; /** Allows the audio playback of notes */ export default class SynthInstrument { private gridWidth; private gridHeight; private numVoices; private scale; private noteOffset; private polyphony; private players; private currentPlayer; private notes; private noteLength; private destroyed; /** * Creates a synth instrument * @param {number} gridWidth - The width of the grid, in tiles * @param {number} gridHeight - The height of the grid, in tiles */ constructor(gridWidth: number, gridHeight: number, noteLength: number, options?: RecursivePartial, filterOptions?: Partial); /** * Schedules a note at an (x, y) grid coordinate * to automatically play at the appropriate time and pitch * @param gridX - The x position of the note, in grid tiles * @param gridY - The y position of the note, in grid tiles * @returns The id of the note that's been scheduled, for use with unscheduleNote() */ scheduleNote(gridX: number, gridY: number): number; /** * Unschedules a note so that it will no longer play * @param id - The id of the note to unschedule */ unscheduleNote(id: number): void; /** * Clear all notes from polyphony and stuff. */ clearNotes(): void; /** * Get the x position on the grid where the playhead currently is * @returns The x position */ getPlayheadX(): number; dispose(): void; }