@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,84 +0,0 @@
|
|
|
1
|
-
import { AudioEffect } from '@codexo/exojs';
|
|
2
|
-
/** Construction options for {@link PingPongDelayEffect}. */
|
|
3
|
-
export interface PingPongDelayEffectOptions {
|
|
4
|
-
/**
|
|
5
|
-
* Delay time per tap in seconds. Range 0.01..2, default 0.25.
|
|
6
|
-
*/
|
|
7
|
-
delayTime?: number;
|
|
8
|
-
/**
|
|
9
|
-
* Cross-channel feedback fraction - the portion of each delayed tap routed
|
|
10
|
-
* into the opposite channel's delay input. Range 0..0.9, default 0.4.
|
|
11
|
-
*/
|
|
12
|
-
feedback?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Dry/wet mix, 0..1. The dry level is automatically `1 - wet`. Default 0.4.
|
|
15
|
-
*/
|
|
16
|
-
wet?: number;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Stereo ping-pong delay effect using two cross-fed {@link DelayNode}s that
|
|
20
|
-
* bounce the signal alternately between left and right channels. The input
|
|
21
|
-
* feeds only the left delay; cross-feedback (L→R and R→L) then causes the
|
|
22
|
-
* signal to alternate channels on every tap, producing the characteristic L↔R
|
|
23
|
-
* slapback cascade. Each tap is routed through a {@link StereoPannerNode}
|
|
24
|
-
* panned hard left or right, maintaining hard-left / hard-right stereo
|
|
25
|
-
* separation throughout the feedback tail.
|
|
26
|
-
*
|
|
27
|
-
* Node graph:
|
|
28
|
-
* ```
|
|
29
|
-
* input(GainNode) → dryGain ────────────────────────────────── output(GainNode)
|
|
30
|
-
* input → delayL → feedbackGainA → delayR ↑
|
|
31
|
-
* delayR → feedbackGainB → delayL │
|
|
32
|
-
* delayL → pannerL (pan = -1, hard left) → wetGain ─────────┘
|
|
33
|
-
* delayR → pannerR (pan = +1, hard right) → wetGain
|
|
34
|
-
* ```
|
|
35
|
-
* Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* const pingPong = new PingPongDelayEffect({ delayTime: 0.3, feedback: 0.5, wet: 0.5 });
|
|
40
|
-
* bus.addEffect(pingPong);
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export declare class PingPongDelayEffect extends AudioEffect {
|
|
44
|
-
private _setup;
|
|
45
|
-
private _delayTime;
|
|
46
|
-
private _feedback;
|
|
47
|
-
private _wet;
|
|
48
|
-
private readonly _onAudioContextReady;
|
|
49
|
-
constructor(options?: PingPongDelayEffectOptions);
|
|
50
|
-
/**
|
|
51
|
-
* The node where audio enters this effect. Throws if the audio context is
|
|
52
|
-
* not yet initialized.
|
|
53
|
-
*/
|
|
54
|
-
get inputNode(): AudioNode;
|
|
55
|
-
/**
|
|
56
|
-
* The node where audio exits this effect. Throws if the audio context is
|
|
57
|
-
* not yet initialized.
|
|
58
|
-
*/
|
|
59
|
-
get outputNode(): AudioNode;
|
|
60
|
-
/**
|
|
61
|
-
* Delay time per tap in seconds. Both the left and right delay nodes share
|
|
62
|
-
* the same delay time. Range 0.01..2, default 0.25.
|
|
63
|
-
* Changes are ramped smoothly via `setTargetAtTime`.
|
|
64
|
-
*/
|
|
65
|
-
get delayTime(): number;
|
|
66
|
-
set delayTime(value: number);
|
|
67
|
-
/**
|
|
68
|
-
* Cross-channel feedback fraction. Each delayed tap feeds this fraction of
|
|
69
|
-
* its signal into the opposite channel's delay, sustaining the L↔R bounce.
|
|
70
|
-
* Range 0..0.9, default 0.4. Changes are ramped smoothly via
|
|
71
|
-
* `setTargetAtTime`.
|
|
72
|
-
*/
|
|
73
|
-
get feedback(): number;
|
|
74
|
-
set feedback(value: number);
|
|
75
|
-
/**
|
|
76
|
-
* Wet (ping-pong) mix level, 0..1. The dry level is automatically `1 - wet`.
|
|
77
|
-
* Changes are ramped smoothly via `setTargetAtTime`. Default 0.4.
|
|
78
|
-
*/
|
|
79
|
-
get wet(): number;
|
|
80
|
-
set wet(value: number);
|
|
81
|
-
destroy(): void;
|
|
82
|
-
private _setupNodes;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=PingPongDelayEffect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PingPongDelayEffect.d.ts","sourceRoot":"","sources":["../../../src/effects/PingPongDelayEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA6D,MAAM,eAAe,CAAC;AAEvG,4DAA4D;AAC5D,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAeD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,OAAO,CAAC,MAAM,CAAyC;IACvD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAGnC;IAEF,YAAmB,OAAO,GAAE,0BAA+B,EAU1D;IAED;;;OAGG;IACH,IAAW,SAAS,IAAI,SAAS,CAGhC;IAED;;;OAGG;IACH,IAAW,UAAU,IAAI,SAAS,CAGjC;IAED;;;;OAIG;IACH,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,EAOjC;IAED;;;;;OAKG;IACH,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAOhC;IAED;;;OAGG;IACH,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAO3B;IAEe,OAAO,IAAI,IAAI,CAe9B;IAED,OAAO,CAAC,WAAW;CA+DpB"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from "@codexo/exojs";
|
|
2
|
-
|
|
3
|
-
//#region src/effects/PingPongDelayEffect.ts
|
|
4
|
-
/**
|
|
5
|
-
* Stereo ping-pong delay effect using two cross-fed {@link DelayNode}s that
|
|
6
|
-
* bounce the signal alternately between left and right channels. The input
|
|
7
|
-
* feeds only the left delay; cross-feedback (L→R and R→L) then causes the
|
|
8
|
-
* signal to alternate channels on every tap, producing the characteristic L↔R
|
|
9
|
-
* slapback cascade. Each tap is routed through a {@link StereoPannerNode}
|
|
10
|
-
* panned hard left or right, maintaining hard-left / hard-right stereo
|
|
11
|
-
* separation throughout the feedback tail.
|
|
12
|
-
*
|
|
13
|
-
* Node graph:
|
|
14
|
-
* ```
|
|
15
|
-
* input(GainNode) → dryGain ────────────────────────────────── output(GainNode)
|
|
16
|
-
* input → delayL → feedbackGainA → delayR ↑
|
|
17
|
-
* delayR → feedbackGainB → delayL │
|
|
18
|
-
* delayL → pannerL (pan = -1, hard left) → wetGain ─────────┘
|
|
19
|
-
* delayR → pannerR (pan = +1, hard right) → wetGain
|
|
20
|
-
* ```
|
|
21
|
-
* Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const pingPong = new PingPongDelayEffect({ delayTime: 0.3, feedback: 0.5, wet: 0.5 });
|
|
26
|
-
* bus.addEffect(pingPong);
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
var PingPongDelayEffect = class extends AudioEffect {
|
|
30
|
-
_setup = null;
|
|
31
|
-
_delayTime;
|
|
32
|
-
_feedback;
|
|
33
|
-
_wet;
|
|
34
|
-
_onAudioContextReady = (ctx) => {
|
|
35
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
36
|
-
this._setupNodes(ctx);
|
|
37
|
-
};
|
|
38
|
-
constructor(options = {}) {
|
|
39
|
-
super();
|
|
40
|
-
this._delayTime = Math.max(.01, Math.min(2, options.delayTime ?? .25));
|
|
41
|
-
this._feedback = Math.max(0, Math.min(.9, options.feedback ?? .4));
|
|
42
|
-
this._wet = Math.max(0, Math.min(1, options.wet ?? .4));
|
|
43
|
-
if (isAudioContextReady()) this._setupNodes(getAudioContext());
|
|
44
|
-
else onAudioContextReady.add(this._onAudioContextReady);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The node where audio enters this effect. Throws if the audio context is
|
|
48
|
-
* not yet initialized.
|
|
49
|
-
*/
|
|
50
|
-
get inputNode() {
|
|
51
|
-
if (!this._setup) throw new Error("PingPongDelayEffect not yet initialized.");
|
|
52
|
-
return this._setup.inputGain;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* The node where audio exits this effect. Throws if the audio context is
|
|
56
|
-
* not yet initialized.
|
|
57
|
-
*/
|
|
58
|
-
get outputNode() {
|
|
59
|
-
if (!this._setup) throw new Error("PingPongDelayEffect not yet initialized.");
|
|
60
|
-
return this._setup.outputGain;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Delay time per tap in seconds. Both the left and right delay nodes share
|
|
64
|
-
* the same delay time. Range 0.01..2, default 0.25.
|
|
65
|
-
* Changes are ramped smoothly via `setTargetAtTime`.
|
|
66
|
-
*/
|
|
67
|
-
get delayTime() {
|
|
68
|
-
return this._delayTime;
|
|
69
|
-
}
|
|
70
|
-
set delayTime(value) {
|
|
71
|
-
this._delayTime = Math.max(.01, Math.min(2, value));
|
|
72
|
-
if (this._setup) {
|
|
73
|
-
const time = this._setup.delayL.context.currentTime;
|
|
74
|
-
this._setup.delayL.delayTime.setTargetAtTime(this._delayTime, time, .01);
|
|
75
|
-
this._setup.delayR.delayTime.setTargetAtTime(this._delayTime, time, .01);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Cross-channel feedback fraction. Each delayed tap feeds this fraction of
|
|
80
|
-
* its signal into the opposite channel's delay, sustaining the L↔R bounce.
|
|
81
|
-
* Range 0..0.9, default 0.4. Changes are ramped smoothly via
|
|
82
|
-
* `setTargetAtTime`.
|
|
83
|
-
*/
|
|
84
|
-
get feedback() {
|
|
85
|
-
return this._feedback;
|
|
86
|
-
}
|
|
87
|
-
set feedback(value) {
|
|
88
|
-
this._feedback = Math.max(0, Math.min(.9, value));
|
|
89
|
-
if (this._setup) {
|
|
90
|
-
const time = this._setup.feedbackGainA.context.currentTime;
|
|
91
|
-
this._setup.feedbackGainA.gain.setTargetAtTime(this._feedback, time, .01);
|
|
92
|
-
this._setup.feedbackGainB.gain.setTargetAtTime(this._feedback, time, .01);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Wet (ping-pong) mix level, 0..1. The dry level is automatically `1 - wet`.
|
|
97
|
-
* Changes are ramped smoothly via `setTargetAtTime`. Default 0.4.
|
|
98
|
-
*/
|
|
99
|
-
get wet() {
|
|
100
|
-
return this._wet;
|
|
101
|
-
}
|
|
102
|
-
set wet(value) {
|
|
103
|
-
this._wet = Math.max(0, Math.min(1, value));
|
|
104
|
-
if (this._setup) {
|
|
105
|
-
const ctx = this._setup.wetGain.context;
|
|
106
|
-
this._setup.wetGain.gain.setTargetAtTime(this._wet, ctx.currentTime, .01);
|
|
107
|
-
this._setup.dryGain.gain.setTargetAtTime(1 - this._wet, ctx.currentTime, .01);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
destroy() {
|
|
111
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
112
|
-
if (this._setup) {
|
|
113
|
-
this._setup.inputGain.disconnect();
|
|
114
|
-
this._setup.outputGain.disconnect();
|
|
115
|
-
this._setup.dryGain.disconnect();
|
|
116
|
-
this._setup.wetGain.disconnect();
|
|
117
|
-
this._setup.feedbackGainA.disconnect();
|
|
118
|
-
this._setup.feedbackGainB.disconnect();
|
|
119
|
-
this._setup.delayL.disconnect();
|
|
120
|
-
this._setup.delayR.disconnect();
|
|
121
|
-
this._setup.pannerL.disconnect();
|
|
122
|
-
this._setup.pannerR.disconnect();
|
|
123
|
-
this._setup = null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
_setupNodes(ctx) {
|
|
127
|
-
const inputGain = ctx.createGain();
|
|
128
|
-
const outputGain = ctx.createGain();
|
|
129
|
-
const dryGain = ctx.createGain();
|
|
130
|
-
const wetGain = ctx.createGain();
|
|
131
|
-
const feedbackGainA = ctx.createGain();
|
|
132
|
-
const feedbackGainB = ctx.createGain();
|
|
133
|
-
const delayL = ctx.createDelay(2);
|
|
134
|
-
const delayR = ctx.createDelay(2);
|
|
135
|
-
const pannerL = ctx.createStereoPanner();
|
|
136
|
-
const pannerR = ctx.createStereoPanner();
|
|
137
|
-
inputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
138
|
-
outputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
139
|
-
dryGain.gain.setValueAtTime(1 - this._wet, ctx.currentTime);
|
|
140
|
-
wetGain.gain.setValueAtTime(this._wet, ctx.currentTime);
|
|
141
|
-
feedbackGainA.gain.setValueAtTime(this._feedback, ctx.currentTime);
|
|
142
|
-
feedbackGainB.gain.setValueAtTime(this._feedback, ctx.currentTime);
|
|
143
|
-
delayL.delayTime.setValueAtTime(this._delayTime, ctx.currentTime);
|
|
144
|
-
delayR.delayTime.setValueAtTime(this._delayTime, ctx.currentTime);
|
|
145
|
-
pannerL.pan.value = -1;
|
|
146
|
-
pannerR.pan.value = 1;
|
|
147
|
-
inputGain.connect(dryGain);
|
|
148
|
-
dryGain.connect(outputGain);
|
|
149
|
-
inputGain.connect(delayL);
|
|
150
|
-
delayL.connect(feedbackGainA);
|
|
151
|
-
feedbackGainA.connect(delayR);
|
|
152
|
-
delayR.connect(feedbackGainB);
|
|
153
|
-
feedbackGainB.connect(delayL);
|
|
154
|
-
delayL.connect(pannerL);
|
|
155
|
-
delayR.connect(pannerR);
|
|
156
|
-
pannerL.connect(wetGain);
|
|
157
|
-
pannerR.connect(wetGain);
|
|
158
|
-
wetGain.connect(outputGain);
|
|
159
|
-
this._setup = {
|
|
160
|
-
inputGain,
|
|
161
|
-
outputGain,
|
|
162
|
-
dryGain,
|
|
163
|
-
wetGain,
|
|
164
|
-
feedbackGainA,
|
|
165
|
-
feedbackGainB,
|
|
166
|
-
delayL,
|
|
167
|
-
delayR,
|
|
168
|
-
pannerL,
|
|
169
|
-
pannerR
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
//#endregion
|
|
175
|
-
export { PingPongDelayEffect };
|
|
176
|
-
//# sourceMappingURL=PingPongDelayEffect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PingPongDelayEffect.js","names":[],"sources":["../../../src/effects/PingPongDelayEffect.ts"],"sourcesContent":["import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from '@codexo/exojs';\n\n/** Construction options for {@link PingPongDelayEffect}. */\nexport interface PingPongDelayEffectOptions {\n /**\n * Delay time per tap in seconds. Range 0.01..2, default 0.25.\n */\n delayTime?: number;\n /**\n * Cross-channel feedback fraction - the portion of each delayed tap routed\n * into the opposite channel's delay input. Range 0..0.9, default 0.4.\n */\n feedback?: number;\n /**\n * Dry/wet mix, 0..1. The dry level is automatically `1 - wet`. Default 0.4.\n */\n wet?: number;\n}\n\ninterface PingPongDelayEffectSetup {\n readonly inputGain: GainNode;\n readonly outputGain: GainNode;\n readonly dryGain: GainNode;\n readonly wetGain: GainNode;\n readonly feedbackGainA: GainNode;\n readonly feedbackGainB: GainNode;\n readonly delayL: DelayNode;\n readonly delayR: DelayNode;\n readonly pannerL: StereoPannerNode;\n readonly pannerR: StereoPannerNode;\n}\n\n/**\n * Stereo ping-pong delay effect using two cross-fed {@link DelayNode}s that\n * bounce the signal alternately between left and right channels. The input\n * feeds only the left delay; cross-feedback (L→R and R→L) then causes the\n * signal to alternate channels on every tap, producing the characteristic L↔R\n * slapback cascade. Each tap is routed through a {@link StereoPannerNode}\n * panned hard left or right, maintaining hard-left / hard-right stereo\n * separation throughout the feedback tail.\n *\n * Node graph:\n * ```\n * input(GainNode) → dryGain ────────────────────────────────── output(GainNode)\n * input → delayL → feedbackGainA → delayR ↑\n * delayR → feedbackGainB → delayL │\n * delayL → pannerL (pan = -1, hard left) → wetGain ─────────┘\n * delayR → pannerR (pan = +1, hard right) → wetGain\n * ```\n * Gains: `dryGain.gain = 1 - wet`; `wetGain.gain = wet`.\n *\n * @example\n * ```ts\n * const pingPong = new PingPongDelayEffect({ delayTime: 0.3, feedback: 0.5, wet: 0.5 });\n * bus.addEffect(pingPong);\n * ```\n */\nexport class PingPongDelayEffect extends AudioEffect {\n private _setup: PingPongDelayEffectSetup | null = null;\n private _delayTime: 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: PingPongDelayEffectOptions = {}) {\n super();\n this._delayTime = Math.max(0.01, Math.min(2, options.delayTime ?? 0.25));\n this._feedback = Math.max(0, Math.min(0.9, options.feedback ?? 0.4));\n this._wet = Math.max(0, Math.min(1, options.wet ?? 0.4));\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('PingPongDelayEffect 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('PingPongDelayEffect not yet initialized.');\n return this._setup.outputGain;\n }\n\n /**\n * Delay time per tap in seconds. Both the left and right delay nodes share\n * the same delay time. Range 0.01..2, default 0.25.\n * Changes are ramped smoothly via `setTargetAtTime`.\n */\n public get delayTime(): number {\n return this._delayTime;\n }\n\n public set delayTime(value: number) {\n this._delayTime = Math.max(0.01, Math.min(2, value));\n if (this._setup) {\n const time = this._setup.delayL.context.currentTime;\n this._setup.delayL.delayTime.setTargetAtTime(this._delayTime, time, 0.01);\n this._setup.delayR.delayTime.setTargetAtTime(this._delayTime, time, 0.01);\n }\n }\n\n /**\n * Cross-channel feedback fraction. Each delayed tap feeds this fraction of\n * its signal into the opposite channel's delay, sustaining the L↔R bounce.\n * Range 0..0.9, default 0.4. Changes are ramped smoothly via\n * `setTargetAtTime`.\n */\n public get feedback(): number {\n return this._feedback;\n }\n\n public set feedback(value: number) {\n this._feedback = Math.max(0, Math.min(0.9, value));\n if (this._setup) {\n const time = this._setup.feedbackGainA.context.currentTime;\n this._setup.feedbackGainA.gain.setTargetAtTime(this._feedback, time, 0.01);\n this._setup.feedbackGainB.gain.setTargetAtTime(this._feedback, time, 0.01);\n }\n }\n\n /**\n * Wet (ping-pong) mix level, 0..1. The dry level is automatically `1 - wet`.\n * Changes are ramped smoothly via `setTargetAtTime`. Default 0.4.\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.outputGain.disconnect();\n this._setup.dryGain.disconnect();\n this._setup.wetGain.disconnect();\n this._setup.feedbackGainA.disconnect();\n this._setup.feedbackGainB.disconnect();\n this._setup.delayL.disconnect();\n this._setup.delayR.disconnect();\n this._setup.pannerL.disconnect();\n this._setup.pannerR.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 dryGain = ctx.createGain();\n const wetGain = ctx.createGain();\n const feedbackGainA = ctx.createGain();\n const feedbackGainB = ctx.createGain();\n const delayL = ctx.createDelay(2);\n const delayR = ctx.createDelay(2);\n const pannerL = ctx.createStereoPanner();\n const pannerR = ctx.createStereoPanner();\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 feedbackGainA.gain.setValueAtTime(this._feedback, ctx.currentTime);\n feedbackGainB.gain.setValueAtTime(this._feedback, ctx.currentTime);\n delayL.delayTime.setValueAtTime(this._delayTime, ctx.currentTime);\n delayR.delayTime.setValueAtTime(this._delayTime, ctx.currentTime);\n\n // Hard-pan each tap to its respective stereo channel.\n pannerL.pan.value = -1;\n pannerR.pan.value = 1;\n\n // Dry path: input → dryGain → output\n inputGain.connect(dryGain);\n dryGain.connect(outputGain);\n\n // Wet path: input feeds only the left delay.\n // Feeding both delays symmetrically would produce identical L/R evolution\n // (no ping-pong). The cross-feedback edges below route each tap into the\n // opposite channel's delay, creating the alternating L↔R slapback.\n inputGain.connect(delayL);\n\n // Cross-feedback: L → R and R → L\n delayL.connect(feedbackGainA);\n feedbackGainA.connect(delayR);\n delayR.connect(feedbackGainB);\n feedbackGainB.connect(delayL);\n\n // Pan taps: delayL → pannerL (hard left), delayR → pannerR (hard right)\n delayL.connect(pannerL);\n delayR.connect(pannerR);\n\n // Wet output: panned taps sum into wetGain → output\n pannerL.connect(wetGain);\n pannerR.connect(wetGain);\n wetGain.connect(outputGain);\n\n this._setup = {\n inputGain,\n outputGain,\n dryGain,\n wetGain,\n feedbackGainA,\n feedbackGainB,\n delayL,\n delayR,\n pannerL,\n pannerR,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAa,sBAAb,cAAyC,YAAY;CACnD,AAAQ,SAA0C;CAClD,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAiB,wBAAwB,QAA4B;EACnE,oBAAoB,OAAO,KAAK,oBAAoB;EACpD,KAAK,YAAY,GAAG;CACtB;CAEA,AAAO,YAAY,UAAsC,CAAC,GAAG;EAC3D,MAAM;EACN,KAAK,aAAa,KAAK,IAAI,KAAM,KAAK,IAAI,GAAG,QAAQ,aAAa,GAAI,CAAC;EACvE,KAAK,YAAY,KAAK,IAAI,GAAG,KAAK,IAAI,IAAK,QAAQ,YAAY,EAAG,CAAC;EACnE,KAAK,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,QAAQ,OAAO,EAAG,CAAC;EACvD,IAAI,oBAAoB,GACtB,KAAK,YAAY,gBAAgB,CAAC;OAElC,oBAAoB,IAAI,KAAK,oBAAoB;CAErD;;;;;CAMA,IAAW,YAAuB;EAChC,IAAI,CAAC,KAAK,QAAQ,MAAM,IAAI,MAAM,0CAA0C;EAC5E,OAAO,KAAK,OAAO;CACrB;;;;;CAMA,IAAW,aAAwB;EACjC,IAAI,CAAC,KAAK,QAAQ,MAAM,IAAI,MAAM,0CAA0C;EAC5E,OAAO,KAAK,OAAO;CACrB;;;;;;CAOA,IAAW,YAAoB;EAC7B,OAAO,KAAK;CACd;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AAQ,OAAO;EACvB,QAAQ,QAAQ,OAAO;EACvB,QAAQ,QAAQ,UAAU;EAE1B,KAAK,SAAS;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;AACF"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { WorkletEffect } from '@codexo/exojs';
|
|
2
|
-
export interface PitchShiftEffectOptions {
|
|
3
|
-
/** Pitch ratio. 1.0 = no change, 0.5 = octave down, 2.0 = octave up. Default 1.0. */
|
|
4
|
-
pitch?: number;
|
|
5
|
-
/** Dry/wet mix, 0..1. Default 1.0 (full wet). */
|
|
6
|
-
wet?: number;
|
|
7
|
-
/**
|
|
8
|
-
* Internal SOLA frame size in samples. Default 1024 (~21ms at 48kHz).
|
|
9
|
-
* Larger = more latency but better low-frequency alignment; smaller = lower
|
|
10
|
-
* latency but coarser correlation. The correlation search radius scales with it.
|
|
11
|
-
*/
|
|
12
|
-
grainSize?: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Real-time pitch shifter (WorkletEffect) using SOLA - synchronized
|
|
16
|
-
* overlap-add. Each synthesis grain is realigned by waveform cross-correlation,
|
|
17
|
-
* so grain restarts stay phase coherent and the output pitch tracks the `pitch`
|
|
18
|
-
* ratio exactly across the whole 0.25x-4.0x range (a naive granular delay drifts
|
|
19
|
-
* the pitch instead).
|
|
20
|
-
*
|
|
21
|
-
* Quality: clean, in-tune shifting for tonal material. As with any time-domain
|
|
22
|
-
* method, sharp transients can smear or double slightly; for those a phase
|
|
23
|
-
* vocoder would do better at the cost of much more CPU and latency.
|
|
24
|
-
*
|
|
25
|
-
* Latency: ~one frame + search ≈ 30ms at the default 1024-sample grain
|
|
26
|
-
* (at 48kHz). Not suitable for live monitoring; fine for games / playback.
|
|
27
|
-
*
|
|
28
|
-
* Use cases:
|
|
29
|
-
* - Sound variation: random ±200 cent pitch on each footstep / bullet
|
|
30
|
-
* - Voice effects: chipmunk (1.5x) or demon (0.7x) for game NPCs
|
|
31
|
-
* - Detune layering: stack 0.99x and 1.01x for thick chorused sound
|
|
32
|
-
*/
|
|
33
|
-
export declare class PitchShiftEffect extends WorkletEffect {
|
|
34
|
-
private _pitch;
|
|
35
|
-
private readonly _grainSize;
|
|
36
|
-
constructor(options?: PitchShiftEffectOptions);
|
|
37
|
-
protected get _workletName(): string;
|
|
38
|
-
protected get _workletSource(): string;
|
|
39
|
-
protected get _dryLatencySeconds(): number;
|
|
40
|
-
protected get _workletOptions(): AudioWorkletNodeOptions;
|
|
41
|
-
protected _onWorkletReady(): void;
|
|
42
|
-
/** Pitch ratio relative to the original. 1.0 = no change, 0.5 = one octave down, 2.0 = one octave up. Range 0.25..4.0, default 1.0. */
|
|
43
|
-
get pitch(): number;
|
|
44
|
-
set pitch(value: number);
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=PitchShiftEffect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PitchShiftEffect.d.ts","sourceRoot":"","sources":["../../../src/effects/PitchShiftEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,MAAM,WAAW,uBAAuB;IACtC,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;IACjD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IAEpC,YAAmB,OAAO,GAAE,uBAA4B,EAKvD;IAED,SAAS,KAAK,YAAY,IAAI,MAAM,CAEnC;IAED,SAAS,KAAK,cAAc,IAAI,MAAM,CAErC;IAED,cAAuB,kBAAkB,IAAI,MAAM,CAIlD;IAED,cAAuB,eAAe,IAAI,uBAAuB,CAMhE;IAED,UAAmB,eAAe,IAAI,IAAI,CAEzC;IAED,uIAAuI;IACvI,IAAW,KAAK,IAAI,MAAM,CAEzB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;CACF"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import pitch_shift_worklet_default from "../worklets/pitch-shift.worklet.js";
|
|
2
|
-
import { WorkletEffect } from "@codexo/exojs";
|
|
3
|
-
|
|
4
|
-
//#region src/effects/PitchShiftEffect.ts
|
|
5
|
-
/**
|
|
6
|
-
* Real-time pitch shifter (WorkletEffect) using SOLA - synchronized
|
|
7
|
-
* overlap-add. Each synthesis grain is realigned by waveform cross-correlation,
|
|
8
|
-
* so grain restarts stay phase coherent and the output pitch tracks the `pitch`
|
|
9
|
-
* ratio exactly across the whole 0.25x-4.0x range (a naive granular delay drifts
|
|
10
|
-
* the pitch instead).
|
|
11
|
-
*
|
|
12
|
-
* Quality: clean, in-tune shifting for tonal material. As with any time-domain
|
|
13
|
-
* method, sharp transients can smear or double slightly; for those a phase
|
|
14
|
-
* vocoder would do better at the cost of much more CPU and latency.
|
|
15
|
-
*
|
|
16
|
-
* Latency: ~one frame + search ≈ 30ms at the default 1024-sample grain
|
|
17
|
-
* (at 48kHz). Not suitable for live monitoring; fine for games / playback.
|
|
18
|
-
*
|
|
19
|
-
* Use cases:
|
|
20
|
-
* - Sound variation: random ±200 cent pitch on each footstep / bullet
|
|
21
|
-
* - Voice effects: chipmunk (1.5x) or demon (0.7x) for game NPCs
|
|
22
|
-
* - Detune layering: stack 0.99x and 1.01x for thick chorused sound
|
|
23
|
-
*/
|
|
24
|
-
var PitchShiftEffect = class extends WorkletEffect {
|
|
25
|
-
_pitch;
|
|
26
|
-
_grainSize;
|
|
27
|
-
constructor(options = {}) {
|
|
28
|
-
super();
|
|
29
|
-
this._pitch = Math.max(.25, Math.min(4, options.pitch ?? 1));
|
|
30
|
-
this._grainSize = options.grainSize ?? 1024;
|
|
31
|
-
this.wet = options.wet ?? 1;
|
|
32
|
-
}
|
|
33
|
-
get _workletName() {
|
|
34
|
-
return "exojs-pitch-shift";
|
|
35
|
-
}
|
|
36
|
-
get _workletSource() {
|
|
37
|
-
return pitch_shift_worklet_default;
|
|
38
|
-
}
|
|
39
|
-
get _dryLatencySeconds() {
|
|
40
|
-
return (this._grainSize + (this._grainSize >> 2)) / this._sampleRate;
|
|
41
|
-
}
|
|
42
|
-
get _workletOptions() {
|
|
43
|
-
return {
|
|
44
|
-
numberOfInputs: 1,
|
|
45
|
-
numberOfOutputs: 1,
|
|
46
|
-
processorOptions: { grainSize: this._grainSize }
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
_onWorkletReady() {
|
|
50
|
-
this._setAudioParam("pitch", this._pitch);
|
|
51
|
-
}
|
|
52
|
-
/** Pitch ratio relative to the original. 1.0 = no change, 0.5 = one octave down, 2.0 = one octave up. Range 0.25..4.0, default 1.0. */
|
|
53
|
-
get pitch() {
|
|
54
|
-
return this._pitch;
|
|
55
|
-
}
|
|
56
|
-
set pitch(value) {
|
|
57
|
-
this._pitch = Math.max(.25, Math.min(4, value));
|
|
58
|
-
this._setAudioParam("pitch", this._pitch);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
export { PitchShiftEffect };
|
|
64
|
-
//# sourceMappingURL=PitchShiftEffect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PitchShiftEffect.js","names":["pitchShiftWorkletSource"],"sources":["../../../src/effects/PitchShiftEffect.ts"],"sourcesContent":["import { WorkletEffect } from '@codexo/exojs';\n\nimport pitchShiftWorkletSource from '../worklets/pitch-shift.worklet.ts?worklet';\n\nexport interface PitchShiftEffectOptions {\n /** Pitch ratio. 1.0 = no change, 0.5 = octave down, 2.0 = octave up. Default 1.0. */\n pitch?: number;\n /** Dry/wet mix, 0..1. Default 1.0 (full wet). */\n wet?: number;\n /**\n * Internal SOLA frame size in samples. Default 1024 (~21ms at 48kHz).\n * Larger = more latency but better low-frequency alignment; smaller = lower\n * latency but coarser correlation. The correlation search radius scales with it.\n */\n grainSize?: number;\n}\n\n/**\n * Real-time pitch shifter (WorkletEffect) using SOLA - synchronized\n * overlap-add. Each synthesis grain is realigned by waveform cross-correlation,\n * so grain restarts stay phase coherent and the output pitch tracks the `pitch`\n * ratio exactly across the whole 0.25x-4.0x range (a naive granular delay drifts\n * the pitch instead).\n *\n * Quality: clean, in-tune shifting for tonal material. As with any time-domain\n * method, sharp transients can smear or double slightly; for those a phase\n * vocoder would do better at the cost of much more CPU and latency.\n *\n * Latency: ~one frame + search ≈ 30ms at the default 1024-sample grain\n * (at 48kHz). Not suitable for live monitoring; fine for games / playback.\n *\n * Use cases:\n * - Sound variation: random ±200 cent pitch on each footstep / bullet\n * - Voice effects: chipmunk (1.5x) or demon (0.7x) for game NPCs\n * - Detune layering: stack 0.99x and 1.01x for thick chorused sound\n */\nexport class PitchShiftEffect extends WorkletEffect {\n private _pitch: number;\n private readonly _grainSize: number;\n\n public constructor(options: PitchShiftEffectOptions = {}) {\n super();\n this._pitch = Math.max(0.25, Math.min(4, options.pitch ?? 1));\n this._grainSize = options.grainSize ?? 1024;\n this.wet = options.wet ?? 1;\n }\n\n protected get _workletName(): string {\n return 'exojs-pitch-shift';\n }\n\n protected get _workletSource(): string {\n return pitchShiftWorkletSource;\n }\n\n protected override get _dryLatencySeconds(): number {\n // SOLA algorithmic latency ≈ one analysis frame + the correlation search\n // radius (grainSize/4). Tuned against the wet=0.5 comb-filter test below.\n return (this._grainSize + (this._grainSize >> 2)) / this._sampleRate;\n }\n\n protected override get _workletOptions(): AudioWorkletNodeOptions {\n return {\n numberOfInputs: 1,\n numberOfOutputs: 1,\n processorOptions: { grainSize: this._grainSize },\n };\n }\n\n protected override _onWorkletReady(): void {\n this._setAudioParam('pitch', this._pitch);\n }\n\n /** Pitch ratio relative to the original. 1.0 = no change, 0.5 = one octave down, 2.0 = one octave up. Range 0.25..4.0, default 1.0. */\n public get pitch(): number {\n return this._pitch;\n }\n public set pitch(value: number) {\n this._pitch = Math.max(0.25, Math.min(4, value));\n this._setAudioParam('pitch', this._pitch);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,mBAAb,cAAsC,cAAc;CAClD,AAAQ;CACR,AAAiB;CAEjB,AAAO,YAAY,UAAmC,CAAC,GAAG;EACxD,MAAM;EACN,KAAK,SAAS,KAAK,IAAI,KAAM,KAAK,IAAI,GAAG,QAAQ,SAAS,CAAC,CAAC;EAC5D,KAAK,aAAa,QAAQ,aAAa;EACvC,KAAK,MAAM,QAAQ,OAAO;CAC5B;CAEA,IAAc,eAAuB;EACnC,OAAO;CACT;CAEA,IAAc,iBAAyB;EACrC,OAAOA;CACT;CAEA,IAAuB,qBAA6B;EAGlD,QAAQ,KAAK,cAAc,KAAK,cAAc,MAAM,KAAK;CAC3D;CAEA,IAAuB,kBAA2C;EAChE,OAAO;GACL,gBAAgB;GAChB,iBAAiB;GACjB,kBAAkB,EAAE,WAAW,KAAK,WAAW;EACjD;CACF;CAEA,AAAmB,kBAAwB;EACzC,KAAK,eAAe,SAAS,KAAK,MAAM;CAC1C;;CAGA,IAAW,QAAgB;EACzB,OAAO,KAAK;CACd;CACA,IAAW,MAAM,OAAe;EAC9B,KAAK,SAAS,KAAK,IAAI,KAAM,KAAK,IAAI,GAAG,KAAK,CAAC;EAC/C,KAAK,eAAe,SAAS,KAAK,MAAM;CAC1C;AACF"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AudioEffect } from '@codexo/exojs';
|
|
2
|
-
/** Construction options for {@link ReverbEffect}. */
|
|
3
|
-
export interface ReverbEffectOptions {
|
|
4
|
-
durationSeconds?: number;
|
|
5
|
-
decay?: number;
|
|
6
|
-
wet?: number;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Convolution reverb using a procedurally-generated impulse response loaded
|
|
10
|
-
* into a `ConvolverNode`. The impulse response is a stereo noise burst whose
|
|
11
|
-
* amplitude decays exponentially, simulating room reflections. Adjusting
|
|
12
|
-
* `durationSeconds` or `decay` rebuilds the impulse response immediately, so
|
|
13
|
-
* avoid animating these properties at audio rate - use `wet` for real-time
|
|
14
|
-
* mix control instead.
|
|
15
|
-
*/
|
|
16
|
-
export declare class ReverbEffect extends AudioEffect {
|
|
17
|
-
private _setup;
|
|
18
|
-
private _duration;
|
|
19
|
-
private readonly _onAudioContextReady;
|
|
20
|
-
private _decay;
|
|
21
|
-
private _wet;
|
|
22
|
-
constructor(options?: ReverbEffectOptions);
|
|
23
|
-
get inputNode(): AudioNode;
|
|
24
|
-
get outputNode(): AudioNode;
|
|
25
|
-
/** Length of the generated impulse response in seconds. Range 0.1..5, default 2. Changing this rebuilds the IR buffer. */
|
|
26
|
-
get durationSeconds(): number;
|
|
27
|
-
set durationSeconds(value: number);
|
|
28
|
-
/** Exponential decay rate of the impulse response. Higher values produce a tighter, drier reverb tail. Range 0.5..10, default 2. Changing this rebuilds the IR buffer. */
|
|
29
|
-
get decay(): number;
|
|
30
|
-
set decay(value: number);
|
|
31
|
-
/** Wet (reverberated) mix level, 0..1. The dry level is automatically `1 - wet`. Default 0.4. */
|
|
32
|
-
get wet(): number;
|
|
33
|
-
set wet(value: number);
|
|
34
|
-
destroy(): void;
|
|
35
|
-
private _generateImpulseResponse;
|
|
36
|
-
private _setupNodes;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=ReverbEffect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReverbEffect.d.ts","sourceRoot":"","sources":["../../../src/effects/ReverbEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA6D,MAAM,eAAe,CAAC;AAEvG,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAUD;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAGnC;IACF,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAS;IAErB,YAAmB,OAAO,GAAE,mBAAwB,EAUnD;IAED,IAAW,SAAS,IAAI,SAAS,CAGhC;IAED,IAAW,UAAU,IAAI,SAAS,CAGjC;IAED,0HAA0H;IAC1H,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,MAAM,EAKvC;IAED,0KAA0K;IAC1K,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAK7B;IAED,iGAAiG;IACjG,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED,IAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAO3B;IAEe,OAAO,IAAI,IAAI,CAU9B;IAED,OAAO,CAAC,wBAAwB;IAchC,OAAO,CAAC,WAAW;CAyBpB"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from "@codexo/exojs";
|
|
2
|
-
|
|
3
|
-
//#region src/effects/ReverbEffect.ts
|
|
4
|
-
/**
|
|
5
|
-
* Convolution reverb using a procedurally-generated impulse response loaded
|
|
6
|
-
* into a `ConvolverNode`. The impulse response is a stereo noise burst whose
|
|
7
|
-
* amplitude decays exponentially, simulating room reflections. Adjusting
|
|
8
|
-
* `durationSeconds` or `decay` rebuilds the impulse response immediately, so
|
|
9
|
-
* avoid animating these properties at audio rate - use `wet` for real-time
|
|
10
|
-
* mix control instead.
|
|
11
|
-
*/
|
|
12
|
-
var ReverbEffect = class extends AudioEffect {
|
|
13
|
-
_setup = null;
|
|
14
|
-
_duration;
|
|
15
|
-
_onAudioContextReady = (ctx) => {
|
|
16
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
17
|
-
this._setupNodes(ctx);
|
|
18
|
-
};
|
|
19
|
-
_decay;
|
|
20
|
-
_wet;
|
|
21
|
-
constructor(options = {}) {
|
|
22
|
-
super();
|
|
23
|
-
this._duration = Math.max(.1, Math.min(5, options.durationSeconds ?? 2));
|
|
24
|
-
this._decay = Math.max(.5, Math.min(10, options.decay ?? 2));
|
|
25
|
-
this._wet = Math.max(0, Math.min(1, options.wet ?? .4));
|
|
26
|
-
if (isAudioContextReady()) this._setupNodes(getAudioContext());
|
|
27
|
-
else onAudioContextReady.add(this._onAudioContextReady);
|
|
28
|
-
}
|
|
29
|
-
get inputNode() {
|
|
30
|
-
if (!this._setup) throw new Error("ReverbEffect not yet initialized.");
|
|
31
|
-
return this._setup.inputGain;
|
|
32
|
-
}
|
|
33
|
-
get outputNode() {
|
|
34
|
-
if (!this._setup) throw new Error("ReverbEffect not yet initialized.");
|
|
35
|
-
return this._setup.outputGain;
|
|
36
|
-
}
|
|
37
|
-
/** Length of the generated impulse response in seconds. Range 0.1..5, default 2. Changing this rebuilds the IR buffer. */
|
|
38
|
-
get durationSeconds() {
|
|
39
|
-
return this._duration;
|
|
40
|
-
}
|
|
41
|
-
set durationSeconds(value) {
|
|
42
|
-
this._duration = Math.max(.1, Math.min(5, value));
|
|
43
|
-
if (this._setup) this._setup.convolver.buffer = this._generateImpulseResponse(this._setup.convolver.context);
|
|
44
|
-
}
|
|
45
|
-
/** Exponential decay rate of the impulse response. Higher values produce a tighter, drier reverb tail. Range 0.5..10, default 2. Changing this rebuilds the IR buffer. */
|
|
46
|
-
get decay() {
|
|
47
|
-
return this._decay;
|
|
48
|
-
}
|
|
49
|
-
set decay(value) {
|
|
50
|
-
this._decay = Math.max(.5, Math.min(10, value));
|
|
51
|
-
if (this._setup) this._setup.convolver.buffer = this._generateImpulseResponse(this._setup.convolver.context);
|
|
52
|
-
}
|
|
53
|
-
/** Wet (reverberated) mix level, 0..1. The dry level is automatically `1 - wet`. Default 0.4. */
|
|
54
|
-
get wet() {
|
|
55
|
-
return this._wet;
|
|
56
|
-
}
|
|
57
|
-
set wet(value) {
|
|
58
|
-
this._wet = Math.max(0, Math.min(1, value));
|
|
59
|
-
if (this._setup) {
|
|
60
|
-
const ctx = this._setup.wetGain.context;
|
|
61
|
-
this._setup.wetGain.gain.setTargetAtTime(this._wet, ctx.currentTime, .01);
|
|
62
|
-
this._setup.dryGain.gain.setTargetAtTime(1 - this._wet, ctx.currentTime, .01);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
destroy() {
|
|
66
|
-
onAudioContextReady.remove(this._onAudioContextReady);
|
|
67
|
-
if (this._setup) {
|
|
68
|
-
this._setup.inputGain.disconnect();
|
|
69
|
-
this._setup.convolver.disconnect();
|
|
70
|
-
this._setup.dryGain.disconnect();
|
|
71
|
-
this._setup.wetGain.disconnect();
|
|
72
|
-
this._setup.outputGain.disconnect();
|
|
73
|
-
this._setup = null;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
_generateImpulseResponse(ctx) {
|
|
77
|
-
const length = Math.floor(ctx.sampleRate * this._duration);
|
|
78
|
-
const buffer = ctx.createBuffer(2, length, ctx.sampleRate);
|
|
79
|
-
for (let channel = 0; channel < 2; channel++) {
|
|
80
|
-
const data = buffer.getChannelData(channel);
|
|
81
|
-
for (let i = 0; i < length; i++) {
|
|
82
|
-
const t = i / length;
|
|
83
|
-
const decayFactor = Math.pow(1 - t, this._decay);
|
|
84
|
-
data[i] = (Math.random() * 2 - 1) * decayFactor;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return buffer;
|
|
88
|
-
}
|
|
89
|
-
_setupNodes(ctx) {
|
|
90
|
-
const inputGain = ctx.createGain();
|
|
91
|
-
const outputGain = ctx.createGain();
|
|
92
|
-
const convolver = ctx.createConvolver();
|
|
93
|
-
const dryGain = ctx.createGain();
|
|
94
|
-
const wetGain = ctx.createGain();
|
|
95
|
-
inputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
96
|
-
outputGain.gain.setValueAtTime(1, ctx.currentTime);
|
|
97
|
-
dryGain.gain.setValueAtTime(1 - this._wet, ctx.currentTime);
|
|
98
|
-
wetGain.gain.setValueAtTime(this._wet, ctx.currentTime);
|
|
99
|
-
convolver.buffer = this._generateImpulseResponse(ctx);
|
|
100
|
-
inputGain.connect(dryGain);
|
|
101
|
-
dryGain.connect(outputGain);
|
|
102
|
-
inputGain.connect(convolver);
|
|
103
|
-
convolver.connect(wetGain);
|
|
104
|
-
wetGain.connect(outputGain);
|
|
105
|
-
this._setup = {
|
|
106
|
-
inputGain,
|
|
107
|
-
outputGain,
|
|
108
|
-
convolver,
|
|
109
|
-
dryGain,
|
|
110
|
-
wetGain
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
export { ReverbEffect };
|
|
117
|
-
//# sourceMappingURL=ReverbEffect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReverbEffect.js","names":[],"sources":["../../../src/effects/ReverbEffect.ts"],"sourcesContent":["import { AudioEffect, getAudioContext, isAudioContextReady, onAudioContextReady } from '@codexo/exojs';\n\n/** Construction options for {@link ReverbEffect}. */\nexport interface ReverbEffectOptions {\n durationSeconds?: number;\n decay?: number;\n wet?: number;\n}\n\ninterface ReverbEffectSetup {\n readonly inputGain: GainNode;\n readonly outputGain: GainNode;\n readonly convolver: ConvolverNode;\n readonly dryGain: GainNode;\n readonly wetGain: GainNode;\n}\n\n/**\n * Convolution reverb using a procedurally-generated impulse response loaded\n * into a `ConvolverNode`. The impulse response is a stereo noise burst whose\n * amplitude decays exponentially, simulating room reflections. Adjusting\n * `durationSeconds` or `decay` rebuilds the impulse response immediately, so\n * avoid animating these properties at audio rate - use `wet` for real-time\n * mix control instead.\n */\nexport class ReverbEffect extends AudioEffect {\n private _setup: ReverbEffectSetup | null = null;\n private _duration: number;\n private readonly _onAudioContextReady = (ctx: AudioContext): void => {\n onAudioContextReady.remove(this._onAudioContextReady);\n this._setupNodes(ctx);\n };\n private _decay: number;\n private _wet: number;\n\n public constructor(options: ReverbEffectOptions = {}) {\n super();\n this._duration = Math.max(0.1, Math.min(5, options.durationSeconds ?? 2));\n this._decay = Math.max(0.5, Math.min(10, options.decay ?? 2));\n this._wet = Math.max(0, Math.min(1, options.wet ?? 0.4));\n if (isAudioContextReady()) {\n this._setupNodes(getAudioContext());\n } else {\n onAudioContextReady.add(this._onAudioContextReady);\n }\n }\n\n public get inputNode(): AudioNode {\n if (!this._setup) throw new Error('ReverbEffect not yet initialized.');\n return this._setup.inputGain;\n }\n\n public get outputNode(): AudioNode {\n if (!this._setup) throw new Error('ReverbEffect not yet initialized.');\n return this._setup.outputGain;\n }\n\n /** Length of the generated impulse response in seconds. Range 0.1..5, default 2. Changing this rebuilds the IR buffer. */\n public get durationSeconds(): number {\n return this._duration;\n }\n\n public set durationSeconds(value: number) {\n this._duration = Math.max(0.1, Math.min(5, value));\n if (this._setup) {\n this._setup.convolver.buffer = this._generateImpulseResponse(this._setup.convolver.context as AudioContext);\n }\n }\n\n /** Exponential decay rate of the impulse response. Higher values produce a tighter, drier reverb tail. Range 0.5..10, default 2. Changing this rebuilds the IR buffer. */\n public get decay(): number {\n return this._decay;\n }\n\n public set decay(value: number) {\n this._decay = Math.max(0.5, Math.min(10, value));\n if (this._setup) {\n this._setup.convolver.buffer = this._generateImpulseResponse(this._setup.convolver.context as AudioContext);\n }\n }\n\n /** Wet (reverberated) mix level, 0..1. The dry level is automatically `1 - wet`. Default 0.4. */\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.convolver.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 _generateImpulseResponse(ctx: AudioContext): AudioBuffer {\n const length = Math.floor(ctx.sampleRate * this._duration);\n const buffer = ctx.createBuffer(2, length, ctx.sampleRate);\n for (let channel = 0; channel < 2; channel++) {\n const data = buffer.getChannelData(channel);\n for (let i = 0; i < length; i++) {\n const t = i / length;\n const decayFactor = Math.pow(1 - t, this._decay);\n data[i] = (Math.random() * 2 - 1) * decayFactor;\n }\n }\n return buffer;\n }\n\n private _setupNodes(ctx: AudioContext): void {\n const inputGain = ctx.createGain();\n const outputGain = ctx.createGain();\n const convolver = ctx.createConvolver();\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 convolver.buffer = this._generateImpulseResponse(ctx);\n\n // Dry path: input → dryGain → output\n inputGain.connect(dryGain);\n dryGain.connect(outputGain);\n\n // Wet path: input → convolver → wetGain → output\n inputGain.connect(convolver);\n convolver.connect(wetGain);\n wetGain.connect(outputGain);\n\n this._setup = { inputGain, outputGain, convolver, dryGain, wetGain };\n }\n}\n"],"mappings":";;;;;;;;;;;AAyBA,IAAa,eAAb,cAAkC,YAAY;CAC5C,AAAQ,SAAmC;CAC3C,AAAQ;CACR,AAAiB,wBAAwB,QAA4B;EACnE,oBAAoB,OAAO,KAAK,oBAAoB;EACpD,KAAK,YAAY,GAAG;CACtB;CACA,AAAQ;CACR,AAAQ;CAER,AAAO,YAAY,UAA+B,C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