1 | import { Seconds, Time } from "../core/type/Units.js";
|
2 | import { Effect, EffectOptions } from "./Effect.js";
|
3 | interface ReverbOptions extends EffectOptions {
|
4 | decay: Seconds;
|
5 | preDelay: Seconds;
|
6 | }
|
7 | /**
|
8 | * Simple convolution created with decaying noise.
|
9 | * Generates an Impulse Response Buffer
|
10 | * with Tone.Offline then feeds the IR into ConvolverNode.
|
11 | * The impulse response generation is async, so you have
|
12 | * to wait until {@link ready} resolves before it will make a sound.
|
13 | *
|
14 | * Inspiration from [ReverbGen](https://github.com/adelespinasse/reverbGen).
|
15 | * Copyright (c) 2014 Alan deLespinasse Apache 2.0 License.
|
16 | *
|
17 | * @category Effect
|
18 | */
|
19 | export declare class Reverb extends Effect<ReverbOptions> {
|
20 | readonly name: string;
|
21 | /**
|
22 | * Convolver node
|
23 | */
|
24 | private _convolver;
|
25 | /**
|
26 | * The duration of the reverb.
|
27 | */
|
28 | private _decay;
|
29 | /**
|
30 | * The amount of time before the reverb is fully ramped in.
|
31 | */
|
32 | private _preDelay;
|
33 | /**
|
34 | * Resolves when the reverb buffer is generated. Whenever either {@link decay}
|
35 | * or {@link preDelay} are set, you have to wait until {@link ready} resolves
|
36 | * before the IR is generated with the latest values.
|
37 | */
|
38 | ready: Promise<void>;
|
39 | /**
|
40 | * @param decay The amount of time it will reverberate for.
|
41 | */
|
42 | constructor(decay?: Seconds);
|
43 | constructor(options?: Partial<ReverbOptions>);
|
44 | static getDefaults(): ReverbOptions;
|
45 | /**
|
46 | * The duration of the reverb.
|
47 | */
|
48 | get decay(): Time;
|
49 | set decay(time: Time);
|
50 | /**
|
51 | * The amount of time before the reverb is fully ramped in.
|
52 | */
|
53 | get preDelay(): Time;
|
54 | set preDelay(time: Time);
|
55 | /**
|
56 | * Generate the Impulse Response. Returns a promise while the IR is being generated.
|
57 | * @return Promise which returns this object.
|
58 | */
|
59 | generate(): Promise<this>;
|
60 | dispose(): this;
|
61 | }
|
62 | export {};
|