Tone.js/src/effects/FeedbackDelay.js

27 lines
732 B
JavaScript
Raw Normal View History

2014-03-11 23:27:46 +00:00
///////////////////////////////////////////////////////////////////////////////
//
// FEEDBACK DELAY
//
///////////////////////////////////////////////////////////////////////////////
define(["core/Tone", "effects/FeedbackEffect"], function(Tone){
2014-03-11 23:27:46 +00:00
//@param {number} delayTime
Tone.FeedbackDelay = function(delayTime){
Tone.FeedbackEffect.call(this);
2014-03-11 23:27:46 +00:00
this.delay = this.context.createDelay(4);
this.delay.delayTime.value = this.defaultArg(delayTime, .25);
2014-03-11 23:27:46 +00:00
//connect it up
this.connectEffect(this.delay);
}
2014-03-11 23:27:46 +00:00
Tone.extend(Tone.FeedbackDelay, Tone.FeedbackEffect);
Tone.FeedbackDelay.prototype.setDelayTime = function(delayTime){
this.rampToValue(this.delay.delayTime, delayTime);
}
return Tone.FeedbackDelay;
});