@thi.ng/dsp 4.3.23 → 4.4.1
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 +8 -1
- package/README.md +1 -1
- package/osc.d.ts +5 -2
- package/osc.js +5 -2
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-08-
|
|
3
|
+
- **Last updated**: 2023-08-27T11:20:59Z
|
|
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.
|
|
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
## [4.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/dsp@4.4.0) (2023-08-24)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- update modOsc() fmod arg type ([06b0e38](https://github.com/thi-ng/umbrella/commit/06b0e38))
|
|
17
|
+
- allow numbers as constant freq offset
|
|
18
|
+
|
|
12
19
|
### [4.3.17](https://github.com/thi-ng/umbrella/tree/@thi.ng/dsp@4.3.17) (2023-08-04)
|
|
13
20
|
|
|
14
21
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
package/osc.d.ts
CHANGED
|
@@ -34,9 +34,12 @@ export declare const osc: (osc: StatelessOscillator, freq: IGen<number> | number
|
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```ts
|
|
37
|
-
* // FM sin osc using rect osc as modulator
|
|
37
|
+
* // FM sin osc using rect osc as frequency modulator
|
|
38
38
|
* modOsc(sin, 0.01, osc(rect, 0.1, 0.2))
|
|
39
39
|
*
|
|
40
|
+
* // AM sin osc using rect osc as amplitude modulator
|
|
41
|
+
* modOsc(sin, 0.01, 0, osc(rect, 0.1, 0.2))
|
|
42
|
+
*
|
|
40
43
|
* // FM & AM sin osc using rect osc as fmod and saw as amod
|
|
41
44
|
* modOsc(sin, 0.01, osc(rect, 0.1, 0.2), osc(saw, 0.05))
|
|
42
45
|
*
|
|
@@ -49,7 +52,7 @@ export declare const osc: (osc: StatelessOscillator, freq: IGen<number> | number
|
|
|
49
52
|
* @param dc` - DC offset / center value
|
|
50
53
|
* @param phase - normalized start phase
|
|
51
54
|
*/
|
|
52
|
-
export declare const modOsc: (osc: StatelessOscillator, freq: IGen<number> | number, fmod: IGen<number
|
|
55
|
+
export declare const modOsc: (osc: StatelessOscillator, freq: IGen<number> | number, fmod: IGen<number> | number, amod?: IGen<number> | number, dc?: number, phase?: number) => Osc;
|
|
53
56
|
export declare class Osc extends AGen<number> {
|
|
54
57
|
protected _osc: StatelessOscillator;
|
|
55
58
|
protected _dc: number;
|
package/osc.js
CHANGED
|
@@ -37,9 +37,12 @@ export const osc = (osc, freq, amp, dc, phase) => new Osc(osc, freq, amp, dc, ph
|
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```ts
|
|
40
|
-
* // FM sin osc using rect osc as modulator
|
|
40
|
+
* // FM sin osc using rect osc as frequency modulator
|
|
41
41
|
* modOsc(sin, 0.01, osc(rect, 0.1, 0.2))
|
|
42
42
|
*
|
|
43
|
+
* // AM sin osc using rect osc as amplitude modulator
|
|
44
|
+
* modOsc(sin, 0.01, 0, osc(rect, 0.1, 0.2))
|
|
45
|
+
*
|
|
43
46
|
* // FM & AM sin osc using rect osc as fmod and saw as amod
|
|
44
47
|
* modOsc(sin, 0.01, osc(rect, 0.1, 0.2), osc(saw, 0.05))
|
|
45
48
|
*
|
|
@@ -52,7 +55,7 @@ export const osc = (osc, freq, amp, dc, phase) => new Osc(osc, freq, amp, dc, ph
|
|
|
52
55
|
* @param dc` - DC offset / center value
|
|
53
56
|
* @param phase - normalized start phase
|
|
54
57
|
*/
|
|
55
|
-
export const modOsc = (osc, freq, fmod, amod = 1, dc, phase) => new Osc(osc, sum(fmod, isNumber(freq) ? add(freq) : freq), amod, dc, phase);
|
|
58
|
+
export const modOsc = (osc, freq, fmod, amod = 1, dc, phase) => new Osc(osc, sum(isNumber(fmod) ? new Const(fmod) : fmod, isNumber(freq) ? add(freq) : freq), amod, dc, phase);
|
|
56
59
|
export class Osc extends AGen {
|
|
57
60
|
constructor(_osc, freq, amp = 1, _dc = 0, phase = 0) {
|
|
58
61
|
super(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/dsp",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.1",
|
|
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.9.
|
|
38
|
-
"@thi.ng/checks": "^3.4.
|
|
39
|
-
"@thi.ng/errors": "^2.3.
|
|
40
|
-
"@thi.ng/math": "^5.
|
|
41
|
-
"@thi.ng/random": "^3.6.
|
|
42
|
-
"@thi.ng/transducers": "^8.6.
|
|
37
|
+
"@thi.ng/api": "^8.9.5",
|
|
38
|
+
"@thi.ng/checks": "^3.4.5",
|
|
39
|
+
"@thi.ng/errors": "^2.3.5",
|
|
40
|
+
"@thi.ng/math": "^5.6.1",
|
|
41
|
+
"@thi.ng/random": "^3.6.3",
|
|
42
|
+
"@thi.ng/transducers": "^8.6.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-extractor": "^7.36.4",
|
|
46
|
-
"@thi.ng/testament": "^0.3.
|
|
46
|
+
"@thi.ng/testament": "^0.3.23",
|
|
47
47
|
"rimraf": "^5.0.1",
|
|
48
48
|
"tools": "^0.0.1",
|
|
49
|
-
"typedoc": "^0.
|
|
50
|
-
"typescript": "^5.
|
|
49
|
+
"typedoc": "^0.25.0",
|
|
50
|
+
"typescript": "^5.2.2"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"allpass",
|
|
@@ -275,5 +275,5 @@
|
|
|
275
275
|
],
|
|
276
276
|
"year": 2015
|
|
277
277
|
},
|
|
278
|
-
"gitHead": "
|
|
278
|
+
"gitHead": "5929dd20497668496af13415cdf784a4d6f69aa3\n"
|
|
279
279
|
}
|