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
|
@@ -59,13 +59,12 @@ describe("GrainPlayer", () => {
|
|
|
59
59
|
done();
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
it("makes a sound", () => {
|
|
63
|
-
|
|
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
|
-
|
|
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)
|
|
136
|
-
|
|
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
|
-
|
|
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)
|
|
154
|
-
|
|
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
|
-
|
|
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)
|
|
167
|
-
|
|
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
|
-
|
|
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)
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
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)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
|