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
|
@@ -150,8 +150,8 @@ describe("Players", () => {
|
|
|
150
150
|
|
|
151
151
|
it("can add a player with an unloaded ToneAudioBuffer", (done) => {
|
|
152
152
|
const players = new Players();
|
|
153
|
-
const
|
|
154
|
-
players.add("test",
|
|
153
|
+
const output = new ToneAudioBuffer("./test/audio/sine.wav");
|
|
154
|
+
players.add("test", output, () => {
|
|
155
155
|
expect(players.has("test")).to.be.true;
|
|
156
156
|
expect(players.player("test").loaded).to.be.true;
|
|
157
157
|
players.dispose();
|
|
@@ -169,52 +169,48 @@ describe("Players", () => {
|
|
|
169
169
|
players.player("test").start(0);
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
return Offline(() => {
|
|
172
|
+
it("can be muted", async () => {
|
|
173
|
+
const output = await Offline(() => {
|
|
175
174
|
const players = new Players({
|
|
176
175
|
test: buffer,
|
|
177
176
|
}).toDestination();
|
|
178
177
|
players.player("test").start(0);
|
|
179
178
|
players.mute = true;
|
|
180
179
|
expect(players.mute).to.be.true;
|
|
181
|
-
}, 0.3)
|
|
182
|
-
|
|
183
|
-
});
|
|
180
|
+
}, 0.3);
|
|
181
|
+
expect(output.isSilent()).to.be.true;
|
|
184
182
|
});
|
|
185
183
|
|
|
186
|
-
it("be scheduled to start in the future", () => {
|
|
187
|
-
|
|
184
|
+
it("be scheduled to start in the future", async () => {
|
|
185
|
+
const output = await Offline(() => {
|
|
188
186
|
const players = new Players({
|
|
189
187
|
test: buffer,
|
|
190
188
|
}).toDestination();
|
|
191
189
|
players.player("test").start(0.1);
|
|
192
|
-
}, 0.3)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
});
|
|
190
|
+
}, 0.3);
|
|
191
|
+
output.forEach((sample, time) => {
|
|
192
|
+
if (sample > 0) {
|
|
193
|
+
expect(time).to.be.at.least(0.099);
|
|
194
|
+
}
|
|
198
195
|
});
|
|
199
196
|
});
|
|
200
197
|
|
|
201
|
-
it("be scheduled to stop in the future", () => {
|
|
202
|
-
|
|
198
|
+
it("be scheduled to stop in the future", async () => {
|
|
199
|
+
const output = await Offline(() => {
|
|
203
200
|
const players = new Players({
|
|
204
201
|
test: buffer,
|
|
205
202
|
}).toDestination();
|
|
206
203
|
players.player("test").start(0).stop(0.2);
|
|
207
|
-
}, 0.3)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
});
|
|
204
|
+
}, 0.3);
|
|
205
|
+
output.forEach((sample, time) => {
|
|
206
|
+
if (time > 0.2) {
|
|
207
|
+
expect(sample).to.equal(0);
|
|
208
|
+
}
|
|
213
209
|
});
|
|
214
210
|
});
|
|
215
211
|
|
|
216
|
-
it("if any of the players are playing, reports state as 'started'", () => {
|
|
217
|
-
|
|
212
|
+
it("if any of the players are playing, reports state as 'started'", async () => {
|
|
213
|
+
await Offline(() => {
|
|
218
214
|
const players = new Players({
|
|
219
215
|
test0: buffer,
|
|
220
216
|
test1: buffer,
|
|
@@ -231,8 +227,8 @@ describe("Players", () => {
|
|
|
231
227
|
}, 0.2);
|
|
232
228
|
});
|
|
233
229
|
|
|
234
|
-
it("can start multiple samples", () => {
|
|
235
|
-
|
|
230
|
+
it("can start multiple samples", async () => {
|
|
231
|
+
await OutputAudio(() => {
|
|
236
232
|
const players = new Players({
|
|
237
233
|
test0: buffer,
|
|
238
234
|
test1: buffer,
|
|
@@ -242,8 +238,8 @@ describe("Players", () => {
|
|
|
242
238
|
});
|
|
243
239
|
});
|
|
244
240
|
|
|
245
|
-
it("can stop all of the samples in the future", () => {
|
|
246
|
-
|
|
241
|
+
it("can stop all of the samples in the future", async () => {
|
|
242
|
+
const output = await Offline(() => {
|
|
247
243
|
const players = new Players({
|
|
248
244
|
test0: buffer,
|
|
249
245
|
test1: buffer,
|
|
@@ -251,17 +247,16 @@ describe("Players", () => {
|
|
|
251
247
|
players.player("test0").start(0);
|
|
252
248
|
players.player("test1").start(0);
|
|
253
249
|
players.stopAll(0.2);
|
|
254
|
-
}, 0.3)
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
});
|
|
250
|
+
}, 0.3);
|
|
251
|
+
output.forEach((sample, time) => {
|
|
252
|
+
if (time > 0.2) {
|
|
253
|
+
expect(sample).to.equal(0);
|
|
254
|
+
}
|
|
260
255
|
});
|
|
261
256
|
});
|
|
262
257
|
|
|
263
|
-
it("fades in and out correctly", () => {
|
|
264
|
-
|
|
258
|
+
it("fades in and out correctly", async () => {
|
|
259
|
+
const output = await Offline(() => {
|
|
265
260
|
const onesArray = new Float32Array(
|
|
266
261
|
getContext().sampleRate * 0.5
|
|
267
262
|
);
|
|
@@ -279,18 +274,17 @@ describe("Players", () => {
|
|
|
279
274
|
}
|
|
280
275
|
).toDestination();
|
|
281
276
|
players.player("test").start(0);
|
|
282
|
-
}, 0.6)
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
});
|
|
277
|
+
}, 0.6);
|
|
278
|
+
output.forEach((sample, time) => {
|
|
279
|
+
if (time < 0.1) {
|
|
280
|
+
expect(sample).to.be.within(0, 1);
|
|
281
|
+
} else if (time < 0.4) {
|
|
282
|
+
expect(sample).to.equal(1);
|
|
283
|
+
} else if (time < 0.5) {
|
|
284
|
+
expect(sample).to.be.within(0, 1);
|
|
285
|
+
} else {
|
|
286
|
+
expect(sample).to.equal(0);
|
|
287
|
+
}
|
|
294
288
|
});
|
|
295
289
|
});
|
|
296
290
|
});
|