1 | import { NormalRange, Positive, Seconds, Ticks, Time, TransportTime } from "../core/type/Units.js";
|
2 | import { ToneEvent, ToneEventCallback, ToneEventOptions } from "./ToneEvent.js";
|
3 | type SequenceEventDescription<T> = Array<T | SequenceEventDescription<T>>;
|
4 | interface SequenceOptions<T> extends Omit<ToneEventOptions<T>, "value"> {
|
5 | loopStart: number;
|
6 | loopEnd: number;
|
7 | subdivision: Time;
|
8 | events: SequenceEventDescription<T>;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare class Sequence<ValueType = any> extends ToneEvent<ValueType> {
|
27 | readonly name: string;
|
28 | |
29 |
|
30 |
|
31 | private _subdivision;
|
32 | |
33 |
|
34 |
|
35 | private _part;
|
36 | |
37 |
|
38 |
|
39 | private _events;
|
40 | |
41 |
|
42 |
|
43 | private _eventsArray;
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 | constructor(callback?: ToneEventCallback<ValueType>, events?: SequenceEventDescription<ValueType>, subdivision?: Time);
|
50 | constructor(options?: Partial<SequenceOptions<ValueType>>);
|
51 | static getDefaults(): SequenceOptions<any>;
|
52 | /**
|
53 | * The internal callback for when an event is invoked
|
54 | */
|
55 | private _seqCallback;
|
56 | /**
|
57 | * The sequence
|
58 | */
|
59 | get events(): any[];
|
60 | set events(s: any[]);
|
61 | /**
|
62 | * Start the part at the given time.
|
63 | * @param time When to start the part.
|
64 | * @param offset The offset index to start at
|
65 | */
|
66 | start(time?: TransportTime, offset?: number): this;
|
67 | /**
|
68 | * Stop the part at the given time.
|
69 | * @param time When to stop the part.
|
70 | */
|
71 | stop(time?: TransportTime): this;
|
72 | /**
|
73 | * The subdivision of the sequence. This can only be
|
74 | * set in the constructor. The subdivision is the
|
75 | * interval between successive steps.
|
76 | */
|
77 | get subdivision(): Seconds;
|
78 | /**
|
79 | * Create a sequence proxy which can be monitored to create subsequences
|
80 | */
|
81 | private _createSequence;
|
82 | /**
|
83 | * When the sequence has changed, all of the events need to be recreated
|
84 | */
|
85 | private _eventsUpdated;
|
86 | /**
|
87 | * reschedule all of the events that need to be rescheduled
|
88 | */
|
89 | private _rescheduleSequence;
|
90 | /**
|
91 | * Get the time of the index given the Sequence's subdivision
|
92 | * @param index
|
93 | * @return The time of that index
|
94 | */
|
95 | private _indexTime;
|
96 | /**
|
97 | * Clear all of the events
|
98 | */
|
99 | clear(): this;
|
100 | dispose(): this;
|
101 | get loop(): boolean | number;
|
102 | set loop(l: boolean | number);
|
103 | /**
|
104 | * The index at which the sequence should start looping
|
105 | */
|
106 | get loopStart(): number;
|
107 | set loopStart(index: number);
|
108 | /**
|
109 | * The index at which the sequence should end looping
|
110 | */
|
111 | get loopEnd(): number;
|
112 | set loopEnd(index: number);
|
113 | get startOffset(): Ticks;
|
114 | set startOffset(start: Ticks);
|
115 | get playbackRate(): Positive;
|
116 | set playbackRate(rate: Positive);
|
117 | get probability(): NormalRange;
|
118 | set probability(prob: NormalRange);
|
119 | get progress(): NormalRange;
|
120 | get humanize(): boolean | Time;
|
121 | set humanize(variation: boolean | Time);
|
122 | /**
|
123 | * The number of scheduled events
|
124 | */
|
125 | get length(): number;
|
126 | }
|
127 | export {};
|