1 | import { AmplitudeEnvelope } from "../component/envelope/AmplitudeEnvelope.js";
|
2 | import { EnvelopeOptions } from "../component/envelope/Envelope.js";
|
3 | import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode.js";
|
4 | import { NormalRange, Seconds, Time } from "../core/type/Units.js";
|
5 | import { RecursivePartial } from "../core/util/Interface.js";
|
6 | import { Signal } from "../signal/Signal.js";
|
7 | import { OmniOscillator } from "../source/oscillator/OmniOscillator.js";
|
8 | import { OmniOscillatorSynthOptions } from "../source/oscillator/OscillatorInterface.js";
|
9 | import { Monophonic, MonophonicOptions } from "./Monophonic.js";
|
10 | export interface SynthOptions extends MonophonicOptions {
|
11 | oscillator: OmniOscillatorSynthOptions;
|
12 | envelope: Omit<EnvelopeOptions, keyof ToneAudioNodeOptions>;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare class Synth<Options extends SynthOptions = SynthOptions> extends Monophonic<Options> {
|
27 | readonly name: string;
|
28 | |
29 |
|
30 |
|
31 | readonly oscillator: OmniOscillator<any>;
|
32 | |
33 |
|
34 |
|
35 | readonly frequency: Signal<"frequency">;
|
36 | |
37 |
|
38 |
|
39 | readonly detune: Signal<"cents">;
|
40 | |
41 |
|
42 |
|
43 | readonly envelope: AmplitudeEnvelope;
|
44 | |
45 |
|
46 |
|
47 | constructor(options?: RecursivePartial<SynthOptions>);
|
48 | static getDefaults(): SynthOptions;
|
49 | /**
|
50 | * start the attack portion of the envelope
|
51 | * @param time the time the attack should start
|
52 | * @param velocity the velocity of the note (0-1)
|
53 | */
|
54 | protected _triggerEnvelopeAttack(time: Seconds, velocity: number): void;
|
55 | /**
|
56 | * start the release portion of the envelope
|
57 | * @param time the time the release should start
|
58 | */
|
59 | protected _triggerEnvelopeRelease(time: Seconds): void;
|
60 | getLevelAtTime(time: Time): NormalRange;
|
61 | /**
|
62 | * clean up
|
63 | */
|
64 | dispose(): this;
|
65 | }
|