Tone.js/Tone/effect/StereoXFeedbackEffect.ts
Yotam Mann aaf880c925
Using web-test-runner for tests, updating import paths (#1242)
* 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
2024-05-03 14:31:14 -04:00

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"]);
}
}