UNPKG

1.33 kBTypeScriptView Raw
1import { Time } from "../../core/type/Units.js";
2import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode.js";
3export interface FollowerOptions extends ToneAudioNodeOptions {
4 smoothing: Time;
5}
6/**
7 * Follower is a simple envelope follower.
8 * It's implemented by applying a lowpass filter to the absolute value of the incoming signal.
9 * ```
10 * +-----+ +---------------+
11 * Input +--> Abs +----> OnePoleFilter +--> Output
12 * +-----+ +---------------+
13 * ```
14 * @category Component
15 */
16export declare class Follower extends ToneAudioNode<FollowerOptions> {
17 readonly name: string;
18 readonly input: InputNode;
19 readonly output: OutputNode;
20 /**
21 * Private reference to the smoothing parameter
22 */
23 private _smoothing;
24 /**
25 * The lowpass filter
26 */
27 private _lowpass;
28 /**
29 * The absolute value
30 */
31 private _abs;
32 /**
33 * @param smoothing The rate of change of the follower.
34 */
35 constructor(smoothing?: Time);
36 constructor(options?: Partial<FollowerOptions>);
37 static getDefaults(): FollowerOptions;
38 /**
39 * The amount of time it takes a value change to arrive at the updated value.
40 */
41 get smoothing(): Time;
42 set smoothing(smoothing: Time);
43 dispose(): this;
44}