@thi.ng/dsp 3.0.28 → 4.0.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/CHANGELOG.md +82 -133
- package/README.md +66 -58
- package/{gen/add.d.ts → add.d.ts} +4 -2
- package/{gen/add.js → add.js} +7 -2
- package/{comp/addg.d.ts → addg.d.ts} +1 -1
- package/{comp/addg.js → addg.js} +0 -0
- package/{gen/adsr.d.ts → adsr.d.ts} +1 -1
- package/{gen/adsr.js → adsr.js} +22 -2
- package/{gen/agen.d.ts → agen.d.ts} +1 -1
- package/{gen/agen.js → agen.js} +3 -4
- package/{proc/allpass.d.ts → allpass.d.ts} +0 -0
- package/{proc/allpass.js → allpass.js} +5 -1
- package/{gen/alt.d.ts → alt.d.ts} +0 -0
- package/{gen/alt.js → alt.js} +3 -1
- package/{util/anti-alias.d.ts → anti-alias.d.ts} +0 -0
- package/{util/anti-alias.js → anti-alias.js} +1 -1
- package/{proc/aproc.d.ts → aproc.d.ts} +6 -4
- package/{proc/aproc.js → aproc.js} +8 -4
- package/{proc/biquad.d.ts → biquad.d.ts} +1 -1
- package/{proc/biquad.js → biquad.js} +15 -3
- package/bounce.d.ts +13 -0
- package/bounce.js +18 -0
- package/{util/complex.d.ts → complex.d.ts} +1 -1
- package/{util/complex.js → complex.js} +1 -1
- package/{gen/const.d.ts → const.d.ts} +0 -0
- package/{gen/const.js → const.js} +0 -0
- package/{util/convert.d.ts → convert.d.ts} +0 -0
- package/{util/convert.js → convert.js} +1 -1
- package/{gen/cosine.d.ts → cosine.d.ts} +0 -0
- package/{gen/cosine.js → cosine.js} +5 -1
- package/{gen/curve.d.ts → curve.d.ts} +0 -0
- package/{gen/curve.js → curve.js} +0 -0
- package/{proc/dcblock.d.ts → dcblock.d.ts} +0 -0
- package/{proc/dcblock.js → dcblock.js} +0 -0
- package/{proc/delay.d.ts → delay.d.ts} +0 -0
- package/{proc/delay.js → delay.js} +6 -2
- package/{proc/feedback-delay.d.ts → feedback-delay.d.ts} +0 -0
- package/{proc/feedback-delay.js → feedback-delay.js} +2 -1
- package/{fft/fft.d.ts → fft.d.ts} +1 -1
- package/{fft/fft.js → fft.js} +2 -2
- package/{util/filter-response.d.ts → filter-response.d.ts} +1 -1
- package/{util/filter-response.js → filter-response.js} +3 -2
- package/{proc/foldback.d.ts → foldback.d.ts} +0 -0
- package/{proc/foldback.js → foldback.js} +3 -1
- package/{gen/impulse-train.d.ts → impulse-train.d.ts} +0 -0
- package/{gen/impulse-train.js → impulse-train.js} +5 -0
- package/{gen/impulse.d.ts → impulse.d.ts} +0 -0
- package/{gen/impulse.js → impulse.js} +2 -0
- package/index.d.ts +56 -55
- package/index.js +56 -55
- package/{proc/integrator.d.ts → integrator.d.ts} +0 -0
- package/{proc/integrator.js → integrator.js} +2 -0
- package/internal/take.d.ts +3 -0
- package/internal/take.js +6 -0
- package/{gen/iterable.d.ts → iterable.d.ts} +1 -1
- package/{gen/iterable.js → iterable.js} +4 -4
- package/{gen/line.d.ts → line.d.ts} +0 -0
- package/{gen/line.js → line.js} +0 -0
- package/{gen/madd.d.ts → madd.d.ts} +0 -0
- package/{gen/madd.js → madd.js} +4 -0
- package/{comp/mapg.d.ts → mapg.d.ts} +2 -2
- package/{comp/mapg.js → mapg.js} +16 -2
- package/{proc/mix.d.ts → mix.d.ts} +0 -0
- package/{proc/mix.js → mix.js} +2 -1
- package/{gen/mul.d.ts → mul.d.ts} +0 -0
- package/{gen/mul.js → mul.js} +3 -0
- package/multiplex.d.ts +26 -0
- package/{comp/multiplex.js → multiplex.js} +2 -1
- package/{proc/onepole.d.ts → onepole.d.ts} +1 -1
- package/{proc/onepole.js → onepole.js} +6 -1
- package/{osc/additive.d.ts → osc-additive.d.ts} +16 -2
- package/{osc/additive.js → osc-additive.js} +16 -2
- package/osc-cos.d.ts +3 -0
- package/{osc/cos.js → osc-cos.js} +1 -1
- package/{osc/dsf.d.ts → osc-dsf.d.ts} +2 -2
- package/{osc/dsf.js → osc-dsf.js} +1 -1
- package/{osc/mix.d.ts → osc-mix.d.ts} +2 -2
- package/{osc/mix.js → osc-mix.js} +1 -1
- package/{osc/parabolic.d.ts → osc-parabolic.d.ts} +2 -2
- package/{osc/parabolic.js → osc-parabolic.js} +1 -1
- package/{osc/rect.d.ts → osc-rect.d.ts} +2 -2
- package/{osc/rect.js → osc-rect.js} +1 -1
- package/osc-saw.d.ts +3 -0
- package/{osc/saw.js → osc-saw.js} +1 -1
- package/osc-sin.d.ts +3 -0
- package/{osc/sin.js → osc-sin.js} +1 -1
- package/osc-tri.d.ts +3 -0
- package/{osc/tri.js → osc-tri.js} +1 -1
- package/{osc/wavetable.d.ts → osc-wavetable.d.ts} +2 -2
- package/{osc/wavetable.js → osc-wavetable.js} +2 -1
- package/{gen/osc.d.ts → osc.d.ts} +1 -1
- package/{gen/osc.js → osc.js} +6 -2
- package/package.json +201 -33
- package/{gen/pink-noise.d.ts → pink-noise.d.ts} +1 -1
- package/{gen/pink-noise.js → pink-noise.js} +6 -1
- package/{comp/pipe.d.ts → pipe.d.ts} +8 -1
- package/{comp/pipe.js → pipe.js} +0 -0
- package/{fft/power.d.ts → power.d.ts} +1 -1
- package/{fft/power.js → power.js} +2 -2
- package/{comp/product.d.ts → product.d.ts} +1 -1
- package/{comp/product.js → product.js} +0 -0
- package/{gen/reciprocal.d.ts → reciprocal.d.ts} +0 -0
- package/{gen/reciprocal.js → reciprocal.js} +2 -0
- package/serial.d.ts +44 -0
- package/{comp/compp.js → serial.js} +20 -10
- package/{gen/sincos.d.ts → sincos.d.ts} +0 -0
- package/{gen/sincos.js → sincos.js} +6 -1
- package/{comp/sum.d.ts → sum.d.ts} +1 -1
- package/{comp/sum.js → sum.js} +0 -0
- package/{proc/svf.d.ts → svf.d.ts} +1 -1
- package/{proc/svf.js → svf.js} +11 -1
- package/{gen/sweep.d.ts → sweep.d.ts} +1 -1
- package/{gen/sweep.js → sweep.js} +1 -1
- package/{proc/waveshaper.d.ts → waveshaper.d.ts} +0 -0
- package/{proc/waveshaper.js → waveshaper.js} +5 -1
- package/{gen/white-noise.d.ts → white-noise.d.ts} +1 -1
- package/{gen/white-noise.js → white-noise.js} +3 -1
- package/{fft/window.d.ts → window.d.ts} +1 -1
- package/{fft/window.js → window.js} +2 -2
- package/comp/compp.d.ts +0 -33
- package/comp/multiplex.d.ts +0 -11
- package/lib/index.js +0 -1703
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -1
- package/lib/index.umd.js.map +0 -1
- package/osc/cos.d.ts +0 -3
- package/osc/saw.d.ts +0 -3
- package/osc/sin.d.ts +0 -3
- package/osc/tri.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,181 +3,130 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [4.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.31...@thi.ng/dsp@4.0.0) (2021-10-12)
|
|
7
7
|
|
|
8
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
9
8
|
|
|
9
|
+
### Build System
|
|
10
10
|
|
|
11
|
+
* major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
### Features
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [3.0.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.25...@thi.ng/dsp@3.0.26) (2021-08-08)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## [3.0.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.24...@thi.ng/dsp@3.0.25) (2021-08-08)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## [3.0.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.23...@thi.ng/dsp@3.0.24) (2021-08-04)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## [3.0.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.22...@thi.ng/dsp@3.0.23) (2021-08-04)
|
|
47
|
-
|
|
48
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## [3.0.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.21...@thi.ng/dsp@3.0.22) (2021-07-27)
|
|
55
|
-
|
|
56
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## [3.0.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.20...@thi.ng/dsp@3.0.21) (2021-07-01)
|
|
63
|
-
|
|
64
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
## [3.0.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@3.0.19...@thi.ng/dsp@3.0.20) (2021-06-08)
|
|
71
|
-
|
|
72
|
-
**Note:** Version bump only for package @thi.ng/dsp
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
16
|
+
* **dsp:** restructure/flatten /src folder, add ops ([c001e6f](https://github.com/thi-ng/umbrella/commit/c001e6f86bcb132323bde974a23cf1e69421142f))
|
|
77
17
|
|
|
78
|
-
# [3.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.5...@thi.ng/dsp@3.0.0) (2020-12-22)
|
|
79
18
|
|
|
19
|
+
### BREAKING CHANGES
|
|
80
20
|
|
|
81
|
-
|
|
21
|
+
* **dsp:** restructure pkg, add/rename ops
|
|
82
22
|
|
|
83
|
-
|
|
23
|
+
- dissolve all subfolders
|
|
24
|
+
- add bounce()
|
|
25
|
+
- rename `compP()` => `serial()`
|
|
26
|
+
- add docs
|
|
27
|
+
* discontinue CommonJS & UMD versions
|
|
84
28
|
|
|
29
|
+
- only ESM modules will be published from now on
|
|
30
|
+
- CJS obsolete due to ESM support in recent versions of node:
|
|
31
|
+
- i.e. launch NodeJS via:
|
|
32
|
+
- `node --experimental-specifier-resolution=node --experimental-repl-await`
|
|
33
|
+
- in the node REPL use `await import(...)` instead of `require()`
|
|
34
|
+
- UMD obsolete due to widespread browser support for ESM
|
|
85
35
|
|
|
86
|
-
|
|
36
|
+
Also:
|
|
37
|
+
- normalize/restructure/reorg all package.json files
|
|
38
|
+
- cleanup all build scripts, remove obsolete
|
|
39
|
+
- switch from mocha to @thi.ng/testament for all tests
|
|
87
40
|
|
|
88
|
-
* **dsp:** add applyWindow(), windowBartlett() ([d51a17c](https://github.com/thi-ng/umbrella/commit/d51a17c10dd6cbfbb69bb1cf09f46e59d2dd8ba2))
|
|
89
|
-
* **dsp:** add cos() stateless oscillator ([276c6b7](https://github.com/thi-ng/umbrella/commit/276c6b76a6b69498f3b37c94fc34c4915b95b9b6))
|
|
90
|
-
* **dsp:** add power & integral fns ([88edaac](https://github.com/thi-ng/umbrella/commit/88edaac0b93fb811738cbfd06d41063d8c4b9aff))
|
|
91
|
-
* **dsp:** add windowWelch(), add docs ([84cd476](https://github.com/thi-ng/umbrella/commit/84cd4763a2a897d6b15b21b680fe2c8bd15c9d4a))
|
|
92
|
-
* **dsp:** add/update power & integral fns ([f455fad](https://github.com/thi-ng/umbrella/commit/f455fad649394cd386839d983d8ae25895f9f1a2))
|
|
93
|
-
* **dsp:** add/update various FFT & spectrum fns (fix [#258](https://github.com/thi-ng/umbrella/issues/258)) ([e351acb](https://github.com/thi-ng/umbrella/commit/e351acb98b1c776a6c8efe9ba910c2ec3b2df831))
|
|
94
41
|
|
|
95
42
|
|
|
96
|
-
### BREAKING CHANGES
|
|
97
43
|
|
|
98
|
-
* **adjacency:** replace filter type enums w/ type aliases
|
|
99
44
|
|
|
100
|
-
- FilterType
|
|
101
|
-
- BiquadType
|
|
102
|
-
- SVFType
|
|
103
|
-
- OnepoleType
|
|
104
|
-
* **dsp:** new args for normalizeFFT(),denormalizeFFT(), spectrumPow()
|
|
105
45
|
|
|
106
|
-
-
|
|
107
|
-
- add thresholdFFT()
|
|
108
|
-
- add copyComplex()
|
|
109
|
-
- update various real/complex checks using isComplex()
|
|
110
|
-
- update docs, add references
|
|
46
|
+
# [3.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.1.5...@thi.ng/dsp@3.0.0) (2020-12-22)
|
|
111
47
|
|
|
48
|
+
### Code Refactoring
|
|
112
49
|
|
|
50
|
+
- **adjacency:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enums w/ type aliases ([b9cfacb](https://github.com/thi-ng/umbrella/commit/b9cfacbbb67fcb89d72090bdad512edaffa1adcf))
|
|
113
51
|
|
|
52
|
+
### Features
|
|
114
53
|
|
|
54
|
+
- **dsp:** add applyWindow(), windowBartlett() ([d51a17c](https://github.com/thi-ng/umbrella/commit/d51a17c10dd6cbfbb69bb1cf09f46e59d2dd8ba2))
|
|
55
|
+
- **dsp:** add cos() stateless oscillator ([276c6b7](https://github.com/thi-ng/umbrella/commit/276c6b76a6b69498f3b37c94fc34c4915b95b9b6))
|
|
56
|
+
- **dsp:** add power & integral fns ([88edaac](https://github.com/thi-ng/umbrella/commit/88edaac0b93fb811738cbfd06d41063d8c4b9aff))
|
|
57
|
+
- **dsp:** add windowWelch(), add docs ([84cd476](https://github.com/thi-ng/umbrella/commit/84cd4763a2a897d6b15b21b680fe2c8bd15c9d4a))
|
|
58
|
+
- **dsp:** add/update power & integral fns ([f455fad](https://github.com/thi-ng/umbrella/commit/f455fad649394cd386839d983d8ae25895f9f1a2))
|
|
59
|
+
- **dsp:** add/update various FFT & spectrum fns (fix [#258](https://github.com/thi-ng/umbrella/issues/258)) ([e351acb](https://github.com/thi-ng/umbrella/commit/e351acb98b1c776a6c8efe9ba910c2ec3b2df831))
|
|
115
60
|
|
|
116
|
-
|
|
61
|
+
### BREAKING CHANGES
|
|
117
62
|
|
|
63
|
+
- **adjacency:** replace filter type enums w/ type aliases
|
|
64
|
+
- FilterType
|
|
65
|
+
- BiquadType
|
|
66
|
+
- SVFType
|
|
67
|
+
- OnepoleType
|
|
68
|
+
- **dsp:** new args for normalizeFFT(),denormalizeFFT(), spectrumPow()
|
|
69
|
+
- add support for windowing adjustments in above functions
|
|
70
|
+
- add thresholdFFT()
|
|
71
|
+
- add copyComplex()
|
|
72
|
+
- update various real/complex checks using isComplex()
|
|
73
|
+
- update docs, add references
|
|
118
74
|
|
|
119
|
-
|
|
75
|
+
# [2.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@2.0.28...@thi.ng/dsp@2.1.0) (2020-08-28)
|
|
120
76
|
|
|
121
|
-
|
|
77
|
+
### Features
|
|
122
78
|
|
|
79
|
+
- **dsp:** add iterable() wrapper ([94fb8ed](https://github.com/thi-ng/umbrella/commit/94fb8ed3a91ea45dcb53961a3b1c4a6a96cb2fb0))
|
|
123
80
|
|
|
81
|
+
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@1.0.18...@thi.ng/dsp@2.0.0) (2020-01-24)
|
|
124
82
|
|
|
83
|
+
### Code Refactoring
|
|
125
84
|
|
|
85
|
+
- **dsp:** remove obsolete classes ([aa24c1e](https://github.com/thi-ng/umbrella/commit/aa24c1e4d9272f6ed468c011c00ab7c1b3e6c4f7))
|
|
126
86
|
|
|
127
|
-
|
|
87
|
+
### Features
|
|
128
88
|
|
|
129
|
-
|
|
89
|
+
- **dsp:** add DelayLine ([bd25cd7](https://github.com/thi-ng/umbrella/commit/bd25cd7482d40ad21b713c6c6f7086458b5adbd0))
|
|
90
|
+
- **dsp:** add fft, spectrum and window fns, add tests ([f918af4](https://github.com/thi-ng/umbrella/commit/f918af4e4169f75a0168098083e6b7fab4eba551))
|
|
91
|
+
- **dsp:** add filters, refactor, update pkg/docs/readme ([7758609](https://github.com/thi-ng/umbrella/commit/775860996c09ea540d397702040ab4d53a338830))
|
|
92
|
+
- **dsp:** add gen/proc composition ops, restructure ([8be2a5f](https://github.com/thi-ng/umbrella/commit/8be2a5f9fee18e2fdf7aefb48455b38511de5569))
|
|
93
|
+
- **dsp:** add LFO sin/cos iterator/osc, minor refactor window fns ([dc89204](https://github.com/thi-ng/umbrella/commit/dc892043bb94b759ec04547b9194d8cfdbd9aa2f))
|
|
94
|
+
- **dsp:** add missing factory fns, update docstrings ([3ede5af](https://github.com/thi-ng/umbrella/commit/3ede5af1c85564a4aa974f3a77c18a12f3bb6073))
|
|
95
|
+
- **dsp:** add new operators ([68a88e4](https://github.com/thi-ng/umbrella/commit/68a88e4774979ef1a81149dd233324cdbc8b3787))
|
|
96
|
+
- **dsp:** add sweep(), move curve(), minor refactor ([0b24d80](https://github.com/thi-ng/umbrella/commit/0b24d8035d8da716f14644c76b7768ba75b84189))
|
|
97
|
+
- **dsp:** add/rename oscillators ([8a826bf](https://github.com/thi-ng/umbrella/commit/8a826bf0f0ead26e7da52ef79c911290942c80fb))
|
|
98
|
+
- **dsp:** add/update FFT fns, test, update docs ([1ac9508](https://github.com/thi-ng/umbrella/commit/1ac95080da1da7d07212dcc65a1d97917c644d7f))
|
|
99
|
+
- **dsp:** add/update filters, filter resp, delay ([2854b09](https://github.com/thi-ng/umbrella/commit/2854b096fdbe05f05b542c87a80bf08bb2b14ffe))
|
|
100
|
+
- **dsp:** import gen & proc nodes, general pkg restructure ([a85c3cf](https://github.com/thi-ng/umbrella/commit/a85c3cf3c80c3714637fc4f3410742a88356f78f))
|
|
101
|
+
- **dsp:** update ADSR, add ADSROpts, auto-release ([16f41ec](https://github.com/thi-ng/umbrella/commit/16f41ec4a60ea80ee9e544641f034491b7814754))
|
|
102
|
+
- **dsp:** update all gens/procs, housekeeping, docs ([e483245](https://github.com/thi-ng/umbrella/commit/e483245d48b8ae0c74d93d1f2f2270a2379c642b))
|
|
103
|
+
- **dsp:** update DelayLine ctor, freqBin, update pkg ([228a81e](https://github.com/thi-ng/umbrella/commit/228a81e951203e4e215de825d2474ec302290727))
|
|
104
|
+
- **dsp:** update gens to support clamping ([fe8f6f3](https://github.com/thi-ng/umbrella/commit/fe8f6f347b9a9a618cfd30b95739f9400cc197d6))
|
|
130
105
|
|
|
131
|
-
|
|
106
|
+
### BREAKING CHANGES
|
|
132
107
|
|
|
133
|
-
|
|
108
|
+
- **dsp:** remove obsolete Oscillator/AMFMOscillator (superceded by osc()/modOsc())
|
|
134
109
|
|
|
135
|
-
|
|
136
|
-
* **dsp:** add fft, spectrum and window fns, add tests ([f918af4](https://github.com/thi-ng/umbrella/commit/f918af4e4169f75a0168098083e6b7fab4eba551))
|
|
137
|
-
* **dsp:** add filters, refactor, update pkg/docs/readme ([7758609](https://github.com/thi-ng/umbrella/commit/775860996c09ea540d397702040ab4d53a338830))
|
|
138
|
-
* **dsp:** add gen/proc composition ops, restructure ([8be2a5f](https://github.com/thi-ng/umbrella/commit/8be2a5f9fee18e2fdf7aefb48455b38511de5569))
|
|
139
|
-
* **dsp:** add LFO sin/cos iterator/osc, minor refactor window fns ([dc89204](https://github.com/thi-ng/umbrella/commit/dc892043bb94b759ec04547b9194d8cfdbd9aa2f))
|
|
140
|
-
* **dsp:** add missing factory fns, update docstrings ([3ede5af](https://github.com/thi-ng/umbrella/commit/3ede5af1c85564a4aa974f3a77c18a12f3bb6073))
|
|
141
|
-
* **dsp:** add new operators ([68a88e4](https://github.com/thi-ng/umbrella/commit/68a88e4774979ef1a81149dd233324cdbc8b3787))
|
|
142
|
-
* **dsp:** add sweep(), move curve(), minor refactor ([0b24d80](https://github.com/thi-ng/umbrella/commit/0b24d8035d8da716f14644c76b7768ba75b84189))
|
|
143
|
-
* **dsp:** add/rename oscillators ([8a826bf](https://github.com/thi-ng/umbrella/commit/8a826bf0f0ead26e7da52ef79c911290942c80fb))
|
|
144
|
-
* **dsp:** add/update FFT fns, test, update docs ([1ac9508](https://github.com/thi-ng/umbrella/commit/1ac95080da1da7d07212dcc65a1d97917c644d7f))
|
|
145
|
-
* **dsp:** add/update filters, filter resp, delay ([2854b09](https://github.com/thi-ng/umbrella/commit/2854b096fdbe05f05b542c87a80bf08bb2b14ffe))
|
|
146
|
-
* **dsp:** import gen & proc nodes, general pkg restructure ([a85c3cf](https://github.com/thi-ng/umbrella/commit/a85c3cf3c80c3714637fc4f3410742a88356f78f))
|
|
147
|
-
* **dsp:** update ADSR, add ADSROpts, auto-release ([16f41ec](https://github.com/thi-ng/umbrella/commit/16f41ec4a60ea80ee9e544641f034491b7814754))
|
|
148
|
-
* **dsp:** update all gens/procs, housekeeping, docs ([e483245](https://github.com/thi-ng/umbrella/commit/e483245d48b8ae0c74d93d1f2f2270a2379c642b))
|
|
149
|
-
* **dsp:** update DelayLine ctor, freqBin, update pkg ([228a81e](https://github.com/thi-ng/umbrella/commit/228a81e951203e4e215de825d2474ec302290727))
|
|
150
|
-
* **dsp:** update gens to support clamping ([fe8f6f3](https://github.com/thi-ng/umbrella/commit/fe8f6f347b9a9a618cfd30b95739f9400cc197d6))
|
|
110
|
+
## [1.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@1.0.9...@thi.ng/dsp@1.0.10) (2019-04-26)
|
|
151
111
|
|
|
152
|
-
###
|
|
112
|
+
### Bug Fixes
|
|
153
113
|
|
|
154
|
-
|
|
155
|
-
(superceded by osc()/modOsc())
|
|
114
|
+
- **dsp:** fix tri() oscillator for negative phases ([c67c733](https://github.com/thi-ng/umbrella/commit/c67c733))
|
|
156
115
|
|
|
157
|
-
|
|
116
|
+
# [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dsp@0.1.3...@thi.ng/dsp@1.0.0) (2019-01-21)
|
|
158
117
|
|
|
159
|
-
###
|
|
118
|
+
### Build System
|
|
160
119
|
|
|
161
|
-
|
|
120
|
+
- update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
|
|
162
121
|
|
|
163
|
-
|
|
122
|
+
### BREAKING CHANGES
|
|
164
123
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
### BREAKING CHANGES
|
|
124
|
+
- enabled multi-outputs (ES6 modules, CJS, UMD)
|
|
125
|
+
- build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
|
|
126
|
+
- all imports MUST be updated to only refer to package level (not individual files anymore). tree shaking in user land will get rid of all unused imported symbols.
|
|
170
127
|
|
|
171
|
-
|
|
128
|
+
# 0.1.0 (2018-10-17)
|
|
172
129
|
|
|
173
|
-
|
|
174
|
-
`scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
|
|
175
|
-
- all imports MUST be updated to only refer to package level
|
|
176
|
-
(not individual files anymore). tree shaking in user land will get rid of
|
|
177
|
-
all unused imported symbols.
|
|
178
|
-
|
|
179
|
-
# 0.1.0 (2018-10-17)
|
|
180
|
-
|
|
181
|
-
### Features
|
|
130
|
+
### Features
|
|
182
131
|
|
|
183
|
-
|
|
132
|
+
- **dsp:** add oscillators as [@thi](https://github.com/thi).ng/dsp package (from synstack / VEX) ([889730f](https://github.com/thi-ng/umbrella/commit/889730f))
|
package/README.md
CHANGED
|
@@ -69,15 +69,23 @@ might be ported to WASM.
|
|
|
69
69
|
yarn add @thi.ng/dsp
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
ES module import:
|
|
73
|
+
|
|
72
74
|
```html
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
<script type="module" src="https://cdn.skypack.dev/@thi.ng/dsp"></script>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
[Skypack documentation](https://docs.skypack.dev/)
|
|
79
|
+
|
|
80
|
+
For NodeJS (v14.6+):
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
node --experimental-specifier-resolution=node --experimental-repl-await
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
<script src="https://unpkg.com/@thi.ng/dsp/lib/index.umd.js" crossorigin></script>
|
|
85
|
+
> const dsp = await import("@thi.ng/dsp");
|
|
78
86
|
```
|
|
79
87
|
|
|
80
|
-
Package sizes (gzipped, pre-treeshake): ESM:
|
|
88
|
+
Package sizes (gzipped, pre-treeshake): ESM: 7.43 KB
|
|
81
89
|
|
|
82
90
|
## Dependencies
|
|
83
91
|
|
|
@@ -96,12 +104,12 @@ directory are using this package.
|
|
|
96
104
|
|
|
97
105
|
A selection:
|
|
98
106
|
|
|
99
|
-
| Screenshot
|
|
100
|
-
|
|
101
|
-
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/fft-synth.png" width="240"/>
|
|
102
|
-
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-spline.png" width="240"/>
|
|
103
|
-
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/
|
|
104
|
-
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-ssao.jpg" width="240"/>
|
|
107
|
+
| Screenshot | Description | Live demo | Source |
|
|
108
|
+
|:---------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------|:----------------------------------------------------|:---------------------------------------------------------------------------------|
|
|
109
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/fft-synth.png" width="240"/> | Interactive inverse FFT toy synth | [Demo](https://demo.thi.ng/umbrella/fft-synth/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/fft-synth) |
|
|
110
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-spline.png" width="240"/> | Polygon to cubic curve conversion & visualization | [Demo](https://demo.thi.ng/umbrella/poly-spline/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-spline) |
|
|
111
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-cubemap.jpg" width="240"/> | WebGL cube maps with async texture loading | [Demo](https://demo.thi.ng/umbrella/webgl-cubemap/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-cubemap) |
|
|
112
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-ssao.jpg" width="240"/> | WebGL screenspace ambient occlusion | [Demo](https://demo.thi.ng/umbrella/webgl-ssao/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-ssao) |
|
|
105
113
|
|
|
106
114
|
## API
|
|
107
115
|
|
|
@@ -175,36 +183,36 @@ import { take } from "@thi.ng/transducers";
|
|
|
175
183
|
// ]
|
|
176
184
|
```
|
|
177
185
|
|
|
178
|
-
- [add](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
179
|
-
- [adsr](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
180
|
-
- [alt](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
181
|
-
- [constant](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
182
|
-
- [cosine](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
183
|
-
- [curve](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
184
|
-
- [impulse](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
185
|
-
- [impulseTrain](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
186
|
-
- [line](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
187
|
-
- [madd](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
188
|
-
- [mul](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
189
|
-
- [pinkNoise](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
190
|
-
- [reciprocal](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
191
|
-
- [sincos](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
192
|
-
- [sweep](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
193
|
-
- [whiteNoise](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
186
|
+
- [add](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/add.ts) - adder
|
|
187
|
+
- [adsr](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/add.ts) - timebased ADSR / AD envelope generator
|
|
188
|
+
- [alt](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/alt.ts) - alternating values
|
|
189
|
+
- [constant](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/const.ts) - constant value
|
|
190
|
+
- [cosine](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/cosp.ts) - trig-free cosine osc
|
|
191
|
+
- [curve](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/curve.ts) - timebased exponential gain/decay (factory for `madd`)
|
|
192
|
+
- [impulse](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/impulse.ts) - impulse gen
|
|
193
|
+
- [impulseTrain](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/impulse-train.ts) - timebased cyclic impulse
|
|
194
|
+
- [line](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/line.ts) - timebased line gen (factory for `add`)
|
|
195
|
+
- [madd](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/madd.ts) - multiply-adder
|
|
196
|
+
- [mul](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/mul.ts) - multiplier (exponential gain/decay)
|
|
197
|
+
- [pinkNoise](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/pink-noise.ts) - configurable pink noise (1/f power spectrum)
|
|
198
|
+
- [reciprocal](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/reciprocal.ts) - fractional sequence (1, 1/2, 1/3, 1/4 etc.)
|
|
199
|
+
- [sincos](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/sincos.ts) - trig-free sin/cos LFO
|
|
200
|
+
- [sweep](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/sweep.ts) - freq sweep gen w/ phase accumulation for oscillators
|
|
201
|
+
- [whiteNoise](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/pink-noise.ts) - white noise
|
|
194
202
|
|
|
195
203
|
#### Higher order generators
|
|
196
204
|
|
|
197
|
-
- [mapG](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
198
|
-
- [addG](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
199
|
-
- [product](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
200
|
-
- [sum](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
205
|
+
- [mapG](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/mapg.ts) - `IGen` composition / transformation (1-4 inputs)
|
|
206
|
+
- [addG](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/addg.ts) - higher-order adder
|
|
207
|
+
- [product](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/product.ts) - product of input gens
|
|
208
|
+
- [sum](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/sum.ts) - sum of input gens
|
|
201
209
|
|
|
202
210
|
#### Oscillators
|
|
203
211
|
|
|
204
212
|
##### IGen wrappers
|
|
205
213
|
|
|
206
|
-
- [osc](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
207
|
-
- [modOsc](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
214
|
+
- [osc](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc.ts) - arbitrary function oscillator w/ modulation support
|
|
215
|
+
- [modOsc](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc.ts) - FM / FMAM oscillator builder
|
|
208
216
|
|
|
209
217
|
```ts
|
|
210
218
|
const FS = 44100;
|
|
@@ -238,17 +246,17 @@ Diagram of the FM/AM osc with some low pass filters applied:
|
|
|
238
246
|
|
|
239
247
|
##### Stateless oscillator functions
|
|
240
248
|
|
|
241
|
-
- [additive](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
242
|
-
- [dsf](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
243
|
-
- [mix](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
244
|
-
- [parabolic](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
245
|
-
- [rect](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
246
|
-
- [saw](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
247
|
-
- [sawAdditive](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
248
|
-
- [squareAdditive](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
249
|
-
- [sin](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
250
|
-
- [tri](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
251
|
-
- [wavetable](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc
|
|
249
|
+
- [additive](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-additive.ts)
|
|
250
|
+
- [dsf](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-dsf.ts)
|
|
251
|
+
- [mix](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-mix.ts)
|
|
252
|
+
- [parabolic](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-parabolic.ts)
|
|
253
|
+
- [rect](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-rect.ts)
|
|
254
|
+
- [saw](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-saw.ts)
|
|
255
|
+
- [sawAdditive](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-additive.ts)
|
|
256
|
+
- [squareAdditive](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-additive.ts)
|
|
257
|
+
- [sin](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-sin.ts)
|
|
258
|
+
- [tri](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-tri.ts)
|
|
259
|
+
- [wavetable](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/osc-wavetable.ts)
|
|
252
260
|
|
|
253
261
|
### IProc
|
|
254
262
|
|
|
@@ -319,9 +327,9 @@ The following filter types / functions are available:
|
|
|
319
327
|
|
|
320
328
|
##### 1-pole
|
|
321
329
|
|
|
322
|
-
- [`onepoleLP`](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
323
|
-
- [`dcBlock`](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
324
|
-
- [`allpass`](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
330
|
+
- [`onepoleLP`](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/onepole.ts) - low pass, 6dB/oct falloff
|
|
331
|
+
- [`dcBlock`](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/dcblock.ts) - high pass, 6dB/oct falloff
|
|
332
|
+
- [`allpass`](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/allpass.ts) - allpass (-90° phase shift @ center freq)
|
|
325
333
|
|
|
326
334
|
Low pass:
|
|
327
335
|
|
|
@@ -337,7 +345,7 @@ Allpass:
|
|
|
337
345
|
|
|
338
346
|
##### Biquad
|
|
339
347
|
|
|
340
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
348
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/biquad.ts)
|
|
341
349
|
|
|
342
350
|
- `biquadLP` - low pass, 12dB/oct falloff, resonance
|
|
343
351
|
- `biquadHP` - high pass, 12dB/oct falloff, resonance
|
|
@@ -379,7 +387,7 @@ High shelf (gain = -6dB):
|
|
|
379
387
|
|
|
380
388
|
##### State variable filter
|
|
381
389
|
|
|
382
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
390
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/biquad.ts)
|
|
383
391
|
|
|
384
392
|
- `svfLP` - low pass, resonance
|
|
385
393
|
- `svfHP` - high pass, resonance
|
|
@@ -417,7 +425,7 @@ Allpass:
|
|
|
417
425
|
#### Filter responses
|
|
418
426
|
|
|
419
427
|
Using the [Filter response
|
|
420
|
-
utils](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
428
|
+
utils](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/filter-response.ts),
|
|
421
429
|
the following filter types can be evaluated for analyzing their impact
|
|
422
430
|
on specific frequencies (or frequency bands). Any type implementing
|
|
423
431
|
[`IFilter`](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/api.ts#L50)
|
|
@@ -460,7 +468,7 @@ Basic filter response plot:
|
|
|
460
468
|
|
|
461
469
|
#### Delay
|
|
462
470
|
|
|
463
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
471
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/delay.ts)
|
|
464
472
|
|
|
465
473
|
Ringbuffer / delay line for arbitrary values and support for single &
|
|
466
474
|
multi-taps at any relative positions. Useful fundamental building block
|
|
@@ -468,14 +476,14 @@ for various other effects, filters etc.
|
|
|
468
476
|
|
|
469
477
|
#### Feedback delay
|
|
470
478
|
|
|
471
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
479
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/feedback-delay.ts)
|
|
472
480
|
|
|
473
481
|
Variation of `delay()` which adds a portion of the delayed value to each
|
|
474
482
|
new input and stores result in delay line.
|
|
475
483
|
|
|
476
484
|
#### Wave shaping
|
|
477
485
|
|
|
478
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
486
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/waveshaper.ts)
|
|
479
487
|
|
|
480
488
|
This operator remaps inputs via a user provided function. The following shaping functions are provided:
|
|
481
489
|
|
|
@@ -500,7 +508,7 @@ Sine:
|
|
|
500
508
|
|
|
501
509
|
#### Foldback distortion
|
|
502
510
|
|
|
503
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
511
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/waveshaper.ts)
|
|
504
512
|
|
|
505
513
|
Recursively folds input into `[-thresh .. +thresh]` interval and amplifies it with `amp` (default: 1/thresh).
|
|
506
514
|
|
|
@@ -511,7 +519,7 @@ Desmos](https://www.desmos.com/calculator/lkyf2ag3ta) to experiment.
|
|
|
511
519
|
|
|
512
520
|
### FFT
|
|
513
521
|
|
|
514
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/fft
|
|
522
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/fft.ts)
|
|
515
523
|
|
|
516
524
|
- `fft()`
|
|
517
525
|
- `ifft()`
|
|
@@ -534,7 +542,7 @@ Desmos](https://www.desmos.com/calculator/lkyf2ag3ta) to experiment.
|
|
|
534
542
|
|
|
535
543
|
#### Window functions
|
|
536
544
|
|
|
537
|
-
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
545
|
+
[Source](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/window.ts)
|
|
538
546
|
|
|
539
547
|
- `window()`
|
|
540
548
|
- `applyWindow()`
|
|
@@ -554,8 +562,8 @@ Desmos](https://www.desmos.com/calculator/lkyf2ag3ta) to experiment.
|
|
|
554
562
|
|
|
555
563
|
### Utilities
|
|
556
564
|
|
|
557
|
-
- [Unit conversions](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
558
|
-
- [Filter response](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/
|
|
565
|
+
- [Unit conversions](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/convert.ts)
|
|
566
|
+
- [Filter response](https://github.com/thi-ng/umbrella/blob/develop/packages/dsp/src/filter-response.ts)
|
|
559
567
|
|
|
560
568
|
## Authors
|
|
561
569
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { IReset } from "@thi.ng/api";
|
|
2
2
|
import { AGen } from "./agen";
|
|
3
3
|
/**
|
|
4
|
-
* Creates a new `Add` gen using given `step` (default: 1) and `start
|
|
5
|
-
* (default: 0) values, producing: `y(t) = step + y(t-1)`.
|
|
4
|
+
* Creates a new `Add` gen using given `step` (default: 1.0) and `start`
|
|
5
|
+
* (default: 0.0) values, producing: `y(t) = step + y(t-1)`. If `clamp` is
|
|
6
|
+
* given, the resulting output will be clamped to that value (min or max depends
|
|
7
|
+
* on sign of `start - clamp`).
|
|
6
8
|
*
|
|
7
9
|
* @param step
|
|
8
10
|
* @param start
|
package/{gen/add.js → add.js}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AGen } from "./agen";
|
|
2
2
|
/**
|
|
3
|
-
* Creates a new `Add` gen using given `step` (default: 1) and `start
|
|
4
|
-
* (default: 0) values, producing: `y(t) = step + y(t-1)`.
|
|
3
|
+
* Creates a new `Add` gen using given `step` (default: 1.0) and `start`
|
|
4
|
+
* (default: 0.0) values, producing: `y(t) = step + y(t-1)`. If `clamp` is
|
|
5
|
+
* given, the resulting output will be clamped to that value (min or max depends
|
|
6
|
+
* on sign of `start - clamp`).
|
|
5
7
|
*
|
|
6
8
|
* @param step
|
|
7
9
|
* @param start
|
|
@@ -9,6 +11,9 @@ import { AGen } from "./agen";
|
|
|
9
11
|
*/
|
|
10
12
|
export const add = (step, start, clamp) => new Add(step, start, clamp);
|
|
11
13
|
export class Add extends AGen {
|
|
14
|
+
_step;
|
|
15
|
+
_start;
|
|
16
|
+
_clamp;
|
|
12
17
|
constructor(_step = 1, _start = 0, _clamp) {
|
|
13
18
|
super(0);
|
|
14
19
|
this._step = _step;
|
package/{comp/addg.js → addg.js}
RENAMED
|
File without changes
|
package/{gen/adsr.js → adsr.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clamp01 } from "@thi.ng/math";
|
|
1
|
+
import { clamp01 } from "@thi.ng/math/interval";
|
|
2
2
|
import { add } from "./add";
|
|
3
3
|
import { AGen } from "./agen";
|
|
4
4
|
import { curve } from "./curve";
|
|
@@ -36,9 +36,29 @@ var EnvPhase;
|
|
|
36
36
|
*/
|
|
37
37
|
export const adsr = (opts) => new ADSR(opts);
|
|
38
38
|
export class ADSR extends AGen {
|
|
39
|
+
_phase;
|
|
40
|
+
_curve;
|
|
41
|
+
_atime;
|
|
42
|
+
_dtime;
|
|
43
|
+
_rtime;
|
|
44
|
+
_acurve;
|
|
45
|
+
_dcurve;
|
|
46
|
+
_sustain;
|
|
47
|
+
_speriod;
|
|
48
|
+
_gain;
|
|
39
49
|
constructor(opts) {
|
|
40
50
|
super(0);
|
|
41
|
-
opts =
|
|
51
|
+
opts = {
|
|
52
|
+
a: 0,
|
|
53
|
+
d: 0,
|
|
54
|
+
s: 1,
|
|
55
|
+
r: 0,
|
|
56
|
+
acurve: 0.1,
|
|
57
|
+
dcurve: 0.001,
|
|
58
|
+
slen: Infinity,
|
|
59
|
+
gain: 1,
|
|
60
|
+
...opts,
|
|
61
|
+
};
|
|
42
62
|
this.setAttack(opts.a);
|
|
43
63
|
this.setDecay(opts.d);
|
|
44
64
|
this.setRelease(opts.r);
|
package/{gen/agen.js → agen.js}
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { __take } from "./internal/take";
|
|
1
2
|
/**
|
|
2
3
|
* Abstract base class for unit gens in this package. Provides
|
|
3
4
|
* {@link @thi.ng/api#IDeref} to obtain the gen's current value and
|
|
4
5
|
* `Iterable` implementations to use gens as ES6 iterables.
|
|
5
6
|
*/
|
|
6
7
|
export class AGen {
|
|
8
|
+
_val;
|
|
7
9
|
constructor(_val) {
|
|
8
10
|
this._val = _val;
|
|
9
11
|
}
|
|
@@ -15,9 +17,6 @@ export class AGen {
|
|
|
15
17
|
yield this.next();
|
|
16
18
|
}
|
|
17
19
|
take(num, out = [], idx = 0) {
|
|
18
|
-
|
|
19
|
-
out[idx++] = this.next();
|
|
20
|
-
}
|
|
21
|
-
return out;
|
|
20
|
+
return __take(this, num, out, idx);
|
|
22
21
|
}
|
|
23
22
|
}
|