@logue/reverb 1.5.2 → 1.6.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/dist/Reverb.es.js CHANGED
@@ -1,307 +1,240 @@
1
1
  /**
2
- * @logue/reverb
3
- *
4
- * @description JavaScript Reverb effect class
5
- * @author Logue <logue@hotmail.co.jp>
6
- * @copyright 2019-2026 By Masashi Yoshikawa All rights reserved.
7
- * @license MIT
8
- * @version 1.5.2
9
- * @see {@link https://github.com/logue/Reverb.js}
10
- */
2
+ * @logue/reverb
3
+ *
4
+ * @description JavaScript Reverb effect class
5
+ * @author Logue <logue@hotmail.co.jp>
6
+ * @copyright 2019-2026 By Masashi Yoshikawa All rights reserved.
7
+ * @license MIT
8
+ * @version 1.6.0
9
+ * @see {@link https://github.com/logue/Reverb.js}
10
+ */
11
11
 
12
- //#region node_modules/.pnpm/@thi.ng+random@4.1.48/node_modules/@thi.ng/random/arandom.js
13
- var e = 1 / 2 ** 32, t = class {
14
- float(t = 1) {
15
- return this.int() * e * t;
16
- }
17
- probability(e) {
18
- return this.float() < e;
19
- }
20
- norm(t = 1) {
21
- return (this.int() * e - .5) * 2 * t;
22
- }
23
- normMinMax(e, t) {
24
- let n = this.minmax(e, t);
25
- return this.float() < .5 ? n : -n;
26
- }
27
- minmax(e, t) {
28
- return this.float() * (t - e) + e;
29
- }
30
- minmaxInt(e, t) {
31
- e |= 0;
32
- let n = (t | 0) - e;
33
- return n ? e + this.int() % n : e;
34
- }
35
- minmaxUint(e, t) {
36
- e >>>= 0;
37
- let n = (t >>> 0) - e;
38
- return n ? e + this.int() % n : e;
39
- }
40
- }, n = new class extends t {
41
- constructor(e) {
42
- super(), this.rnd = e;
43
- }
44
- rnd;
45
- float(e = 1) {
46
- return this.rnd() * e;
47
- }
48
- norm(e = 1) {
49
- return (this.rnd() - .5) * 2 * e;
50
- }
51
- int() {
52
- return this.rnd() * 4294967296 >>> 0;
53
- }
54
- }(Math.random), r = {
55
- bins: 2,
56
- scale: 1,
57
- rnd: n
58
- }, i = (e, t, n) => {
59
- let r = Array(e);
60
- for (let i = 0; i < e; i++) r[i] = n.norm(t);
61
- return r;
62
- }, a = (e) => e.reduce((e, t) => e + t, 0);
63
- function* o(e, t) {
64
- let n = [e[Symbol.iterator](), t[Symbol.iterator]()];
65
- for (let e = 0;; e ^= 1) {
66
- let t = n[e].next();
67
- if (t.done) return;
68
- yield t.value;
69
- }
70
- }
71
- //#endregion
72
- //#region node_modules/.pnpm/@thi.ng+colored-noise@1.0.132/node_modules/@thi.ng/colored-noise/blue.js
73
- function* s(e) {
74
- let { bins: t, scale: n, rnd: o } = {
75
- ...r,
76
- ...e
77
- }, s = i(t, n, o);
78
- s.forEach((e, t) => s[t] = t & 1 ? e : -e);
79
- let c = 1 / t, l = a(s);
80
- for (let e = 0, r = -1;; ++e >= t && (e = 0)) l -= s[e], l += s[e] = r * o.norm(n), r ^= 4294967294, yield r * l * c;
81
- }
82
- //#endregion
83
- //#region node_modules/.pnpm/@thi.ng+colored-noise@1.0.132/node_modules/@thi.ng/colored-noise/green.js
84
- var c = (e) => o(s(e), s(e)), l = (e) => {
85
- let t = 32;
86
- return e &= -e, e && t--, e & 65535 && (t -= 16), e & 16711935 && (t -= 8), e & 252645135 && (t -= 4), e & 858993459 && (t -= 2), e & 1431655765 && --t, t;
12
+ import { blue, green, pink, red, violet, white } from "@thi.ng/colored-noise";
13
+ import { take } from "@thi.ng/transducers";
14
+ import { SYSTEM } from "@thi.ng/random";
15
+ const defaults = {
16
+ noise: 'white',
17
+ scale: 1,
18
+ peaks: 2,
19
+ randomAlgorithm: SYSTEM,
20
+ decay: 2,
21
+ delay: 0,
22
+ reverse: false,
23
+ time: 2,
24
+ filterType: 'allpass',
25
+ filterFreq: 2200,
26
+ filterQ: 1,
27
+ mix: 0.5,
28
+ once: false
87
29
  };
88
- //#endregion
89
- //#region node_modules/.pnpm/@thi.ng+colored-noise@1.0.132/node_modules/@thi.ng/colored-noise/pink.js
90
- function* u(e) {
91
- let { bins: t = 8, scale: n, rnd: o } = {
92
- ...r,
93
- ...e
94
- }, s = i(t, n, o), c = 1 / t, u = a(s);
95
- for (let e = 0;; e = e + 1 >>> 0) {
96
- let r = l(e) % t;
97
- u -= s[r], u += s[r] = o.norm(n), yield u * c;
98
- }
99
- }
100
- //#endregion
101
- //#region node_modules/.pnpm/@thi.ng+colored-noise@1.0.132/node_modules/@thi.ng/colored-noise/red.js
102
- function* d(e) {
103
- let { bins: t, scale: n, rnd: o } = {
104
- ...r,
105
- ...e
106
- }, s = i(t, n, o), c = 1 / t, l = a(s);
107
- for (let e = 0;; ++e >= t && (e = 0)) l -= s[e], l += s[e] = o.norm(n), yield l * c;
108
- }
109
- //#endregion
110
- //#region node_modules/.pnpm/@thi.ng+colored-noise@1.0.132/node_modules/@thi.ng/colored-noise/violet.js
111
- var f = (e) => o(d(e), d(e));
112
- //#endregion
113
- //#region node_modules/.pnpm/@thi.ng+colored-noise@1.0.132/node_modules/@thi.ng/colored-noise/white.js
114
- function* p(e) {
115
- let { scale: t, rnd: n } = {
116
- ...r,
117
- ...e
118
- };
119
- for (;;) yield n.norm(t);
120
- }
121
- //#endregion
122
- //#region node_modules/.pnpm/@thi.ng+checks@3.9.2/node_modules/@thi.ng/checks/implements-function.js
123
- var m = (e, t) => typeof e?.[t] == "function", h = (e) => m(e, "xform") ? e.xform() : e, g = (e) => typeof e?.[Symbol.iterator] == "function", _ = (e) => e, v = class {
124
- value;
125
- constructor(e) {
126
- this.value = e;
127
- }
128
- deref() {
129
- return this.value;
130
- }
131
- }, y = (e) => new v(e), b = (e) => e instanceof v, x = (e) => e instanceof v ? e : new v(e), S = (e) => e instanceof v ? e.deref() : e, C = (e, t) => [
132
- e,
133
- _,
134
- t
135
- ];
136
- //#endregion
137
- //#region node_modules/.pnpm/@thi.ng+transducers@9.6.36/node_modules/@thi.ng/transducers/push.js
138
- function w(e) {
139
- return e ? [...e] : C(() => [], (e, t) => (e.push(t), e));
140
- }
141
- //#endregion
142
- //#region node_modules/.pnpm/@thi.ng+transducers@9.6.36/node_modules/@thi.ng/transducers/iterator.js
143
- function* T(e, t) {
144
- let n = h(e)(w()), r = n[1], i = n[2];
145
- for (let e of t) {
146
- let t = i([], e);
147
- if (b(t)) {
148
- yield* S(r(t.deref()));
149
- return;
150
- }
151
- t.length && (yield* t);
152
- }
153
- yield* S(r([]));
30
+ const meta = {
31
+ version: "1.6.0",
32
+ date: "2026-06-27T10:08:29.918Z"
33
+ };
34
+ const Meta = meta;
35
+ const NoiseType = {
36
+ blue: blue,
37
+ brown: red,
38
+ green: green,
39
+ pink: pink,
40
+ red: red,
41
+ violet: violet,
42
+ white: white
43
+ };
44
+ function _define_property(obj, key, value) {
45
+ if (key in obj) Object.defineProperty(obj, key, {
46
+ value: value,
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true
50
+ });
51
+ else obj[key] = value;
52
+ return obj;
154
53
  }
155
- //#endregion
156
- //#region node_modules/.pnpm/@thi.ng+transducers@9.6.36/node_modules/@thi.ng/transducers/compr.js
157
- var E = (e, t) => [
158
- e[0],
159
- e[1],
160
- t
161
- ];
162
- //#endregion
163
- //#region node_modules/.pnpm/@thi.ng+transducers@9.6.36/node_modules/@thi.ng/transducers/take.js
164
- function D(e, t) {
165
- return g(t) ? T(D(e), t) : (t) => {
166
- let n = t[2], r = e;
167
- return E(t, (e, t) => --r > 0 ? n(e, t) : r === 0 ? x(n(e, t)) : y(e));
168
- };
54
+ class Reverb {
55
+ connect(sourceNode) {
56
+ if (this.isConnected && this.options.once) {
57
+ this.isConnected = false;
58
+ return this.outputNode;
59
+ }
60
+ this.convolverNode.connect(this.filterNode);
61
+ this.filterNode.connect(this.wetGainNode);
62
+ sourceNode.connect(this.convolverNode);
63
+ sourceNode.connect(this.dryGainNode);
64
+ sourceNode.connect(this.wetGainNode);
65
+ this.dryGainNode.connect(this.outputNode);
66
+ this.wetGainNode.connect(this.outputNode);
67
+ this.isConnected = true;
68
+ return this.outputNode;
69
+ }
70
+ disconnect(sourceNode) {
71
+ if (this.isConnected) {
72
+ this.convolverNode.disconnect(this.filterNode);
73
+ this.filterNode.disconnect(this.wetGainNode);
74
+ }
75
+ this.isConnected = false;
76
+ return sourceNode;
77
+ }
78
+ mix(mix) {
79
+ if (!Reverb.inRange(mix, 0, 1)) throw new RangeError('[Reverb.js] Dry/Wet ratio must be between 0 to 1.');
80
+ this.options.mix = mix;
81
+ this.dryGainNode.gain.value = 1 - mix;
82
+ this.wetGainNode.gain.value = mix;
83
+ console.debug(`[Reverb.js] Set dry/wet ratio to ${100 * mix}%`);
84
+ }
85
+ time(value) {
86
+ if (!Reverb.inRange(value, 1, 50)) throw new RangeError('[Reverb.js] Time length of impulse response must be less than 50sec.');
87
+ this.options.time = value;
88
+ this.buildImpulse();
89
+ console.debug(`[Reverb.js] Set impulse response time length to ${value}sec.`);
90
+ }
91
+ decay(value) {
92
+ if (!Reverb.inRange(value, 0, 100)) throw new RangeError('[Reverb.js] Impulse Response decay level must be less than 100.');
93
+ this.options.decay = value;
94
+ this.buildImpulse();
95
+ console.debug(`[Reverb.js] Set impulse response decay level to ${value}.`);
96
+ }
97
+ delay(value) {
98
+ if (!Reverb.inRange(value, 0, 100)) throw new RangeError('[Reverb.js] Impulse Response delay time must be less than 100.');
99
+ this.options.delay = value;
100
+ this.buildImpulse();
101
+ console.debug(`[Reverb.js] Set impulse response delay time to ${value}sec.`);
102
+ }
103
+ reverse(reverse) {
104
+ this.options.reverse = reverse;
105
+ this.buildImpulse();
106
+ console.debug(`[Reverb.js] Inpulse response is ${reverse ? '' : 'not '}reversed.`);
107
+ }
108
+ filterType(type = 'allpass') {
109
+ this.filterNode.type = this.options.filterType = type;
110
+ console.debug(`[Reverb.js] Set filter type to ${type}`);
111
+ }
112
+ filterFreq(freq) {
113
+ if (!Reverb.inRange(freq, 20, 20000)) throw new RangeError('[Reverb.js] Filter frequrncy must be between 20 and 20000.');
114
+ this.options.filterFreq = freq;
115
+ this.filterNode.frequency.value = this.options.filterFreq;
116
+ console.debug(`[Reverb.js] Set filter frequency to ${freq}Hz.`);
117
+ }
118
+ filterQ(q) {
119
+ if (!Reverb.inRange(q, 0, 10)) throw new RangeError('[Reverb.js] Filter Q value must be between 0 and 10.');
120
+ this.options.filterQ = q;
121
+ this.filterNode.Q.value = this.options.filterQ;
122
+ console.debug(`[Reverb.js] Set filter Q to ${q}.`);
123
+ }
124
+ peaks(p) {
125
+ this.options.peaks = p;
126
+ this.buildImpulse();
127
+ console.debug(`[Reverb.js] Set IR source noise peaks to ${p}.`);
128
+ }
129
+ scale(s) {
130
+ this.options.scale = s;
131
+ this.buildImpulse();
132
+ console.debug(`[Reverb.js] Set IR source noise scale to ${s}.`);
133
+ }
134
+ getNoise(duration) {
135
+ return [
136
+ ...take(duration, this.noise({
137
+ bins: this.options.peaks,
138
+ scale: this.options.scale,
139
+ rnd: this.options.randomAlgorithm
140
+ }))
141
+ ];
142
+ }
143
+ setNoise(type) {
144
+ this.options.noise = type;
145
+ switch(type){
146
+ case 'blue':
147
+ this.noise = this.noiseMap.blue;
148
+ break;
149
+ case 'brown':
150
+ this.noise = this.noiseMap.brown;
151
+ break;
152
+ case 'green':
153
+ this.noise = this.noiseMap.green;
154
+ break;
155
+ case 'pink':
156
+ this.noise = this.noiseMap.pink;
157
+ break;
158
+ case 'red':
159
+ this.noise = this.noiseMap.red;
160
+ break;
161
+ case 'violet':
162
+ this.noise = this.noiseMap.violet;
163
+ break;
164
+ case 'white':
165
+ this.noise = this.noiseMap.white;
166
+ break;
167
+ default:
168
+ this.noise = white;
169
+ break;
170
+ }
171
+ this.buildImpulse();
172
+ console.debug(`[Reverb.js] Set IR generator source noise type to ${type}.`);
173
+ }
174
+ setRandomAlgorithm(algorithm) {
175
+ this.options.randomAlgorithm = algorithm;
176
+ this.buildImpulse();
177
+ console.debug("[Reverb.js] Set IR source noise generator.");
178
+ }
179
+ static inRange(x, min, max) {
180
+ return x >= min && x <= max;
181
+ }
182
+ buildImpulse() {
183
+ const rate = this.ctx.sampleRate;
184
+ const duration = Math.max(rate * this.options.time, 1);
185
+ const delayDuration = rate * this.options.delay;
186
+ const impulse = this.ctx.createBuffer(2, duration, rate);
187
+ const impulseL = new Float32Array(duration);
188
+ const impulseR = new Float32Array(duration);
189
+ const sampleL = new Float32Array(1);
190
+ const sampleR = new Float32Array(1);
191
+ const noiseL = this.getNoise(duration);
192
+ const noiseR = this.getNoise(duration);
193
+ for(let i = 0; i < duration; i++){
194
+ let n;
195
+ if (i < delayDuration) {
196
+ sampleL[0] = 0;
197
+ sampleR[0] = 0;
198
+ impulseL.set(sampleL, i);
199
+ impulseR.set(sampleR, i);
200
+ n = this.options.reverse ?? false ? duration - (i - delayDuration) : i - delayDuration;
201
+ } else n = this.options.reverse ?? false ? duration - i : i;
202
+ sampleL[0] = (noiseL.at(i) ?? 0) * (1 - n / duration) ** this.options.decay;
203
+ sampleR[0] = (noiseR.at(i) ?? 0) * (1 - n / duration) ** this.options.decay;
204
+ impulseL.set(sampleL, i);
205
+ impulseR.set(sampleR, i);
206
+ }
207
+ impulse.getChannelData(0).set(impulseL);
208
+ impulse.getChannelData(1).set(impulseR);
209
+ this.convolverNode.buffer = impulse;
210
+ }
211
+ constructor(ctx, options = {}){
212
+ _define_property(this, "ctx", void 0);
213
+ _define_property(this, "wetGainNode", void 0);
214
+ _define_property(this, "dryGainNode", void 0);
215
+ _define_property(this, "filterNode", void 0);
216
+ _define_property(this, "convolverNode", void 0);
217
+ _define_property(this, "outputNode", void 0);
218
+ _define_property(this, "options", void 0);
219
+ _define_property(this, "isConnected", void 0);
220
+ _define_property(this, "noise", white);
221
+ _define_property(this, "noiseMap", NoiseType);
222
+ this.ctx = ctx;
223
+ this.options = Object.assign({}, defaults, options);
224
+ this.wetGainNode = this.ctx.createGain();
225
+ this.dryGainNode = this.ctx.createGain();
226
+ this.filterNode = this.ctx.createBiquadFilter();
227
+ this.convolverNode = this.ctx.createConvolver();
228
+ this.outputNode = this.ctx.createGain();
229
+ this.isConnected = false;
230
+ this.filterType(this.options.filterType);
231
+ this.setNoise(this.options.noise);
232
+ this.buildImpulse();
233
+ this.mix(this.options.mix);
234
+ }
169
235
  }
170
- //#endregion
171
- //#region src/Meta.ts
172
- var O = {
173
- version: "1.5.2",
174
- date: "2026-05-17T05:21:07.564Z"
175
- }, k = {
176
- blue: s,
177
- brown: d,
178
- green: c,
179
- pink: u,
180
- red: d,
181
- violet: f,
182
- white: p
183
- }, A = {
184
- noise: "white",
185
- scale: 1,
186
- peaks: 2,
187
- randomAlgorithm: n,
188
- decay: 2,
189
- delay: 0,
190
- reverse: !1,
191
- time: 2,
192
- filterType: "allpass",
193
- filterFreq: 2200,
194
- filterQ: 1,
195
- mix: .5,
196
- once: !1
197
- }, j = class e {
198
- static version = O.version;
199
- static build = O.date;
200
- ctx;
201
- wetGainNode;
202
- dryGainNode;
203
- filterNode;
204
- convolverNode;
205
- outputNode;
206
- options;
207
- isConnected;
208
- noise = p;
209
- noiseMap = k;
210
- constructor(e, t = {}) {
211
- this.ctx = e, this.options = Object.assign({}, A, t), this.wetGainNode = this.ctx.createGain(), this.dryGainNode = this.ctx.createGain(), this.filterNode = this.ctx.createBiquadFilter(), this.convolverNode = this.ctx.createConvolver(), this.outputNode = this.ctx.createGain(), this.isConnected = !1, this.filterType(this.options.filterType), this.setNoise(this.options.noise), this.buildImpulse(), this.mix(this.options.mix);
212
- }
213
- connect(e) {
214
- return this.isConnected && this.options.once ? (this.isConnected = !1, this.outputNode) : (this.convolverNode.connect(this.filterNode), this.filterNode.connect(this.wetGainNode), e.connect(this.convolverNode), e.connect(this.dryGainNode), e.connect(this.wetGainNode), this.dryGainNode.connect(this.outputNode), this.wetGainNode.connect(this.outputNode), this.isConnected = !0, this.outputNode);
215
- }
216
- disconnect(e) {
217
- return this.isConnected && (this.convolverNode.disconnect(this.filterNode), this.filterNode.disconnect(this.wetGainNode)), this.isConnected = !1, e;
218
- }
219
- mix(t) {
220
- if (!e.inRange(t, 0, 1)) throw RangeError("[Reverb.js] Dry/Wet ratio must be between 0 to 1.");
221
- this.options.mix = t, this.dryGainNode.gain.value = 1 - t, this.wetGainNode.gain.value = t, console.debug(`[Reverb.js] Set dry/wet ratio to ${t * 100}%`);
222
- }
223
- time(t) {
224
- if (!e.inRange(t, 1, 50)) throw RangeError("[Reverb.js] Time length of impulse response must be less than 50sec.");
225
- this.options.time = t, this.buildImpulse(), console.debug(`[Reverb.js] Set impulse response time length to ${t}sec.`);
226
- }
227
- decay(t) {
228
- if (!e.inRange(t, 0, 100)) throw RangeError("[Reverb.js] Impulse Response decay level must be less than 100.");
229
- this.options.decay = t, this.buildImpulse(), console.debug(`[Reverb.js] Set impulse response decay level to ${t}.`);
230
- }
231
- delay(t) {
232
- if (!e.inRange(t, 0, 100)) throw RangeError("[Reverb.js] Impulse Response delay time must be less than 100.");
233
- this.options.delay = t, this.buildImpulse(), console.debug(`[Reverb.js] Set impulse response delay time to ${t}sec.`);
234
- }
235
- reverse(e) {
236
- this.options.reverse = e, this.buildImpulse(), console.debug(`[Reverb.js] Inpulse response is ${e ? "" : "not "}reversed.`);
237
- }
238
- filterType(e = "allpass") {
239
- this.filterNode.type = this.options.filterType = e, console.debug(`[Reverb.js] Set filter type to ${e}`);
240
- }
241
- filterFreq(t) {
242
- if (!e.inRange(t, 20, 2e4)) throw RangeError("[Reverb.js] Filter frequrncy must be between 20 and 20000.");
243
- this.options.filterFreq = t, this.filterNode.frequency.value = this.options.filterFreq, console.debug(`[Reverb.js] Set filter frequency to ${t}Hz.`);
244
- }
245
- filterQ(t) {
246
- if (!e.inRange(t, 0, 10)) throw RangeError("[Reverb.js] Filter Q value must be between 0 and 10.");
247
- this.options.filterQ = t, this.filterNode.Q.value = this.options.filterQ, console.debug(`[Reverb.js] Set filter Q to ${t}.`);
248
- }
249
- peaks(e) {
250
- this.options.peaks = e, this.buildImpulse(), console.debug(`[Reverb.js] Set IR source noise peaks to ${e}.`);
251
- }
252
- scale(e) {
253
- this.options.scale = e, this.buildImpulse(), console.debug(`[Reverb.js] Set IR source noise scale to ${e}.`);
254
- }
255
- getNoise(e) {
256
- return [...D(e, this.noise({
257
- bins: this.options.peaks,
258
- scale: this.options.scale,
259
- rnd: this.options.randomAlgorithm
260
- }))];
261
- }
262
- setNoise(e) {
263
- switch (this.options.noise = e, e) {
264
- case "blue":
265
- this.noise = this.noiseMap.blue;
266
- break;
267
- case "brown":
268
- this.noise = this.noiseMap.brown;
269
- break;
270
- case "green":
271
- this.noise = this.noiseMap.green;
272
- break;
273
- case "pink":
274
- this.noise = this.noiseMap.pink;
275
- break;
276
- case "red":
277
- this.noise = this.noiseMap.red;
278
- break;
279
- case "violet":
280
- this.noise = this.noiseMap.violet;
281
- break;
282
- case "white":
283
- this.noise = this.noiseMap.white;
284
- break;
285
- default:
286
- this.noise = p;
287
- break;
288
- }
289
- this.buildImpulse(), console.debug(`[Reverb.js] Set IR generator source noise type to ${e}.`);
290
- }
291
- setRandomAlgorithm(e) {
292
- this.options.randomAlgorithm = e, this.buildImpulse(), console.debug("[Reverb.js] Set IR source noise generator.");
293
- }
294
- static inRange(e, t, n) {
295
- return e >= t && e <= n;
296
- }
297
- buildImpulse() {
298
- let e = this.ctx.sampleRate, t = Math.max(e * this.options.time, 1), n = e * this.options.delay, r = this.ctx.createBuffer(2, t, e), i = new Float32Array(t), a = new Float32Array(t), o = new Float32Array(1), s = new Float32Array(1), c = this.getNoise(t), l = this.getNoise(t);
299
- for (let e = 0; e < t; e++) {
300
- let r;
301
- e < n ? (o[0] = 0, s[0] = 0, i.set(o, e), a.set(s, e), r = this.options.reverse ?? !1 ? t - (e - n) : e - n) : r = this.options.reverse ?? !1 ? t - e : e, o[0] = (c.at(e) ?? 0) * (1 - r / t) ** this.options.decay, s[0] = (l.at(e) ?? 0) * (1 - r / t) ** this.options.decay, i.set(o, e), a.set(s, e);
302
- }
303
- r.getChannelData(0).set(i), r.getChannelData(1).set(a), this.convolverNode.buffer = r;
304
- }
305
- };
306
- //#endregion
307
- export { j as default };
236
+ _define_property(Reverb, "version", Meta.version);
237
+ _define_property(Reverb, "build", Meta.date);
238
+ export default Reverb;
239
+
240
+ //# sourceMappingURL=Reverb.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reverb.es.js","sources":["../src/interfaces/OptionInterface.ts","../src/Meta.ts","../src/NoiseType.ts","../src/index.ts"],"sourcesContent":["import type { INorm } from '@thi.ng/random';\nimport { SYSTEM } from '@thi.ng/random';\nimport type { NoiseType } from '@/NoiseType';\n\n/** Reverb Option */\nexport interface OptionInterface {\n /**\n * IR (Inpulse Response) colord noise algorithm (BLUE, GREEN, PINK, RED, VIOLET, WHITE)\n * @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/colored-noise}\n */\n noise: NoiseType;\n /** IR source noise scale */\n scale: number;\n /** Number of IR source noise peaks */\n peaks: number;\n /**\n * Randam noise algorythm\n * @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/random}\n */\n randomAlgorithm: INorm;\n /** Decay */\n decay: number;\n /** Delay until impulse response is generated */\n delay: number;\n /** Filter frequency applied to impulse response[Hz] */\n filterFreq: number;\n /** Filter quality for impulse response */\n filterQ: number;\n /** Filter type for impulse response */\n filterType: BiquadFilterType;\n /** Dry/Wet ratio */\n mix: number;\n /** Invert the impulse response */\n reverse?: boolean;\n /** Impulse response length */\n time: number;\n /** Prevents multiple effectors from being connected. */\n once: boolean;\n}\n\n/** Default Value */\nexport const defaults: OptionInterface = {\n noise: 'white',\n scale: 1,\n peaks: 2,\n randomAlgorithm: SYSTEM,\n decay: 2,\n delay: 0,\n reverse: false,\n time: 2,\n filterType: 'allpass',\n filterFreq: 2200,\n filterQ: 1,\n mix: 0.5,\n once: false,\n};\n","import type MetaInterface from '@/interfaces/MetaInterface';\n\nconst meta: MetaInterface = {\n version: __APP_VERSION__,\n date: __BUILD_DATE__,\n};\nexport default meta;\n","import {\n blue,\n type ColoredNoiseOpts,\n green,\n pink,\n red,\n violet,\n white,\n} from '@thi.ng/colored-noise';\n\n/** Noise Type */\nexport type NoiseType =\n | 'blue'\n | 'brown'\n | 'green'\n | 'pink'\n | 'red'\n | 'violet'\n | 'white';\n\nexport const NoiseType: Record<\n NoiseType,\n (opts?: Partial<ColoredNoiseOpts>) => Generator<number, void, unknown>\n> = {\n blue,\n brown: red,\n green,\n pink,\n red,\n violet,\n white,\n};\n","/// <reference path=\"./env.d.ts\" />\nimport { type ColoredNoiseOpts, white } from '@thi.ng/colored-noise';\nimport type { INorm } from '@thi.ng/random';\nimport { take } from '@thi.ng/transducers';\nimport { defaults, type OptionInterface } from '@/interfaces/OptionInterface';\nimport Meta from '@/Meta';\nimport { type NoiseType, NoiseType as NoiseTypeMap } from '@/NoiseType';\n\n/**\n * Reverb effect class\n */\nexport default class Reverb {\n /** Version strings */\n static readonly version: string = Meta.version;\n /** Build date */\n static readonly build: string = Meta.date;\n /** AudioContext */\n private readonly ctx: AudioContext;\n /** Wet Level (Reverberated node) */\n private readonly wetGainNode: GainNode;\n /** Dry Level (Original sound node) */\n private readonly dryGainNode: GainNode;\n /** Impulse response filter */\n private readonly filterNode: BiquadFilterNode;\n /** Convolution node for applying impulse response */\n private readonly convolverNode: ConvolverNode;\n /** Output gain node */\n private readonly outputNode: GainNode;\n /** Option */\n private readonly options: OptionInterface;\n /** Connected flag */\n private isConnected: boolean;\n /** Noise Generator */\n private noise: (\n _opts?: Partial<ColoredNoiseOpts>,\n ) => Generator<number, void, unknown> = white;\n /**\n * Map of noise types to their respective generator functions.\n */\n private readonly noiseMap: Record<\n NoiseType,\n (opts?: Partial<ColoredNoiseOpts>) => Generator<number, void, unknown>\n > = NoiseTypeMap;\n\n /**\n * Constructor\n *\n * @param ctx - Root AudioContext\n * @param options - Configure\n */\n constructor(ctx: AudioContext, options: Partial<OptionInterface> = {}) {\n // Store the master AudioContext.\n this.ctx = ctx;\n // Keep shared defaults immutable across instances/tests.\n this.options = Object.assign({}, defaults, options);\n // Initialize audio nodes.\n this.wetGainNode = this.ctx.createGain();\n this.dryGainNode = this.ctx.createGain();\n this.filterNode = this.ctx.createBiquadFilter();\n this.convolverNode = this.ctx.createConvolver();\n this.outputNode = this.ctx.createGain();\n // Reset connected flag.\n this.isConnected = false;\n this.filterType(this.options.filterType);\n this.setNoise(this.options.noise);\n // Generate the impulse response.\n this.buildImpulse();\n // Set the initial dry/wet ratio.\n this.mix(this.options.mix);\n }\n\n /**\n * Connect the node for the reverb effect to the original sound node.\n *\n * @param sourceNode - Input source node\n */\n public connect(sourceNode: AudioNode): AudioNode {\n if (this.isConnected && this.options.once) {\n // Already connected: reset flag and return the output node as-is.\n this.isConnected = false;\n return this.outputNode;\n }\n // Connect convolver to filter node.\n this.convolverNode.connect(this.filterNode);\n // Connect filter node to wet gain.\n this.filterNode.connect(this.wetGainNode);\n // Connect source to convolver (wet path).\n sourceNode.connect(this.convolverNode);\n // Connect source to dry gain.\n sourceNode.connect(this.dryGainNode);\n // Connect source directly to wet gain.\n sourceNode.connect(this.wetGainNode);\n // Connect dry gain to output.\n this.dryGainNode.connect(this.outputNode);\n // Connect wet gain to output.\n this.wetGainNode.connect(this.outputNode);\n // Mark as connected.\n this.isConnected = true;\n\n return this.outputNode;\n }\n\n /**\n * Disconnect the reverb node\n *\n * @param sourceNode - Input source node\n */\n public disconnect(sourceNode?: AudioNode): AudioNode | undefined {\n // Nodes are not connected in the initial state; skip disconnect to avoid errors.\n if (this.isConnected) {\n // Disconnect convolver from filter node.\n this.convolverNode.disconnect(this.filterNode);\n // Disconnect filter node from wet gain.\n this.filterNode.disconnect(this.wetGainNode);\n }\n // Clear connected flag.\n this.isConnected = false;\n\n // Return the source node to mirror common Web Audio API patterns.\n return sourceNode;\n }\n\n /**\n * Dry/Wet ratio\n *\n * @param mix - Ratio (0~1)\n */\n public mix(mix: number): void {\n if (!Reverb.inRange(mix, 0, 1)) {\n throw new RangeError('[Reverb.js] Dry/Wet ratio must be between 0 to 1.');\n }\n this.options.mix = mix;\n this.dryGainNode.gain.value = 1 - mix;\n this.wetGainNode.gain.value = mix;\n console.debug(`[Reverb.js] Set dry/wet ratio to ${mix * 100}%`);\n }\n\n /**\n * Set Impulse Response time length (second)\n *\n * @param value - IR length\n */\n public time(value: number): void {\n if (!Reverb.inRange(value, 1, 50)) {\n throw new RangeError(\n '[Reverb.js] Time length of impulse response must be less than 50sec.',\n );\n }\n this.options.time = value;\n this.buildImpulse();\n console.debug(\n `[Reverb.js] Set impulse response time length to ${value}sec.`,\n );\n }\n\n /**\n * Impulse response decay rate.\n *\n * @param value - Decay value\n */\n public decay(value: number): void {\n if (!Reverb.inRange(value, 0, 100)) {\n throw new RangeError(\n '[Reverb.js] Impulse Response decay level must be less than 100.',\n );\n }\n this.options.decay = value;\n this.buildImpulse();\n console.debug(`[Reverb.js] Set impulse response decay level to ${value}.`);\n }\n\n /**\n * Delay before reverberation starts\n *\n * @param value - Time[ms]\n */\n public delay(value: number): void {\n if (!Reverb.inRange(value, 0, 100)) {\n throw new RangeError(\n '[Reverb.js] Impulse Response delay time must be less than 100.',\n );\n }\n this.options.delay = value;\n this.buildImpulse();\n console.debug(\n `[Reverb.js] Set impulse response delay time to ${value}sec.`,\n );\n }\n\n /**\n * Reverse the impulse response.\n *\n * @param reverse - Reverse IR\n */\n public reverse(reverse: boolean): void {\n this.options.reverse = reverse;\n this.buildImpulse();\n console.debug(\n `[Reverb.js] Inpulse response is ${reverse ? '' : 'not '}reversed.`,\n );\n }\n\n /**\n * Filter for impulse response\n *\n * @param type - Filiter Type\n */\n public filterType(type: BiquadFilterType = 'allpass'): void {\n this.filterNode.type = this.options.filterType = type;\n console.debug(`[Reverb.js] Set filter type to ${type}`);\n }\n\n /**\n * Filter frequency applied to impulse response\n *\n * @param freq - Frequency\n */\n public filterFreq(freq: number): void {\n if (!Reverb.inRange(freq, 20, 20000)) {\n throw new RangeError(\n '[Reverb.js] Filter frequrncy must be between 20 and 20000.',\n );\n }\n this.options.filterFreq = freq;\n this.filterNode.frequency.value = this.options.filterFreq;\n console.debug(`[Reverb.js] Set filter frequency to ${freq}Hz.`);\n }\n\n /**\n * Filter quality.\n *\n * @param q - Quality\n */\n public filterQ(q: number): void {\n if (!Reverb.inRange(q, 0, 10)) {\n throw new RangeError(\n '[Reverb.js] Filter Q value must be between 0 and 10.',\n );\n }\n this.options.filterQ = q;\n this.filterNode.Q.value = this.options.filterQ;\n console.debug(`[Reverb.js] Set filter Q to ${q}.`);\n }\n\n /**\n * set IR source noise peaks\n *\n * @param p - Peaks\n */\n public peaks(p: number): void {\n this.options.peaks = p;\n this.buildImpulse();\n console.debug(`[Reverb.js] Set IR source noise peaks to ${p}.`);\n }\n\n /**\n * set IR source noise scale.\n *\n * @param s - Scale\n */\n public scale(s: number): void {\n this.options.scale = s;\n this.buildImpulse();\n console.debug(`[Reverb.js] Set IR source noise scale to ${s}.`);\n }\n\n /**\n * Noise source\n *\n * @param duration - length of IR.\n */\n private getNoise(duration: number): number[] {\n return [\n ...take<number>(\n duration,\n this.noise({\n bins: this.options.peaks,\n scale: this.options.scale,\n rnd: this.options.randomAlgorithm,\n }),\n ),\n ];\n }\n\n /**\n * Inpulse Response Noise algorithm.\n *\n * @param type - IR noise algorithm type.\n */\n public setNoise(type: NoiseType): void {\n this.options.noise = type;\n switch (type) {\n case 'blue':\n this.noise = this.noiseMap.blue;\n break;\n case 'brown':\n this.noise = this.noiseMap.brown;\n break;\n case 'green':\n this.noise = this.noiseMap.green;\n break;\n case 'pink':\n this.noise = this.noiseMap.pink;\n break;\n case 'red':\n this.noise = this.noiseMap.red;\n break;\n case 'violet':\n this.noise = this.noiseMap.violet;\n break;\n case 'white':\n this.noise = this.noiseMap.white;\n break;\n default:\n this.noise = white;\n break;\n }\n this.buildImpulse();\n console.debug(`[Reverb.js] Set IR generator source noise type to ${type}.`);\n }\n\n /**\n * Set the random number algorithm used for noise generation.\n *\n * @param algorithm - Random algorithm implementing {@link INorm}\n */\n public setRandomAlgorithm(algorithm: INorm): void {\n this.options.randomAlgorithm = algorithm;\n this.buildImpulse();\n console.debug(`[Reverb.js] Set IR source noise generator.`);\n }\n\n /**\n * Return true if in range, otherwise false\n *\n * @param x - Target value\n * @param min - Minimum value\n * @param max - Maximum value\n */\n private static inRange(x: number, min: number, max: number): boolean {\n return x >= min && x <= max;\n }\n\n /** Builds the impulse response buffer from the current options. */\n private buildImpulse(): void {\n /** Sample rate of the AudioContext. */\n const rate: number = this.ctx.sampleRate;\n /** Total IR length in samples. */\n const duration: number = Math.max(rate * this.options.time, 1);\n /** Delay before IR onset, in samples. */\n const delayDuration: number = rate * this.options.delay;\n /** IR audio buffer (stereo). */\n const impulse: AudioBuffer = this.ctx.createBuffer(2, duration, rate);\n /** Left channel sample array. */\n const impulseL: Float32Array = new Float32Array(duration);\n /** Right channel sample array. */\n const impulseR: Float32Array = new Float32Array(duration);\n /** Temporary single-sample buffers used with Float32Array.set(). */\n const sampleL = new Float32Array(1);\n const sampleR = new Float32Array(1);\n /** Noise source for left channel. */\n const noiseL: number[] = this.getNoise(duration);\n /** Noise source for right channel. */\n const noiseR: number[] = this.getNoise(duration);\n\n for (let i = 0; i < duration; i++) {\n /** Decay position index (accounts for reverse and delay). */\n let n: number;\n\n if (i < delayDuration) {\n // Zero out samples within the delay period.\n sampleL[0] = 0;\n sampleR[0] = 0;\n impulseL.set(sampleL, i);\n impulseR.set(sampleR, i);\n n =\n (this.options.reverse ?? false)\n ? duration - (i - delayDuration)\n : i - delayDuration;\n } else {\n n = (this.options.reverse ?? false) ? duration - i : i;\n }\n // Apply exponential decay to the noise source over time.\n sampleL[0] =\n (noiseL.at(i) ?? 0) * (1 - n / duration) ** this.options.decay;\n sampleR[0] =\n (noiseR.at(i) ?? 0) * (1 - n / duration) ** this.options.decay;\n impulseL.set(sampleL, i);\n impulseR.set(sampleR, i);\n }\n\n // Write the generated wave table into the IR buffer.\n impulse.getChannelData(0).set(impulseL);\n impulse.getChannelData(1).set(impulseR);\n\n this.convolverNode.buffer = impulse;\n }\n}\n"],"names":["defaults","SYSTEM","meta","__APP_VERSION__","__BUILD_DATE__","NoiseType","blue","red","green","pink","violet","white","Reverb","sourceNode","mix","RangeError","console","value","reverse","type","freq","q","p","s","duration","take","algorithm","x","min","max","rate","Math","delayDuration","impulse","impulseL","Float32Array","impulseR","sampleL","sampleR","noiseL","noiseR","i","n","ctx","options","NoiseTypeMap","Object","Meta"],"mappings":";;;;;;;;;;;;;;AAyCO,MAAMA,WAA4B;IACvC,OAAO;IACP,OAAO;IACP,OAAO;IACP,iBAAiBC;IACjB,OAAO;IACP,OAAO;IACP,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,KAAK;IACL,MAAM;AACR;ACrDA,MAAMC,OAAsB;IAC1B,SAASC;IACT,MAAMC;AACR;AACA,aAAeF;ACcR,MAAMG,YAGT;IACFC,MAAIA;IACJ,OAAOC;IACPC,OAAKA;IACLC,MAAIA;IACJF,KAAGA;IACHG,QAAMA;IACNC,OAAKA;AACP;;;;;;;;;;;ACpBe,MAAMC;IAiEZ,QAAQC,UAAqB,EAAa;QAC/C,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YAEzC,IAAI,CAAC,WAAW,GAAG;YACnB,OAAO,IAAI,CAAC,UAAU;QACxB;QAEA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU;QAE1C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW;QAExCA,WAAW,OAAO,CAAC,IAAI,CAAC,aAAa;QAErCA,WAAW,OAAO,CAAC,IAAI,CAAC,WAAW;QAEnCA,WAAW,OAAO,CAAC,IAAI,CAAC,WAAW;QAEnC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU;QAExC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU;QAExC,IAAI,CAAC,WAAW,GAAG;QAEnB,OAAO,IAAI,CAAC,UAAU;IACxB;I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AO,CAAC,GAAG;IAC3B;AAwUF;AAhYE,iBAFmBhC,QAEH,WAAkBmC,KAAK,OAAO;AAE9C,iBAJmBnC,QAIH,SAAgBmC,KAAK,IAAI"}
@@ -1,12 +1,13 @@
1
1
  /**
2
- * @logue/reverb
3
- *
4
- * @description JavaScript Reverb effect class
5
- * @author Logue <logue@hotmail.co.jp>
6
- * @copyright 2019-2026 By Masashi Yoshikawa All rights reserved.
7
- * @license MIT
8
- * @version 1.5.2
9
- * @see {@link https://github.com/logue/Reverb.js}
10
- */
2
+ * @logue/reverb
3
+ *
4
+ * @description JavaScript Reverb effect class
5
+ * @author Logue <logue@hotmail.co.jp>
6
+ * @copyright 2019-2026 By Masashi Yoshikawa All rights reserved.
7
+ * @license MIT
8
+ * @version 1.6.0
9
+ * @see {@link https://github.com/logue/Reverb.js}
10
+ */
11
11
 
12
- (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.Reverb=t())})(this,function(){var e=1/2**32,t=class{float(t=1){return this.int()*e*t}probability(e){return this.float()<e}norm(t=1){return(this.int()*e-.5)*2*t}normMinMax(e,t){let n=this.minmax(e,t);return this.float()<.5?n:-n}minmax(e,t){return this.float()*(t-e)+e}minmaxInt(e,t){e|=0;let n=(t|0)-e;return n?e+this.int()%n:e}minmaxUint(e,t){e>>>=0;let n=(t>>>0)-e;return n?e+this.int()%n:e}},n=new class extends t{constructor(e){super(),this.rnd=e}rnd;float(e=1){return this.rnd()*e}norm(e=1){return(this.rnd()-.5)*2*e}int(){return this.rnd()*4294967296>>>0}}(Math.random),r={bins:2,scale:1,rnd:n},i=(e,t,n)=>{let r=Array(e);for(let i=0;i<e;i++)r[i]=n.norm(t);return r},a=e=>e.reduce((e,t)=>e+t,0);function*o(e,t){let n=[e[Symbol.iterator](),t[Symbol.iterator]()];for(let e=0;;e^=1){let t=n[e].next();if(t.done)return;yield t.value}}function*s(e){let{bins:t,scale:n,rnd:o}={...r,...e},s=i(t,n,o);s.forEach((e,t)=>s[t]=t&1?e:-e);let c=1/t,l=a(s);for(let e=0,r=-1;;++e>=t&&(e=0))l-=s[e],l+=s[e]=r*o.norm(n),r^=4294967294,yield r*l*c}var c=e=>o(s(e),s(e)),l=e=>{let t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&--t,t};function*u(e){let{bins:t=8,scale:n,rnd:o}={...r,...e},s=i(t,n,o),c=1/t,u=a(s);for(let e=0;;e=e+1>>>0){let r=l(e)%t;u-=s[r],u+=s[r]=o.norm(n),yield u*c}}function*d(e){let{bins:t,scale:n,rnd:o}={...r,...e},s=i(t,n,o),c=1/t,l=a(s);for(let e=0;;++e>=t&&(e=0))l-=s[e],l+=s[e]=o.norm(n),yield l*c}var f=e=>o(d(e),d(e));function*p(e){let{scale:t,rnd:n}={...r,...e};for(;;)yield n.norm(t)}var m=(e,t)=>typeof e?.[t]==`function`,h=e=>m(e,`xform`)?e.xform():e,g=e=>typeof e?.[Symbol.iterator]==`function`,_=e=>e,v=class{value;constructor(e){this.value=e}deref(){return this.value}},y=e=>new v(e),b=e=>e instanceof v,x=e=>e instanceof v?e:new v(e),S=e=>e instanceof v?e.deref():e,C=(e,t)=>[e,_,t];function w(e){return e?[...e]:C(()=>[],(e,t)=>(e.push(t),e))}function*T(e,t){let n=h(e)(w()),r=n[1],i=n[2];for(let e of t){let t=i([],e);if(b(t)){yield*S(r(t.deref()));return}t.length&&(yield*t)}yield*S(r([]))}var E=(e,t)=>[e[0],e[1],t];function D(e,t){return g(t)?T(D(e),t):t=>{let n=t[2],r=e;return E(t,(e,t)=>--r>0?n(e,t):r===0?x(n(e,t)):y(e))}}var O={version:`1.5.2`,date:`2026-05-17T05:21:07.564Z`},k={blue:s,brown:d,green:c,pink:u,red:d,violet:f,white:p},A={noise:`white`,scale:1,peaks:2,randomAlgorithm:n,decay:2,delay:0,reverse:!1,time:2,filterType:`allpass`,filterFreq:2200,filterQ:1,mix:.5,once:!1};return class e{static version=O.version;static build=O.date;ctx;wetGainNode;dryGainNode;filterNode;convolverNode;outputNode;options;isConnected;noise=p;noiseMap=k;constructor(e,t={}){this.ctx=e,this.options=Object.assign({},A,t),this.wetGainNode=this.ctx.createGain(),this.dryGainNode=this.ctx.createGain(),this.filterNode=this.ctx.createBiquadFilter(),this.convolverNode=this.ctx.createConvolver(),this.outputNode=this.ctx.createGain(),this.isConnected=!1,this.filterType(this.options.filterType),this.setNoise(this.options.noise),this.buildImpulse(),this.mix(this.options.mix)}connect(e){return this.isConnected&&this.options.once?(this.isConnected=!1,this.outputNode):(this.convolverNode.connect(this.filterNode),this.filterNode.connect(this.wetGainNode),e.connect(this.convolverNode),e.connect(this.dryGainNode),e.connect(this.wetGainNode),this.dryGainNode.connect(this.outputNode),this.wetGainNode.connect(this.outputNode),this.isConnected=!0,this.outputNode)}disconnect(e){return this.isConnected&&(this.convolverNode.disconnect(this.filterNode),this.filterNode.disconnect(this.wetGainNode)),this.isConnected=!1,e}mix(t){if(!e.inRange(t,0,1))throw RangeError(`[Reverb.js] Dry/Wet ratio must be between 0 to 1.`);this.options.mix=t,this.dryGainNode.gain.value=1-t,this.wetGainNode.gain.value=t,console.debug(`[Reverb.js] Set dry/wet ratio to ${t*100}%`)}time(t){if(!e.inRange(t,1,50))throw RangeError(`[Reverb.js] Time length of impulse response must be less than 50sec.`);this.options.time=t,this.buildImpulse(),console.debug(`[Reverb.js] Set impulse response time length to ${t}sec.`)}decay(t){if(!e.inRange(t,0,100))throw RangeError(`[Reverb.js] Impulse Response decay level must be less than 100.`);this.options.decay=t,this.buildImpulse(),console.debug(`[Reverb.js] Set impulse response decay level to ${t}.`)}delay(t){if(!e.inRange(t,0,100))throw RangeError(`[Reverb.js] Impulse Response delay time must be less than 100.`);this.options.delay=t,this.buildImpulse(),console.debug(`[Reverb.js] Set impulse response delay time to ${t}sec.`)}reverse(e){this.options.reverse=e,this.buildImpulse(),console.debug(`[Reverb.js] Inpulse response is ${e?``:`not `}reversed.`)}filterType(e=`allpass`){this.filterNode.type=this.options.filterType=e,console.debug(`[Reverb.js] Set filter type to ${e}`)}filterFreq(t){if(!e.inRange(t,20,2e4))throw RangeError(`[Reverb.js] Filter frequrncy must be between 20 and 20000.`);this.options.filterFreq=t,this.filterNode.frequency.value=this.options.filterFreq,console.debug(`[Reverb.js] Set filter frequency to ${t}Hz.`)}filterQ(t){if(!e.inRange(t,0,10))throw RangeError(`[Reverb.js] Filter Q value must be between 0 and 10.`);this.options.filterQ=t,this.filterNode.Q.value=this.options.filterQ,console.debug(`[Reverb.js] Set filter Q to ${t}.`)}peaks(e){this.options.peaks=e,this.buildImpulse(),console.debug(`[Reverb.js] Set IR source noise peaks to ${e}.`)}scale(e){this.options.scale=e,this.buildImpulse(),console.debug(`[Reverb.js] Set IR source noise scale to ${e}.`)}getNoise(e){return[...D(e,this.noise({bins:this.options.peaks,scale:this.options.scale,rnd:this.options.randomAlgorithm}))]}setNoise(e){switch(this.options.noise=e,e){case`blue`:this.noise=this.noiseMap.blue;break;case`brown`:this.noise=this.noiseMap.brown;break;case`green`:this.noise=this.noiseMap.green;break;case`pink`:this.noise=this.noiseMap.pink;break;case`red`:this.noise=this.noiseMap.red;break;case`violet`:this.noise=this.noiseMap.violet;break;case`white`:this.noise=this.noiseMap.white;break;default:this.noise=p;break}this.buildImpulse(),console.debug(`[Reverb.js] Set IR generator source noise type to ${e}.`)}setRandomAlgorithm(e){this.options.randomAlgorithm=e,this.buildImpulse(),console.debug(`[Reverb.js] Set IR source noise generator.`)}static inRange(e,t,n){return e>=t&&e<=n}buildImpulse(){let e=this.ctx.sampleRate,t=Math.max(e*this.options.time,1),n=e*this.options.delay,r=this.ctx.createBuffer(2,t,e),i=new Float32Array(t),a=new Float32Array(t),o=new Float32Array(1),s=new Float32Array(1),c=this.getNoise(t),l=this.getNoise(t);for(let e=0;e<t;e++){let r;e<n?(o[0]=0,s[0]=0,i.set(o,e),a.set(s,e),r=this.options.reverse??!1?t-(e-n):e-n):r=this.options.reverse??!1?t-e:e,o[0]=(c.at(e)??0)*(1-r/t)**this.options.decay,s[0]=(l.at(e)??0)*(1-r/t)**this.options.decay,i.set(o,e),a.set(s,e)}r.getChannelData(0).set(i),r.getChannelData(1).set(a),this.convolverNode.buffer=r}}});
12
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Reverb=t():e.Reverb=t()}(global,()=>(()=>{"use strict";var e={};e.d=(t,i,s)=>{var o=(i,s)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,[s]:i[o]})};o(i,"get"),o(s,"value")},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{default:()=>R});let i=1/0x100000000;class s{float(e=1){return this.int()*i*e}probability(e){return this.float()<e}norm(e=1){return(this.int()*i-.5)*2*e}normMinMax(e,t){let i=this.minmax(e,t);return .5>this.float()?i:-i}minmax(e,t){return this.float()*(t-e)+e}minmaxInt(e,t){let i=(0|t)-(e|=0);return i?e+this.int()%i:e}minmaxUint(e,t){let i=(t>>>0)-(e>>>=0);return i?e+this.int()%i:e}}let o=new class extends s{constructor(e){super(),this.rnd=e}rnd;float(e=1){return this.rnd()*e}norm(e=1){return(this.rnd()-.5)*2*e}int(){return 0x100000000*this.rnd()>>>0}}(Math.random),n={bins:2,scale:1,rnd:o};function*r(e){let{scale:t,rnd:i}={...n,...e};for(;;)yield i.norm(t)}let l=e=>e;class a{value;constructor(e){this.value=e}deref(){return this.value}}let h=e=>e instanceof a,d=e=>e instanceof a?e.deref():e,c={noise:"white",scale:1,peaks:2,randomAlgorithm:o,decay:2,delay:0,reverse:!1,time:2,filterType:"allpass",filterFreq:2200,filterQ:1,mix:.5,once:!1},u=(e,t,i)=>{let s=Array(e);for(let o=0;o<e;o++)s[o]=i.norm(t);return s},f=e=>e.reduce((e,t)=>e+t,0);function*p(e,t){let i=[e[Symbol.iterator](),t[Symbol.iterator]()];for(let e=0;;e^=1){let t=i[e].next();if(t.done)return;yield t.value}}function*b(e){let{bins:t,scale:i,rnd:s}={...n,...e},o=u(t,i,s);o.forEach((e,t)=>o[t]=1&t?e:-e);let r=1/t,l=f(o);for(let e=0,n=-1;;++e>=t&&(e=0))l-=o[e],l+=o[e]=n*s.norm(i),n^=0xfffffffe,yield n*l*r}function*m(e){let{bins:t,scale:i,rnd:s}={...n,...e},o=u(t,i,s),r=1/t,l=f(o);for(let e=0;;++e>=t&&(e=0))l-=o[e],l+=o[e]=s.norm(i),yield l*r}let v=e=>{let t=32;return(e&=-e)&&t--,65535&e&&(t-=16),0xff00ff&e&&(t-=8),0xf0f0f0f&e&&(t-=4),0x33333333&e&&(t-=2),0x55555555&e&&(t-=1),t},y={blue:b,brown:m,green:e=>p(b(e),b(e)),pink:function*(e){let{bins:t=8,scale:i,rnd:s}={...n,...e},o=u(t,i,s),r=1/t,l=f(o);for(let e=0;;e=e+1>>>0){let n=v(e)%t;l-=o[n],l+=o[n]=s.norm(i),yield l*r}},red:m,violet:e=>p(m(e),m(e)),white:r};function g(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class R{connect(e){return this.isConnected&&this.options.once?this.isConnected=!1:(this.convolverNode.connect(this.filterNode),this.filterNode.connect(this.wetGainNode),e.connect(this.convolverNode),e.connect(this.dryGainNode),e.connect(this.wetGainNode),this.dryGainNode.connect(this.outputNode),this.wetGainNode.connect(this.outputNode),this.isConnected=!0),this.outputNode}disconnect(e){return this.isConnected&&(this.convolverNode.disconnect(this.filterNode),this.filterNode.disconnect(this.wetGainNode)),this.isConnected=!1,e}mix(e){if(!R.inRange(e,0,1))throw RangeError("[Reverb.js] Dry/Wet ratio must be between 0 to 1.");this.options.mix=e,this.dryGainNode.gain.value=1-e,this.wetGainNode.gain.value=e,console.debug(`[Reverb.js] Set dry/wet ratio to ${100*e}%`)}time(e){if(!R.inRange(e,1,50))throw RangeError("[Reverb.js] Time length of impulse response must be less than 50sec.");this.options.time=e,this.buildImpulse(),console.debug(`[Reverb.js] Set impulse response time length to ${e}sec.`)}decay(e){if(!R.inRange(e,0,100))throw RangeError("[Reverb.js] Impulse Response decay level must be less than 100.");this.options.decay=e,this.buildImpulse(),console.debug(`[Reverb.js] Set impulse response decay level to ${e}.`)}delay(e){if(!R.inRange(e,0,100))throw RangeError("[Reverb.js] Impulse Response delay time must be less than 100.");this.options.delay=e,this.buildImpulse(),console.debug(`[Reverb.js] Set impulse response delay time to ${e}sec.`)}reverse(e){this.options.reverse=e,this.buildImpulse(),console.debug(`[Reverb.js] Inpulse response is ${e?"":"not "}reversed.`)}filterType(e="allpass"){this.filterNode.type=this.options.filterType=e,console.debug(`[Reverb.js] Set filter type to ${e}`)}filterFreq(e){if(!R.inRange(e,20,2e4))throw RangeError("[Reverb.js] Filter frequrncy must be between 20 and 20000.");this.options.filterFreq=e,this.filterNode.frequency.value=this.options.filterFreq,console.debug(`[Reverb.js] Set filter frequency to ${e}Hz.`)}filterQ(e){if(!R.inRange(e,0,10))throw RangeError("[Reverb.js] Filter Q value must be between 0 and 10.");this.options.filterQ=e,this.filterNode.Q.value=this.options.filterQ,console.debug(`[Reverb.js] Set filter Q to ${e}.`)}peaks(e){this.options.peaks=e,this.buildImpulse(),console.debug(`[Reverb.js] Set IR source noise peaks to ${e}.`)}scale(e){this.options.scale=e,this.buildImpulse(),console.debug(`[Reverb.js] Set IR source noise scale to ${e}.`)}getNoise(e){return[...function e(t,i){return"function"==typeof i?.[Symbol.iterator]?function*(e,t){let i=("function"==typeof e?.xform?e.xform():e)([()=>[],l,(e,t)=>(e.push(t),e)]),s=i[1],o=i[2];for(let e of t){let t=o([],e);if(h(t))return void(yield*d(s(t.deref())));t.length&&(yield*t)}yield*d(s([]))}(e(t),i):e=>{let i,s=e[2],o=t;return i=(e,t)=>{let i;return--o>0?s(e,t):0===o?(i=s(e,t))instanceof a?i:new a(i):new a(e)},[e[0],e[1],i]}}(e,this.noise({bins:this.options.peaks,scale:this.options.scale,rnd:this.options.randomAlgorithm}))]}setNoise(e){switch(this.options.noise=e,e){case"blue":this.noise=this.noiseMap.blue;break;case"brown":this.noise=this.noiseMap.brown;break;case"green":this.noise=this.noiseMap.green;break;case"pink":this.noise=this.noiseMap.pink;break;case"red":this.noise=this.noiseMap.red;break;case"violet":this.noise=this.noiseMap.violet;break;case"white":this.noise=this.noiseMap.white;break;default:this.noise=r}this.buildImpulse(),console.debug(`[Reverb.js] Set IR generator source noise type to ${e}.`)}setRandomAlgorithm(e){this.options.randomAlgorithm=e,this.buildImpulse(),console.debug("[Reverb.js] Set IR source noise generator.")}static inRange(e,t,i){return e>=t&&e<=i}buildImpulse(){let e=this.ctx.sampleRate,t=Math.max(e*this.options.time,1),i=e*this.options.delay,s=this.ctx.createBuffer(2,t,e),o=new Float32Array(t),n=new Float32Array(t),r=new Float32Array(1),l=new Float32Array(1),a=this.getNoise(t),h=this.getNoise(t);for(let e=0;e<t;e++){let s;e<i?(r[0]=0,l[0]=0,o.set(r,e),n.set(l,e),s=this.options.reverse?t-(e-i):e-i):s=this.options.reverse?t-e:e,r[0]=(a.at(e)??0)*(1-s/t)**this.options.decay,l[0]=(h.at(e)??0)*(1-s/t)**this.options.decay,o.set(r,e),n.set(l,e)}s.getChannelData(0).set(o),s.getChannelData(1).set(n),this.convolverNode.buffer=s}constructor(e,t={}){g(this,"ctx",void 0),g(this,"wetGainNode",void 0),g(this,"dryGainNode",void 0),g(this,"filterNode",void 0),g(this,"convolverNode",void 0),g(this,"outputNode",void 0),g(this,"options",void 0),g(this,"isConnected",void 0),g(this,"noise",r),g(this,"noiseMap",y),this.ctx=e,this.options=Object.assign({},c,t),this.wetGainNode=this.ctx.createGain(),this.dryGainNode=this.ctx.createGain(),this.filterNode=this.ctx.createBiquadFilter(),this.convolverNode=this.ctx.createConvolver(),this.outputNode=this.ctx.createGain(),this.isConnected=!1,this.filterType(this.options.filterType),this.setNoise(this.options.noise),this.buildImpulse(),this.mix(this.options.mix)}}return g(R,"version","1.6.0"),g(R,"build","2026-06-27T10:08:29.918Z"),t})());
13
+ //# sourceMappingURL=Reverb.umd.js.map