@logue/reverb 1.2.1 → 1.2.2
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/Meta.d.ts +3 -3
- package/dist/NoiseType.d.ts +6 -6
- package/dist/Reverb.d.ts +143 -143
- package/dist/Reverb.es.js +36 -26
- package/dist/Reverb.iife.js +223 -213
- package/dist/Reverb.umd.js +225 -215
- package/dist/interfaces/MetaInterface.d.ts +7 -7
- package/dist/interfaces/OptionInterface.d.ts +39 -39
- package/package.json +21 -20
package/dist/Reverb.umd.js
CHANGED
|
@@ -5,239 +5,249 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2019-2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.2.
|
|
8
|
+
* @version 1.2.2
|
|
9
9
|
* @see {@link https://github.com/logue/Reverb.js}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
(function (global, factory) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@thi.ng/random'), require('@thi.ng/colored-noise'), require('@thi.ng/transducers')) :
|
|
14
|
+
typeof define === 'function' && define.amd ? define(['@thi.ng/random', '@thi.ng/colored-noise', '@thi.ng/transducers'], factory) :
|
|
15
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Reverb = factory(global.random, global.colordNoise, global.transducers));
|
|
16
16
|
})(this, (function (random, coloredNoise, transducers) { 'use strict';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
/** Impulse response noise generation algorithm */
|
|
19
|
+
const Noise = {
|
|
20
|
+
/** Blue noise */
|
|
21
|
+
BLUE: 'blue',
|
|
22
|
+
/** Green noise */
|
|
23
|
+
GREEN: 'green',
|
|
24
|
+
/** Pink noise */
|
|
25
|
+
PINK: 'pink',
|
|
26
|
+
/** Red noise */
|
|
27
|
+
RED: 'red',
|
|
28
|
+
/** Violet noise */
|
|
29
|
+
VIOLET: 'violet',
|
|
30
|
+
/** White noise */
|
|
31
|
+
WHITE: 'white',
|
|
32
|
+
/** Brown noise (same as red noise) */
|
|
33
|
+
BROWN: 'red',
|
|
34
|
+
};
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
/** デフォルト値 */
|
|
37
|
+
const defaults = {
|
|
38
|
+
noise: Noise.WHITE,
|
|
39
|
+
scale: 1,
|
|
40
|
+
peaks: 2,
|
|
41
|
+
randomAlgorithm: random.SYSTEM,
|
|
42
|
+
decay: 2,
|
|
43
|
+
delay: 0,
|
|
44
|
+
reverse: false,
|
|
45
|
+
time: 2,
|
|
46
|
+
filterType: 'allpass',
|
|
47
|
+
filterFreq: 2200,
|
|
48
|
+
filterQ: 1,
|
|
49
|
+
mix: 0.5,
|
|
50
|
+
once: false,
|
|
51
|
+
};
|
|
43
52
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
// This file is auto-generated by the build system.
|
|
54
|
+
const meta = {
|
|
55
|
+
version: '1.2.2',
|
|
56
|
+
date: '2022-12-22T02:11:59.486Z',
|
|
57
|
+
};
|
|
48
58
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.isConnected = false;
|
|
70
|
-
this.filterType(this.options.filterType);
|
|
71
|
-
this.setNoise(this.options.noise);
|
|
72
|
-
this.buildImpulse();
|
|
73
|
-
this.mix(this.options.mix);
|
|
74
|
-
}
|
|
75
|
-
connect(sourceNode) {
|
|
76
|
-
if (this.isConnected && this.options.once) {
|
|
59
|
+
class Reverb {
|
|
60
|
+
static version = meta.version;
|
|
61
|
+
static build = meta.date;
|
|
62
|
+
ctx;
|
|
63
|
+
wetGainNode;
|
|
64
|
+
dryGainNode;
|
|
65
|
+
filterNode;
|
|
66
|
+
convolverNode;
|
|
67
|
+
outputNode;
|
|
68
|
+
options;
|
|
69
|
+
isConnected;
|
|
70
|
+
noise = coloredNoise.white;
|
|
71
|
+
constructor(ctx, options) {
|
|
72
|
+
this.ctx = ctx;
|
|
73
|
+
this.options = { ...defaults, ...options };
|
|
74
|
+
this.wetGainNode = this.ctx.createGain();
|
|
75
|
+
this.dryGainNode = this.ctx.createGain();
|
|
76
|
+
this.filterNode = this.ctx.createBiquadFilter();
|
|
77
|
+
this.convolverNode = this.ctx.createConvolver();
|
|
78
|
+
this.outputNode = this.ctx.createGain();
|
|
77
79
|
this.isConnected = false;
|
|
80
|
+
this.filterType(this.options.filterType);
|
|
81
|
+
this.setNoise(this.options.noise);
|
|
82
|
+
this.buildImpulse();
|
|
83
|
+
this.mix(this.options.mix);
|
|
84
|
+
}
|
|
85
|
+
connect(sourceNode) {
|
|
86
|
+
if (this.isConnected && this.options.once) {
|
|
87
|
+
this.isConnected = false;
|
|
88
|
+
return this.outputNode;
|
|
89
|
+
}
|
|
90
|
+
this.convolverNode.connect(this.filterNode);
|
|
91
|
+
this.filterNode.connect(this.wetGainNode);
|
|
92
|
+
sourceNode.connect(this.convolverNode);
|
|
93
|
+
sourceNode.connect(this.dryGainNode).connect(this.outputNode);
|
|
94
|
+
sourceNode.connect(this.wetGainNode).connect(this.outputNode);
|
|
95
|
+
this.isConnected = true;
|
|
78
96
|
return this.outputNode;
|
|
79
97
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
disconnect(sourceNode) {
|
|
89
|
-
if (this.isConnected) {
|
|
90
|
-
this.convolverNode.disconnect(this.filterNode);
|
|
91
|
-
this.filterNode.disconnect(this.wetGainNode);
|
|
98
|
+
disconnect(sourceNode) {
|
|
99
|
+
if (this.isConnected) {
|
|
100
|
+
this.convolverNode.disconnect(this.filterNode);
|
|
101
|
+
this.filterNode.disconnect(this.wetGainNode);
|
|
102
|
+
}
|
|
103
|
+
this.isConnected = false;
|
|
104
|
+
return sourceNode;
|
|
92
105
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
mix(mix) {
|
|
107
|
+
if (!this.inRange(mix, 0, 1)) {
|
|
108
|
+
throw new RangeError("[Reverb.js] Dry/Wet ratio must be between 0 to 1.");
|
|
109
|
+
}
|
|
110
|
+
this.options.mix = mix;
|
|
111
|
+
this.dryGainNode.gain.value = 1 - this.options.mix;
|
|
112
|
+
this.wetGainNode.gain.value = this.options.mix;
|
|
99
113
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (!this.inRange(value, 1, 50)) {
|
|
106
|
-
throw new RangeError(
|
|
107
|
-
"[Reverb.js] Time length of inpulse response must be less than 50sec."
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
this.options.time = value;
|
|
111
|
-
this.buildImpulse();
|
|
112
|
-
}
|
|
113
|
-
decay(value) {
|
|
114
|
-
if (!this.inRange(value, 0, 100)) {
|
|
115
|
-
throw new RangeError(
|
|
116
|
-
"[Reverb.js] Inpulse Response decay level must be less than 100."
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
this.options.decay = value;
|
|
120
|
-
this.buildImpulse();
|
|
121
|
-
}
|
|
122
|
-
delay(value) {
|
|
123
|
-
if (!this.inRange(value, 0, 100)) {
|
|
124
|
-
throw new RangeError(
|
|
125
|
-
"[Reverb.js] Inpulse Response delay time must be less than 100."
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
this.options.delay = value;
|
|
129
|
-
this.buildImpulse();
|
|
130
|
-
}
|
|
131
|
-
reverse(reverse) {
|
|
132
|
-
this.options.reverse = reverse;
|
|
133
|
-
this.buildImpulse();
|
|
134
|
-
}
|
|
135
|
-
filterType(type = "allpass") {
|
|
136
|
-
this.filterNode.type = this.options.filterType = type;
|
|
137
|
-
}
|
|
138
|
-
filterFreq(freq) {
|
|
139
|
-
if (!this.inRange(freq, 20, 2e4)) {
|
|
140
|
-
throw new RangeError(
|
|
141
|
-
"[Reverb.js] Filter frequrncy must be between 20 and 20000."
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
this.options.filterFreq = freq;
|
|
145
|
-
this.filterNode.frequency.value = this.options.filterFreq;
|
|
146
|
-
}
|
|
147
|
-
filterQ(q) {
|
|
148
|
-
if (!this.inRange(q, 0, 10)) {
|
|
149
|
-
throw new RangeError(
|
|
150
|
-
"[Reverb.js] Filter quality value must be between 0 and 10."
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
this.options.filterQ = q;
|
|
154
|
-
this.filterNode.Q.value = this.options.filterQ;
|
|
155
|
-
}
|
|
156
|
-
peaks(p) {
|
|
157
|
-
this.options.peaks = p;
|
|
158
|
-
this.buildImpulse();
|
|
159
|
-
}
|
|
160
|
-
scale(s) {
|
|
161
|
-
this.options.scale = s;
|
|
162
|
-
this.buildImpulse();
|
|
163
|
-
}
|
|
164
|
-
randomAlgorithm(a) {
|
|
165
|
-
this.options.randomAlgorithm = a;
|
|
166
|
-
this.buildImpulse();
|
|
167
|
-
}
|
|
168
|
-
setNoise(type) {
|
|
169
|
-
this.options.noise = type;
|
|
170
|
-
switch (type) {
|
|
171
|
-
case Noise.BLUE:
|
|
172
|
-
this.noise = coloredNoise.blue;
|
|
173
|
-
break;
|
|
174
|
-
case Noise.GREEN:
|
|
175
|
-
this.noise = coloredNoise.green;
|
|
176
|
-
break;
|
|
177
|
-
case Noise.PINK:
|
|
178
|
-
this.noise = coloredNoise.pink;
|
|
179
|
-
break;
|
|
180
|
-
case Noise.RED:
|
|
181
|
-
case Noise.BROWN:
|
|
182
|
-
this.noise = coloredNoise.red;
|
|
183
|
-
break;
|
|
184
|
-
case Noise.VIOLET:
|
|
185
|
-
this.noise = coloredNoise.violet;
|
|
186
|
-
break;
|
|
187
|
-
default:
|
|
188
|
-
this.noise = coloredNoise.white;
|
|
189
|
-
}
|
|
190
|
-
this.buildImpulse();
|
|
191
|
-
}
|
|
192
|
-
setRandomAlgorythm(algorithm) {
|
|
193
|
-
this.options.randomAlgorithm = algorithm;
|
|
194
|
-
this.buildImpulse();
|
|
195
|
-
}
|
|
196
|
-
inRange(x, min, max) {
|
|
197
|
-
return (x - min) * (x - max) <= 0;
|
|
198
|
-
}
|
|
199
|
-
buildImpulse() {
|
|
200
|
-
const rate = this.ctx.sampleRate;
|
|
201
|
-
const duration = Math.max(rate * this.options.time, 1);
|
|
202
|
-
const delayDuration = rate * this.options.delay;
|
|
203
|
-
const impulse = this.ctx.createBuffer(2, duration, rate);
|
|
204
|
-
const impulseL = new Float32Array(duration);
|
|
205
|
-
const impulseR = new Float32Array(duration);
|
|
206
|
-
const noiseL = this.getNoise(duration);
|
|
207
|
-
const noiseR = this.getNoise(duration);
|
|
208
|
-
for (let i = 0; i < duration; i++) {
|
|
209
|
-
let n = 0;
|
|
210
|
-
if (i < delayDuration) {
|
|
211
|
-
impulseL[i] = 0;
|
|
212
|
-
impulseR[i] = 0;
|
|
213
|
-
n = this.options.reverse ? duration - (i - delayDuration) : i - delayDuration;
|
|
214
|
-
} else {
|
|
215
|
-
n = this.options.reverse ? duration - i : i;
|
|
114
|
+
time(value) {
|
|
115
|
+
if (!this.inRange(value, 1, 50)) {
|
|
116
|
+
throw new RangeError(
|
|
117
|
+
"[Reverb.js] Time length of inpulse response must be less than 50sec."
|
|
118
|
+
);
|
|
216
119
|
}
|
|
217
|
-
|
|
218
|
-
|
|
120
|
+
this.options.time = value;
|
|
121
|
+
this.buildImpulse();
|
|
219
122
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
123
|
+
decay(value) {
|
|
124
|
+
if (!this.inRange(value, 0, 100)) {
|
|
125
|
+
throw new RangeError(
|
|
126
|
+
"[Reverb.js] Inpulse Response decay level must be less than 100."
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
this.options.decay = value;
|
|
130
|
+
this.buildImpulse();
|
|
131
|
+
}
|
|
132
|
+
delay(value) {
|
|
133
|
+
if (!this.inRange(value, 0, 100)) {
|
|
134
|
+
throw new RangeError(
|
|
135
|
+
"[Reverb.js] Inpulse Response delay time must be less than 100."
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
this.options.delay = value;
|
|
139
|
+
this.buildImpulse();
|
|
140
|
+
}
|
|
141
|
+
reverse(reverse) {
|
|
142
|
+
this.options.reverse = reverse;
|
|
143
|
+
this.buildImpulse();
|
|
144
|
+
}
|
|
145
|
+
filterType(type = "allpass") {
|
|
146
|
+
this.filterNode.type = this.options.filterType = type;
|
|
147
|
+
}
|
|
148
|
+
filterFreq(freq) {
|
|
149
|
+
if (!this.inRange(freq, 20, 2e4)) {
|
|
150
|
+
throw new RangeError(
|
|
151
|
+
"[Reverb.js] Filter frequrncy must be between 20 and 20000."
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
this.options.filterFreq = freq;
|
|
155
|
+
this.filterNode.frequency.value = this.options.filterFreq;
|
|
156
|
+
}
|
|
157
|
+
filterQ(q) {
|
|
158
|
+
if (!this.inRange(q, 0, 10)) {
|
|
159
|
+
throw new RangeError(
|
|
160
|
+
"[Reverb.js] Filter quality value must be between 0 and 10."
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
this.options.filterQ = q;
|
|
164
|
+
this.filterNode.Q.value = this.options.filterQ;
|
|
165
|
+
}
|
|
166
|
+
peaks(p) {
|
|
167
|
+
this.options.peaks = p;
|
|
168
|
+
this.buildImpulse();
|
|
169
|
+
}
|
|
170
|
+
scale(s) {
|
|
171
|
+
this.options.scale = s;
|
|
172
|
+
this.buildImpulse();
|
|
173
|
+
}
|
|
174
|
+
randomAlgorithm(a) {
|
|
175
|
+
this.options.randomAlgorithm = a;
|
|
176
|
+
this.buildImpulse();
|
|
177
|
+
}
|
|
178
|
+
setNoise(type) {
|
|
179
|
+
this.options.noise = type;
|
|
180
|
+
switch (type) {
|
|
181
|
+
case Noise.BLUE:
|
|
182
|
+
this.noise = coloredNoise.blue;
|
|
183
|
+
break;
|
|
184
|
+
case Noise.GREEN:
|
|
185
|
+
this.noise = coloredNoise.green;
|
|
186
|
+
break;
|
|
187
|
+
case Noise.PINK:
|
|
188
|
+
this.noise = coloredNoise.pink;
|
|
189
|
+
break;
|
|
190
|
+
case Noise.RED:
|
|
191
|
+
case Noise.BROWN:
|
|
192
|
+
this.noise = coloredNoise.red;
|
|
193
|
+
break;
|
|
194
|
+
case Noise.VIOLET:
|
|
195
|
+
this.noise = coloredNoise.violet;
|
|
196
|
+
break;
|
|
197
|
+
default:
|
|
198
|
+
this.noise = coloredNoise.white;
|
|
199
|
+
}
|
|
200
|
+
this.buildImpulse();
|
|
201
|
+
}
|
|
202
|
+
setRandomAlgorythm(algorithm) {
|
|
203
|
+
this.options.randomAlgorithm = algorithm;
|
|
204
|
+
this.buildImpulse();
|
|
205
|
+
}
|
|
206
|
+
inRange(x, min, max) {
|
|
207
|
+
return (x - min) * (x - max) <= 0;
|
|
208
|
+
}
|
|
209
|
+
buildImpulse() {
|
|
210
|
+
const rate = this.ctx.sampleRate;
|
|
211
|
+
const duration = Math.max(rate * this.options.time, 1);
|
|
212
|
+
const delayDuration = rate * this.options.delay;
|
|
213
|
+
const impulse = this.ctx.createBuffer(2, duration, rate);
|
|
214
|
+
const impulseL = new Float32Array(duration);
|
|
215
|
+
const impulseR = new Float32Array(duration);
|
|
216
|
+
const noiseL = this.getNoise(duration);
|
|
217
|
+
const noiseR = this.getNoise(duration);
|
|
218
|
+
for (let i = 0; i < duration; i++) {
|
|
219
|
+
let n = 0;
|
|
220
|
+
if (i < delayDuration) {
|
|
221
|
+
impulseL[i] = 0;
|
|
222
|
+
impulseR[i] = 0;
|
|
223
|
+
n = this.options.reverse ? duration - (i - delayDuration) : i - delayDuration;
|
|
224
|
+
} else {
|
|
225
|
+
n = this.options.reverse ? duration - i : i;
|
|
226
|
+
}
|
|
227
|
+
impulseL[i] = noiseL[i] * (1 - n / duration) ** this.options.decay;
|
|
228
|
+
impulseR[i] = noiseR[i] * (1 - n / duration) ** this.options.decay;
|
|
229
|
+
}
|
|
230
|
+
impulse.getChannelData(0).set(impulseL);
|
|
231
|
+
impulse.getChannelData(1).set(impulseR);
|
|
232
|
+
this.convolverNode.buffer = impulse;
|
|
233
|
+
}
|
|
234
|
+
getNoise(duration) {
|
|
235
|
+
return [
|
|
236
|
+
...transducers.take(
|
|
237
|
+
duration,
|
|
238
|
+
this.noise(
|
|
239
|
+
this.options.peaks,
|
|
240
|
+
this.options.scale,
|
|
241
|
+
this.options.randomAlgorithm
|
|
242
|
+
)
|
|
232
243
|
)
|
|
233
|
-
|
|
234
|
-
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (!window.Reverb) {
|
|
248
|
+
window.Reverb = Reverb;
|
|
235
249
|
}
|
|
236
|
-
}
|
|
237
|
-
if (!window.Reverb) {
|
|
238
|
-
window.Reverb = Reverb;
|
|
239
|
-
}
|
|
240
250
|
|
|
241
|
-
|
|
251
|
+
return Reverb;
|
|
242
252
|
|
|
243
253
|
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** Meta Information Interface */
|
|
2
|
-
export default interface MetaInterface {
|
|
3
|
-
/** Version */
|
|
4
|
-
version: string;
|
|
5
|
-
/** Build Date */
|
|
6
|
-
date: string;
|
|
7
|
-
}
|
|
1
|
+
/** Meta Information Interface */
|
|
2
|
+
export default interface MetaInterface {
|
|
3
|
+
/** Version */
|
|
4
|
+
version: string;
|
|
5
|
+
/** Build Date */
|
|
6
|
+
date: string;
|
|
7
|
+
}
|
|
8
8
|
//# sourceMappingURL=MetaInterface.d.ts.map
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { type NoiseType } from '../NoiseType';
|
|
2
|
-
import type { INorm } from '@thi.ng/random';
|
|
3
|
-
/** Reverb Option */
|
|
4
|
-
export default interface OptionInterface {
|
|
5
|
-
/**
|
|
6
|
-
* IR (Inpulse Response) colord noise algorithm (BLUE, GREEN, PINK, RED, VIOLET, WHITE)
|
|
7
|
-
* @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/colored-noise}
|
|
8
|
-
*/
|
|
9
|
-
noise: NoiseType;
|
|
10
|
-
/** IR source noise scale */
|
|
11
|
-
scale: number;
|
|
12
|
-
/** Number of IR source noise peaks */
|
|
13
|
-
peaks: number;
|
|
14
|
-
/**
|
|
15
|
-
* Randam noise algorythm
|
|
16
|
-
* @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/random}
|
|
17
|
-
*/
|
|
18
|
-
randomAlgorithm: INorm;
|
|
19
|
-
/** Decay */
|
|
20
|
-
decay: number;
|
|
21
|
-
/** Delay until impulse response is generated */
|
|
22
|
-
delay: number;
|
|
23
|
-
/** Filter frequency applied to impulse response[Hz] */
|
|
24
|
-
filterFreq: number;
|
|
25
|
-
/** Filter quality for impulse response */
|
|
26
|
-
filterQ: number;
|
|
27
|
-
/** Filter type for impulse response */
|
|
28
|
-
filterType: BiquadFilterType;
|
|
29
|
-
/** Dry/Wet ratio */
|
|
30
|
-
mix: number;
|
|
31
|
-
/** Invert the impulse response */
|
|
32
|
-
reverse: boolean;
|
|
33
|
-
/** Impulse response length */
|
|
34
|
-
time: number;
|
|
35
|
-
/** Prevents multiple effectors from being connected. */
|
|
36
|
-
once: boolean;
|
|
37
|
-
}
|
|
38
|
-
/** デフォルト値 */
|
|
39
|
-
export declare const defaults: OptionInterface;
|
|
1
|
+
import { type NoiseType } from '../NoiseType';
|
|
2
|
+
import type { INorm } from '@thi.ng/random';
|
|
3
|
+
/** Reverb Option */
|
|
4
|
+
export default interface OptionInterface {
|
|
5
|
+
/**
|
|
6
|
+
* IR (Inpulse Response) colord noise algorithm (BLUE, GREEN, PINK, RED, VIOLET, WHITE)
|
|
7
|
+
* @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/colored-noise}
|
|
8
|
+
*/
|
|
9
|
+
noise: NoiseType;
|
|
10
|
+
/** IR source noise scale */
|
|
11
|
+
scale: number;
|
|
12
|
+
/** Number of IR source noise peaks */
|
|
13
|
+
peaks: number;
|
|
14
|
+
/**
|
|
15
|
+
* Randam noise algorythm
|
|
16
|
+
* @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/random}
|
|
17
|
+
*/
|
|
18
|
+
randomAlgorithm: INorm;
|
|
19
|
+
/** Decay */
|
|
20
|
+
decay: number;
|
|
21
|
+
/** Delay until impulse response is generated */
|
|
22
|
+
delay: number;
|
|
23
|
+
/** Filter frequency applied to impulse response[Hz] */
|
|
24
|
+
filterFreq: number;
|
|
25
|
+
/** Filter quality for impulse response */
|
|
26
|
+
filterQ: number;
|
|
27
|
+
/** Filter type for impulse response */
|
|
28
|
+
filterType: BiquadFilterType;
|
|
29
|
+
/** Dry/Wet ratio */
|
|
30
|
+
mix: number;
|
|
31
|
+
/** Invert the impulse response */
|
|
32
|
+
reverse: boolean;
|
|
33
|
+
/** Impulse response length */
|
|
34
|
+
time: number;
|
|
35
|
+
/** Prevents multiple effectors from being connected. */
|
|
36
|
+
once: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** デフォルト値 */
|
|
39
|
+
export declare const defaults: OptionInterface;
|
|
40
40
|
//# sourceMappingURL=OptionInterface.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@logue/reverb",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"description": "JavaScript Reverb effect class",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"webaudio",
|
|
@@ -40,44 +40,45 @@
|
|
|
40
40
|
"node": ">=18.12.1",
|
|
41
41
|
"yarn": ">=1.22.19"
|
|
42
42
|
},
|
|
43
|
-
"packageManager": "yarn@3.3.
|
|
43
|
+
"packageManager": "yarn@3.3.1",
|
|
44
44
|
"sideEffects": false,
|
|
45
45
|
"scripts": {
|
|
46
|
-
"
|
|
47
|
-
"type-check": "tsc --composite false",
|
|
48
|
-
"build": "
|
|
49
|
-
"build:analyze": "vite build --mode analyze",
|
|
46
|
+
"clean": "rimraf node_modules/.vite",
|
|
47
|
+
"type-check": "tsc --noEmit --composite false",
|
|
48
|
+
"build": "run-p type-check build-only build-declaration",
|
|
50
49
|
"build:clean": "rimraf dist",
|
|
50
|
+
"build-only": "vite build",
|
|
51
|
+
"build-declaration": "tsc -p tsconfig.app.json --composite false --declaration --declarationMap --declarationDir dist",
|
|
51
52
|
"lint": "eslint . --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint && prettier . --write",
|
|
52
|
-
"preview": "vite serve docs",
|
|
53
53
|
"prepare": "husky install"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@thi.ng/colored-noise": "^1.0.
|
|
57
|
-
"@thi.ng/transducers": "^8.3.
|
|
56
|
+
"@thi.ng/colored-noise": "^1.0.4",
|
|
57
|
+
"@thi.ng/transducers": "^8.3.27"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/node": "^18.11.
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
62
|
-
"@typescript-eslint/parser": "^5.
|
|
63
|
-
"eslint": "^8.
|
|
60
|
+
"@types/node": "^18.11.17",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
62
|
+
"@typescript-eslint/parser": "^5.47.0",
|
|
63
|
+
"eslint": "^8.30.0",
|
|
64
64
|
"eslint-config-google": "^0.14.0",
|
|
65
65
|
"eslint-config-prettier": "^8.5.0",
|
|
66
66
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
67
67
|
"eslint-import-resolver-typescript": "^3.5.2",
|
|
68
68
|
"eslint-plugin-import": "^2.26.0",
|
|
69
|
-
"eslint-plugin-jsdoc": "^39.6.
|
|
69
|
+
"eslint-plugin-jsdoc": "^39.6.4",
|
|
70
70
|
"eslint-plugin-prettier": "^4.2.1",
|
|
71
71
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
72
72
|
"husky": "^8.0.2",
|
|
73
|
-
"lint-staged": "^13.0
|
|
74
|
-
"
|
|
73
|
+
"lint-staged": "^13.1.0",
|
|
74
|
+
"npm-run-all": "^4.1.5",
|
|
75
|
+
"prettier": "^2.8.1",
|
|
75
76
|
"rimraf": "^3.0.2",
|
|
76
77
|
"rollup-plugin-visualizer": "^5.8.3",
|
|
77
|
-
"typescript": "^4.9.
|
|
78
|
-
"vite": "^
|
|
79
|
-
"vite-plugin-banner": "^0.
|
|
80
|
-
"vite-plugin-checker": "^0.5.
|
|
78
|
+
"typescript": "^4.9.4",
|
|
79
|
+
"vite": "^4.0.3",
|
|
80
|
+
"vite-plugin-banner": "^0.7.0",
|
|
81
|
+
"vite-plugin-checker": "^0.5.2",
|
|
81
82
|
"vite-plugin-dts": "^1.7.1"
|
|
82
83
|
},
|
|
83
84
|
"husky": {
|