@logue/reverb 1.2.8 → 1.2.11
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 +18 -18
- package/dist/Reverb.iife.js +18 -18
- package/dist/Reverb.umd.js +18 -18
- package/dist/src/NoiseType.d.ts +2 -2
- package/dist/src/interfaces/OptionInterface.d.ts +29 -15
- package/package.json +19 -18
package/dist/Reverb.es.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2019-2023 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.2.
|
|
8
|
+
* @version 1.2.11
|
|
9
9
|
* @see {@link https://github.com/logue/Reverb.js}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -30,25 +30,25 @@ const defaults = {
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
const meta = {
|
|
33
|
-
version: "1.2.
|
|
34
|
-
date: "2023-
|
|
33
|
+
version: "1.2.11",
|
|
34
|
+
date: "2023-04-14T05:19:21.845Z"
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
const Noise = {
|
|
38
38
|
/** Blue noise */
|
|
39
|
-
|
|
39
|
+
blue: "blue",
|
|
40
40
|
/** Green noise */
|
|
41
|
-
|
|
41
|
+
green: "green",
|
|
42
42
|
/** Pink noise */
|
|
43
|
-
|
|
43
|
+
pink: "pink",
|
|
44
44
|
/** Red noise */
|
|
45
|
-
|
|
45
|
+
brown: "red",
|
|
46
46
|
/** Violet noise */
|
|
47
|
-
|
|
47
|
+
violet: "violet",
|
|
48
48
|
/** White noise */
|
|
49
|
-
|
|
49
|
+
white: "white",
|
|
50
50
|
/** Brown noise (same as red noise) */
|
|
51
|
-
|
|
51
|
+
red: "red"
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
class Reverb {
|
|
@@ -80,9 +80,9 @@ class Reverb {
|
|
|
80
80
|
* @param ctx - Root AudioContext
|
|
81
81
|
* @param options - Configure
|
|
82
82
|
*/
|
|
83
|
-
constructor(ctx, options) {
|
|
83
|
+
constructor(ctx, options = {}) {
|
|
84
84
|
this.ctx = ctx;
|
|
85
|
-
this.options =
|
|
85
|
+
this.options = Object.assign(defaults, options);
|
|
86
86
|
this.wetGainNode = this.ctx.createGain();
|
|
87
87
|
this.dryGainNode = this.ctx.createGain();
|
|
88
88
|
this.filterNode = this.ctx.createBiquadFilter();
|
|
@@ -260,20 +260,20 @@ class Reverb {
|
|
|
260
260
|
setNoise(type) {
|
|
261
261
|
this.options.noise = type;
|
|
262
262
|
switch (type) {
|
|
263
|
-
case Noise
|
|
263
|
+
case Noise.blue:
|
|
264
264
|
this.noise = blue;
|
|
265
265
|
break;
|
|
266
|
-
case Noise
|
|
266
|
+
case Noise.green:
|
|
267
267
|
this.noise = green;
|
|
268
268
|
break;
|
|
269
|
-
case Noise
|
|
269
|
+
case Noise.pink:
|
|
270
270
|
this.noise = pink;
|
|
271
271
|
break;
|
|
272
|
-
case Noise
|
|
273
|
-
case Noise
|
|
272
|
+
case Noise.red:
|
|
273
|
+
case Noise.brown:
|
|
274
274
|
this.noise = red;
|
|
275
275
|
break;
|
|
276
|
-
case Noise
|
|
276
|
+
case Noise.violet:
|
|
277
277
|
this.noise = violet;
|
|
278
278
|
break;
|
|
279
279
|
default:
|
package/dist/Reverb.iife.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2019-2023 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.2.
|
|
8
|
+
* @version 1.2.11
|
|
9
9
|
* @see {@link https://github.com/logue/Reverb.js}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -29,25 +29,25 @@ var Reverb = (function (random, coloredNoise, transducers) {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const meta = {
|
|
32
|
-
version: "1.2.
|
|
33
|
-
date: "2023-
|
|
32
|
+
version: "1.2.11",
|
|
33
|
+
date: "2023-04-14T05:19:21.845Z"
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const Noise = {
|
|
37
37
|
/** Blue noise */
|
|
38
|
-
|
|
38
|
+
blue: "blue",
|
|
39
39
|
/** Green noise */
|
|
40
|
-
|
|
40
|
+
green: "green",
|
|
41
41
|
/** Pink noise */
|
|
42
|
-
|
|
42
|
+
pink: "pink",
|
|
43
43
|
/** Red noise */
|
|
44
|
-
|
|
44
|
+
brown: "red",
|
|
45
45
|
/** Violet noise */
|
|
46
|
-
|
|
46
|
+
violet: "violet",
|
|
47
47
|
/** White noise */
|
|
48
|
-
|
|
48
|
+
white: "white",
|
|
49
49
|
/** Brown noise (same as red noise) */
|
|
50
|
-
|
|
50
|
+
red: "red"
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
class Reverb {
|
|
@@ -79,9 +79,9 @@ var Reverb = (function (random, coloredNoise, transducers) {
|
|
|
79
79
|
* @param ctx - Root AudioContext
|
|
80
80
|
* @param options - Configure
|
|
81
81
|
*/
|
|
82
|
-
constructor(ctx, options) {
|
|
82
|
+
constructor(ctx, options = {}) {
|
|
83
83
|
this.ctx = ctx;
|
|
84
|
-
this.options =
|
|
84
|
+
this.options = Object.assign(defaults, options);
|
|
85
85
|
this.wetGainNode = this.ctx.createGain();
|
|
86
86
|
this.dryGainNode = this.ctx.createGain();
|
|
87
87
|
this.filterNode = this.ctx.createBiquadFilter();
|
|
@@ -259,20 +259,20 @@ var Reverb = (function (random, coloredNoise, transducers) {
|
|
|
259
259
|
setNoise(type) {
|
|
260
260
|
this.options.noise = type;
|
|
261
261
|
switch (type) {
|
|
262
|
-
case Noise
|
|
262
|
+
case Noise.blue:
|
|
263
263
|
this.noise = coloredNoise.blue;
|
|
264
264
|
break;
|
|
265
|
-
case Noise
|
|
265
|
+
case Noise.green:
|
|
266
266
|
this.noise = coloredNoise.green;
|
|
267
267
|
break;
|
|
268
|
-
case Noise
|
|
268
|
+
case Noise.pink:
|
|
269
269
|
this.noise = coloredNoise.pink;
|
|
270
270
|
break;
|
|
271
|
-
case Noise
|
|
272
|
-
case Noise
|
|
271
|
+
case Noise.red:
|
|
272
|
+
case Noise.brown:
|
|
273
273
|
this.noise = coloredNoise.red;
|
|
274
274
|
break;
|
|
275
|
-
case Noise
|
|
275
|
+
case Noise.violet:
|
|
276
276
|
this.noise = coloredNoise.violet;
|
|
277
277
|
break;
|
|
278
278
|
default:
|
package/dist/Reverb.umd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2019-2023 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.2.
|
|
8
|
+
* @version 1.2.11
|
|
9
9
|
* @see {@link https://github.com/logue/Reverb.js}
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -32,25 +32,25 @@
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const meta = {
|
|
35
|
-
version: "1.2.
|
|
36
|
-
date: "2023-
|
|
35
|
+
version: "1.2.11",
|
|
36
|
+
date: "2023-04-14T05:19:21.845Z"
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const Noise = {
|
|
40
40
|
/** Blue noise */
|
|
41
|
-
|
|
41
|
+
blue: "blue",
|
|
42
42
|
/** Green noise */
|
|
43
|
-
|
|
43
|
+
green: "green",
|
|
44
44
|
/** Pink noise */
|
|
45
|
-
|
|
45
|
+
pink: "pink",
|
|
46
46
|
/** Red noise */
|
|
47
|
-
|
|
47
|
+
brown: "red",
|
|
48
48
|
/** Violet noise */
|
|
49
|
-
|
|
49
|
+
violet: "violet",
|
|
50
50
|
/** White noise */
|
|
51
|
-
|
|
51
|
+
white: "white",
|
|
52
52
|
/** Brown noise (same as red noise) */
|
|
53
|
-
|
|
53
|
+
red: "red"
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
class Reverb {
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
* @param ctx - Root AudioContext
|
|
83
83
|
* @param options - Configure
|
|
84
84
|
*/
|
|
85
|
-
constructor(ctx, options) {
|
|
85
|
+
constructor(ctx, options = {}) {
|
|
86
86
|
this.ctx = ctx;
|
|
87
|
-
this.options =
|
|
87
|
+
this.options = Object.assign(defaults, options);
|
|
88
88
|
this.wetGainNode = this.ctx.createGain();
|
|
89
89
|
this.dryGainNode = this.ctx.createGain();
|
|
90
90
|
this.filterNode = this.ctx.createBiquadFilter();
|
|
@@ -262,20 +262,20 @@
|
|
|
262
262
|
setNoise(type) {
|
|
263
263
|
this.options.noise = type;
|
|
264
264
|
switch (type) {
|
|
265
|
-
case Noise
|
|
265
|
+
case Noise.blue:
|
|
266
266
|
this.noise = coloredNoise.blue;
|
|
267
267
|
break;
|
|
268
|
-
case Noise
|
|
268
|
+
case Noise.green:
|
|
269
269
|
this.noise = coloredNoise.green;
|
|
270
270
|
break;
|
|
271
|
-
case Noise
|
|
271
|
+
case Noise.pink:
|
|
272
272
|
this.noise = coloredNoise.pink;
|
|
273
273
|
break;
|
|
274
|
-
case Noise
|
|
275
|
-
case Noise
|
|
274
|
+
case Noise.red:
|
|
275
|
+
case Noise.brown:
|
|
276
276
|
this.noise = coloredNoise.red;
|
|
277
277
|
break;
|
|
278
|
-
case Noise
|
|
278
|
+
case Noise.violet:
|
|
279
279
|
this.noise = coloredNoise.violet;
|
|
280
280
|
break;
|
|
281
281
|
default:
|
package/dist/src/NoiseType.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Impulse response noise generation algorithm */
|
|
2
|
-
declare const Noise: Record<
|
|
2
|
+
declare const Noise: Record<NoiseType, string>;
|
|
3
3
|
/** Noise Type */
|
|
4
|
-
export type NoiseType =
|
|
4
|
+
export type NoiseType = 'blue' | 'green' | 'pink' | 'red' | 'violet' | 'white' | 'brown';
|
|
5
5
|
/** Noise */
|
|
6
6
|
export default Noise;
|
|
@@ -1,39 +1,53 @@
|
|
|
1
|
-
import type { NoiseType } from '../NoiseType';
|
|
2
1
|
import type { INorm } from '@thi.ng/random';
|
|
2
|
+
import type { NoiseType } from '../NoiseType';
|
|
3
3
|
/** Reverb Option */
|
|
4
4
|
export default interface OptionInterface {
|
|
5
5
|
/**
|
|
6
6
|
* IR (Inpulse Response) colord noise algorithm (BLUE, GREEN, PINK, RED, VIOLET, WHITE)
|
|
7
7
|
* @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/colored-noise}
|
|
8
8
|
*/
|
|
9
|
-
noise
|
|
9
|
+
noise?: NoiseType;
|
|
10
10
|
/** IR source noise scale */
|
|
11
|
-
scale
|
|
11
|
+
scale?: number;
|
|
12
12
|
/** Number of IR source noise peaks */
|
|
13
|
-
peaks
|
|
13
|
+
peaks?: number;
|
|
14
14
|
/**
|
|
15
15
|
* Randam noise algorythm
|
|
16
16
|
* @see {@link https://github.com/thi-ng/umbrella/tree/develop/packages/random}
|
|
17
17
|
*/
|
|
18
|
-
randomAlgorithm
|
|
18
|
+
randomAlgorithm?: INorm;
|
|
19
19
|
/** Decay */
|
|
20
|
-
decay
|
|
20
|
+
decay?: number;
|
|
21
21
|
/** Delay until impulse response is generated */
|
|
22
|
-
delay
|
|
22
|
+
delay?: number;
|
|
23
23
|
/** Filter frequency applied to impulse response[Hz] */
|
|
24
|
-
filterFreq
|
|
24
|
+
filterFreq?: number;
|
|
25
25
|
/** Filter quality for impulse response */
|
|
26
|
-
filterQ
|
|
26
|
+
filterQ?: number;
|
|
27
27
|
/** Filter type for impulse response */
|
|
28
|
-
filterType
|
|
28
|
+
filterType?: BiquadFilterType;
|
|
29
29
|
/** Dry/Wet ratio */
|
|
30
|
-
mix
|
|
30
|
+
mix?: number;
|
|
31
31
|
/** Invert the impulse response */
|
|
32
|
-
reverse
|
|
32
|
+
reverse?: boolean;
|
|
33
33
|
/** Impulse response length */
|
|
34
|
-
time
|
|
34
|
+
time?: number;
|
|
35
35
|
/** Prevents multiple effectors from being connected. */
|
|
36
|
-
once
|
|
36
|
+
once?: boolean;
|
|
37
37
|
}
|
|
38
38
|
/** デフォルト値 */
|
|
39
|
-
export declare const defaults:
|
|
39
|
+
export declare const defaults: {
|
|
40
|
+
noise: NoiseType;
|
|
41
|
+
scale: number;
|
|
42
|
+
peaks: number;
|
|
43
|
+
randomAlgorithm: INorm;
|
|
44
|
+
decay: number;
|
|
45
|
+
delay: number;
|
|
46
|
+
filterFreq: number;
|
|
47
|
+
filterQ: number;
|
|
48
|
+
filterType: BiquadFilterType;
|
|
49
|
+
mix: number;
|
|
50
|
+
reverse: boolean;
|
|
51
|
+
time: number;
|
|
52
|
+
once: boolean;
|
|
53
|
+
};
|
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.11",
|
|
5
5
|
"description": "JavaScript Reverb effect class",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"webaudio",
|
|
@@ -57,35 +57,36 @@
|
|
|
57
57
|
"prepare": "husky install"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@thi.ng/colored-noise": "^1.0.
|
|
61
|
-
"@thi.ng/transducers": "^8.
|
|
60
|
+
"@thi.ng/colored-noise": "^1.0.14",
|
|
61
|
+
"@thi.ng/transducers": "^8.4.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@tsconfig/node18-strictest-esm": "^1.0.1",
|
|
65
|
-
"@types/node": "^18.15.
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
67
|
-
"
|
|
68
|
-
"eslint": "^8.
|
|
69
|
-
"eslint-config-prettier": "^8.
|
|
70
|
-
"eslint-config-standard-with-typescript": "
|
|
65
|
+
"@types/node": "^18.15.11",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
67
|
+
"bootstrap": "^5.3.0-alpha.3",
|
|
68
|
+
"eslint": "^8.38.0",
|
|
69
|
+
"eslint-config-prettier": "^8.8.0",
|
|
70
|
+
"eslint-config-standard-with-typescript": "^34.0.1",
|
|
71
71
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
72
|
-
"eslint-import-resolver-typescript": "^3.5.
|
|
72
|
+
"eslint-import-resolver-typescript": "^3.5.5",
|
|
73
|
+
"eslint-plugin-html": "^7.1.0",
|
|
73
74
|
"eslint-plugin-import": "^2.27.5",
|
|
74
|
-
"eslint-plugin-n": "^15.
|
|
75
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
75
|
+
"eslint-plugin-n": "^15.7.0",
|
|
76
76
|
"eslint-plugin-promise": "^6.1.1",
|
|
77
77
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
78
|
+
"eslint-plugin-yaml": "^0.5.0",
|
|
78
79
|
"husky": "^8.0.3",
|
|
79
|
-
"lint-staged": "^13.2.
|
|
80
|
+
"lint-staged": "^13.2.1",
|
|
80
81
|
"npm-run-all": "^4.1.5",
|
|
81
|
-
"prettier": "^2.8.
|
|
82
|
-
"rimraf": "^
|
|
82
|
+
"prettier": "^2.8.7",
|
|
83
|
+
"rimraf": "^5.0.0",
|
|
83
84
|
"rollup-plugin-visualizer": "^5.9.0",
|
|
84
|
-
"typescript": "
|
|
85
|
-
"vite": "^4.2.
|
|
85
|
+
"typescript": "*",
|
|
86
|
+
"vite": "^4.2.1",
|
|
86
87
|
"vite-plugin-banner": "^0.7.0",
|
|
87
88
|
"vite-plugin-checker": "^0.5.6",
|
|
88
|
-
"vite-plugin-dts": "^2.
|
|
89
|
+
"vite-plugin-dts": "^2.2.0"
|
|
89
90
|
},
|
|
90
91
|
"husky": {
|
|
91
92
|
"hooks": {
|