@codexo/exojs-audio-fx 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -53
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +12 -20
- package/dist/esm/AudioAnalyser.d.ts +0 -125
- package/dist/esm/AudioAnalyser.d.ts.map +0 -1
- package/dist/esm/AudioAnalyser.js +0 -369
- package/dist/esm/AudioAnalyser.js.map +0 -1
- package/dist/esm/BeatDetector.d.ts +0 -286
- package/dist/esm/BeatDetector.d.ts.map +0 -1
- package/dist/esm/BeatDetector.js +0 -419
- package/dist/esm/BeatDetector.js.map +0 -1
- package/dist/esm/PcmStreamSource.d.ts +0 -127
- package/dist/esm/PcmStreamSource.d.ts.map +0 -1
- package/dist/esm/PcmStreamSource.js +0 -308
- package/dist/esm/PcmStreamSource.js.map +0 -1
- package/dist/esm/dsp/fft.d.ts +0 -22
- package/dist/esm/dsp/fft.d.ts.map +0 -1
- package/dist/esm/dsp/mel.d.ts +0 -43
- package/dist/esm/dsp/mel.d.ts.map +0 -1
- package/dist/esm/dsp/mel.js +0 -61
- package/dist/esm/dsp/mel.js.map +0 -1
- package/dist/esm/dsp/tempogram.d.ts +0 -192
- package/dist/esm/dsp/tempogram.d.ts.map +0 -1
- package/dist/esm/effects/AutoWahEffect.d.ts +0 -128
- package/dist/esm/effects/AutoWahEffect.d.ts.map +0 -1
- package/dist/esm/effects/AutoWahEffect.js +0 -214
- package/dist/esm/effects/AutoWahEffect.js.map +0 -1
- package/dist/esm/effects/BitCrusherEffect.d.ts +0 -64
- package/dist/esm/effects/BitCrusherEffect.d.ts.map +0 -1
- package/dist/esm/effects/BitCrusherEffect.js +0 -76
- package/dist/esm/effects/BitCrusherEffect.js.map +0 -1
- package/dist/esm/effects/ChorusEffect.d.ts +0 -54
- package/dist/esm/effects/ChorusEffect.d.ts.map +0 -1
- package/dist/esm/effects/ChorusEffect.js +0 -136
- package/dist/esm/effects/ChorusEffect.js.map +0 -1
- package/dist/esm/effects/CompressorEffect.d.ts +0 -56
- package/dist/esm/effects/CompressorEffect.d.ts.map +0 -1
- package/dist/esm/effects/CompressorEffect.js +0 -108
- package/dist/esm/effects/CompressorEffect.js.map +0 -1
- package/dist/esm/effects/ConvolutionEffect.d.ts +0 -119
- package/dist/esm/effects/ConvolutionEffect.d.ts.map +0 -1
- package/dist/esm/effects/ConvolutionEffect.js +0 -212
- package/dist/esm/effects/ConvolutionEffect.js.map +0 -1
- package/dist/esm/effects/DelayEffect.d.ts +0 -36
- package/dist/esm/effects/DelayEffect.d.ts.map +0 -1
- package/dist/esm/effects/DelayEffect.js +0 -109
- package/dist/esm/effects/DelayEffect.js.map +0 -1
- package/dist/esm/effects/DistortionEffect.d.ts +0 -120
- package/dist/esm/effects/DistortionEffect.d.ts.map +0 -1
- package/dist/esm/effects/DistortionEffect.js +0 -194
- package/dist/esm/effects/DistortionEffect.js.map +0 -1
- package/dist/esm/effects/DuckingEffect.d.ts +0 -44
- package/dist/esm/effects/DuckingEffect.d.ts.map +0 -1
- package/dist/esm/effects/DuckingEffect.js +0 -95
- package/dist/esm/effects/DuckingEffect.js.map +0 -1
- package/dist/esm/effects/EqualizerEffect.d.ts +0 -51
- package/dist/esm/effects/EqualizerEffect.d.ts.map +0 -1
- package/dist/esm/effects/EqualizerEffect.js +0 -124
- package/dist/esm/effects/EqualizerEffect.js.map +0 -1
- package/dist/esm/effects/FlangerEffect.d.ts +0 -99
- package/dist/esm/effects/FlangerEffect.d.ts.map +0 -1
- package/dist/esm/effects/FlangerEffect.js +0 -176
- package/dist/esm/effects/FlangerEffect.js.map +0 -1
- package/dist/esm/effects/GranularEffect.d.ts +0 -67
- package/dist/esm/effects/GranularEffect.d.ts.map +0 -1
- package/dist/esm/effects/GranularEffect.js +0 -104
- package/dist/esm/effects/GranularEffect.js.map +0 -1
- package/dist/esm/effects/LimiterEffect.d.ts +0 -125
- package/dist/esm/effects/LimiterEffect.d.ts.map +0 -1
- package/dist/esm/effects/LimiterEffect.js +0 -186
- package/dist/esm/effects/LimiterEffect.js.map +0 -1
- package/dist/esm/effects/PhaserEffect.d.ts +0 -127
- package/dist/esm/effects/PhaserEffect.d.ts.map +0 -1
- package/dist/esm/effects/PhaserEffect.js +0 -218
- package/dist/esm/effects/PhaserEffect.js.map +0 -1
- package/dist/esm/effects/PingPongDelayEffect.d.ts +0 -84
- package/dist/esm/effects/PingPongDelayEffect.d.ts.map +0 -1
- package/dist/esm/effects/PingPongDelayEffect.js +0 -176
- package/dist/esm/effects/PingPongDelayEffect.js.map +0 -1
- package/dist/esm/effects/PitchShiftEffect.d.ts +0 -46
- package/dist/esm/effects/PitchShiftEffect.d.ts.map +0 -1
- package/dist/esm/effects/PitchShiftEffect.js +0 -64
- package/dist/esm/effects/PitchShiftEffect.js.map +0 -1
- package/dist/esm/effects/ReverbEffect.d.ts +0 -38
- package/dist/esm/effects/ReverbEffect.d.ts.map +0 -1
- package/dist/esm/effects/ReverbEffect.js +0 -117
- package/dist/esm/effects/ReverbEffect.js.map +0 -1
- package/dist/esm/effects/RingModulatorEffect.d.ts +0 -96
- package/dist/esm/effects/RingModulatorEffect.d.ts.map +0 -1
- package/dist/esm/effects/RingModulatorEffect.js +0 -157
- package/dist/esm/effects/RingModulatorEffect.js.map +0 -1
- package/dist/esm/effects/TremoloEffect.d.ts +0 -111
- package/dist/esm/effects/TremoloEffect.d.ts.map +0 -1
- package/dist/esm/effects/TremoloEffect.js +0 -197
- package/dist/esm/effects/TremoloEffect.js.map +0 -1
- package/dist/esm/effects/VocoderEffect.d.ts +0 -45
- package/dist/esm/effects/VocoderEffect.d.ts.map +0 -1
- package/dist/esm/effects/VocoderEffect.js +0 -73
- package/dist/esm/effects/VocoderEffect.js.map +0 -1
- package/dist/esm/index.d.ts +0 -25
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -24
- package/dist/esm/worklets/beat-detector.worklet.js +0 -6
- package/dist/esm/worklets/beat-detector.worklet.js.map +0 -1
- package/dist/esm/worklets/bit-crusher.worklet.js +0 -6
- package/dist/esm/worklets/bit-crusher.worklet.js.map +0 -1
- package/dist/esm/worklets/ducking.worklet.js +0 -6
- package/dist/esm/worklets/ducking.worklet.js.map +0 -1
- package/dist/esm/worklets/granular.worklet.js +0 -6
- package/dist/esm/worklets/granular.worklet.js.map +0 -1
- package/dist/esm/worklets/pcm-stream.worklet.js +0 -6
- package/dist/esm/worklets/pcm-stream.worklet.js.map +0 -1
- package/dist/esm/worklets/pitch-shift.worklet.js +0 -6
- package/dist/esm/worklets/pitch-shift.worklet.js.map +0 -1
- package/dist/esm/worklets/vocoder.worklet.js +0 -6
- package/dist/esm/worklets/vocoder.worklet.js.map +0 -1
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from "@codexo/exojs";
|
|
2
|
-
|
|
3
|
-
//#region src/effects/LimiterEffect.ts
|
|
4
|
-
/**
|
|
5
|
-
* Brick-wall limiter backed by a Web Audio `DynamicsCompressorNode` configured
|
|
6
|
-
* for hard limiting: a fixed high ratio (~20), zero knee (hard knee), and a
|
|
7
|
-
* fast attack. Use it as a final-chain safety net to prevent clipping and
|
|
8
|
-
* protect downstream output.
|
|
9
|
-
*
|
|
10
|
-
* The compressor `ratio` and `knee` default to brick-wall values (20 and 0
|
|
11
|
-
* respectively) but remain configurable, unlike a truly fixed limiter,
|
|
12
|
-
* because callers occasionally want a softer, more compressor-like limiting
|
|
13
|
-
* curve (lower ratio) or a gentler transition into limiting (larger knee)
|
|
14
|
-
* without switching to {@link CompressorEffect} and losing the dry/wet mix.
|
|
15
|
-
* The effect also exposes a dry/wet mix for API consistency and parallel
|
|
16
|
-
* processing workflows, though a fully-wet signal (`wet = 1`) is the typical
|
|
17
|
-
* configuration.
|
|
18
|
-
*
|
|
19
|
-
* Node graph:
|
|
20
|
-
* ```
|
|
21
|
-
* input(GainNode) → dryGain → output(GainNode)
|
|
22
|
-
* input → compressor → wetGain → output
|
|
23
|
-
* ```
|
|
24
|
-
* Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const limiter = new LimiterEffect({ threshold: -3, release: 0.1 });
|
|
29
|
-
* masterBus.addEffect(limiter);
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
var LimiterEffect = class extends AudioEffect {
|
|
33
|
-
_setup = null;
|
|
34
|
-
_threshold;
|
|
35
|
-
_attack;
|
|
36
|
-
_release;
|
|
37
|
-
_wet;
|
|
38
|
-
_ratio;
|
|
39
|
-
_knee;
|
|
40
|
-
_onAudioContextReady = (ctx) => {
|
|
41
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
42
|
-
this._setupNodes(ctx);
|
|
43
|
-
};
|
|
44
|
-
constructor(options = {}) {
|
|
45
|
-
super();
|
|
46
|
-
this._threshold = Math.max(-60, Math.min(0, options.threshold ?? -3));
|
|
47
|
-
this._attack = Math.max(0, Math.min(1, options.attack ?? .003));
|
|
48
|
-
this._release = Math.max(0, Math.min(1, options.release ?? .25));
|
|
49
|
-
this._wet = Math.max(0, Math.min(1, options.wet ?? 1));
|
|
50
|
-
this._ratio = Math.max(1, Math.min(20, options.ratio ?? 20));
|
|
51
|
-
this._knee = Math.max(0, Math.min(40, options.knee ?? 0));
|
|
52
|
-
if (isAudioContextReady()) this._setupNodes(getAudioContext());
|
|
53
|
-
else onAudioContextReady.add(this._onAudioContextReady);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* The node where audio enters this effect. Throws if the audio context is
|
|
57
|
-
* not yet initialized.
|
|
58
|
-
*/
|
|
59
|
-
get inputNode() {
|
|
60
|
-
if (!this._setup) throw new Error("LimiterEffect not yet initialized.");
|
|
61
|
-
return this._setup.inputGain;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* The node where audio exits this effect. Throws if the audio context is
|
|
65
|
-
* not yet initialized.
|
|
66
|
-
*/
|
|
67
|
-
get outputNode() {
|
|
68
|
-
if (!this._setup) throw new Error("LimiterEffect not yet initialized.");
|
|
69
|
-
return this._setup.outputGain;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Threshold in dBFS above which limiting is applied. Range −60..0, default −3.
|
|
73
|
-
* Changes are ramped smoothly via `setTargetAtTime`.
|
|
74
|
-
*/
|
|
75
|
-
get threshold() {
|
|
76
|
-
return this._threshold;
|
|
77
|
-
}
|
|
78
|
-
set threshold(value) {
|
|
79
|
-
this._threshold = Math.max(-60, Math.min(0, value));
|
|
80
|
-
if (this._setup) this._setup.compressor.threshold.setTargetAtTime(this._threshold, this._setup.compressor.context.currentTime, .01);
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Attack time in seconds for the limiter to engage. Range 0..1, default 0.003.
|
|
84
|
-
* Changes are ramped smoothly via `setTargetAtTime`.
|
|
85
|
-
*/
|
|
86
|
-
get attack() {
|
|
87
|
-
return this._attack;
|
|
88
|
-
}
|
|
89
|
-
set attack(value) {
|
|
90
|
-
this._attack = Math.max(0, Math.min(1, value));
|
|
91
|
-
if (this._setup) this._setup.compressor.attack.setTargetAtTime(this._attack, this._setup.compressor.context.currentTime, .01);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Release time in seconds for the limiter to disengage. Range 0..1, default 0.25.
|
|
95
|
-
* Changes are ramped smoothly via `setTargetAtTime`.
|
|
96
|
-
*/
|
|
97
|
-
get release() {
|
|
98
|
-
return this._release;
|
|
99
|
-
}
|
|
100
|
-
set release(value) {
|
|
101
|
-
this._release = Math.max(0, Math.min(1, value));
|
|
102
|
-
if (this._setup) this._setup.compressor.release.setTargetAtTime(this._release, this._setup.compressor.context.currentTime, .01);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Input-to-output dB ratio above the threshold. Range 1..20, default 20
|
|
106
|
-
* (brick-wall). Lower for a softer, more compressor-like limiter.
|
|
107
|
-
* Changes are ramped smoothly via `setTargetAtTime`.
|
|
108
|
-
*/
|
|
109
|
-
get ratio() {
|
|
110
|
-
return this._ratio;
|
|
111
|
-
}
|
|
112
|
-
set ratio(value) {
|
|
113
|
-
this._ratio = Math.max(1, Math.min(20, value));
|
|
114
|
-
if (this._setup) this._setup.compressor.ratio.setTargetAtTime(this._ratio, this._setup.compressor.context.currentTime, .01);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Width in dB of the transition region around the threshold (soft knee).
|
|
118
|
-
* Range 0..40, default 0 (hard knee). Raise for a gentler transition into
|
|
119
|
-
* limiting. Changes are ramped smoothly via `setTargetAtTime`.
|
|
120
|
-
*/
|
|
121
|
-
get knee() {
|
|
122
|
-
return this._knee;
|
|
123
|
-
}
|
|
124
|
-
set knee(value) {
|
|
125
|
-
this._knee = Math.max(0, Math.min(40, value));
|
|
126
|
-
if (this._setup) this._setup.compressor.knee.setTargetAtTime(this._knee, this._setup.compressor.context.currentTime, .01);
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Dry/wet mix level, 0..1. The dry level is automatically `1 - wet`.
|
|
130
|
-
* Changes are ramped smoothly via `setTargetAtTime`. Default 1.0.
|
|
131
|
-
*/
|
|
132
|
-
get wet() {
|
|
133
|
-
return this._wet;
|
|
134
|
-
}
|
|
135
|
-
set wet(value) {
|
|
136
|
-
this._wet = Math.max(0, Math.min(1, value));
|
|
137
|
-
if (this._setup) {
|
|
138
|
-
const ctx = this._setup.wetGain.context;
|
|
139
|
-
this._setup.wetGain.gain.setTargetAtTime(this._wet, ctx.currentTime, .01);
|
|
140
|
-
this._setup.dryGain.gain.setTargetAtTime(1 - this._wet, ctx.currentTime, .01);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
destroy() {
|
|
144
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
145
|
-
if (this._setup) {
|
|
146
|
-
this._setup.inputGain.disconnect();
|
|
147
|
-
this._setup.compressor.disconnect();
|
|
148
|
-
this._setup.dryGain.disconnect();
|
|
149
|
-
this._setup.wetGain.disconnect();
|
|
150
|
-
this._setup.outputGain.disconnect();
|
|
151
|
-
this._setup = null;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
_setupNodes(ctx) {
|
|
155
|
-
const inputGain = ctx.createGain();
|
|
156
|
-
const outputGain = ctx.createGain();
|
|
157
|
-
const compressor = ctx.createDynamicsCompressor();
|
|
158
|
-
const dryGain = ctx.createGain();
|
|
159
|
-
const wetGain = ctx.createGain();
|
|
160
|
-
inputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
161
|
-
outputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
162
|
-
dryGain.gain.setValueAtTime(1 - this._wet, ctx.currentTime);
|
|
163
|
-
wetGain.gain.setValueAtTime(this._wet, ctx.currentTime);
|
|
164
|
-
compressor.ratio.setValueAtTime(this._ratio, ctx.currentTime);
|
|
165
|
-
compressor.knee.setValueAtTime(this._knee, ctx.currentTime);
|
|
166
|
-
compressor.threshold.setValueAtTime(this._threshold, ctx.currentTime);
|
|
167
|
-
compressor.attack.setValueAtTime(this._attack, ctx.currentTime);
|
|
168
|
-
compressor.release.setValueAtTime(this._release, ctx.currentTime);
|
|
169
|
-
inputGain.connect(dryGain);
|
|
170
|
-
dryGain.connect(outputGain);
|
|
171
|
-
inputGain.connect(compressor);
|
|
172
|
-
compressor.connect(wetGain);
|
|
173
|
-
wetGain.connect(outputGain);
|
|
174
|
-
this._setup = {
|
|
175
|
-
inputGain,
|
|
176
|
-
outputGain,
|
|
177
|
-
compressor,
|
|
178
|
-
dryGain,
|
|
179
|
-
wetGain
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
//#endregion
|
|
185
|
-
export { LimiterEffect };
|
|
186
|
-
//# sourceMappingURL=LimiterEffect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LimiterEffect.js","names":[],"sources":["../../../src/effects/LimiterEffect.ts"],"sourcesContent":["import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from '@codexo/exojs';\n\n/** Construction options for {@link LimiterEffect}. */\nexport interface LimiterEffectOptions {\n /**\n * Threshold in dBFS above which limiting is applied. Range −60..0, default −3.\n */\n threshold?: number;\n /**\n * Time in seconds for the limiter to engage after the signal exceeds the\n * threshold. Range 0..1, default 0.003.\n */\n attack?: number;\n /**\n * Time in seconds for the limiter to release after the signal drops below the\n * threshold. Range 0..1, default 0.25.\n */\n release?: number;\n /**\n * Dry/wet mix, 0..1. The dry level is automatically `1 - wet`. Default 1.0.\n * A limiter is typically used fully wet, but exposing this allows parallel\n * processing workflows.\n */\n wet?: number;\n /**\n * Input-to-output dB ratio above the threshold. Range 1..20, default 20\n * (brick-wall). Lower it for a softer, more compressor-like limiter.\n */\n ratio?: number;\n /**\n * Width in dB of the transition region around the threshold (soft knee).\n * Range 0..40, default 0 (hard knee). Raise it for a gentler transition\n * into limiting.\n */\n knee?: number;\n}\n\ninterface LimiterEffectSetup {\n readonly inputGain: GainNode;\n readonly outputGain: GainNode;\n readonly compressor: DynamicsCompressorNode;\n readonly dryGain: GainNode;\n readonly wetGain: GainNode;\n}\n\n/**\n * Brick-wall limiter backed by a Web Audio `DynamicsCompressorNode` configured\n * for hard limiting: a fixed high ratio (~20), zero knee (hard knee), and a\n * fast attack. Use it as a final-chain safety net to prevent clipping and\n * protect downstream output.\n *\n * The compressor `ratio` and `knee` default to brick-wall values (20 and 0\n * respectively) but remain configurable, unlike a truly fixed limiter,\n * because callers occasionally want a softer, more compressor-like limiting\n * curve (lower ratio) or a gentler transition into limiting (larger knee)\n * without switching to {@link CompressorEffect} and losing the dry/wet mix.\n * The effect also exposes a dry/wet mix for API consistency and parallel\n * processing workflows, though a fully-wet signal (`wet = 1`) is the typical\n * configuration.\n *\n * Node graph:\n * ```\n * input(GainNode) → dryGain → output(GainNode)\n * input → compressor → wetGain → output\n * ```\n * Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`.\n *\n * @example\n * ```ts\n * const limiter = new LimiterEffect({ threshold: -3, release: 0.1 });\n * masterBus.addEffect(limiter);\n * ```\n */\nexport class LimiterEffect extends AudioEffect {\n private _setup: LimiterEffectSetup | null = null;\n private _threshold: number;\n private _attack: number;\n private _release: number;\n private _wet: number;\n private _ratio: number;\n private _knee: number;\n private readonly _onAudioContextReady = (ctx: AudioContext): void => {\n onAudioContextReady.remove(this._onAudioContextReady);\n this._setupNodes(ctx);\n };\n\n public constructor(options: LimiterEffectOptions = {}) {\n super();\n this._threshold = Math.max(-60, Math.min(0, options.threshold ?? -3));\n this._attack = Math.max(0, Math.min(1, options.attack ?? 0.003));\n this._release = Math.max(0, Math.min(1, options.release ?? 0.25));\n this._wet = Math.max(0, Math.min(1, options.wet ?? 1));\n this._ratio = Math.max(1, Math.min(20, options.ratio ?? 20));\n this._knee = Math.max(0, Math.min(40, options.knee ?? 0));\n if (isAudioContextReady()) {\n this._setupNodes(getAudioContext());\n } else {\n onAudioContextReady.add(this._onAudioContextReady);\n }\n }\n\n /**\n * The node where audio enters this effect. Throws if the audio context is\n * not yet initialized.\n */\n public get inputNode(): AudioNode {\n if (!this._setup) throw new Error('LimiterEffect not yet initialized.');\n return this._setup.inputGain;\n }\n\n /**\n * The node where audio exits this effect. Throws if the audio context is\n * not yet initialized.\n */\n public get outputNode(): AudioNode {\n if (!this._setup) throw new Error('LimiterEffect not yet initialized.');\n return this._setup.outputGain;\n }\n\n /**\n * Threshold in dBFS above which limiting is applied. Range −60..0, default −3.\n * Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get threshold(): number {\n return this._threshold;\n }\n\n public set threshold(value: number) {\n this._threshold = Math.max(-60, Math.min(0, value));\n if (this._setup) {\n this._setup.compressor.threshold.setTargetAtTime(this._threshold, this._setup.compressor.context.currentTime, 0.01);\n }\n }\n\n /**\n * Attack time in seconds for the limiter to engage. Range 0..1, default 0.003.\n * Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get attack(): number {\n return this._attack;\n }\n\n public set attack(value: number) {\n this._attack = Math.max(0, Math.min(1, value));\n if (this._setup) {\n this._setup.compressor.attack.setTargetAtTime(this._attack, this._setup.compressor.context.currentTime, 0.01);\n }\n }\n\n /**\n * Release time in seconds for the limiter to disengage. Range 0..1, default 0.25.\n * Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get release(): number {\n return this._release;\n }\n\n public set release(value: number) {\n this._release = Math.max(0, Math.min(1, value));\n if (this._setup) {\n this._setup.compressor.release.setTargetAtTime(this._release, this._setup.compressor.context.currentTime, 0.01);\n }\n }\n\n /**\n * Input-to-output dB ratio above the threshold. Range 1..20, default 20\n * (brick-wall). Lower for a softer, more compressor-like limiter.\n * Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get ratio(): number {\n return this._ratio;\n }\n\n public set ratio(value: number) {\n this._ratio = Math.max(1, Math.min(20, value));\n if (this._setup) {\n this._setup.compressor.ratio.setTargetAtTime(this._ratio, this._setup.compressor.context.currentTime, 0.01);\n }\n }\n\n /**\n * Width in dB of the transition region around the threshold (soft knee).\n * Range 0..40, default 0 (hard knee). Raise for a gentler transition into\n * limiting. Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get knee(): number {\n return this._knee;\n }\n\n public set knee(value: number) {\n this._knee = Math.max(0, Math.min(40, value));\n if (this._setup) {\n this._setup.compressor.knee.setTargetAtTime(this._knee, this._setup.compressor.context.currentTime, 0.01);\n }\n }\n\n /**\n * Dry/wet mix level, 0..1. The dry level is automatically `1 - wet`.\n * Changes are ramped smoothly via `setTargetAtTime`. Default 1.0.\n */\n public get wet(): number {\n return this._wet;\n }\n\n public set wet(value: number) {\n this._wet = Math.max(0, Math.min(1, value));\n if (this._setup) {\n const ctx = this._setup.wetGain.context;\n this._setup.wetGain.gain.setTargetAtTime(this._wet, ctx.currentTime, 0.01);\n this._setup.dryGain.gain.setTargetAtTime(1 - this._wet, ctx.currentTime, 0.01);\n }\n }\n\n public override destroy(): void {\n onAudioContextReady.remove(this._onAudioContextReady);\n if (this._setup) {\n this._setup.inputGain.disconnect();\n this._setup.compressor.disconnect();\n this._setup.dryGain.disconnect();\n this._setup.wetGain.disconnect();\n this._setup.outputGain.disconnect();\n this._setup = null;\n }\n }\n\n private _setupNodes(ctx: AudioContext): void {\n const inputGain = ctx.createGain();\n const outputGain = ctx.createGain();\n const compressor = ctx.createDynamicsCompressor();\n const dryGain = ctx.createGain();\n const wetGain = ctx.createGain();\n\n inputGain.gain.setValueAtTime(1, ctx.currentTime);\n outputGain.gain.setValueAtTime(1, ctx.currentTime);\n dryGain.gain.setValueAtTime(1 - this._wet, ctx.currentTime);\n wetGain.gain.setValueAtTime(this._wet, ctx.currentTime);\n\n // Defaults to brick-wall behaviour (high ratio, hard knee) but both remain\n // configurable - see LimiterEffectOptions.ratio / .knee.\n compressor.ratio.setValueAtTime(this._ratio, ctx.currentTime);\n compressor.knee.setValueAtTime(this._knee, ctx.currentTime);\n compressor.threshold.setValueAtTime(this._threshold, ctx.currentTime);\n compressor.attack.setValueAtTime(this._attack, ctx.currentTime);\n compressor.release.setValueAtTime(this._release, ctx.currentTime);\n\n // Dry path: input → dryGain → output\n inputGain.connect(dryGain);\n dryGain.connect(outputGain);\n\n // Wet path: input → compressor → wetGain → output\n inputGain.connect(compressor);\n compressor.connect(wetGain);\n wetGain.connect(outputGain);\n\n this._setup = { inputGain, outputGain, compressor, dryGain, wetGain };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,IAAa,gBAAb,cAAmC,YAAY;CAC7C,AAAQ,SAAoC;CAC5C,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAiB,wBAAwB,QAA4B;EACnE,oBAAoB,OAAO,KAAK,oBAAoB;EACpD,KAAK,YAAY,GAAG;CACtB;CAEA,AAAO,YAAY,UAAgC,CAAC,GA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AoB,OAAO,KAAK,oBAAoB;EACpD,IAAI,KAAK,QAAQ;GACf,KAAK,OAAO,UAAU,WAAW;GACjC,KAAK,OAAO,WAAW,WAAW;GAClC,KAAK,OAAO,QAAQ,WAAW;GAC/B,KAAK,OAAO,QAAQ,WAAW;GAC/B,KAAK,OAAO,WAAW,WAAW;GAClC,KAAK,SAAS;EAChB;CACF;CAEA,AAAQ,YAAY,KAAyB;EAC3C,MAAM,YAAY,IAAI,WAAW;EACjC,MAAM,aAAa,IAAI,WAAW;EAClC,MAAM,aAAa,IAAI,yBAAyB;EAChD,MAAM,UAAU,IAAI,WAAW;EAC/B,MAAM,UAAU,IAAI,WAAW;EAE/B,UAAU,KAAK,eAAe,GAAG,IAAI,WAAW;EAChD,WAAW,KAAK,eAAe,GAAG,IAAI,WAAW;EACjD,QAAQ,KAAK,eAAe,IAAI,KAAK,MAAM,IAAI,WAAW;EAC1D,QAAQ,KAAK,eAAe,KAAK,MAAM,IAAI,WAAW;EAItD,WAAW,MAAM,eAAe,KAAK,QAAQ,IAAI,WAAW;EAC5D,WAAW,KAAK,eAAe,KAAK,OAAO,IAAI,WAAW;EAC1D,WAAW,UAAU,eAAe,KAAK,YAAY,IAAI,WAAW;EACpE,WAAW,OAAO,eAAe,KAAK,SAAS,IAAI,WAAW;EAC9D,WAAW,QAAQ,eAAe,KAAK,UAAU,IAAI,WAAW;EAGhE,UAAU,QAAQ,OAAO;EACzB,QAAQ,QAAQ,UAAU;EAG1B,UAAU,QAAQ,UAAU;EAC5B,WAAW,QAAQ,OAAO;EAC1B,QAAQ,QAAQ,UAAU;EAE1B,KAAK,SAAS;GAAE;GAAW;GAAY;GAAY;GAAS;EAAQ;CACtE;AACF"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { AudioEffect } from '@codexo/exojs';
|
|
2
|
-
/** Construction options for {@link PhaserEffect}. */
|
|
3
|
-
export interface PhaserEffectOptions {
|
|
4
|
-
/**
|
|
5
|
-
* Number of allpass filter stages. Must be an even integer in the range
|
|
6
|
-
* 2..12. Odd values are rounded up to the next even number. Default 4.
|
|
7
|
-
*/
|
|
8
|
-
stages?: number;
|
|
9
|
-
/**
|
|
10
|
-
* LFO sweep rate in Hz. Range 0..20, default 0.5.
|
|
11
|
-
*/
|
|
12
|
-
rateHz?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Centre frequency of all allpass stages in Hz. Range 50..5000, default 500.
|
|
15
|
-
*/
|
|
16
|
-
baseFrequency?: number;
|
|
17
|
-
/**
|
|
18
|
-
* LFO modulation depth as a fraction of `baseFrequency`. Range 0..1,
|
|
19
|
-
* default 0.6. The LFO peak deviation equals `depth × baseFrequency` Hz,
|
|
20
|
-
* so the filter frequencies sweep between
|
|
21
|
-
* `baseFrequency ± depth × baseFrequency`.
|
|
22
|
-
*/
|
|
23
|
-
depth?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Feedback gain from the last stage back to the first stage. Range 0..0.9,
|
|
26
|
-
* default 0.3. Higher values add resonance and sharpen the notch sweep.
|
|
27
|
-
*/
|
|
28
|
-
feedback?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Dry/wet mix, 0..1. The dry level is automatically `1 - wet`. Default 0.5.
|
|
31
|
-
*/
|
|
32
|
-
wet?: number;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Phaser effect implemented with native Web Audio nodes (no worklet required).
|
|
36
|
-
*
|
|
37
|
-
* The wet signal passes through a cascade of allpass `BiquadFilterNode`s whose
|
|
38
|
-
* centre frequencies are swept synchronously by a sine LFO. The phase shift
|
|
39
|
-
* produced by each allpass stage creates sweeping notches when summed with the
|
|
40
|
-
* dry signal. An optional feedback path from the last stage back to the first
|
|
41
|
-
* adds resonance and sharpens the effect.
|
|
42
|
-
*
|
|
43
|
-
* Node graph:
|
|
44
|
-
* ```
|
|
45
|
-
* inputGain ┬── dryGain ───────────────────────────────────────┐
|
|
46
|
-
* │ ├── outputGain
|
|
47
|
-
* └── allpass[0] ─► ... ─► allpass[N-1] ── wetGain ───┘
|
|
48
|
-
* ▲ │
|
|
49
|
-
* └── feedbackDelay ◄── feedbackGain ◄─────────┘
|
|
50
|
-
*
|
|
51
|
-
* lfoOscillator ── lfoGain (depth × baseFrequency Hz) ──► each allpass.frequency
|
|
52
|
-
* ```
|
|
53
|
-
* Note: `feedbackDelay` is a {@link DelayNode} with `delayTime = 0`. Even at
|
|
54
|
-
* zero delay the node itself breaks the zero-latency cycle, which spec-compliant
|
|
55
|
-
* browsers (Chrome, Edge, Safari) would otherwise mute entirely.
|
|
56
|
-
* Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`;
|
|
57
|
-
* `feedbackGain.gain = feedback`; `lfoGain.gain = depth × baseFrequency`.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* const phaser = new PhaserEffect({ stages: 6, rateHz: 0.3, depth: 0.8, wet: 0.6 });
|
|
62
|
-
* bus.addEffect(phaser);
|
|
63
|
-
*
|
|
64
|
-
* // Automate the rate at runtime
|
|
65
|
-
* phaser.rateHz = 1.2;
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export declare class PhaserEffect extends AudioEffect {
|
|
69
|
-
private _setup;
|
|
70
|
-
private _stages;
|
|
71
|
-
private _rateHz;
|
|
72
|
-
private _baseFrequency;
|
|
73
|
-
private _depth;
|
|
74
|
-
private _feedback;
|
|
75
|
-
private _wet;
|
|
76
|
-
private readonly _onAudioContextReady;
|
|
77
|
-
constructor(options?: PhaserEffectOptions);
|
|
78
|
-
/**
|
|
79
|
-
* The node where audio enters this effect. Throws if the audio context is
|
|
80
|
-
* not yet initialized.
|
|
81
|
-
*/
|
|
82
|
-
get inputNode(): AudioNode;
|
|
83
|
-
/**
|
|
84
|
-
* The node where audio exits this effect. Throws if the audio context is
|
|
85
|
-
* not yet initialized.
|
|
86
|
-
*/
|
|
87
|
-
get outputNode(): AudioNode;
|
|
88
|
-
/**
|
|
89
|
-
* Number of allpass filter stages (even integer, 2..12). Set at construction
|
|
90
|
-
* time only; read-only at runtime.
|
|
91
|
-
*/
|
|
92
|
-
get stages(): number;
|
|
93
|
-
/**
|
|
94
|
-
* LFO sweep rate in Hz. Range 0..20, default 0.5. Changes are ramped
|
|
95
|
-
* smoothly via `setTargetAtTime`.
|
|
96
|
-
*/
|
|
97
|
-
get rateHz(): number;
|
|
98
|
-
set rateHz(value: number);
|
|
99
|
-
/**
|
|
100
|
-
* Centre frequency of all allpass stages in Hz. Range 50..5000, default 500.
|
|
101
|
-
* Changes are ramped smoothly and update both the filter frequencies and the
|
|
102
|
-
* absolute LFO depth.
|
|
103
|
-
*/
|
|
104
|
-
get baseFrequency(): number;
|
|
105
|
-
set baseFrequency(value: number);
|
|
106
|
-
/**
|
|
107
|
-
* LFO modulation depth as a fraction of `baseFrequency`. Range 0..1,
|
|
108
|
-
* default 0.6. Changes are ramped smoothly via `setTargetAtTime`.
|
|
109
|
-
*/
|
|
110
|
-
get depth(): number;
|
|
111
|
-
set depth(value: number);
|
|
112
|
-
/**
|
|
113
|
-
* Feedback gain from the last stage back to the first. Range 0..0.9,
|
|
114
|
-
* default 0.3. Changes are ramped smoothly via `setTargetAtTime`.
|
|
115
|
-
*/
|
|
116
|
-
get feedback(): number;
|
|
117
|
-
set feedback(value: number);
|
|
118
|
-
/**
|
|
119
|
-
* Wet (phased) mix level, 0..1. The dry level is automatically `1 - wet`.
|
|
120
|
-
* Changes are ramped smoothly via `setTargetAtTime`. Default 0.5.
|
|
121
|
-
*/
|
|
122
|
-
get wet(): number;
|
|
123
|
-
set wet(value: number);
|
|
124
|
-
destroy(): void;
|
|
125
|
-
private _setupNodes;
|
|
126
|
-
}
|
|
127
|
-
//# sourceMappingURL=PhaserEffect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PhaserEffect.d.ts","sourceRoot":"","sources":["../../../src/effects/PhaserEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,E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AAM,CAE5B;IACD,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAKhC;IAED;;;OAGG;IACH,IAAW,GAAG,IAAI,MAAM,CAEvB;IACD,IAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAO3B;IAMe,OAAO,IAAI,IAAI,CAiB9B;IAMD,OAAO,CAAC,WAAW;CA4EpB"}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from "@codexo/exojs";
|
|
2
|
-
|
|
3
|
-
//#region src/effects/PhaserEffect.ts
|
|
4
|
-
/**
|
|
5
|
-
* Phaser effect implemented with native Web Audio nodes (no worklet required).
|
|
6
|
-
*
|
|
7
|
-
* The wet signal passes through a cascade of allpass `BiquadFilterNode`s whose
|
|
8
|
-
* centre frequencies are swept synchronously by a sine LFO. The phase shift
|
|
9
|
-
* produced by each allpass stage creates sweeping notches when summed with the
|
|
10
|
-
* dry signal. An optional feedback path from the last stage back to the first
|
|
11
|
-
* adds resonance and sharpens the effect.
|
|
12
|
-
*
|
|
13
|
-
* Node graph:
|
|
14
|
-
* ```
|
|
15
|
-
* inputGain ┬── dryGain ───────────────────────────────────────┐
|
|
16
|
-
* │ ├── outputGain
|
|
17
|
-
* └── allpass[0] ─► ... ─► allpass[N-1] ── wetGain ───┘
|
|
18
|
-
* ▲ │
|
|
19
|
-
* └── feedbackDelay ◄── feedbackGain ◄─────────┘
|
|
20
|
-
*
|
|
21
|
-
* lfoOscillator ── lfoGain (depth × baseFrequency Hz) ──► each allpass.frequency
|
|
22
|
-
* ```
|
|
23
|
-
* Note: `feedbackDelay` is a {@link DelayNode} with `delayTime = 0`. Even at
|
|
24
|
-
* zero delay the node itself breaks the zero-latency cycle, which spec-compliant
|
|
25
|
-
* browsers (Chrome, Edge, Safari) would otherwise mute entirely.
|
|
26
|
-
* Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`;
|
|
27
|
-
* `feedbackGain.gain = feedback`; `lfoGain.gain = depth × baseFrequency`.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const phaser = new PhaserEffect({ stages: 6, rateHz: 0.3, depth: 0.8, wet: 0.6 });
|
|
32
|
-
* bus.addEffect(phaser);
|
|
33
|
-
*
|
|
34
|
-
* // Automate the rate at runtime
|
|
35
|
-
* phaser.rateHz = 1.2;
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
var PhaserEffect = class extends AudioEffect {
|
|
39
|
-
_setup = null;
|
|
40
|
-
_stages;
|
|
41
|
-
_rateHz;
|
|
42
|
-
_baseFrequency;
|
|
43
|
-
_depth;
|
|
44
|
-
_feedback;
|
|
45
|
-
_wet;
|
|
46
|
-
_onAudioContextReady = (ctx) => {
|
|
47
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
48
|
-
this._setupNodes(ctx);
|
|
49
|
-
};
|
|
50
|
-
constructor(options = {}) {
|
|
51
|
-
super();
|
|
52
|
-
const rawStages = Math.max(2, Math.min(12, Math.round(options.stages ?? 4)));
|
|
53
|
-
this._stages = rawStages % 2 !== 0 ? Math.min(12, rawStages + 1) : rawStages;
|
|
54
|
-
this._rateHz = Math.max(0, Math.min(20, options.rateHz ?? .5));
|
|
55
|
-
this._baseFrequency = Math.max(50, Math.min(5e3, options.baseFrequency ?? 500));
|
|
56
|
-
this._depth = Math.max(0, Math.min(1, options.depth ?? .6));
|
|
57
|
-
this._feedback = Math.max(0, Math.min(.9, options.feedback ?? .3));
|
|
58
|
-
this._wet = Math.max(0, Math.min(1, options.wet ?? .5));
|
|
59
|
-
if (isAudioContextReady()) this._setupNodes(getAudioContext());
|
|
60
|
-
else onAudioContextReady.add(this._onAudioContextReady);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* The node where audio enters this effect. Throws if the audio context is
|
|
64
|
-
* not yet initialized.
|
|
65
|
-
*/
|
|
66
|
-
get inputNode() {
|
|
67
|
-
if (!this._setup) throw new Error("PhaserEffect not yet initialized.");
|
|
68
|
-
return this._setup.inputGain;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* The node where audio exits this effect. Throws if the audio context is
|
|
72
|
-
* not yet initialized.
|
|
73
|
-
*/
|
|
74
|
-
get outputNode() {
|
|
75
|
-
if (!this._setup) throw new Error("PhaserEffect not yet initialized.");
|
|
76
|
-
return this._setup.outputGain;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Number of allpass filter stages (even integer, 2..12). Set at construction
|
|
80
|
-
* time only; read-only at runtime.
|
|
81
|
-
*/
|
|
82
|
-
get stages() {
|
|
83
|
-
return this._stages;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* LFO sweep rate in Hz. Range 0..20, default 0.5. Changes are ramped
|
|
87
|
-
* smoothly via `setTargetAtTime`.
|
|
88
|
-
*/
|
|
89
|
-
get rateHz() {
|
|
90
|
-
return this._rateHz;
|
|
91
|
-
}
|
|
92
|
-
set rateHz(value) {
|
|
93
|
-
this._rateHz = Math.max(0, Math.min(20, value));
|
|
94
|
-
if (this._setup) this._setup.lfoOscillator.frequency.setTargetAtTime(this._rateHz, this._setup.inputGain.context.currentTime, .01);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Centre frequency of all allpass stages in Hz. Range 50..5000, default 500.
|
|
98
|
-
* Changes are ramped smoothly and update both the filter frequencies and the
|
|
99
|
-
* absolute LFO depth.
|
|
100
|
-
*/
|
|
101
|
-
get baseFrequency() {
|
|
102
|
-
return this._baseFrequency;
|
|
103
|
-
}
|
|
104
|
-
set baseFrequency(value) {
|
|
105
|
-
this._baseFrequency = Math.max(50, Math.min(5e3, value));
|
|
106
|
-
if (this._setup) {
|
|
107
|
-
const ctx = this._setup.inputGain.context;
|
|
108
|
-
for (const filter of this._setup.allpassFilters) filter.frequency.setTargetAtTime(this._baseFrequency, ctx.currentTime, .01);
|
|
109
|
-
this._setup.lfoGain.gain.setTargetAtTime(this._depth * this._baseFrequency, ctx.currentTime, .01);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* LFO modulation depth as a fraction of `baseFrequency`. Range 0..1,
|
|
114
|
-
* default 0.6. Changes are ramped smoothly via `setTargetAtTime`.
|
|
115
|
-
*/
|
|
116
|
-
get depth() {
|
|
117
|
-
return this._depth;
|
|
118
|
-
}
|
|
119
|
-
set depth(value) {
|
|
120
|
-
this._depth = Math.max(0, Math.min(1, value));
|
|
121
|
-
if (this._setup) this._setup.lfoGain.gain.setTargetAtTime(this._depth * this._baseFrequency, this._setup.inputGain.context.currentTime, .01);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Feedback gain from the last stage back to the first. Range 0..0.9,
|
|
125
|
-
* default 0.3. Changes are ramped smoothly via `setTargetAtTime`.
|
|
126
|
-
*/
|
|
127
|
-
get feedback() {
|
|
128
|
-
return this._feedback;
|
|
129
|
-
}
|
|
130
|
-
set feedback(value) {
|
|
131
|
-
this._feedback = Math.max(0, Math.min(.9, value));
|
|
132
|
-
if (this._setup) this._setup.feedbackGain.gain.setTargetAtTime(this._feedback, this._setup.inputGain.context.currentTime, .01);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Wet (phased) mix level, 0..1. The dry level is automatically `1 - wet`.
|
|
136
|
-
* Changes are ramped smoothly via `setTargetAtTime`. Default 0.5.
|
|
137
|
-
*/
|
|
138
|
-
get wet() {
|
|
139
|
-
return this._wet;
|
|
140
|
-
}
|
|
141
|
-
set wet(value) {
|
|
142
|
-
this._wet = Math.max(0, Math.min(1, value));
|
|
143
|
-
if (this._setup) {
|
|
144
|
-
const ctx = this._setup.wetGain.context;
|
|
145
|
-
this._setup.wetGain.gain.setTargetAtTime(this._wet, ctx.currentTime, .01);
|
|
146
|
-
this._setup.dryGain.gain.setTargetAtTime(1 - this._wet, ctx.currentTime, .01);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
destroy() {
|
|
150
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
151
|
-
if (this._setup) {
|
|
152
|
-
this._setup.lfoOscillator.stop();
|
|
153
|
-
this._setup.lfoOscillator.disconnect();
|
|
154
|
-
this._setup.lfoGain.disconnect();
|
|
155
|
-
for (const filter of this._setup.allpassFilters) filter.disconnect();
|
|
156
|
-
this._setup.feedbackGain.disconnect();
|
|
157
|
-
this._setup.feedbackDelay.disconnect();
|
|
158
|
-
this._setup.dryGain.disconnect();
|
|
159
|
-
this._setup.wetGain.disconnect();
|
|
160
|
-
this._setup.inputGain.disconnect();
|
|
161
|
-
this._setup.outputGain.disconnect();
|
|
162
|
-
this._setup = null;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
_setupNodes(ctx) {
|
|
166
|
-
const inputGain = ctx.createGain();
|
|
167
|
-
const outputGain = ctx.createGain();
|
|
168
|
-
const dryGain = ctx.createGain();
|
|
169
|
-
const wetGain = ctx.createGain();
|
|
170
|
-
const feedbackGain = ctx.createGain();
|
|
171
|
-
const lfoGain = ctx.createGain();
|
|
172
|
-
const feedbackDelay = ctx.createDelay(1);
|
|
173
|
-
feedbackDelay.delayTime.setValueAtTime(0, ctx.currentTime);
|
|
174
|
-
inputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
175
|
-
outputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
176
|
-
dryGain.gain.setValueAtTime(1 - this._wet, ctx.currentTime);
|
|
177
|
-
wetGain.gain.setValueAtTime(this._wet, ctx.currentTime);
|
|
178
|
-
feedbackGain.gain.setValueAtTime(this._feedback, ctx.currentTime);
|
|
179
|
-
lfoGain.gain.setValueAtTime(this._depth * this._baseFrequency, ctx.currentTime);
|
|
180
|
-
const allpassFilters = [];
|
|
181
|
-
for (let i = 0; i < this._stages; i++) {
|
|
182
|
-
const filter = ctx.createBiquadFilter();
|
|
183
|
-
filter.type = "allpass";
|
|
184
|
-
filter.frequency.setValueAtTime(this._baseFrequency, ctx.currentTime);
|
|
185
|
-
allpassFilters.push(filter);
|
|
186
|
-
}
|
|
187
|
-
const lfoOscillator = ctx.createOscillator();
|
|
188
|
-
lfoOscillator.type = "sine";
|
|
189
|
-
lfoOscillator.frequency.value = this._rateHz;
|
|
190
|
-
lfoOscillator.connect(lfoGain);
|
|
191
|
-
for (const filter of allpassFilters) lfoGain.connect(filter.frequency);
|
|
192
|
-
inputGain.connect(dryGain);
|
|
193
|
-
dryGain.connect(outputGain);
|
|
194
|
-
inputGain.connect(allpassFilters[0]);
|
|
195
|
-
for (let i = 0; i < allpassFilters.length - 1; i++) allpassFilters[i].connect(allpassFilters[i + 1]);
|
|
196
|
-
allpassFilters[allpassFilters.length - 1].connect(wetGain);
|
|
197
|
-
wetGain.connect(outputGain);
|
|
198
|
-
allpassFilters[allpassFilters.length - 1].connect(feedbackGain);
|
|
199
|
-
feedbackGain.connect(feedbackDelay);
|
|
200
|
-
feedbackDelay.connect(allpassFilters[0]);
|
|
201
|
-
lfoOscillator.start();
|
|
202
|
-
this._setup = {
|
|
203
|
-
inputGain,
|
|
204
|
-
outputGain,
|
|
205
|
-
dryGain,
|
|
206
|
-
wetGain,
|
|
207
|
-
feedbackGain,
|
|
208
|
-
feedbackDelay,
|
|
209
|
-
lfoGain,
|
|
210
|
-
allpassFilters,
|
|
211
|
-
lfoOscillator
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
//#endregion
|
|
217
|
-
export { PhaserEffect };
|
|
218
|
-
//# sourceMappingURL=PhaserEffect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PhaserEffect.js","names":[],"sources":["../../../src/effects/PhaserEffect.ts"],"sourcesContent":["import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from '@codexo/exojs';\n\n/** Construction options for {@link PhaserEffect}. */\nexport interface PhaserEffectOptions {\n /**\n * Number of allpass filter stages. Must be an even integer in the range\n * 2..12. Odd values are rounded up to the next even number. Default 4.\n */\n stages?: number;\n /**\n * LFO sweep rate in Hz. Range 0..20, default 0.5.\n */\n rateHz?: number;\n /**\n * Centre frequency of all allpass stages in Hz. Range 50..5000, default 500.\n */\n baseFrequency?: number;\n /**\n * LFO modulation depth as a fraction of `baseFrequency`. Range 0..1,\n * default 0.6. The LFO peak deviation equals `depth × baseFrequency` Hz,\n * so the filter frequencies sweep between\n * `baseFrequency ± depth × baseFrequency`.\n */\n depth?: number;\n /**\n * Feedback gain from the last stage back to the first stage. Range 0..0.9,\n * default 0.3. Higher values add resonance and sharpen the notch sweep.\n */\n feedback?: number;\n /**\n * Dry/wet mix, 0..1. The dry level is automatically `1 - wet`. Default 0.5.\n */\n wet?: number;\n}\n\ninterface PhaserEffectSetup {\n readonly inputGain: GainNode;\n readonly outputGain: GainNode;\n readonly dryGain: GainNode;\n readonly wetGain: GainNode;\n readonly feedbackGain: GainNode;\n readonly feedbackDelay: DelayNode;\n readonly lfoGain: GainNode;\n readonly allpassFilters: BiquadFilterNode[];\n readonly lfoOscillator: OscillatorNode;\n}\n\n/**\n * Phaser effect implemented with native Web Audio nodes (no worklet required).\n *\n * The wet signal passes through a cascade of allpass `BiquadFilterNode`s whose\n * centre frequencies are swept synchronously by a sine LFO. The phase shift\n * produced by each allpass stage creates sweeping notches when summed with the\n * dry signal. An optional feedback path from the last stage back to the first\n * adds resonance and sharpens the effect.\n *\n * Node graph:\n * ```\n * inputGain ┬── dryGain ───────────────────────────────────────┐\n * │ ├── outputGain\n * └── allpass[0] ─► ... ─► allpass[N-1] ── wetGain ───┘\n * ▲ │\n * └── feedbackDelay ◄── feedbackGain ◄─────────┘\n *\n * lfoOscillator ── lfoGain (depth × baseFrequency Hz) ──► each allpass.frequency\n * ```\n * Note: `feedbackDelay` is a {@link DelayNode} with `delayTime = 0`. Even at\n * zero delay the node itself breaks the zero-latency cycle, which spec-compliant\n * browsers (Chrome, Edge, Safari) would otherwise mute entirely.\n * Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`;\n * `feedbackGain.gain = feedback`; `lfoGain.gain = depth × baseFrequency`.\n *\n * @example\n * ```ts\n * const phaser = new PhaserEffect({ stages: 6, rateHz: 0.3, depth: 0.8, wet: 0.6 });\n * bus.addEffect(phaser);\n *\n * // Automate the rate at runtime\n * phaser.rateHz = 1.2;\n * ```\n */\nexport class PhaserEffect extends AudioEffect {\n private _setup: PhaserEffectSetup | null = null;\n private _stages: number;\n private _rateHz: number;\n private _baseFrequency: number;\n private _depth: number;\n private _feedback: number;\n private _wet: number;\n private readonly _onAudioContextReady = (ctx: AudioContext): void => {\n onAudioContextReady.remove(this._onAudioContextReady);\n this._setupNodes(ctx);\n };\n\n public constructor(options: PhaserEffectOptions = {}) {\n super();\n const rawStages = Math.max(2, Math.min(12, Math.round(options.stages ?? 4)));\n this._stages = rawStages % 2 !== 0 ? Math.min(12, rawStages + 1) : rawStages;\n this._rateHz = Math.max(0, Math.min(20, options.rateHz ?? 0.5));\n this._baseFrequency = Math.max(50, Math.min(5000, options.baseFrequency ?? 500));\n this._depth = Math.max(0, Math.min(1, options.depth ?? 0.6));\n this._feedback = Math.max(0, Math.min(0.9, options.feedback ?? 0.3));\n this._wet = Math.max(0, Math.min(1, options.wet ?? 0.5));\n if (isAudioContextReady()) {\n this._setupNodes(getAudioContext());\n } else {\n onAudioContextReady.add(this._onAudioContextReady);\n }\n }\n\n /**\n * The node where audio enters this effect. Throws if the audio context is\n * not yet initialized.\n */\n public get inputNode(): AudioNode {\n if (!this._setup) throw new Error('PhaserEffect not yet initialized.');\n return this._setup.inputGain;\n }\n\n /**\n * The node where audio exits this effect. Throws if the audio context is\n * not yet initialized.\n */\n public get outputNode(): AudioNode {\n if (!this._setup) throw new Error('PhaserEffect not yet initialized.');\n return this._setup.outputGain;\n }\n\n // ---------------------------------------------------------------------------\n // Getters / setters\n // ---------------------------------------------------------------------------\n\n /**\n * Number of allpass filter stages (even integer, 2..12). Set at construction\n * time only; read-only at runtime.\n */\n public get stages(): number {\n return this._stages;\n }\n\n /**\n * LFO sweep rate in Hz. Range 0..20, default 0.5. Changes are ramped\n * smoothly via `setTargetAtTime`.\n */\n public get rateHz(): number {\n return this._rateHz;\n }\n public set rateHz(value: number) {\n this._rateHz = Math.max(0, Math.min(20, value));\n if (this._setup) {\n this._setup.lfoOscillator.frequency.setTargetAtTime(this._rateHz, this._setup.inputGain.context.currentTime, 0.01);\n }\n }\n\n /**\n * Centre frequency of all allpass stages in Hz. Range 50..5000, default 500.\n * Changes are ramped smoothly and update both the filter frequencies and the\n * absolute LFO depth.\n */\n public get baseFrequency(): number {\n return this._baseFrequency;\n }\n public set baseFrequency(value: number) {\n this._baseFrequency = Math.max(50, Math.min(5000, value));\n if (this._setup) {\n const ctx = this._setup.inputGain.context;\n for (const filter of this._setup.allpassFilters) {\n filter.frequency.setTargetAtTime(this._baseFrequency, ctx.currentTime, 0.01);\n }\n this._setup.lfoGain.gain.setTargetAtTime(this._depth * this._baseFrequency, ctx.currentTime, 0.01);\n }\n }\n\n /**\n * LFO modulation depth as a fraction of `baseFrequency`. Range 0..1,\n * default 0.6. Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get depth(): number {\n return this._depth;\n }\n public set depth(value: number) {\n this._depth = Math.max(0, Math.min(1, value));\n if (this._setup) {\n this._setup.lfoGain.gain.setTargetAtTime(this._depth * this._baseFrequency, this._setup.inputGain.context.currentTime, 0.01);\n }\n }\n\n /**\n * Feedback gain from the last stage back to the first. Range 0..0.9,\n * default 0.3. Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get feedback(): number {\n return this._feedback;\n }\n public set feedback(value: number) {\n this._feedback = Math.max(0, Math.min(0.9, value));\n if (this._setup) {\n this._setup.feedbackGain.gain.setTargetAtTime(this._feedback, this._setup.inputGain.context.currentTime, 0.01);\n }\n }\n\n /**\n * Wet (phased) mix level, 0..1. The dry level is automatically `1 - wet`.\n * Changes are ramped smoothly via `setTargetAtTime`. Default 0.5.\n */\n public get wet(): number {\n return this._wet;\n }\n public set wet(value: number) {\n this._wet = Math.max(0, Math.min(1, value));\n if (this._setup) {\n const ctx = this._setup.wetGain.context;\n this._setup.wetGain.gain.setTargetAtTime(this._wet, ctx.currentTime, 0.01);\n this._setup.dryGain.gain.setTargetAtTime(1 - this._wet, ctx.currentTime, 0.01);\n }\n }\n\n // ---------------------------------------------------------------------------\n // Lifecycle\n // ---------------------------------------------------------------------------\n\n public override destroy(): void {\n onAudioContextReady.remove(this._onAudioContextReady);\n if (this._setup) {\n this._setup.lfoOscillator.stop();\n this._setup.lfoOscillator.disconnect();\n this._setup.lfoGain.disconnect();\n for (const filter of this._setup.allpassFilters) {\n filter.disconnect();\n }\n this._setup.feedbackGain.disconnect();\n this._setup.feedbackDelay.disconnect();\n this._setup.dryGain.disconnect();\n this._setup.wetGain.disconnect();\n this._setup.inputGain.disconnect();\n this._setup.outputGain.disconnect();\n this._setup = null;\n }\n }\n\n // ---------------------------------------------------------------------------\n // Private\n // ---------------------------------------------------------------------------\n\n private _setupNodes(ctx: AudioContext): void {\n const inputGain = ctx.createGain();\n const outputGain = ctx.createGain();\n const dryGain = ctx.createGain();\n const wetGain = ctx.createGain();\n const feedbackGain = ctx.createGain();\n const lfoGain = ctx.createGain();\n\n // A zero-length DelayNode in the feedback path is required so that\n // spec-compliant browsers do not mute the entire allpass chain. Browsers\n // are permitted to silence feedback cycles that contain no DelayNode (i.e.\n // zero-latency cycles), so even delayTime=0 here is sufficient to make the\n // cycle legal - the DelayNode itself introduces at least one render-quantum\n // of delay regardless of its delayTime parameter.\n const feedbackDelay = ctx.createDelay(1);\n feedbackDelay.delayTime.setValueAtTime(0, ctx.currentTime);\n\n inputGain.gain.setValueAtTime(1, ctx.currentTime);\n outputGain.gain.setValueAtTime(1, ctx.currentTime);\n dryGain.gain.setValueAtTime(1 - this._wet, ctx.currentTime);\n wetGain.gain.setValueAtTime(this._wet, ctx.currentTime);\n feedbackGain.gain.setValueAtTime(this._feedback, ctx.currentTime);\n lfoGain.gain.setValueAtTime(this._depth * this._baseFrequency, ctx.currentTime);\n\n // Allpass filter cascade\n const allpassFilters: BiquadFilterNode[] = [];\n for (let i = 0; i < this._stages; i++) {\n const filter = ctx.createBiquadFilter();\n filter.type = 'allpass';\n filter.frequency.setValueAtTime(this._baseFrequency, ctx.currentTime);\n allpassFilters.push(filter);\n }\n\n // LFO oscillator\n const lfoOscillator = ctx.createOscillator();\n lfoOscillator.type = 'sine';\n lfoOscillator.frequency.value = this._rateHz;\n\n // LFO wiring: lfoOscillator → lfoGain → each allpass.frequency (AudioParam)\n lfoOscillator.connect(lfoGain);\n for (const filter of allpassFilters) {\n lfoGain.connect(filter.frequency as unknown as AudioNode);\n }\n\n // Dry path: inputGain → dryGain → outputGain\n inputGain.connect(dryGain);\n dryGain.connect(outputGain);\n\n // Wet path: inputGain → allpass[0] → ... → allpass[N-1] → wetGain → outputGain\n inputGain.connect(allpassFilters[0]!);\n for (let i = 0; i < allpassFilters.length - 1; i++) {\n allpassFilters[i]!.connect(allpassFilters[i + 1]!);\n }\n allpassFilters[allpassFilters.length - 1]!.connect(wetGain);\n wetGain.connect(outputGain);\n\n // Feedback path: allpass[N-1] → feedbackGain → feedbackDelay → allpass[0]\n // feedbackDelay breaks the zero-latency cycle so browsers do not mute the chain.\n allpassFilters[allpassFilters.length - 1]!.connect(feedbackGain);\n feedbackGain.connect(feedbackDelay);\n feedbackDelay.connect(allpassFilters[0]!);\n\n lfoOscillator.start();\n\n this._setup = {\n inputGain,\n outputGain,\n dryGain,\n wetGain,\n feedbackGain,\n feedbackDelay,\n lfoGain,\n allpassFilters,\n lfoOscillator,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,IAAa,eAAb,cAAkC,YAAY;CAC5C,AAAQ,SAAmC;CAC3C,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAiB,wBAAwB,QAA4B;EACnE,oBAAoB,OAAO,KAA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