1 | import { Param } from "../../core/context/Param.js";
|
2 | import { InputNode, OutputNode, ToneAudioNode } from "../../core/context/ToneAudioNode.js";
|
3 | import { Degrees, Frequency, NormalRange, Time, UnitName } from "../../core/type/Units.js";
|
4 | import { BasicPlaybackState } from "../../core/util/StateTimeline.js";
|
5 | import { Signal } from "../../signal/Signal.js";
|
6 | import { ToneOscillatorType } from "./Oscillator.js";
|
7 | import { ToneOscillatorOptions } from "./OscillatorInterface.js";
|
8 | export type LFOOptions = {
|
9 | min: number;
|
10 | max: number;
|
11 | amplitude: NormalRange;
|
12 | units: UnitName;
|
13 | } & ToneOscillatorOptions;
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | export declare class LFO extends ToneAudioNode<LFOOptions> {
|
26 | readonly name: string;
|
27 | |
28 |
|
29 |
|
30 | private _oscillator;
|
31 | |
32 |
|
33 |
|
34 | private _amplitudeGain;
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | readonly amplitude: Param<"normalRange">;
|
42 | |
43 |
|
44 |
|
45 | private _stoppedSignal;
|
46 | |
47 |
|
48 |
|
49 |
|
50 | private _zeros;
|
51 | |
52 |
|
53 |
|
54 | private _stoppedValue;
|
55 | |
56 |
|
57 |
|
58 | private _a2g;
|
59 | |
60 |
|
61 |
|
62 | private _scaler;
|
63 | |
64 |
|
65 |
|
66 | readonly output: OutputNode;
|
67 | |
68 |
|
69 |
|
70 | readonly input: undefined;
|
71 | |
72 |
|
73 |
|
74 | private _units;
|
75 | |
76 |
|
77 |
|
78 | convert: boolean;
|
79 | |
80 |
|
81 |
|
82 | readonly frequency: Signal<"frequency">;
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | constructor(frequency?: Frequency, min?: number, max?: number);
|
90 | constructor(options?: Partial<LFOOptions>);
|
91 | static getDefaults(): LFOOptions;
|
92 | /**
|
93 | * Start the LFO.
|
94 | * @param time The time the LFO will start
|
95 | */
|
96 | start(time?: Time): this;
|
97 | /**
|
98 | * Stop the LFO.
|
99 | * @param time The time the LFO will stop
|
100 | */
|
101 | stop(time?: Time): this;
|
102 | /**
|
103 | * Sync the start/stop/pause to the transport
|
104 | * and the frequency to the bpm of the transport
|
105 | * @example
|
106 | * const lfo = new Tone.LFO("8n");
|
107 | * lfo.sync().start(0);
|
108 | * // the rate of the LFO will always be an eighth note, even as the tempo changes
|
109 | */
|
110 | sync(): this;
|
111 | /**
|
112 | * unsync the LFO from transport control
|
113 | */
|
114 | unsync(): this;
|
115 | /**
|
116 | * After the oscillator waveform is updated, reset the `_stoppedSignal` value to match the updated waveform
|
117 | */
|
118 | private _setStoppedValue;
|
119 | /**
|
120 | * The minimum output of the LFO.
|
121 | */
|
122 | get min(): number;
|
123 | set min(min: number);
|
124 | /**
|
125 | * The maximum output of the LFO.
|
126 | */
|
127 | get max(): number;
|
128 | set max(max: number);
|
129 | /**
|
130 | * The type of the oscillator.
|
131 | * @see {@link Oscillator.type}
|
132 | */
|
133 | get type(): ToneOscillatorType;
|
134 | set type(type: ToneOscillatorType);
|
135 | /**
|
136 | * The oscillator's partials array.
|
137 | * @see {@link Oscillator.partials}
|
138 | */
|
139 | get partials(): number[];
|
140 | set partials(partials: number[]);
|
141 | |
142 |
|
143 |
|
144 | get phase(): Degrees;
|
145 | set phase(phase: Degrees);
|
146 | |
147 |
|
148 |
|
149 | get units(): UnitName;
|
150 | set units(val: UnitName);
|
151 | |
152 |
|
153 |
|
154 | get state(): BasicPlaybackState;
|
155 | |
156 |
|
157 |
|
158 |
|
159 |
|
160 | connect(node: InputNode, outputNum?: number, inputNum?: number): this;
|
161 | |
162 |
|
163 |
|
164 | private _fromType;
|
165 | private _toType;
|
166 | private _is;
|
167 | private _clampValue;
|
168 | dispose(): this;
|
169 | }
|