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.
Files changed (69) hide show
  1. package/Tone/component/analysis/Follower.test.ts +38 -42
  2. package/Tone/component/channel/Channel.test.ts +3 -4
  3. package/Tone/component/channel/Merge.test.ts +5 -6
  4. package/Tone/component/channel/MidSideSplit.test.ts +21 -25
  5. package/Tone/component/channel/Mono.test.ts +18 -20
  6. package/Tone/component/channel/PanVol.test.ts +3 -4
  7. package/Tone/component/channel/Panner.test.ts +28 -32
  8. package/Tone/component/channel/Recorder.ts +1 -1
  9. package/Tone/component/channel/Volume.test.ts +9 -12
  10. package/Tone/component/dynamics/Gate.test.ts +10 -14
  11. package/Tone/component/envelope/AmplitudeEnvelope.test.ts +7 -9
  12. package/Tone/component/envelope/Envelope.test.ts +347 -384
  13. package/Tone/component/filter/BiquadFilter.test.ts +5 -6
  14. package/Tone/component/filter/Convolver.test.ts +6 -9
  15. package/Tone/component/filter/FeedbackCombFilter.test.ts +14 -16
  16. package/Tone/component/filter/Filter.test.ts +5 -6
  17. package/Tone/component/filter/LowpassCombFilter.test.ts +15 -17
  18. package/Tone/core/clock/Clock.test.ts +12 -15
  19. package/Tone/core/clock/TickSignal.test.ts +18 -21
  20. package/Tone/core/clock/Transport.test.ts +133 -162
  21. package/Tone/core/clock/TransportEvent.test.ts +3 -4
  22. package/Tone/core/clock/TransportRepeatEvent.test.ts +6 -6
  23. package/Tone/core/context/Context.test.ts +8 -10
  24. package/Tone/core/context/Context.ts +8 -4
  25. package/Tone/core/context/Destination.test.ts +3 -4
  26. package/Tone/core/context/Offline.test.ts +23 -41
  27. package/Tone/core/context/OfflineContext.test.ts +20 -22
  28. package/Tone/core/context/Param.test.ts +33 -40
  29. package/Tone/core/context/ToneAudioBuffer.test.ts +3 -10
  30. package/Tone/core/context/ToneAudioBuffers.test.ts +9 -13
  31. package/Tone/core/worklet/ToneAudioWorklet.ts +3 -1
  32. package/Tone/effect/AutoFilter.test.ts +10 -12
  33. package/Tone/effect/AutoPanner.test.ts +10 -12
  34. package/Tone/effect/Chorus.test.ts +10 -14
  35. package/Tone/effect/FrequencyShifter.test.ts +6 -7
  36. package/Tone/effect/Reverb.test.ts +12 -15
  37. package/Tone/effect/Tremolo.test.ts +10 -12
  38. package/Tone/event/Loop.test.ts +29 -36
  39. package/Tone/event/Part.test.ts +152 -180
  40. package/Tone/event/Pattern.test.ts +16 -20
  41. package/Tone/event/Sequence.test.ts +86 -101
  42. package/Tone/event/ToneEvent.test.ts +60 -70
  43. package/Tone/instrument/MonoSynth.test.ts +3 -4
  44. package/Tone/instrument/PolySynth.test.ts +62 -74
  45. package/Tone/instrument/Sampler.test.ts +39 -48
  46. package/Tone/instrument/Synth.test.ts +40 -47
  47. package/Tone/signal/AudioToGain.test.ts +4 -5
  48. package/Tone/signal/Signal.test.ts +120 -143
  49. package/Tone/signal/SyncedSignal.test.ts +108 -122
  50. package/Tone/signal/ToneConstantSource.test.ts +21 -25
  51. package/Tone/signal/WaveShaper.test.ts +5 -6
  52. package/Tone/source/Source.test.ts +42 -48
  53. package/Tone/source/buffer/GrainPlayer.test.ts +29 -35
  54. package/Tone/source/buffer/Player.test.ts +162 -191
  55. package/Tone/source/buffer/Players.test.ts +44 -50
  56. package/Tone/source/buffer/ToneBufferSource.test.ts +176 -211
  57. package/Tone/source/oscillator/LFO.test.ts +49 -61
  58. package/Tone/source/oscillator/Oscillator.test.ts +24 -28
  59. package/Tone/source/oscillator/PulseOscillator.test.ts +36 -40
  60. package/Tone/source/oscillator/ToneOscillatorNode.test.ts +25 -29
  61. package/Tone/version.ts +1 -1
  62. package/build/Tone.js +1 -1
  63. package/build/Tone.js.map +1 -1
  64. package/build/esm/component/channel/Recorder.js.map +1 -1
  65. package/build/esm/core/context/Context.js +6 -3
  66. package/build/esm/core/context/Context.js.map +1 -1
  67. package/build/esm/core/worklet/ToneAudioWorklet.js.map +1 -1
  68. package/build/esm/version.js +1 -1
  69. package/package.json +1 -1
