1 | import { Envelope, EnvelopeOptions } from "../component/envelope/Envelope.js";
|
2 | import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode.js";
|
3 | import { Frequency, NormalRange, Positive, Seconds, Time } from "../core/type/Units.js";
|
4 | import { RecursivePartial } from "../core/util/Interface.js";
|
5 | import { Signal } from "../signal/Signal.js";
|
6 | import { Monophonic, MonophonicOptions } from "./Monophonic.js";
|
7 | export interface MetalSynthOptions extends MonophonicOptions {
|
8 | harmonicity: Positive;
|
9 | modulationIndex: Positive;
|
10 | octaves: number;
|
11 | resonance: Frequency;
|
12 | envelope: Omit<EnvelopeOptions, keyof ToneAudioNodeOptions>;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export declare class MetalSynth extends Monophonic<MetalSynthOptions> {
|
21 | readonly name: string;
|
22 | |
23 |
|
24 |
|
25 | readonly frequency: Signal<"frequency">;
|
26 | |
27 |
|
28 |
|
29 | readonly detune: Signal<"cents">;
|
30 | |
31 |
|
32 |
|
33 | private _oscillators;
|
34 | |
35 |
|
36 |
|
37 | private _freqMultipliers;
|
38 | |
39 |
|
40 |
|
41 | private _amplitude;
|
42 | |
43 |
|
44 |
|
45 | private _highpass;
|
46 | |
47 |
|
48 |
|
49 |
|
50 | private _octaves;
|
51 | |
52 |
|
53 |
|
54 | private _filterFreqScaler;
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 | readonly envelope: Envelope;
|
61 | constructor(options?: RecursivePartial<MetalSynthOptions>);
|
62 | static getDefaults(): MetalSynthOptions;
|
63 | /**
|
64 | * Trigger the attack.
|
65 | * @param time When the attack should be triggered.
|
66 | * @param velocity The velocity that the envelope should be triggered at.
|
67 | */
|
68 | protected _triggerEnvelopeAttack(time: Seconds, velocity?: NormalRange): this;
|
69 | /**
|
70 | * Trigger the release of the envelope.
|
71 | * @param time When the release should be triggered.
|
72 | */
|
73 | protected _triggerEnvelopeRelease(time: Seconds): this;
|
74 | getLevelAtTime(time: Time): NormalRange;
|
75 | /**
|
76 | * The modulationIndex of the oscillators which make up the source.
|
77 | * see {@link FMOscillator.modulationIndex}
|
78 | * @min 1
|
79 | * @max 100
|
80 | */
|
81 | get modulationIndex(): number;
|
82 | set modulationIndex(val: number);
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | get harmonicity(): number;
|
90 | set harmonicity(val: number);
|
91 | |
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | get resonance(): Frequency;
|
98 | set resonance(val: Frequency);
|
99 | |
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | get octaves(): number;
|
106 | set octaves(val: number);
|
107 | dispose(): this;
|
108 | }
|