@thi.ng/dsp 4.3.8 → 4.3.10

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-03-14T13:27:19Z
3
+ - **Last updated**: 2023-03-27T19:05:48Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -84,7 +84,7 @@ For Node.js REPL:
84
84
  const dsp = await import("@thi.ng/dsp");
85
85
  ```
86
86
 
87
- Package sizes (brotli'd, pre-treeshake): ESM: 6.88 KB
87
+ Package sizes (brotli'd, pre-treeshake): ESM: 6.90 KB
88
88
 
89
89
  ## Dependencies
90
90
 
package/adsr.js CHANGED
@@ -59,54 +59,54 @@ export class ADSR extends AGen {
59
59
  this.reset();
60
60
  }
61
61
  reset() {
62
- this._phase = 0 /* EnvPhase.ATTACK */;
62
+ this._phase = EnvPhase.ATTACK;
63
63
  this._curve = curve(0, 1, this._atime + 1, this._acurve, true);
64
64
  this._val = 0;
65
65
  return this;
66
66
  }
67
67
  release() {
68
- if (this._phase < 3 /* EnvPhase.RELEASE */) {
69
- this._phase = 3 /* EnvPhase.RELEASE */;
68
+ if (this._phase < EnvPhase.RELEASE) {
69
+ this._phase = EnvPhase.RELEASE;
70
70
  this._curve = curve(this._sustain, 0, this._rtime + 1, this._dcurve, true);
71
71
  }
72
72
  }
73
73
  isSustained() {
74
- return this._phase === 2 /* EnvPhase.SUSTAIN */;
74
+ return this._phase === EnvPhase.SUSTAIN;
75
75
  }
76
76
  isDone() {
77
- return this._phase === 4 /* EnvPhase.IDLE */;
77
+ return this._phase === EnvPhase.IDLE;
78
78
  }
79
79
  next() {
80
80
  let v;
81
81
  switch (this._phase) {
82
- case 4 /* EnvPhase.IDLE */:
82
+ case EnvPhase.IDLE:
83
83
  return 0;
84
- case 0 /* EnvPhase.ATTACK */:
84
+ case EnvPhase.ATTACK:
85
85
  v = this._curve.next();
86
86
  if (v >= 1) {
87
87
  v = 1;
88
- this._phase = 1 /* EnvPhase.DECAY */;
88
+ this._phase = EnvPhase.DECAY;
89
89
  this._curve = curve(1, this._sustain, this._dtime + 1, this._dcurve, true);
90
90
  }
91
91
  break;
92
- case 1 /* EnvPhase.DECAY */:
92
+ case EnvPhase.DECAY:
93
93
  v = this._curve.next();
94
94
  if (v <= this._sustain) {
95
95
  v = this._sustain;
96
- this._phase = 2 /* EnvPhase.SUSTAIN */;
96
+ this._phase = EnvPhase.SUSTAIN;
97
97
  this._curve = add(1, 1);
98
98
  }
99
99
  break;
100
- case 2 /* EnvPhase.SUSTAIN */:
100
+ case EnvPhase.SUSTAIN:
101
101
  if (this._curve.next() >= this._speriod) {
102
102
  this.release();
103
103
  }
104
104
  return this._val;
105
- case 3 /* EnvPhase.RELEASE */:
105
+ case EnvPhase.RELEASE:
106
106
  v = this._curve.next();
107
107
  if (v < 0) {
108
108
  v = 0;
109
- this._phase = 4 /* EnvPhase.IDLE */;
109
+ this._phase = EnvPhase.IDLE;
110
110
  }
111
111
  }
112
112
  return (this._val = v * this._gain);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/dsp",
3
- "version": "4.3.8",
3
+ "version": "4.3.10",
4
4
  "description": "Composable signal generators, oscillators, filters, FFT, spectrum, windowing & related DSP utils",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,20 +34,20 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.7.4",
38
- "@thi.ng/checks": "^3.3.10",
39
- "@thi.ng/errors": "^2.2.13",
40
- "@thi.ng/math": "^5.4.5",
41
- "@thi.ng/random": "^3.3.27",
42
- "@thi.ng/transducers": "^8.3.38"
37
+ "@thi.ng/api": "^8.7.5",
38
+ "@thi.ng/checks": "^3.3.11",
39
+ "@thi.ng/errors": "^2.2.14",
40
+ "@thi.ng/math": "^5.4.6",
41
+ "@thi.ng/random": "^3.3.28",
42
+ "@thi.ng/transducers": "^8.4.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@microsoft/api-extractor": "^7.34.4",
46
- "@thi.ng/testament": "^0.3.13",
47
- "rimraf": "^4.4.0",
46
+ "@thi.ng/testament": "^0.3.14",
47
+ "rimraf": "^4.4.1",
48
48
  "tools": "^0.0.1",
49
- "typedoc": "^0.23.26",
50
- "typescript": "^4.9.5"
49
+ "typedoc": "^0.23.28",
50
+ "typescript": "^5.0.2"
51
51
  },
52
52
  "keywords": [
53
53
  "allpass",
@@ -275,5 +275,5 @@
275
275
  ],
276
276
  "year": 2015
277
277
  },
278
- "gitHead": "cc46c097a3a173fb1ef41f57a858d03037063141\n"
278
+ "gitHead": "83b15b34326d480cbca0472b20390d4d3bbb792a\n"
279
279
  }