UNPKG

1.86 kBTypeScriptView Raw
1import { Frequency, Positive } from "../core/type/Units.js";
2import { Filter, FilterOptions } from "../component/filter/Filter.js";
3import { SourceOptions } from "../source/Source.js";
4import { LFOEffect, LFOEffectOptions } from "./LFOEffect.js";
5export interface AutoFilterOptions extends LFOEffectOptions {
6 baseFrequency: Frequency;
7 octaves: Positive;
8 filter: Omit<FilterOptions, keyof SourceOptions | "frequency" | "detune" | "gain">;
9}
10/**
11 * AutoFilter is a Tone.Filter with a Tone.LFO connected to the filter cutoff frequency.
12 * Setting the LFO rate and depth allows for control over the filter modulation rate
13 * and depth.
14 *
15 * @example
16 * // create an autofilter and start it's LFO
17 * const autoFilter = new Tone.AutoFilter("4n").toDestination().start();
18 * // route an oscillator through the filter and start it
19 * const oscillator = new Tone.Oscillator().connect(autoFilter).start();
20 * @category Effect
21 */
22export declare class AutoFilter extends LFOEffect<AutoFilterOptions> {
23 readonly name: string;
24 /**
25 * The filter node
26 */
27 readonly filter: Filter;
28 /**
29 * The octaves placeholder
30 */
31 private _octaves;
32 /**
33 * @param frequency The rate of the LFO.
34 * @param baseFrequency The lower value of the LFOs oscillation
35 * @param octaves The number of octaves above the baseFrequency
36 */
37 constructor(frequency?: Frequency, baseFrequency?: Frequency, octaves?: Positive);
38 constructor(options?: Partial<AutoFilterOptions>);
39 static getDefaults(): AutoFilterOptions;
40 /**
41 * The minimum value of the filter's cutoff frequency.
42 */
43 get baseFrequency(): Frequency;
44 set baseFrequency(freq: Frequency);
45 /**
46 * The maximum value of the filter's cutoff frequency.
47 */
48 get octaves(): Positive;
49 set octaves(oct: Positive);
50 dispose(): this;
51}