tone 15.2.1 → 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/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/worklet/ToneAudioWorklet.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -60,29 +60,27 @@ describe("Tremolo", () => {
|
|
|
60
60
|
tremolo.dispose();
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
it("can sync the frequency to the transport", () => {
|
|
64
|
-
|
|
63
|
+
it("can sync the frequency to the transport", async () => {
|
|
64
|
+
const buffer = await Offline(({ transport }) => {
|
|
65
65
|
const tremolo = new Tremolo(2);
|
|
66
66
|
tremolo.sync();
|
|
67
67
|
tremolo.frequency.toDestination();
|
|
68
68
|
transport.bpm.setValueAtTime(transport.bpm.value * 2, 0.05);
|
|
69
|
-
}, 0.1)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
69
|
+
}, 0.1);
|
|
70
|
+
expect(buffer.getValueAtTime(0)).to.be.closeTo(2, 0.1);
|
|
71
|
+
expect(buffer.getValueAtTime(0.05)).to.be.closeTo(4, 0.1);
|
|
73
72
|
});
|
|
74
73
|
|
|
75
|
-
it("can unsync the frequency to the transport", () => {
|
|
76
|
-
|
|
74
|
+
it("can unsync the frequency to the transport", async () => {
|
|
75
|
+
const buffer = await Offline(({ transport }) => {
|
|
77
76
|
const tremolo = new Tremolo(2);
|
|
78
77
|
tremolo.sync();
|
|
79
78
|
tremolo.frequency.toDestination();
|
|
80
79
|
transport.bpm.setValueAtTime(transport.bpm.value * 2, 0.05);
|
|
81
80
|
tremolo.unsync();
|
|
82
|
-
}, 0.1)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
81
|
+
}, 0.1);
|
|
82
|
+
expect(buffer.getValueAtTime(0)).to.be.closeTo(2, 0.1);
|
|
83
|
+
expect(buffer.getValueAtTime(0.05)).to.be.closeTo(2, 0.1);
|
|
86
84
|
});
|
|
87
85
|
});
|
|
88
86
|
});
|
package/Tone/event/Loop.test.ts
CHANGED
|
@@ -97,22 +97,21 @@ describe("Loop", () => {
|
|
|
97
97
|
}, 0.3);
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
it("is invoked after it's started", () => {
|
|
100
|
+
it("is invoked after it's started", async () => {
|
|
101
101
|
let invoked = false;
|
|
102
|
-
|
|
102
|
+
await Offline(({ transport }) => {
|
|
103
103
|
const loop = new Loop(() => {
|
|
104
104
|
invoked = true;
|
|
105
105
|
loop.dispose();
|
|
106
106
|
}, 0.05).start(0);
|
|
107
107
|
transport.start();
|
|
108
|
-
}).then(() => {
|
|
109
|
-
expect(invoked).to.be.true;
|
|
110
108
|
});
|
|
109
|
+
expect(invoked).to.be.true;
|
|
111
110
|
});
|
|
112
111
|
|
|
113
|
-
it("passes in the scheduled time to the callback", () => {
|
|
112
|
+
it("passes in the scheduled time to the callback", async () => {
|
|
114
113
|
let invoked = false;
|
|
115
|
-
|
|
114
|
+
await Offline(({ transport }) => {
|
|
116
115
|
const now = transport.now() + 0.1;
|
|
117
116
|
const loop = new Loop((time) => {
|
|
118
117
|
expect(time).to.be.a("number");
|
|
@@ -122,9 +121,8 @@ describe("Loop", () => {
|
|
|
122
121
|
});
|
|
123
122
|
transport.start(now);
|
|
124
123
|
loop.start(0.3);
|
|
125
|
-
}, 0.5)
|
|
126
|
-
|
|
127
|
-
});
|
|
124
|
+
}, 0.5);
|
|
125
|
+
expect(invoked).to.be.true;
|
|
128
126
|
});
|
|
129
127
|
|
|
130
128
|
it("can mute the callback", () => {
|
|
@@ -218,9 +216,9 @@ describe("Loop", () => {
|
|
|
218
216
|
});
|
|
219
217
|
|
|
220
218
|
context("Looping", () => {
|
|
221
|
-
it("loops", () => {
|
|
219
|
+
it("loops", async () => {
|
|
222
220
|
let callCount = 0;
|
|
223
|
-
|
|
221
|
+
await Offline(({ transport }) => {
|
|
224
222
|
new Loop({
|
|
225
223
|
interval: 0.1,
|
|
226
224
|
callback: () => {
|
|
@@ -228,14 +226,13 @@ describe("Loop", () => {
|
|
|
228
226
|
},
|
|
229
227
|
}).start(0);
|
|
230
228
|
transport.start();
|
|
231
|
-
}, 0.81)
|
|
232
|
-
|
|
233
|
-
});
|
|
229
|
+
}, 0.81);
|
|
230
|
+
expect(callCount).to.equal(9);
|
|
234
231
|
});
|
|
235
232
|
|
|
236
|
-
it("loops for the specified interval", () => {
|
|
233
|
+
it("loops for the specified interval", async () => {
|
|
237
234
|
let invoked = false;
|
|
238
|
-
|
|
235
|
+
await Offline(({ transport }) => {
|
|
239
236
|
let lastCall;
|
|
240
237
|
new Loop({
|
|
241
238
|
interval: "8n",
|
|
@@ -248,14 +245,13 @@ describe("Loop", () => {
|
|
|
248
245
|
},
|
|
249
246
|
}).start(0);
|
|
250
247
|
transport.start();
|
|
251
|
-
}, 1)
|
|
252
|
-
|
|
253
|
-
});
|
|
248
|
+
}, 1);
|
|
249
|
+
expect(invoked).to.be.true;
|
|
254
250
|
});
|
|
255
251
|
|
|
256
|
-
it("can loop a specific number of iterations", () => {
|
|
252
|
+
it("can loop a specific number of iterations", async () => {
|
|
257
253
|
let callCount = 0;
|
|
258
|
-
|
|
254
|
+
await Offline(({ transport }) => {
|
|
259
255
|
new Loop({
|
|
260
256
|
interval: 0.1,
|
|
261
257
|
iterations: 2,
|
|
@@ -264,13 +260,12 @@ describe("Loop", () => {
|
|
|
264
260
|
},
|
|
265
261
|
}).start(0);
|
|
266
262
|
transport.start();
|
|
267
|
-
}, 0.4)
|
|
268
|
-
|
|
269
|
-
});
|
|
263
|
+
}, 0.4);
|
|
264
|
+
expect(callCount).to.equal(2);
|
|
270
265
|
});
|
|
271
266
|
|
|
272
|
-
it("reports the progress of the loop", () => {
|
|
273
|
-
|
|
267
|
+
it("reports the progress of the loop", async () => {
|
|
268
|
+
await Offline(({ transport }) => {
|
|
274
269
|
const loop = new Loop({
|
|
275
270
|
interval: 1,
|
|
276
271
|
}).start(0);
|
|
@@ -283,9 +278,9 @@ describe("Loop", () => {
|
|
|
283
278
|
});
|
|
284
279
|
|
|
285
280
|
context("playbackRate", () => {
|
|
286
|
-
it("can adjust the playbackRate", () => {
|
|
281
|
+
it("can adjust the playbackRate", async () => {
|
|
287
282
|
let invoked = false;
|
|
288
|
-
|
|
283
|
+
await Offline(({ transport }) => {
|
|
289
284
|
let lastCall;
|
|
290
285
|
const loop = new Loop({
|
|
291
286
|
playbackRate: 2,
|
|
@@ -300,14 +295,13 @@ describe("Loop", () => {
|
|
|
300
295
|
}).start(0);
|
|
301
296
|
expect(loop.playbackRate).to.equal(2);
|
|
302
297
|
transport.start();
|
|
303
|
-
}, 0.7)
|
|
304
|
-
|
|
305
|
-
});
|
|
298
|
+
}, 0.7);
|
|
299
|
+
expect(invoked).to.be.true;
|
|
306
300
|
});
|
|
307
301
|
|
|
308
|
-
it("can playback at a faster rate", () => {
|
|
302
|
+
it("can playback at a faster rate", async () => {
|
|
309
303
|
let callCount = 0;
|
|
310
|
-
|
|
304
|
+
await Offline(({ transport }) => {
|
|
311
305
|
const loop = new Loop({
|
|
312
306
|
interval: 0.1,
|
|
313
307
|
callback: () => {
|
|
@@ -317,9 +311,8 @@ describe("Loop", () => {
|
|
|
317
311
|
loop.playbackRate = 1.5;
|
|
318
312
|
expect(loop.playbackRate).to.equal(1.5);
|
|
319
313
|
transport.start();
|
|
320
|
-
}, 0.81)
|
|
321
|
-
|
|
322
|
-
});
|
|
314
|
+
}, 0.81);
|
|
315
|
+
expect(callCount).to.equal(13);
|
|
323
316
|
});
|
|
324
317
|
});
|
|
325
318
|
});
|