We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c17425a commit 344968eCopy full SHA for 344968e
test/tests/p5.Gain.js
@@ -36,6 +36,23 @@ describe('p5.Gain', function () {
36
gain.connect(filter);
37
gain.connect(filter.input);
38
});
39
+ it('can set the output level of gain Node', () => {
40
+ let osc = new p5.Oscillator('sine');
41
+ let mainGainNode = new p5.Gain();
42
+ let amplitude = new p5.Amplitude();
43
+
44
+ osc.amp(1);
45
+ osc.start();
46
+ osc.disconnect();
47
48
+ mainGainNode.setInput(osc);
49
+ amplitude.setInput(mainGainNode);
50
51
+ mainGainNode.amp(0.5);
52
+ setTimeout(function () {
53
+ expect(amplitude.getLevel()).to.be.closeTo(0.25, 0.125);
54
+ }, 100);
55
+ });
56
it('can disconnect', function () {
57
let filter = new p5.Filter();
58
0 commit comments