mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-13 20:39:06 +00:00
aaf880c925
* WIP moving tests to web-test-runner * updating thresholds * Adding file extensions * Testing integrations * linting * fixing dep * moving back to root dir * prettier all of the files * updating eslint rules to use with prettier * remove import package * moving tsignore around * removing unneeded ignores * all tests run on puppeteer, no need for testing guards * linting * import type syntax * cleaning up * Update package.json
41 lines
1.6 KiB
TypeScript
41 lines
1.6 KiB
TypeScript
import {
|
|
StereoFeedbackEffect,
|
|
StereoFeedbackEffectOptions,
|
|
} from "./StereoFeedbackEffect.js";
|
|
import { NormalRange } from "../core/type/Units.js";
|
|
import { readOnly } from "../core/util/Interface.js";
|
|
|
|
export interface StereoXFeedbackEffectOptions
|
|
extends StereoFeedbackEffectOptions {
|
|
feedback: NormalRange;
|
|
}
|
|
|
|
/**
|
|
* Just like a {@link StereoFeedbackEffect}, but the feedback is routed from left to right
|
|
* and right to left instead of on the same channel.
|
|
* ```
|
|
* +--------------------------------+ feedbackL <-----------------------------------+
|
|
* | |
|
|
* +--> +-----> +----> +-----+
|
|
* feedbackMerge +--> split (EFFECT) merge +--> feedbackSplit | |
|
|
* +--> +-----> +----> +---+ |
|
|
* | |
|
|
* +--------------------------------+ feedbackR <-------------------------------------+
|
|
* ```
|
|
*/
|
|
export class StereoXFeedbackEffect<
|
|
Options extends StereoXFeedbackEffectOptions,
|
|
> extends StereoFeedbackEffect<Options> {
|
|
constructor(options: StereoXFeedbackEffectOptions) {
|
|
super(options);
|
|
// the left output connected to the right input
|
|
this._feedbackL.disconnect();
|
|
this._feedbackL.connect(this._feedbackMerge, 0, 1);
|
|
|
|
// the left output connected to the right input
|
|
this._feedbackR.disconnect();
|
|
this._feedbackR.connect(this._feedbackMerge, 0, 0);
|
|
|
|
readOnly(this, ["feedback"]);
|
|
}
|
|
}
|