@@ -59,13 +59,12 @@ describe("GrainPlayer", () => {
59
59
  done();
60
60
  });
61
61
 
62
- it("makes a sound", () => {
63
- return Offline(() => {
62
+ it("makes a sound", async () => {
63
+ const output = await Offline(() => {
64
64
  const player = new GrainPlayer(buffer).toDestination();
65
65
  player.start();
66
- }).then((output) => {
67
- expect(output.isSilent()).to.be.false;
68
66
  });
67
+ expect(output.isSilent()).to.be.false;
69
68
  });
70
69
  });
71
70
 
@@ -119,8 +118,8 @@ describe("GrainPlayer", () => {
119
118
  buffer.load("./test/audio/short_sine.wav");
120
119
  });
121
120
 
122
- it("can be play for a specific duration", () => {
123
- return Offline(() => {
121
+ it("can be play for a specific duration", async () => {
122
+ const output = await Offline(() => {
124
123
  const player = new GrainPlayer(buffer);
125
124
  player.toDestination();
126
125
  player.start(0).stop(0.1);
@@ -132,13 +131,12 @@ describe("GrainPlayer", () => {
132
131
  expect(player.state).to.equal("started");
133
132
  });
134
133
  };
135
- }, 0.3).then((output) => {
136
- expect(output.getTimeOfLastSound()).to.be.closeTo(0.1, 0.02);
137
- });
134
+ }, 0.3);
135
+ expect(output.getTimeOfLastSound()).to.be.closeTo(0.1, 0.02);
138
136
  });
139
137
 
140
- it("can be play for a specific duration passed in the 'start' method", () => {
141
- return Offline(() => {
138
+ it("can be play for a specific duration passed in the 'start' method", async () => {
139
+ const output = await Offline(() => {
142
140
  const player = new GrainPlayer(buffer);
143
141
  player.toDestination();
144
142
  player.start(0, 0, 0.1);
@@ -150,50 +148,46 @@ describe("GrainPlayer", () => {
150
148
  expect(player.state).to.equal("started");
151
149
  });
152
150
  };
153
- }, 0.3).then((output) => {
154
- expect(output.getTimeOfLastSound()).to.be.closeTo(0.1, 0.02);
155
- });
151
+ }, 0.3);
152
+ expect(output.getTimeOfLastSound()).to.be.closeTo(0.1, 0.02);
156
153
  });
157
154
 
158
- it("invokes the onstop method on restart", () => {
155
+ it("invokes the onstop method on restart", async () => {
159
156
  let wasInvoked = 0;
160
- return Offline(() => {
157
+ await Offline(() => {
161
158
  const player = new GrainPlayer(buffer);
162
159
  player.start(0).restart(0.1).stop(0.2);
163
160
  player.onstop = () => {
164
161
  wasInvoked++;
165
162
  };
166
- }, 0.3).then(() => {
167
- expect(wasInvoked).to.equal(2);
168
- });
163
+ }, 0.3);
164
+ expect(wasInvoked).to.equal(2);
169
165
  });
170
166
 
171
- it("can play to the end of the file", () => {
167
+ it("can play to the end of the file", async () => {
172
168
  const bufferDuration = buffer.duration;
173
- return Offline(() => {
169
+ const output = await Offline(() => {
174
170
  const player = new GrainPlayer(buffer).toDestination();
175
171
  player.grainSize = 0.1;
176
172
  player.start(0);
177
- }, bufferDuration * 1.2).then((output) => {
178
- expect(output.getTimeOfLastSound()).to.be.closeTo(
179
- bufferDuration,
180
- 0.1
181
- );
182
- });
173
+ }, bufferDuration * 1.2);
174
+ expect(output.getTimeOfLastSound()).to.be.closeTo(
175
+ bufferDuration,
176
+ 0.1
177
+ );
183
178
  });
184
179
 
185
- it("plays for the right time when playbackRate = 2", () => {
180
+ it("plays for the right time when playbackRate = 2", async () => {
186
181
  const bufferDuration = buffer.duration;
187
- return Offline(() => {
182
+ const output = await Offline(() => {
188
183
  const player = new GrainPlayer(buffer).toDestination();
189
184
  player.playbackRate = 2;
190
185
  player.start(0);
191
- }, bufferDuration).then((output) => {
192
- expect(output.getTimeOfLastSound()).to.be.closeTo(
193
- bufferDuration * 0.5,
194
- 0.1
195
- );
196
- });
186
+ }, bufferDuration);
187
+ expect(output.getTimeOfLastSound()).to.be.closeTo(
188
+ bufferDuration * 0.5,
189
+ 0.1
190
+ );
197
191
  });
198
192
  });
199
193