tone 15.2.0 → 15.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Tone/component/analysis/Follower.test.ts +38 -42
- package/Tone/component/channel/Channel.test.ts +3 -4
- package/Tone/component/channel/Merge.test.ts +5 -6
- package/Tone/component/channel/MidSideSplit.test.ts +21 -25
- package/Tone/component/channel/Mono.test.ts +18 -20
- package/Tone/component/channel/PanVol.test.ts +3 -4
- package/Tone/component/channel/Panner.test.ts +28 -32
- package/Tone/component/channel/Recorder.ts +1 -1
- package/Tone/component/channel/Volume.test.ts +9 -12
- package/Tone/component/dynamics/Gate.test.ts +10 -14
- package/Tone/component/envelope/AmplitudeEnvelope.test.ts +7 -9
- package/Tone/component/envelope/Envelope.test.ts +347 -384
- package/Tone/component/filter/BiquadFilter.test.ts +5 -6
- package/Tone/component/filter/Convolver.test.ts +6 -9
- package/Tone/component/filter/FeedbackCombFilter.test.ts +14 -16
- package/Tone/component/filter/Filter.test.ts +5 -6
- package/Tone/component/filter/LowpassCombFilter.test.ts +15 -17
- package/Tone/core/clock/Clock.test.ts +12 -15
- package/Tone/core/clock/TickSignal.test.ts +18 -21
- package/Tone/core/clock/Transport.test.ts +133 -162
- package/Tone/core/clock/TransportEvent.test.ts +3 -4
- package/Tone/core/clock/TransportRepeatEvent.test.ts +6 -6
- package/Tone/core/context/Context.test.ts +8 -10
- package/Tone/core/context/Context.ts +8 -4
- package/Tone/core/context/Destination.test.ts +3 -4
- package/Tone/core/context/Offline.test.ts +23 -41
- package/Tone/core/context/OfflineContext.test.ts +20 -22
- package/Tone/core/context/Param.test.ts +33 -40
- package/Tone/core/context/ToneAudioBuffer.test.ts +3 -10
- package/Tone/core/context/ToneAudioBuffers.test.ts +9 -13
- package/Tone/core/worklet/ToneAudioWorklet.ts +3 -1
- package/Tone/effect/AutoFilter.test.ts +10 -12
- package/Tone/effect/AutoPanner.test.ts +10 -12
- package/Tone/effect/Chorus.test.ts +10 -14
- package/Tone/effect/FrequencyShifter.test.ts +6 -7
- package/Tone/effect/Reverb.test.ts +12 -15
- package/Tone/effect/Tremolo.test.ts +10 -12
- package/Tone/event/Loop.test.ts +29 -36
- package/Tone/event/Part.test.ts +152 -180
- package/Tone/event/Pattern.test.ts +16 -20
- package/Tone/event/Sequence.test.ts +86 -101
- package/Tone/event/ToneEvent.test.ts +60 -70
- package/Tone/instrument/MonoSynth.test.ts +3 -4
- package/Tone/instrument/PolySynth.test.ts +62 -74
- package/Tone/instrument/Sampler.test.ts +39 -48
- package/Tone/instrument/Synth.test.ts +40 -47
- package/Tone/signal/AudioToGain.test.ts +4 -5
- package/Tone/signal/Signal.test.ts +120 -143
- package/Tone/signal/SyncedSignal.test.ts +108 -122
- package/Tone/signal/ToneConstantSource.test.ts +21 -25
- package/Tone/signal/WaveShaper.test.ts +5 -6
- package/Tone/source/Source.test.ts +42 -48
- package/Tone/source/buffer/GrainPlayer.test.ts +29 -35
- package/Tone/source/buffer/Player.test.ts +162 -191
- package/Tone/source/buffer/Players.test.ts +44 -50
- package/Tone/source/buffer/ToneBufferSource.test.ts +176 -211
- package/Tone/source/oscillator/LFO.test.ts +49 -61
- package/Tone/source/oscillator/Oscillator.test.ts +24 -28
- package/Tone/source/oscillator/PulseOscillator.test.ts +36 -40
- package/Tone/source/oscillator/ToneOscillatorNode.test.ts +25 -29
- package/Tone/version.ts +1 -1
- package/build/Tone.js +1 -1
- package/build/Tone.js.map +1 -1
- package/build/esm/component/channel/Recorder.js.map +1 -1
- package/build/esm/core/context/Context.js +6 -3
- package/build/esm/core/context/Context.js.map +1 -1
- package/build/esm/core/worklet/ToneAudioWorklet.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -84,9 +84,9 @@ describe("Pattern", () => {
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
context("Callback", () => {
|
|
87
|
-
it("is invoked after it's started", () => {
|
|
87
|
+
it("is invoked after it's started", async () => {
|
|
88
88
|
let invoked = false;
|
|
89
|
-
|
|
89
|
+
await Offline(({ transport }) => {
|
|
90
90
|
const values = ["a", "b", "c"];
|
|
91
91
|
let index = 0;
|
|
92
92
|
const pattern = new Pattern(() => {
|
|
@@ -96,14 +96,13 @@ describe("Pattern", () => {
|
|
|
96
96
|
index++;
|
|
97
97
|
}, values).start(0);
|
|
98
98
|
transport.start();
|
|
99
|
-
}, 0.2)
|
|
100
|
-
|
|
101
|
-
});
|
|
99
|
+
}, 0.2);
|
|
100
|
+
expect(invoked).to.be.true;
|
|
102
101
|
});
|
|
103
102
|
|
|
104
|
-
it("passes in the scheduled time and pattern note to the callback", () => {
|
|
103
|
+
it("passes in the scheduled time and pattern note to the callback", async () => {
|
|
105
104
|
let invoked = false;
|
|
106
|
-
|
|
105
|
+
await Offline(({ transport }) => {
|
|
107
106
|
const startTime = 0.05;
|
|
108
107
|
const pattern = new Pattern(
|
|
109
108
|
(time, note) => {
|
|
@@ -119,14 +118,13 @@ describe("Pattern", () => {
|
|
|
119
118
|
);
|
|
120
119
|
transport.start(startTime);
|
|
121
120
|
pattern.start(0.3);
|
|
122
|
-
}, 0.4)
|
|
123
|
-
|
|
124
|
-
});
|
|
121
|
+
}, 0.4);
|
|
122
|
+
expect(invoked).to.be.true;
|
|
125
123
|
});
|
|
126
124
|
|
|
127
|
-
it("passes in the next note of the pattern", () => {
|
|
125
|
+
it("passes in the next note of the pattern", async () => {
|
|
128
126
|
let counter = 0;
|
|
129
|
-
|
|
127
|
+
await Offline(({ transport }) => {
|
|
130
128
|
const values = ["a", "b", "c"];
|
|
131
129
|
const pattern = new Pattern(
|
|
132
130
|
(time, note) => {
|
|
@@ -140,14 +138,13 @@ describe("Pattern", () => {
|
|
|
140
138
|
).start(0);
|
|
141
139
|
pattern.interval = "16n";
|
|
142
140
|
transport.start(0);
|
|
143
|
-
}, 0.7)
|
|
144
|
-
|
|
145
|
-
});
|
|
141
|
+
}, 0.7);
|
|
142
|
+
expect(counter).to.equal(6);
|
|
146
143
|
});
|
|
147
144
|
|
|
148
|
-
it("can modify the pattern type and values", () => {
|
|
145
|
+
it("can modify the pattern type and values", async () => {
|
|
149
146
|
let counter = 0;
|
|
150
|
-
|
|
147
|
+
await Offline(({ transport }) => {
|
|
151
148
|
const values = ["a", "b", "c"];
|
|
152
149
|
const pattern = new Pattern(
|
|
153
150
|
(time, note) => {
|
|
@@ -163,9 +160,8 @@ describe("Pattern", () => {
|
|
|
163
160
|
pattern.pattern = "up";
|
|
164
161
|
pattern.values = values;
|
|
165
162
|
transport.start(0);
|
|
166
|
-
}, 0.7)
|
|
167
|
-
|
|
168
|
-
});
|
|
163
|
+
}, 0.7);
|
|
164
|
+
expect(counter).to.equal(6);
|
|
169
165
|
});
|
|
170
166
|
});
|
|
171
167
|
});
|
|
@@ -9,8 +9,8 @@ describe("Sequence", () => {
|
|
|
9
9
|
BasicTests(Sequence);
|
|
10
10
|
|
|
11
11
|
context("Constructor", () => {
|
|
12
|
-
it("takes a callback and a sequence of values", () => {
|
|
13
|
-
|
|
12
|
+
it("takes a callback and a sequence of values", async () => {
|
|
13
|
+
await Offline(() => {
|
|
14
14
|
const callback = noOp;
|
|
15
15
|
const seq = new Sequence(callback, [0, 1, 2]);
|
|
16
16
|
expect(seq.callback).to.equal(callback);
|
|
@@ -19,8 +19,8 @@ describe("Sequence", () => {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
it("takes a callback and a sequence of values and a subdivision", () => {
|
|
23
|
-
|
|
22
|
+
it("takes a callback and a sequence of values and a subdivision", async () => {
|
|
23
|
+
await Offline(() => {
|
|
24
24
|
const callback = noOp;
|
|
25
25
|
const seq = new Sequence(callback, [0, 1, 2], "2n");
|
|
26
26
|
expect(seq.callback).to.equal(callback);
|
|
@@ -30,16 +30,16 @@ describe("Sequence", () => {
|
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
it("can be constructed with no arguments", () => {
|
|
34
|
-
|
|
33
|
+
it("can be constructed with no arguments", async () => {
|
|
34
|
+
await Offline(() => {
|
|
35
35
|
const seq = new Sequence();
|
|
36
36
|
expect(seq.length).to.equal(0);
|
|
37
37
|
seq.dispose();
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
it("can pass in arguments in options object", () => {
|
|
42
|
-
|
|
41
|
+
it("can pass in arguments in options object", async () => {
|
|
42
|
+
await Offline(() => {
|
|
43
43
|
const callback = noOp;
|
|
44
44
|
const seq = new Sequence({
|
|
45
45
|
callback,
|
|
@@ -59,8 +59,8 @@ describe("Sequence", () => {
|
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
it("loops by default with the loopEnd as the duration of the loop", () => {
|
|
63
|
-
|
|
62
|
+
it("loops by default with the loopEnd as the duration of the loop", async () => {
|
|
63
|
+
await Offline(() => {
|
|
64
64
|
const seq = new Sequence(noOp, [0, 1, 2, 3], "8n");
|
|
65
65
|
expect(seq.loop).to.be.true;
|
|
66
66
|
expect(seq.length).to.equal(4);
|
|
@@ -71,8 +71,8 @@ describe("Sequence", () => {
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
context("Adding / Removing / Getting Events", () => {
|
|
74
|
-
it("can add an event using the index", () => {
|
|
75
|
-
|
|
74
|
+
it("can add an event using the index", async () => {
|
|
75
|
+
await Offline(() => {
|
|
76
76
|
const seq = new Sequence();
|
|
77
77
|
seq.events[0] = 0;
|
|
78
78
|
expect(seq.length).to.equal(1);
|
|
@@ -82,8 +82,8 @@ describe("Sequence", () => {
|
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
it("can add a subsequence", () => {
|
|
86
|
-
|
|
85
|
+
it("can add a subsequence", async () => {
|
|
86
|
+
await Offline(() => {
|
|
87
87
|
const seq = new Sequence();
|
|
88
88
|
seq.events = [[0, 1, 2]];
|
|
89
89
|
expect(seq.length).to.equal(3);
|
|
@@ -91,8 +91,8 @@ describe("Sequence", () => {
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
it("can retrieve an event using the index", () => {
|
|
95
|
-
|
|
94
|
+
it("can retrieve an event using the index", async () => {
|
|
95
|
+
await Offline(() => {
|
|
96
96
|
const seq = new Sequence(noOp, [0, 1, 2]);
|
|
97
97
|
expect(seq.length).to.equal(3);
|
|
98
98
|
expect(seq.events[0]).to.equal(0);
|
|
@@ -103,8 +103,8 @@ describe("Sequence", () => {
|
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
|
|
106
|
-
it("can set the value of an existing event with an index", () => {
|
|
107
|
-
|
|
106
|
+
it("can set the value of an existing event with an index", async () => {
|
|
107
|
+
await Offline(() => {
|
|
108
108
|
const seq = new Sequence(noOp, [0, 1, 2]);
|
|
109
109
|
expect(seq.length).to.equal(3);
|
|
110
110
|
expect(seq.events[0]).to.equal(0);
|
|
@@ -114,8 +114,8 @@ describe("Sequence", () => {
|
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
it("can remove an event by index", () => {
|
|
118
|
-
|
|
117
|
+
it("can remove an event by index", async () => {
|
|
118
|
+
await Offline(() => {
|
|
119
119
|
const seq = new Sequence(noOp, [0, 1, 2]);
|
|
120
120
|
expect(seq.length).to.equal(3);
|
|
121
121
|
seq.events.splice(0, 1);
|
|
@@ -124,8 +124,8 @@ describe("Sequence", () => {
|
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
it("can add a subsequence and remove the entire subsequence", () => {
|
|
128
|
-
|
|
127
|
+
it("can add a subsequence and remove the entire subsequence", async () => {
|
|
128
|
+
await Offline(() => {
|
|
129
129
|
const seq = new Sequence(noOp, [0, 1, 2]);
|
|
130
130
|
expect(seq.length).to.equal(3);
|
|
131
131
|
seq.events.shift();
|
|
@@ -142,8 +142,8 @@ describe("Sequence", () => {
|
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
it("can remove all of the events", () => {
|
|
146
|
-
|
|
145
|
+
it("can remove all of the events", async () => {
|
|
146
|
+
await Offline(() => {
|
|
147
147
|
const seq = new Sequence(noOp, [0, 1, 2, 3, 4, 5]);
|
|
148
148
|
expect(seq.length).to.equal(6);
|
|
149
149
|
seq.clear();
|
|
@@ -153,22 +153,21 @@ describe("Sequence", () => {
|
|
|
153
153
|
});
|
|
154
154
|
});
|
|
155
155
|
context("Sequence callback", () => {
|
|
156
|
-
it("invokes the callback after it's started", () => {
|
|
156
|
+
it("invokes the callback after it's started", async () => {
|
|
157
157
|
let invoked = false;
|
|
158
|
-
|
|
158
|
+
await Offline(({ transport }) => {
|
|
159
159
|
const seq = new Sequence(() => {
|
|
160
160
|
seq.dispose();
|
|
161
161
|
invoked = true;
|
|
162
162
|
}, [0, 1]).start(0);
|
|
163
163
|
transport.start();
|
|
164
|
-
}, 0.1)
|
|
165
|
-
|
|
166
|
-
});
|
|
164
|
+
}, 0.1);
|
|
165
|
+
expect(invoked).to.be.true;
|
|
167
166
|
});
|
|
168
167
|
|
|
169
|
-
it("can be scheduled to stop", () => {
|
|
168
|
+
it("can be scheduled to stop", async () => {
|
|
170
169
|
let invoked = 0;
|
|
171
|
-
|
|
170
|
+
await Offline(({ transport }) => {
|
|
172
171
|
const seq = new Sequence(
|
|
173
172
|
() => {
|
|
174
173
|
invoked++;
|
|
@@ -179,14 +178,13 @@ describe("Sequence", () => {
|
|
|
179
178
|
.start(0)
|
|
180
179
|
.stop(0.5);
|
|
181
180
|
transport.start();
|
|
182
|
-
}, 1)
|
|
183
|
-
|
|
184
|
-
});
|
|
181
|
+
}, 1);
|
|
182
|
+
expect(invoked).to.equal(6);
|
|
185
183
|
});
|
|
186
184
|
|
|
187
|
-
it("passes in the scheduled time to the callback", () => {
|
|
185
|
+
it("passes in the scheduled time to the callback", async () => {
|
|
188
186
|
let invoked = false;
|
|
189
|
-
|
|
187
|
+
await Offline(({ transport }) => {
|
|
190
188
|
const now = 0.1;
|
|
191
189
|
const seq = new Sequence(
|
|
192
190
|
(time) => {
|
|
@@ -199,14 +197,13 @@ describe("Sequence", () => {
|
|
|
199
197
|
);
|
|
200
198
|
seq.start(0.3);
|
|
201
199
|
transport.start(now);
|
|
202
|
-
}, 0.5)
|
|
203
|
-
|
|
204
|
-
});
|
|
200
|
+
}, 0.5);
|
|
201
|
+
expect(invoked).to.be.true;
|
|
205
202
|
});
|
|
206
203
|
|
|
207
|
-
it("passes in the value to the callback", () => {
|
|
204
|
+
it("passes in the value to the callback", async () => {
|
|
208
205
|
let invoked = false;
|
|
209
|
-
|
|
206
|
+
await Offline(({ transport }) => {
|
|
210
207
|
const seq = new Sequence(
|
|
211
208
|
(time, thing) => {
|
|
212
209
|
expect(time).to.be.a("number");
|
|
@@ -217,14 +214,13 @@ describe("Sequence", () => {
|
|
|
217
214
|
["thing"]
|
|
218
215
|
).start();
|
|
219
216
|
transport.start();
|
|
220
|
-
}, 0.1)
|
|
221
|
-
|
|
222
|
-
});
|
|
217
|
+
}, 0.1);
|
|
218
|
+
expect(invoked).to.be.true;
|
|
223
219
|
});
|
|
224
220
|
|
|
225
|
-
it("invokes the scheduled events in the right order", () => {
|
|
221
|
+
it("invokes the scheduled events in the right order", async () => {
|
|
226
222
|
let count = 0;
|
|
227
|
-
|
|
223
|
+
await Offline(({ transport }) => {
|
|
228
224
|
const seq = new Sequence(
|
|
229
225
|
(time, value) => {
|
|
230
226
|
expect(value).to.equal(count);
|
|
@@ -235,14 +231,13 @@ describe("Sequence", () => {
|
|
|
235
231
|
).start();
|
|
236
232
|
seq.loop = false;
|
|
237
233
|
transport.start(0);
|
|
238
|
-
}, 0.5)
|
|
239
|
-
|
|
240
|
-
});
|
|
234
|
+
}, 0.5);
|
|
235
|
+
expect(count).to.equal(5);
|
|
241
236
|
});
|
|
242
237
|
|
|
243
|
-
it("invokes the scheduled events at the correct times", () => {
|
|
238
|
+
it("invokes the scheduled events at the correct times", async () => {
|
|
244
239
|
let count = 0;
|
|
245
|
-
|
|
240
|
+
await Offline(({ transport }) => {
|
|
246
241
|
const eighth = transport.toSeconds("8n");
|
|
247
242
|
const times = [
|
|
248
243
|
0,
|
|
@@ -262,14 +257,13 @@ describe("Sequence", () => {
|
|
|
262
257
|
).start(0);
|
|
263
258
|
seq.loop = false;
|
|
264
259
|
transport.start(0);
|
|
265
|
-
}, 0.8)
|
|
266
|
-
|
|
267
|
-
});
|
|
260
|
+
}, 0.8);
|
|
261
|
+
expect(count).to.equal(6);
|
|
268
262
|
});
|
|
269
263
|
|
|
270
|
-
it("can schedule rests using 'null'", () => {
|
|
264
|
+
it("can schedule rests using 'null'", async () => {
|
|
271
265
|
let count = 0;
|
|
272
|
-
|
|
266
|
+
await Offline(({ transport }) => {
|
|
273
267
|
const eighth = transport.toSeconds("8n");
|
|
274
268
|
const times = [0, eighth * 2.5];
|
|
275
269
|
const seq = new Sequence(
|
|
@@ -282,14 +276,13 @@ describe("Sequence", () => {
|
|
|
282
276
|
).start(0);
|
|
283
277
|
seq.loop = false;
|
|
284
278
|
transport.start(0);
|
|
285
|
-
}, 0.8)
|
|
286
|
-
|
|
287
|
-
});
|
|
279
|
+
}, 0.8);
|
|
280
|
+
expect(count).to.equal(2);
|
|
288
281
|
});
|
|
289
282
|
|
|
290
|
-
it("can schedule triple nested arrays", () => {
|
|
283
|
+
it("can schedule triple nested arrays", async () => {
|
|
291
284
|
let count = 0;
|
|
292
|
-
|
|
285
|
+
await Offline(({ transport }) => {
|
|
293
286
|
const eighth = transport.toSeconds("8n");
|
|
294
287
|
const times = [0, eighth, eighth * 1.5, eighth * 1.75];
|
|
295
288
|
const seq = new Sequence(
|
|
@@ -302,14 +295,13 @@ describe("Sequence", () => {
|
|
|
302
295
|
).start(0);
|
|
303
296
|
seq.loop = false;
|
|
304
297
|
transport.start(0);
|
|
305
|
-
}, 0.7)
|
|
306
|
-
|
|
307
|
-
});
|
|
298
|
+
}, 0.7);
|
|
299
|
+
expect(count).to.equal(4);
|
|
308
300
|
});
|
|
309
301
|
|
|
310
|
-
it("starts an event added after the seq was started", () => {
|
|
302
|
+
it("starts an event added after the seq was started", async () => {
|
|
311
303
|
let invoked = false;
|
|
312
|
-
|
|
304
|
+
await Offline(({ transport }) => {
|
|
313
305
|
const seq = new Sequence({
|
|
314
306
|
callback(time, value): void {
|
|
315
307
|
if (value === 1) {
|
|
@@ -324,13 +316,12 @@ describe("Sequence", () => {
|
|
|
324
316
|
return atTime(0.1, () => {
|
|
325
317
|
seq.events[1] = 1;
|
|
326
318
|
});
|
|
327
|
-
}, 0.5)
|
|
328
|
-
|
|
329
|
-
});
|
|
319
|
+
}, 0.5);
|
|
320
|
+
expect(invoked).to.be.true;
|
|
330
321
|
});
|
|
331
322
|
|
|
332
|
-
it("can mute the callback", () => {
|
|
333
|
-
|
|
323
|
+
it("can mute the callback", async () => {
|
|
324
|
+
await Offline(({ transport }) => {
|
|
334
325
|
const seq = new Sequence(() => {
|
|
335
326
|
throw new Error("shouldn't call this callback");
|
|
336
327
|
}, [0, 0.1, 0.2, 0.3]).start();
|
|
@@ -342,9 +333,9 @@ describe("Sequence", () => {
|
|
|
342
333
|
});
|
|
343
334
|
|
|
344
335
|
context("Looping", () => {
|
|
345
|
-
it("can be set to loop", () => {
|
|
336
|
+
it("can be set to loop", async () => {
|
|
346
337
|
let callCount = 0;
|
|
347
|
-
|
|
338
|
+
await Offline(({ transport }) => {
|
|
348
339
|
const seq = new Sequence({
|
|
349
340
|
events: [0, 1],
|
|
350
341
|
loop: true,
|
|
@@ -357,14 +348,13 @@ describe("Sequence", () => {
|
|
|
357
348
|
},
|
|
358
349
|
}).start(0);
|
|
359
350
|
transport.start();
|
|
360
|
-
}, 0.5)
|
|
361
|
-
|
|
362
|
-
});
|
|
351
|
+
}, 0.5);
|
|
352
|
+
expect(callCount).to.equal(3);
|
|
363
353
|
});
|
|
364
354
|
|
|
365
|
-
it("can loop between loopStart and loopEnd", () => {
|
|
355
|
+
it("can loop between loopStart and loopEnd", async () => {
|
|
366
356
|
let invokations = 0;
|
|
367
|
-
|
|
357
|
+
await Offline(({ transport }) => {
|
|
368
358
|
const seq = new Sequence({
|
|
369
359
|
events: [0, [1, 2, 3], [4, 5]],
|
|
370
360
|
loopEnd: 2,
|
|
@@ -377,14 +367,13 @@ describe("Sequence", () => {
|
|
|
377
367
|
},
|
|
378
368
|
}).start(0);
|
|
379
369
|
transport.start();
|
|
380
|
-
}, 0.7)
|
|
381
|
-
|
|
382
|
-
});
|
|
370
|
+
}, 0.7);
|
|
371
|
+
expect(invokations).to.equal(9);
|
|
383
372
|
});
|
|
384
373
|
|
|
385
|
-
it("can set the loop points after starting", () => {
|
|
374
|
+
it("can set the loop points after starting", async () => {
|
|
386
375
|
let invoked = false;
|
|
387
|
-
|
|
376
|
+
await Offline(({ transport }) => {
|
|
388
377
|
let switched = false;
|
|
389
378
|
const seq = new Sequence({
|
|
390
379
|
callback(time, value): void {
|
|
@@ -402,16 +391,15 @@ describe("Sequence", () => {
|
|
|
402
391
|
subdivision: "16n",
|
|
403
392
|
}).start(0);
|
|
404
393
|
transport.start();
|
|
405
|
-
}, 0.7)
|
|
406
|
-
|
|
407
|
-
});
|
|
394
|
+
}, 0.7);
|
|
395
|
+
expect(invoked).to.be.true;
|
|
408
396
|
});
|
|
409
397
|
});
|
|
410
398
|
|
|
411
399
|
context("playbackRate", () => {
|
|
412
|
-
it("can adjust the playbackRate", () => {
|
|
400
|
+
it("can adjust the playbackRate", async () => {
|
|
413
401
|
let invoked = false;
|
|
414
|
-
|
|
402
|
+
await Offline(({ transport }) => {
|
|
415
403
|
let lastCall;
|
|
416
404
|
new Sequence({
|
|
417
405
|
events: [0, 1],
|
|
@@ -426,14 +414,13 @@ describe("Sequence", () => {
|
|
|
426
414
|
},
|
|
427
415
|
}).start(0);
|
|
428
416
|
transport.start();
|
|
429
|
-
}, 0.7)
|
|
430
|
-
|
|
431
|
-
});
|
|
417
|
+
}, 0.7);
|
|
418
|
+
expect(invoked).to.be.true;
|
|
432
419
|
});
|
|
433
420
|
|
|
434
|
-
it("adjusts speed of subsequences", () => {
|
|
421
|
+
it("adjusts speed of subsequences", async () => {
|
|
435
422
|
let invoked = false;
|
|
436
|
-
|
|
423
|
+
await Offline(({ transport }) => {
|
|
437
424
|
let lastCall;
|
|
438
425
|
new Sequence({
|
|
439
426
|
events: [
|
|
@@ -451,14 +438,13 @@ describe("Sequence", () => {
|
|
|
451
438
|
},
|
|
452
439
|
}).start(0);
|
|
453
440
|
transport.start();
|
|
454
|
-
}, 0.7)
|
|
455
|
-
|
|
456
|
-
});
|
|
441
|
+
}, 0.7);
|
|
442
|
+
expect(invoked).to.be.true;
|
|
457
443
|
});
|
|
458
444
|
|
|
459
|
-
it("can adjust the playbackRate after starting", () => {
|
|
445
|
+
it("can adjust the playbackRate after starting", async () => {
|
|
460
446
|
let invoked = false;
|
|
461
|
-
|
|
447
|
+
await Offline(({ transport }) => {
|
|
462
448
|
let lastCall;
|
|
463
449
|
const seq = new Sequence({
|
|
464
450
|
events: [0, 1],
|
|
@@ -475,9 +461,8 @@ describe("Sequence", () => {
|
|
|
475
461
|
},
|
|
476
462
|
}).start(0);
|
|
477
463
|
transport.start();
|
|
478
|
-
}, 2)
|
|
479
|
-
|
|
480
|
-
});
|
|
464
|
+
}, 2);
|
|
465
|
+
expect(invoked).to.be.true;
|
|
481
466
|
});
|
|
482
467
|
});
|
|
483
468
|
});
|