UNPKG

1.6 kBTypeScriptView Raw
1import { CrossFade } from "../component/channel/CrossFade.js";
2import { Gain } from "../core/context/Gain.js";
3import { ToneAudioNode, ToneAudioNodeOptions } from "../core/context/ToneAudioNode.js";
4import { NormalRange } from "../core/type/Units.js";
5import { Signal } from "../signal/Signal.js";
6export interface EffectOptions extends ToneAudioNodeOptions {
7 wet: NormalRange;
8}
9/**
10 * Effect is the base class for effects. Connect the effect between
11 * the effectSend and effectReturn GainNodes, then control the amount of
12 * effect which goes to the output using the wet control.
13 */
14export declare abstract class Effect<Options extends EffectOptions> extends ToneAudioNode<Options> {
15 readonly name: string;
16 /**
17 * the drywet knob to control the amount of effect
18 */
19 private _dryWet;
20 /**
21 * The wet control is how much of the effected
22 * will pass through to the output. 1 = 100% effected
23 * signal, 0 = 100% dry signal.
24 */
25 wet: Signal<"normalRange">;
26 /**
27 * connect the effectSend to the input of hte effect
28 */
29 protected effectSend: Gain;
30 /**
31 * connect the output of the effect to the effectReturn
32 */
33 protected effectReturn: Gain;
34 /**
35 * The effect input node
36 */
37 input: Gain;
38 /**
39 * The effect output
40 */
41 output: CrossFade;
42 constructor(options: EffectOptions);
43 static getDefaults(): EffectOptions;
44 /**
45 * chains the effect in between the effectSend and effectReturn
46 */
47 protected connectEffect(effect: ToneAudioNode | AudioNode): this;
48 dispose(): this;
49}