Tone.js/Tone/effects/FeedbackDelay.js

27 lines
777 B
JavaScript
Raw Normal View History

2014-03-11 23:27:46 +00:00
///////////////////////////////////////////////////////////////////////////////
//
// FEEDBACK DELAY
//
///////////////////////////////////////////////////////////////////////////////
2014-04-06 20:51:30 +00:00
define(["Tone/core/Tone", "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.toSeconds(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.rampToValueNow(this.delay.delayTime, this.toSeconds(delayTime));
}
return Tone.FeedbackDelay;
});