1 | import { StereoEffect, StereoEffectOptions } from "./StereoEffect.js";
|
2 | import { Frequency, Positive } from "../core/type/Units.js";
|
3 | import { Signal } from "../signal/Signal.js";
|
4 | export interface PhaserOptions extends StereoEffectOptions {
|
5 | frequency: Frequency;
|
6 | octaves: Positive;
|
7 | stages: Positive;
|
8 | Q: Positive;
|
9 | baseFrequency: Frequency;
|
10 | }
|
11 | /**
|
12 | * Phaser is a phaser effect. Phasers work by changing the phase
|
13 | * of different frequency components of an incoming signal. Read more on
|
14 | * [Wikipedia](https://en.wikipedia.org/wiki/Phaser_(effect)).
|
15 | * Inspiration for this phaser comes from [Tuna.js](https://github.com/Dinahmoe/tuna/).
|
16 | * @example
|
17 | * const phaser = new Tone.Phaser({
|
18 | * frequency: 15,
|
19 | * octaves: 5,
|
20 | * baseFrequency: 1000
|
21 | * }).toDestination();
|
22 | * const synth = new Tone.FMSynth().connect(phaser);
|
23 | * synth.triggerAttackRelease("E3", "2n");
|
24 | * @category Effect
|
25 | */
|
26 | export declare class Phaser extends StereoEffect<PhaserOptions> {
|
27 | readonly name: string;
|
28 | /**
|
29 | * the lfo which controls the frequency on the left side
|
30 | */
|
31 | private _lfoL;
|
32 | /**
|
33 | * the lfo which controls the frequency on the right side
|
34 | */
|
35 | private _lfoR;
|
36 | /**
|
37 | * the base modulation frequency
|
38 | */
|
39 | private _baseFrequency;
|
40 | /**
|
41 | * the octaves of the phasing
|
42 | */
|
43 | private _octaves;
|
44 | /**
|
45 | * The quality factor of the filters
|
46 | */
|
47 | readonly Q: Signal<"positive">;
|
48 | /**
|
49 | * the array of filters for the left side
|
50 | */
|
51 | private _filtersL;
|
52 | /**
|
53 | * the array of filters for the left side
|
54 | */
|
55 | private _filtersR;
|
56 | /**
|
57 | * the frequency of the effect
|
58 | */
|
59 | readonly frequency: Signal<"frequency">;
|
60 | /**
|
61 | * @param frequency The speed of the phasing.
|
62 | * @param octaves The octaves of the effect.
|
63 | * @param baseFrequency The base frequency of the filters.
|
64 | */
|
65 | constructor(frequency?: Frequency, octaves?: Positive, baseFrequency?: Frequency);
|
66 | constructor(options?: Partial<PhaserOptions>);
|
67 | static getDefaults(): PhaserOptions;
|
68 | private _makeFilters;
|
69 | /**
|
70 | * The number of octaves the phase goes above the baseFrequency
|
71 | */
|
72 | get octaves(): number;
|
73 | set octaves(octaves: number);
|
74 | /**
|
75 | * The the base frequency of the filters.
|
76 | */
|
77 | get baseFrequency(): Frequency;
|
78 | set baseFrequency(freq: Frequency);
|
79 | dispose(): this;
|
80 | }
|