import { Positive, Time } from "../core/type/Units"; import { Source, SourceOptions } from "../source/Source"; export declare type NoiseType = "white" | "brown" | "pink"; export interface NoiseOptions extends SourceOptions { type: NoiseType; playbackRate: Positive; fadeIn: Time; fadeOut: Time; } /** * Noise is a noise generator. It uses looped noise buffers to save on performance. * Noise supports the noise types: "pink", "white", and "brown". Read more about * colors of noise on [Wikipedia](https://en.wikipedia.org/wiki/Colors_of_noise). * * @example * //initialize the noise and start * var noise = new Noise("pink").start(); * * //make an autofilter to shape the noise * var autoFilter = new Tone.AutoFilter({ * "frequency" : "8m", * "min" : 800, * "max" : 15000 * }).connect(Tone.Destination); * * //connect the noise * noise.connect(autoFilter); * //start the autofilter LFO * autoFilter.start() * @category Source */ export declare class Noise extends Source { readonly name: string; /** * Private reference to the source */ private _source; /** * private reference to the type */ private _type; /** * The playback rate of the noise. Affects * the "frequency" of the noise. */ private _playbackRate; /** * The fadeIn time of the amplitude envelope. */ protected _fadeIn: Time; /** * The fadeOut time of the amplitude envelope. */ protected _fadeOut: Time; /** * @param type the noise type (white|pink|brown) */ constructor(type?: NoiseType); constructor(options?: Partial); static getDefaults(): NoiseOptions; /** * The type of the noise. Can be "white", "brown", or "pink". * @example * noise.type = "white"; */ type: NoiseType; /** * The playback rate of the noise. Affects * the "frequency" of the noise. */ playbackRate: Positive; /** * internal start method */ protected _start(time?: Time): void; /** * internal stop method */ protected _stop(time?: Time): void; /** * The fadeIn time of the amplitude envelope. */ fadeIn: Time; /** * The fadeOut time of the amplitude envelope. */ fadeOut: Time; /** * Restarts the noise. * @param time When to restart the noise. */ restart(time?: Time): this; /** * Clean up. */ dispose(): this; }