1 | import { AmplitudeEnvelope } from "../component/envelope/AmplitudeEnvelope.js";
|
2 | import { NormalRange, Time } from "../core/type/Units.js";
|
3 | import { RecursivePartial } from "../core/util/Interface.js";
|
4 | import { Noise, NoiseOptions } from "../source/Noise.js";
|
5 | import { Instrument, InstrumentOptions } from "./Instrument.js";
|
6 | import { ToneAudioNodeOptions } from "../core/context/ToneAudioNode.js";
|
7 | import { EnvelopeOptions } from "../component/envelope/Envelope.js";
|
8 | export interface NoiseSynthOptions extends InstrumentOptions {
|
9 | envelope: Omit<EnvelopeOptions, keyof ToneAudioNodeOptions>;
|
10 | noise: Omit<NoiseOptions, keyof ToneAudioNodeOptions>;
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export declare class NoiseSynth extends Instrument<NoiseSynthOptions> {
|
25 | readonly name = "NoiseSynth";
|
26 | |
27 |
|
28 |
|
29 | readonly noise: Noise;
|
30 | |
31 |
|
32 |
|
33 | readonly envelope: AmplitudeEnvelope;
|
34 | constructor(options?: RecursivePartial<NoiseSynthOptions>);
|
35 | static getDefaults(): NoiseSynthOptions;
|
36 | /**
|
37 | * Start the attack portion of the envelopes. Unlike other
|
38 | * instruments, Tone.NoiseSynth doesn't have a note.
|
39 | * @example
|
40 | * const noiseSynth = new Tone.NoiseSynth().toDestination();
|
41 | * noiseSynth.triggerAttack();
|
42 | */
|
43 | triggerAttack(time?: Time, velocity?: NormalRange): this;
|
44 | /**
|
45 | * Start the release portion of the envelopes.
|
46 | */
|
47 | triggerRelease(time?: Time): this;
|
48 | sync(): this;
|
49 | /**
|
50 | * Trigger the attack and then the release after the duration.
|
51 | * @param duration The amount of time to hold the note for
|
52 | * @param time The time the note should start
|
53 | * @param velocity The volume of the note (0-1)
|
54 | * @example
|
55 | * const noiseSynth = new Tone.NoiseSynth().toDestination();
|
56 | * // hold the note for 0.5 seconds
|
57 | * noiseSynth.triggerAttackRelease(0.5);
|
58 | */
|
59 | triggerAttackRelease(duration: Time, time?: Time, velocity?: NormalRange): this;
|
60 | dispose(): this;
|
61 | }
|