1 | import { Signal } from "../signal/Signal.js";
|
2 | import { Multiply } from "../signal/Multiply.js";
|
3 | import { Gain } from "../core/context/Gain.js";
|
4 | import { NormalRange, Positive, Seconds, Time } from "../core/type/Units.js";
|
5 | import { EnvelopeOptions } from "../component/envelope/Envelope.js";
|
6 | import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode.js";
|
7 | import { Monophonic } from "./Monophonic.js";
|
8 | import { OmniOscillator } from "../source/oscillator/OmniOscillator.js";
|
9 | import { OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface.js";
|
10 | import { Synth, SynthOptions } from "./Synth.js";
|
11 | import { AmplitudeEnvelope } from "../component/envelope/AmplitudeEnvelope.js";
|
12 | import { RecursivePartial } from "../core/util/Interface.js";
|
13 | export interface ModulationSynthOptions extends SynthOptions {
|
14 | harmonicity: Positive;
|
15 | modulationEnvelope: Omit<EnvelopeOptions, keyof ToneAudioNodeOptions>;
|
16 | modulation: OmniOscillatorSynthOptions;
|
17 | }
|
18 |
|
19 |
|
20 |
|
21 | export declare abstract class ModulationSynth<Options extends ModulationSynthOptions> extends Monophonic<Options> {
|
22 | readonly name: string;
|
23 | |
24 |
|
25 |
|
26 | protected _carrier: Synth;
|
27 | |
28 |
|
29 |
|
30 | protected _modulator: Synth;
|
31 | |
32 |
|
33 |
|
34 | readonly oscillator: OmniOscillator<any>;
|
35 | |
36 |
|
37 |
|
38 | readonly envelope: AmplitudeEnvelope;
|
39 | |
40 |
|
41 |
|
42 | readonly modulation: OmniOscillator<any>;
|
43 | |
44 |
|
45 |
|
46 | readonly modulationEnvelope: AmplitudeEnvelope;
|
47 | |
48 |
|
49 |
|
50 | readonly frequency: Signal<"frequency">;
|
51 | |
52 |
|
53 |
|
54 | readonly detune: Signal<"cents">;
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | readonly harmonicity: Multiply;
|
65 | |
66 |
|
67 |
|
68 | protected _modulationNode: Gain;
|
69 | constructor(options?: RecursivePartial<ModulationSynthOptions>);
|
70 | static getDefaults(): ModulationSynthOptions;
|
71 | /**
|
72 | * Trigger the attack portion of the note
|
73 | */
|
74 | protected _triggerEnvelopeAttack(time: Seconds, velocity: number): void;
|
75 | /**
|
76 | * Trigger the release portion of the note
|
77 | */
|
78 | protected _triggerEnvelopeRelease(time: Seconds): this;
|
79 | getLevelAtTime(time: Time): NormalRange;
|
80 | dispose(): this;
|
81 | }
|