@logue/reverb 1.2.12 → 1.2.13

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
@@ -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.12
8
+ * @version 1.2.13
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.12",
34
- date: "2023-05-01T10:03:29.999Z"
33
+ version: "1.2.13",
34
+ date: "2023-05-19T02:38:39.637Z"
35
35
  };
36
36
 
37
37
  const Noise = {
38
38
  /** Blue noise */
39
39
  blue: "blue",
40
+ /** Brown noise (same as red noise) */
41
+ brown: "red",
40
42
  /** Green noise */
41
43
  green: "green",
42
44
  /** Pink noise */
43
45
  pink: "pink",
44
46
  /** Red noise */
45
- brown: "red",
47
+ red: "red",
46
48
  /** Violet noise */
47
49
  violet: "violet",
48
50
  /** White noise */
49
- white: "white",
50
- /** Brown noise (same as red noise) */
51
- red: "red"
51
+ white: "white"
52
52
  };
53
53
 
54
54
  class Reverb {
@@ -80,7 +80,7 @@ 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
85
  this.options = Object.assign(defaults, options);
86
86
  this.wetGainNode = this.ctx.createGain();
@@ -315,9 +315,9 @@ class Reverb {
315
315
  if (i < delayDuration) {
316
316
  impulseL[i] = 0;
317
317
  impulseR[i] = 0;
318
- n = this.options.reverse ? duration - (i - delayDuration) : i - delayDuration;
318
+ n = this.options.reverse ?? false ? duration - (i - delayDuration) : i - delayDuration;
319
319
  } else {
320
- n = this.options.reverse ? duration - i : i;
320
+ n = this.options.reverse ?? false ? duration - i : i;
321
321
  }
322
322
  impulseL[i] = (noiseL[i] ?? 0) * (1 - n / duration) ** this.options.decay;
323
323
  impulseR[i] = (noiseR[i] ?? 0) * (1 - n / duration) ** this.options.decay;
@@ -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.12
8
+ * @version 1.2.13
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.12",
33
- date: "2023-05-01T10:03:29.999Z"
32
+ version: "1.2.13",
33
+ date: "2023-05-19T02:38:39.637Z"
34
34
  };
35
35
 
36
36
  const Noise = {
37
37
  /** Blue noise */
38
38
  blue: "blue",
39
+ /** Brown noise (same as red noise) */
40
+ brown: "red",
39
41
  /** Green noise */
40
42
  green: "green",
41
43
  /** Pink noise */
42
44
  pink: "pink",
43
45
  /** Red noise */
44
- brown: "red",
46
+ red: "red",
45
47
  /** Violet noise */
46
48
  violet: "violet",
47
49
  /** White noise */
48
- white: "white",
49
- /** Brown noise (same as red noise) */
50
- red: "red"
50
+ white: "white"
51
51
  };
52
52
 
53
53
  class Reverb {
@@ -79,7 +79,7 @@ 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
84
  this.options = Object.assign(defaults, options);
85
85
  this.wetGainNode = this.ctx.createGain();
@@ -314,9 +314,9 @@ var Reverb = (function (random, coloredNoise, transducers) {
314
314
  if (i < delayDuration) {
315
315
  impulseL[i] = 0;
316
316
  impulseR[i] = 0;
317
- n = this.options.reverse ? duration - (i - delayDuration) : i - delayDuration;
317
+ n = this.options.reverse ?? false ? duration - (i - delayDuration) : i - delayDuration;
318
318
  } else {
319
- n = this.options.reverse ? duration - i : i;
319
+ n = this.options.reverse ?? false ? duration - i : i;
320
320
  }
321
321
  impulseL[i] = (noiseL[i] ?? 0) * (1 - n / duration) ** this.options.decay;
322
322
  impulseR[i] = (noiseR[i] ?? 0) * (1 - n / duration) ** this.options.decay;
@@ -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.12
8
+ * @version 1.2.13
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.12",
36
- date: "2023-05-01T10:03:29.999Z"
35
+ version: "1.2.13",
36
+ date: "2023-05-19T02:38:39.637Z"
37
37
  };
38
38
 
39
39
  const Noise = {
40
40
  /** Blue noise */
41
41
  blue: "blue",
42
+ /** Brown noise (same as red noise) */
43
+ brown: "red",
42
44
  /** Green noise */
43
45
  green: "green",
44
46
  /** Pink noise */
45
47
  pink: "pink",
46
48
  /** Red noise */
47
- brown: "red",
49
+ red: "red",
48
50
  /** Violet noise */
49
51
  violet: "violet",
50
52
  /** White noise */
51
- white: "white",
52
- /** Brown noise (same as red noise) */
53
- red: "red"
53
+ white: "white"
54
54
  };
55
55
 
56
56
  class Reverb {
@@ -82,7 +82,7 @@
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
87
  this.options = Object.assign(defaults, options);
88
88
  this.wetGainNode = this.ctx.createGain();
@@ -317,9 +317,9 @@
317
317
  if (i < delayDuration) {
318
318
  impulseL[i] = 0;
319
319
  impulseR[i] = 0;
320
- n = this.options.reverse ? duration - (i - delayDuration) : i - delayDuration;
320
+ n = this.options.reverse ?? false ? duration - (i - delayDuration) : i - delayDuration;
321
321
  } else {
322
- n = this.options.reverse ? duration - i : i;
322
+ n = this.options.reverse ?? false ? duration - i : i;
323
323
  }
324
324
  impulseL[i] = (noiseL[i] ?? 0) * (1 - n / duration) ** this.options.decay;
325
325
  impulseR[i] = (noiseR[i] ?? 0) * (1 - n / duration) ** this.options.decay;
@@ -1,6 +1,6 @@
1
1
  /** Impulse response noise generation algorithm */
2
2
  declare const Noise: Record<NoiseType, string>;
3
3
  /** Noise Type */
4
- export type NoiseType = 'blue' | 'green' | 'pink' | 'red' | 'violet' | 'white' | 'brown';
4
+ export type NoiseType = 'blue' | 'brown' | 'green' | 'pink' | 'red' | 'violet' | 'white';
5
5
  /** Noise */
6
6
  export default Noise;
@@ -33,7 +33,7 @@ export default class Reverb {
33
33
  * @param ctx - Root AudioContext
34
34
  * @param options - Configure
35
35
  */
36
- constructor(ctx: AudioContext, options?: OptionInterface);
36
+ constructor(ctx: AudioContext, options: Partial<OptionInterface>);
37
37
  /**
38
38
  * Connect the node for the reverb effect to the original sound node.
39
39
  *
@@ -6,48 +6,34 @@ export default interface OptionInterface {
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?: NoiseType;
9
+ noise: NoiseType;
10
10
  /** IR source noise scale */
11
- scale?: number;
11
+ scale: number;
12
12
  /** Number of IR source noise peaks */
13
- peaks?: number;
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?: INorm;
18
+ randomAlgorithm: INorm;
19
19
  /** Decay */
20
- decay?: number;
20
+ decay: number;
21
21
  /** Delay until impulse response is generated */
22
- delay?: number;
22
+ delay: number;
23
23
  /** Filter frequency applied to impulse response[Hz] */
24
- filterFreq?: number;
24
+ filterFreq: number;
25
25
  /** Filter quality for impulse response */
26
- filterQ?: number;
26
+ filterQ: number;
27
27
  /** Filter type for impulse response */
28
- filterType?: BiquadFilterType;
28
+ filterType: BiquadFilterType;
29
29
  /** Dry/Wet ratio */
30
- mix?: number;
30
+ mix: number;
31
31
  /** Invert the impulse response */
32
32
  reverse?: boolean;
33
33
  /** Impulse response length */
34
- time?: number;
35
- /** Prevents multiple effectors from being connected. */
36
- once?: boolean;
37
- }
38
- /** デフォルト値 */
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
34
  time: number;
35
+ /** Prevents multiple effectors from being connected. */
52
36
  once: boolean;
53
- };
37
+ }
38
+ /** Default Value */
39
+ export declare const defaults: OptionInterface;
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.12",
4
+ "version": "1.2.13",
5
5
  "description": "JavaScript Reverb effect class",
6
6
  "keywords": [
7
7
  "webaudio",
@@ -41,7 +41,7 @@
41
41
  "node": ">=18.16.0",
42
42
  "yarn": ">=1.22.19"
43
43
  },
44
- "packageManager": "yarn@3.5.0",
44
+ "packageManager": "yarn@3.5.1",
45
45
  "sideEffects": false,
46
46
  "scripts": {
47
47
  "dev": "vite",
@@ -57,23 +57,22 @@
57
57
  "prepare": "husky install"
58
58
  },
59
59
  "dependencies": {
60
- "@thi.ng/colored-noise": "^1.0.15",
61
- "@thi.ng/transducers": "^8.4.4"
60
+ "@thi.ng/colored-noise": "^1.0.16",
61
+ "@thi.ng/transducers": "^8.4.5"
62
62
  },
63
63
  "devDependencies": {
64
- "@tsconfig/node-lts": "^18.12.1",
65
- "@tsconfig/strictest": "^2.0.1",
66
- "@types/node": "^18.16.3",
67
- "@typescript-eslint/eslint-plugin": "^5.59.1",
64
+ "@tsconfig/node-lts": "^18.12.2",
65
+ "@types/node": "^20.2.1",
66
+ "@typescript-eslint/eslint-plugin": "^5.59.6",
68
67
  "bootstrap": "^5.3.0-alpha.3",
69
- "eslint": "^8.39.0",
68
+ "eslint": "^8.40.0",
70
69
  "eslint-config-prettier": "^8.8.0",
71
70
  "eslint-config-standard-with-typescript": "^34.0.1",
72
71
  "eslint-import-resolver-alias": "^1.1.2",
73
72
  "eslint-import-resolver-typescript": "^3.5.5",
74
73
  "eslint-plugin-html": "^7.1.0",
75
74
  "eslint-plugin-import": "^2.27.5",
76
- "eslint-plugin-n": "^15.7.0",
75
+ "eslint-plugin-n": "^16.0.0",
77
76
  "eslint-plugin-promise": "^6.1.1",
78
77
  "eslint-plugin-tsdoc": "^0.2.17",
79
78
  "eslint-plugin-yaml": "^0.5.0",
@@ -81,10 +80,10 @@
81
80
  "lint-staged": "^13.2.2",
82
81
  "npm-run-all": "^4.1.5",
83
82
  "prettier": "^2.8.8",
84
- "rimraf": "^5.0.0",
83
+ "rimraf": "^5.0.1",
85
84
  "rollup-plugin-visualizer": "^5.9.0",
86
85
  "typescript": "*",
87
- "vite": "^4.3.3",
86
+ "vite": "^4.3.8",
88
87
  "vite-plugin-banner": "^0.7.0",
89
88
  "vite-plugin-checker": "^0.6.0",
90
89
  "vite-plugin-dts": "^2.3.0"