1 | import { Gain } from "../core/context/Gain.js";
|
2 | import { readOnly } from "../core/util/Interface.js";
|
3 | import { Effect } from "./Effect.js";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export class FeedbackEffect extends Effect {
|
9 | constructor(options) {
|
10 | super(options);
|
11 | this.name = "FeedbackEffect";
|
12 | this._feedbackGain = new Gain({
|
13 | context: this.context,
|
14 | gain: options.feedback,
|
15 | units: "normalRange",
|
16 | });
|
17 | this.feedback = this._feedbackGain.gain;
|
18 | readOnly(this, "feedback");
|
19 |
|
20 | this.effectReturn.chain(this._feedbackGain, this.effectSend);
|
21 | }
|
22 | static getDefaults() {
|
23 | return Object.assign(Effect.getDefaults(), {
|
24 | feedback: 0.125,
|
25 | });
|
26 | }
|
27 | dispose() {
|
28 | super.dispose();
|
29 | this._feedbackGain.dispose();
|
30 | this.feedback.dispose();
|
31 | return this;
|
32 | }
|
33 | }
|
34 |
|
\ | No newline at end of file |