import { NormalRange, Positive, Seconds, Ticks, Time, TransportTime } from "../core/type/Units"; import { ToneEvent, ToneEventCallback, ToneEventOptions } from "./ToneEvent"; declare type SequenceEventDescription = Array; interface SequenceOptions extends Omit, "value"> { loopStart: number; loopEnd: number; subdivision: Time; events: SequenceEventDescription; } /** * A sequence is an alternate notation of a part. Instead * of passing in an array of [time, event] pairs, pass * in an array of events which will be spaced at the * given subdivision. Sub-arrays will subdivide that beat * by the number of items are in the array. * Sequence notation inspiration from [Tidal](http://yaxu.org/tidal/) * @example * var seq = new Sequence(function(time, note){ * console.log(note); * //straight quater notes * }, ["C4", "E4", "G4", "A4"], "4n"); * @example * var seq = new Sequence(function(time, note){ * console.log(note); * //subdivisions are given as subarrays * }, ["C4", ["E4", "D4", "E4"], "G4", ["A4", "G4"]]); * @category Event */ export declare class Sequence extends ToneEvent { readonly name: string; /** * The subdivison of each note */ private _subdivision; /** * The object responsible for scheduling all of the events */ private _part; /** * private reference to all of the sequence proxies */ private _events; /** * The proxied array */ private _eventsArray; /** * @param callback The callback to invoke with every note * @param sequence The sequence * @param subdivision The subdivision between which events are placed. */ constructor(callback?: ToneEventCallback, events?: SequenceEventDescription, subdivision?: Time); constructor(options?: Partial>); static getDefaults(): SequenceOptions; /** * The internal callback for when an event is invoked */ private _seqCallback; /** * The sequence */ events: any[]; /** * Start the part at the given time. * @param time When to start the part. * @param offset The offset index to start at */ start(time?: TransportTime, offset?: number): this; /** * Stop the part at the given time. * @param time When to stop the part. */ stop(time?: TransportTime): this; /** * The subdivision of the sequence. This can only be * set in the constructor. The subdivision is the * interval between successive steps. */ readonly subdivision: Seconds; /** * Create a sequence proxy which can be monitored to create subsequences */ private _createSequence; /** * When the sequence has changed, all of the events need to be recreated */ private _eventsUpdated; /** * reschedule all of the events that need to be rescheduled */ private _rescheduleSequence; /** * Get the time of the index given the Sequence's subdivision * @param index * @return The time of that index */ private _indexTime; /** * Clear all of the events */ clear(): this; dispose(): this; loop: boolean | number; /** * The index at which the sequence should start looping */ loopStart: number; /** * The index at which the sequence should end looping */ loopEnd: number; startOffset: Ticks; playbackRate: Positive; probability: NormalRange; humanize: boolean | Time; /** * The number of scheduled events */ readonly length: number; } export {};