UNPKG

3.07 kBTypeScriptView Raw
1import { Effect, EffectOptions } from "./Effect.js";
2import { Decibels, Frequency, GainFactor, Positive, Time } from "../core/type/Units.js";
3import { Signal } from "../signal/Signal.js";
4export interface AutoWahOptions extends EffectOptions {
5 baseFrequency: Frequency;
6 octaves: Positive;
7 sensitivity: Decibels;
8 Q: Positive;
9 gain: GainFactor;
10 follower: Time;
11}
12/**
13 * AutoWah connects a {@link Follower} to a {@link Filter}.
14 * The frequency of the filter, follows the input amplitude curve.
15 * Inspiration from [Tuna.js](https://github.com/Dinahmoe/tuna).
16 *
17 * @example
18 * const autoWah = new Tone.AutoWah(50, 6, -30).toDestination();
19 * // initialize the synth and connect to autowah
20 * const synth = new Tone.Synth().connect(autoWah);
21 * // Q value influences the effect of the wah - default is 2
22 * autoWah.Q.value = 6;
23 * // more audible on higher notes
24 * synth.triggerAttackRelease("C4", "8n");
25 * @category Effect
26 */
27export declare class AutoWah extends Effect<AutoWahOptions> {
28 readonly name: string;
29 /**
30 * The envelope follower. Set the attack/release
31 * timing to adjust how the envelope is followed.
32 */
33 private _follower;
34 /**
35 * scales the follower value to the frequency domain
36 */
37 private _sweepRange;
38 /**
39 * Hold the base frequency value
40 */
41 private _baseFrequency;
42 /**
43 * Private holder for the octave count
44 */
45 private _octaves;
46 /**
47 * the input gain to adjust the sensitivity
48 */
49 private _inputBoost;
50 /**
51 * Private holder for the filter
52 */
53 private _bandpass;
54 /**
55 * The peaking fitler
56 */
57 private _peaking;
58 /**
59 * The gain of the filter.
60 */
61 readonly gain: Signal<"decibels">;
62 /**
63 * The quality of the filter.
64 */
65 readonly Q: Signal<"positive">;
66 /**
67 * @param baseFrequency The frequency the filter is set to at the low point of the wah
68 * @param octaves The number of octaves above the baseFrequency the filter will sweep to when fully open.
69 * @param sensitivity The decibel threshold sensitivity for the incoming signal. Normal range of -40 to 0.
70 */
71 constructor(baseFrequency?: Frequency, octaves?: Positive, sensitivity?: Decibels);
72 constructor(options?: Partial<AutoWahOptions>);
73 static getDefaults(): AutoWahOptions;
74 /**
75 * The number of octaves that the filter will sweep above the baseFrequency.
76 */
77 get octaves(): number;
78 set octaves(octaves: number);
79 /**
80 * The follower's smoothing time
81 */
82 get follower(): Time;
83 set follower(follower: Time);
84 /**
85 * The base frequency from which the sweep will start from.
86 */
87 get baseFrequency(): Frequency;
88 set baseFrequency(baseFreq: Frequency);
89 /**
90 * The sensitivity to control how responsive to the input signal the filter is.
91 */
92 get sensitivity(): Decibels;
93 set sensitivity(sensitivity: Decibels);
94 /**
95 * sets the sweep range of the scaler
96 */
97 private _setSweepRange;
98 dispose(): this;
99}