2014-03-15 05:02:33 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// FEEDBACK EFFECTS
|
|
|
|
//
|
|
|
|
// an effect with feedback
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-04-06 04:12:18 +00:00
|
|
|
define(["core/Tone", "effects/Effect"], function(Tone){
|
2014-03-15 05:02:33 +00:00
|
|
|
|
2014-04-06 04:12:18 +00:00
|
|
|
Tone.FeedbackEffect = function(){
|
|
|
|
//extends Unit
|
|
|
|
Tone.Effect.call(this);
|
2014-03-15 05:02:33 +00:00
|
|
|
|
2014-04-06 04:12:18 +00:00
|
|
|
this.feedback = this.context.createGain();
|
|
|
|
//feedback loop
|
|
|
|
this.chain(this.effectReturn, this.feedback, this.effectSend);
|
2014-03-15 05:02:33 +00:00
|
|
|
|
2014-04-06 04:12:18 +00:00
|
|
|
//some initial values
|
|
|
|
this.setDry(.5);
|
|
|
|
}
|
2014-03-15 05:02:33 +00:00
|
|
|
|
2014-04-06 04:12:18 +00:00
|
|
|
Tone.extend(Tone.FeedbackEffect, Tone.Effect);
|
2014-03-15 05:02:33 +00:00
|
|
|
|
2014-04-06 04:12:18 +00:00
|
|
|
Tone.FeedbackEffect.prototype.setFeedback = function(fback){
|
|
|
|
this.rampToValue(this.feedback.gain, fback);
|
|
|
|
}
|
2014-03-15 05:02:33 +00:00
|
|
|
|
2014-04-06 04:12:18 +00:00
|
|
|
return Tone.FeedbackEffect;
|
|
|
|
});
|