mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
pass Frequency to AutoFilter's min/max
This commit is contained in:
parent
b061b81983
commit
a3a7175f41
2 changed files with 13 additions and 5 deletions
|
@ -31,8 +31,8 @@ define(["Tone/core/Tone", "Tone/effect/Effect", "Tone/component/LFO", "Tone/comp
|
|||
this._lfo = new Tone.LFO({
|
||||
"frequency" : options.frequency,
|
||||
"amplitude" : options.depth,
|
||||
"min" : options.min,
|
||||
"max" : options.max
|
||||
"min" : this.toFrequency(options.min),
|
||||
"max" : this.toFrequency(options.max)
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -151,7 +151,7 @@ define(["Tone/core/Tone", "Tone/effect/Effect", "Tone/component/LFO", "Tone/comp
|
|||
return this._lfo.min;
|
||||
},
|
||||
set : function(min){
|
||||
this._lfo.min = min;
|
||||
this._lfo.min = this.toFrequency(min);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -166,7 +166,7 @@ define(["Tone/core/Tone", "Tone/effect/Effect", "Tone/component/LFO", "Tone/comp
|
|||
return this._lfo.max;
|
||||
},
|
||||
set : function(max){
|
||||
this._lfo.max = max;
|
||||
this._lfo.max = this.toFrequency(max);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
define(["Tone/effect/AutoFilter", "helper/Basic", "helper/EffectTests"], function (AutoFilter, Basic, EffectTests) {
|
||||
define(["Tone/effect/AutoFilter", "helper/Basic", "helper/EffectTests", "deps/teoria"],
|
||||
function (AutoFilter, Basic, EffectTests, teoria) {
|
||||
describe("Effect", function(){
|
||||
Basic(AutoFilter);
|
||||
EffectTests(AutoFilter);
|
||||
|
@ -51,6 +52,13 @@ define(["Tone/effect/AutoFilter", "helper/Basic", "helper/EffectTests"], functio
|
|||
expect(autoFilter.filter.Q.value).to.be.closeTo(2, 0.01);
|
||||
autoFilter.dispose();
|
||||
});
|
||||
|
||||
it ("accepts min and max as frequency values", function(){
|
||||
var autoFilter = new AutoFilter("2n", "C2", "C4");
|
||||
expect(autoFilter.min).to.be.closeTo(teoria.note("C2").fq(), 0.01);
|
||||
expect(autoFilter.max).to.be.closeTo(teoria.note("C4").fq(), 0.01);
|
||||
autoFilter.dispose();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue