1 | import { Degrees, Frequency, Seconds, Time } from "../../core/type/Units.js";
|
2 | import { Signal } from "../../signal/Signal.js";
|
3 | import { Source } from "../Source.js";
|
4 | import { PWMOscillatorOptions, ToneOscillatorInterface } from "./OscillatorInterface.js";
|
5 | export { PWMOscillatorOptions } from "./OscillatorInterface.js";
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export declare class PWMOscillator extends Source<PWMOscillatorOptions> implements ToneOscillatorInterface {
|
18 | readonly name: string;
|
19 | readonly sourceType = "pwm";
|
20 | |
21 |
|
22 |
|
23 | private _pulse;
|
24 | |
25 |
|
26 |
|
27 | private _modulator;
|
28 | |
29 |
|
30 |
|
31 |
|
32 | private _scale;
|
33 | |
34 |
|
35 |
|
36 | readonly frequency: Signal<"frequency">;
|
37 | |
38 |
|
39 |
|
40 | readonly detune: Signal<"cents">;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | readonly modulationFrequency: Signal<"frequency">;
|
49 | |
50 |
|
51 |
|
52 |
|
53 | constructor(frequency?: Frequency, modulationFrequency?: Frequency);
|
54 | constructor(options?: Partial<PWMOscillatorOptions>);
|
55 | static getDefaults(): PWMOscillatorOptions;
|
56 | /**
|
57 | * start the oscillator
|
58 | */
|
59 | protected _start(time: Time): void;
|
60 | /**
|
61 | * stop the oscillator
|
62 | */
|
63 | protected _stop(time: Time): void;
|
64 | /**
|
65 | * restart the oscillator
|
66 | */
|
67 | protected _restart(time: Seconds): void;
|
68 | /**
|
69 | * The type of the oscillator. Always returns "pwm".
|
70 | */
|
71 | get type(): "pwm";
|
72 | /**
|
73 | * The baseType of the oscillator. Always returns "pwm".
|
74 | */
|
75 | get baseType(): "pwm";
|
76 | /**
|
77 | * The partials of the waveform. Cannot set partials for this waveform type
|
78 | */
|
79 | get partials(): number[];
|
80 | /**
|
81 | * No partials for this waveform type.
|
82 | */
|
83 | get partialCount(): number;
|
84 | /**
|
85 | * The phase of the oscillator in degrees.
|
86 | */
|
87 | get phase(): Degrees;
|
88 | set phase(phase: Degrees);
|
89 | asArray(length?: number): Promise<Float32Array>;
|
90 | /**
|
91 | * Clean up.
|
92 | */
|
93 | dispose(): this;
|
94 | }
|