2018-01-03 20:22:52 +00:00
|
|
|
define(["Tone/effect/AutoWah", "helper/Basic", "helper/EffectTests"], function(AutoWah, Basic, EffectTests) {
|
|
|
|
|
2015-08-26 14:29:35 +00:00
|
|
|
describe("AutoWah", function(){
|
|
|
|
|
|
|
|
Basic(AutoWah);
|
|
|
|
EffectTests(AutoWah);
|
|
|
|
|
|
|
|
context("API", function(){
|
|
|
|
|
2017-12-30 16:26:29 +00:00
|
|
|
it("can pass in options in the constructor", function(){
|
2015-08-26 14:29:35 +00:00
|
|
|
var autoWah = new AutoWah({
|
|
|
|
"baseFrequency" : 150,
|
|
|
|
"octaves" : 3,
|
|
|
|
"sensitivity" : -10
|
|
|
|
});
|
|
|
|
expect(autoWah.baseFrequency).to.be.closeTo(150, 0.01);
|
2018-01-03 20:22:52 +00:00
|
|
|
autoWah.baseFrequency = 250;
|
|
|
|
expect(autoWah.baseFrequency).to.be.closeTo(250, 0.01);
|
2015-08-26 14:29:35 +00:00
|
|
|
expect(autoWah.octaves).to.be.closeTo(3, 0.01);
|
2018-01-03 20:22:52 +00:00
|
|
|
autoWah.octaves = 2;
|
|
|
|
expect(autoWah.octaves).to.be.closeTo(2, 0.01);
|
2015-08-26 14:29:35 +00:00
|
|
|
expect(autoWah.sensitivity).to.be.closeTo(-10, 0.1);
|
2018-01-03 20:22:52 +00:00
|
|
|
autoWah.sensitivity = -20;
|
|
|
|
expect(autoWah.sensitivity).to.be.closeTo(-20, 0.1);
|
2015-08-26 14:29:35 +00:00
|
|
|
autoWah.dispose();
|
|
|
|
});
|
|
|
|
|
2017-12-30 16:26:29 +00:00
|
|
|
it("can get/set the options", function(){
|
2015-08-26 14:29:35 +00:00
|
|
|
var autoWah = new AutoWah();
|
|
|
|
autoWah.set({
|
|
|
|
"Q" : 2.4,
|
|
|
|
});
|
|
|
|
expect(autoWah.get().Q).to.be.closeTo(2.4, 0.01);
|
|
|
|
autoWah.dispose();
|
|
|
|
});
|
|
|
|
|
2017-12-30 16:26:29 +00:00
|
|
|
it("can set the gain and follower values", function(){
|
2015-08-26 14:29:35 +00:00
|
|
|
var autoWah = new AutoWah();
|
|
|
|
autoWah.gain.value = 1.2;
|
|
|
|
autoWah.follower.attack = 0.4;
|
|
|
|
autoWah.follower.release = 1;
|
|
|
|
expect(autoWah.gain.value).to.be.closeTo(1.2, 0.01);
|
|
|
|
expect(autoWah.follower.attack).to.be.closeTo(0.4, 0.01);
|
|
|
|
expect(autoWah.follower.release).to.be.closeTo(1, 0.01);
|
|
|
|
autoWah.dispose();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|