Tone.js/src/effects/FeedbackEffect.js

27 lines
613 B
JavaScript
Raw Normal View History

2014-03-15 05:02:33 +00:00
///////////////////////////////////////////////////////////////////////////////
//
// FEEDBACK EFFECTS
//
// an effect with feedback
///////////////////////////////////////////////////////////////////////////////
2014-03-16 17:33:56 +00:00
Tone.FeedbackEffect = function(){
2014-03-15 05:02:33 +00:00
//extends Unit
2014-03-16 17:33:56 +00:00
Tone.Effect.call(this);
2014-03-15 05:02:33 +00:00
this.feedback = this.context.createGain();
//feedback loop
this.chain(this.effectReturn, this.feedback, this.effectSend);
//some initial values
this.setDry(.5);
}
2014-03-16 17:33:56 +00:00
Tone.extend(Tone.FeedbackEffect, Tone.Effect);
2014-03-15 05:02:33 +00:00
2014-03-16 17:33:56 +00:00
Tone.Effect.prototype.setFeedback = function(fback){
2014-03-15 05:02:33 +00:00
this.rampToValue(this.feedback.gain, fback);
}