UNPKG

2.56 kBTypeScriptView Raw
1import { StereoEffect, StereoEffectOptions } from "./StereoEffect.js";
2import { Signal } from "../signal/Signal.js";
3import { Degrees, Frequency, NormalRange, Time } from "../core/type/Units.js";
4import { ToneOscillatorType } from "../source/oscillator/OscillatorInterface.js";
5export interface TremoloOptions extends StereoEffectOptions {
6 frequency: Frequency;
7 type: ToneOscillatorType;
8 depth: NormalRange;
9 spread: Degrees;
10}
11/**
12 * Tremolo modulates the amplitude of an incoming signal using an {@link LFO}.
13 * The effect is a stereo effect where the modulation phase is inverted in each channel.
14 *
15 * @example
16 * // create a tremolo and start it's LFO
17 * const tremolo = new Tone.Tremolo(9, 0.75).toDestination().start();
18 * // route an oscillator through the tremolo and start it
19 * const oscillator = new Tone.Oscillator().connect(tremolo).start();
20 *
21 * @category Effect
22 */
23export declare class Tremolo extends StereoEffect<TremoloOptions> {
24 readonly name: string;
25 /**
26 * The tremolo LFO in the left channel
27 */
28 private _lfoL;
29 /**
30 * The tremolo LFO in the left channel
31 */
32 private _lfoR;
33 /**
34 * Where the gain is multiplied
35 */
36 private _amplitudeL;
37 /**
38 * Where the gain is multiplied
39 */
40 private _amplitudeR;
41 /**
42 * The frequency of the tremolo.
43 */
44 readonly frequency: Signal<"frequency">;
45 /**
46 * The depth of the effect. A depth of 0, has no effect
47 * on the amplitude, and a depth of 1 makes the amplitude
48 * modulate fully between 0 and 1.
49 */
50 readonly depth: Signal<"normalRange">;
51 /**
52 * @param frequency The rate of the effect.
53 * @param depth The depth of the effect.
54 */
55 constructor(frequency?: Frequency, depth?: NormalRange);
56 constructor(options?: Partial<TremoloOptions>);
57 static getDefaults(): TremoloOptions;
58 /**
59 * Start the tremolo.
60 */
61 start(time?: Time): this;
62 /**
63 * Stop the tremolo.
64 */
65 stop(time?: Time): this;
66 /**
67 * Sync the effect to the transport.
68 */
69 sync(): this;
70 /**
71 * Unsync the filter from the transport
72 */
73 unsync(): this;
74 /**
75 * The oscillator type.
76 */
77 get type(): ToneOscillatorType;
78 set type(type: ToneOscillatorType);
79 /**
80 * Amount of stereo spread. When set to 0, both LFO's will be panned centrally.
81 * When set to 180, LFO's will be panned hard left and right respectively.
82 */
83 get spread(): Degrees;
84 set spread(spread: Degrees);
85 dispose(): this;
86}