mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-09 02:18:57 +00:00
29 lines
740 B
JavaScript
29 lines
740 B
JavaScript
///////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// FEEDBACK EFFECTS
|
|
//
|
|
// an effect with feedback
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
define(["Tone/core/Tone", "Tone/effects/Effect"], function(Tone){
|
|
|
|
Tone.FeedbackEffect = function(){
|
|
//extends Unit
|
|
Tone.Effect.call(this);
|
|
|
|
this.feedback = this.context.createGain();
|
|
//feedback loop
|
|
this.chain(this.effectReturn, this.feedback, this.effectSend);
|
|
|
|
//some initial values
|
|
this.setFeedback(0);
|
|
}
|
|
|
|
Tone.extend(Tone.FeedbackEffect, Tone.Effect);
|
|
|
|
Tone.FeedbackEffect.prototype.setFeedback = function(fback){
|
|
this.rampToValueNow(this.feedback.gain, fback);
|
|
}
|
|
|
|
return Tone.FeedbackEffect;
|
|
});
|