@thi.ng/dsp 4.7.61 → 4.7.63
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 +1 -1
- package/README.md +1 -1
- package/addg.d.ts +4 -5
- package/adsr.d.ts +17 -17
- package/anti-alias.d.ts +2 -1
- package/curve.d.ts +9 -9
- package/fft.d.ts +6 -6
- package/foldback.d.ts +1 -2
- package/osc-additive.d.ts +4 -6
- package/osc-dsf.d.ts +9 -10
- package/osc-mix.d.ts +6 -7
- package/osc-parabolic.d.ts +1 -2
- package/osc-rect.d.ts +2 -2
- package/osc-square-sin.d.ts +2 -2
- package/package.json +10 -10
- package/pan.d.ts +1 -1
- package/pink-noise.d.ts +1 -0
- package/power.d.ts +3 -0
- package/sincos.d.ts +6 -6
- package/svf.d.ts +1 -1
- package/waveshaper.d.ts +7 -10
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 202 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/addg.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { IGen } from "./api.js";
|
|
2
2
|
/**
|
|
3
|
-
* Creates a new {@link IGen} using given `step` gen and `start
|
|
4
|
-
*
|
|
3
|
+
* Creates a new {@link IGen} using given `step` gen and `start` (default: 0)
|
|
4
|
+
* value, producing: `y(t) = step(t) + y(t-1)`.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
* Note this is different to {@link sum}, which merely sums given
|
|
8
|
-
*
|
|
9
|
-
* gen.
|
|
7
|
+
* Note this is different to {@link sum}, which merely sums given argument gens
|
|
8
|
+
* for each step, but doesn't for a reduction like this gen.
|
|
10
9
|
*
|
|
11
10
|
* @example
|
|
12
11
|
* ```ts tangle:../export/addg.ts
|
package/adsr.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface ADSROpts {
|
|
|
19
19
|
*/
|
|
20
20
|
d: number;
|
|
21
21
|
/**
|
|
22
|
-
* Sustain level/gain (in [0
|
|
22
|
+
* Sustain level/gain (in `[0,1]` range). Default: 1
|
|
23
23
|
*/
|
|
24
24
|
s: number;
|
|
25
25
|
/**
|
|
@@ -48,26 +48,26 @@ export interface ADSROpts {
|
|
|
48
48
|
gain: number;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Time based ADSR envelope gen with customizable exponential attack,
|
|
52
|
-
*
|
|
51
|
+
* Time based ADSR envelope gen with customizable exponential attack, decay and
|
|
52
|
+
* release curves.
|
|
53
53
|
*
|
|
54
54
|
* @remarks
|
|
55
|
-
* The attack, decay and release options are to be given in samples
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
55
|
+
* The attack, decay and release options are to be given in samples (`num =
|
|
56
|
+
* time_in_seconds * sample_rate`). Unless the sustain length (`slen` opt) is
|
|
57
|
+
* finite (default: ∞), the release phase of the envelope MUST be triggered
|
|
58
|
+
* manually by calling {@link ADSR.release}. If only attack & decay phases are
|
|
59
|
+
* required, initialize the sustain level to zero and configure `dcurve` to
|
|
60
|
+
* adjust falloff shape.
|
|
61
61
|
*
|
|
62
|
-
* The envelope can be re-used & restarted by calling
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
62
|
+
* The envelope can be re-used & restarted by calling {@link ADSR.reset}. This
|
|
63
|
+
* will move the internal state back to the beginning of the attack phase and
|
|
64
|
+
* start producing a new envelope with current settings. Note: Any changes done
|
|
65
|
+
* to the envelope parameters are only guaranteed to be fully applied after
|
|
66
|
+
* reset.
|
|
67
67
|
*
|
|
68
|
-
* The `acurve` and `dcurve` options can be used to control the
|
|
69
|
-
*
|
|
70
|
-
*
|
|
68
|
+
* The `acurve` and `dcurve` options can be used to control the exponential
|
|
69
|
+
* curvature of the attack, decay and release phases. Recommended range
|
|
70
|
+
* `[0.0001,100]` (curved -> linear).
|
|
71
71
|
*
|
|
72
72
|
* @param opts -
|
|
73
73
|
*/
|
package/anti-alias.d.ts
CHANGED
package/curve.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { MAdd } from "./madd.js";
|
|
2
2
|
/**
|
|
3
|
-
* Returns new {@link MAdd} gen, producing an exponential curve (with
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Returns new {@link MAdd} gen, producing an exponential curve (with adjustable
|
|
4
|
+
* curvature) between `start` and `end` values over `num` steps. This is the
|
|
5
|
+
* exponential equivalent of {@link line}.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* Unless `skipFirst` is true (default: false), the `end` value is only
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Unless `skipFirst` is true (default: false), the `end` value is only reached
|
|
9
|
+
* at `num + 1` steps. Unless `clampEnd` is true (default: false), the curve
|
|
10
|
+
* will NOT stop at `end` but continue indefinitely if more values are requested
|
|
11
|
+
* from the generator.
|
|
12
12
|
*
|
|
13
|
-
* The curvature can be controlled via the logarithmic `rate` param.
|
|
14
|
-
*
|
|
13
|
+
* The curvature can be controlled via the logarithmic `rate` param. Recommended
|
|
14
|
+
* range `[0.0001,10000]` (curved -> linear). Default: 0.1
|
|
15
15
|
*
|
|
16
16
|
* Also see {@link madd}.
|
|
17
17
|
*
|
package/fft.d.ts
CHANGED
|
@@ -113,8 +113,8 @@ export declare const scaleFFT: (complex: ComplexArray, scale: number) => Complex
|
|
|
113
113
|
* By default assumes a rectangular window and the resulting scale factor of 2 /
|
|
114
114
|
* N.
|
|
115
115
|
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
116
|
+
* Reference:
|
|
117
|
+
* https://holometer.fnal.gov/GH_FFT.pdf
|
|
118
118
|
*
|
|
119
119
|
* @param complex -
|
|
120
120
|
* @param window -
|
|
@@ -129,8 +129,8 @@ export declare const normalizeFFT: (complex: ComplexArray, window?: number | Num
|
|
|
129
129
|
* By default assumes a rectangular window and the resulting scale factor of N /
|
|
130
130
|
* 2.
|
|
131
131
|
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
132
|
+
* Reference:
|
|
133
|
+
* https://holometer.fnal.gov/GH_FFT.pdf
|
|
134
134
|
*
|
|
135
135
|
* @param complex -
|
|
136
136
|
* @param window -
|
|
@@ -145,8 +145,8 @@ export declare const denormalizeFFT: (complex: ComplexArray, window?: number | N
|
|
|
145
145
|
* {@link spectrumPhase}. The `eps` value might have to be adjusted and should
|
|
146
146
|
* be approx. `max(spectrumMag(fft))/10000`.
|
|
147
147
|
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
148
|
+
* Reference:
|
|
149
|
+
* https://www.gaussianwaves.com/2015/11/interpreting-fft-results-obtaining-magnitude-and-phase-information/
|
|
150
150
|
*
|
|
151
151
|
* @param complex -
|
|
152
152
|
* @param eps -
|
package/foldback.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { AProc } from "./aproc.js";
|
|
|
4
4
|
* amplifies it with `amp` (default: 1/thresh).
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
*
|
|
8
|
-
* - https://www.desmos.com/calculator/lkyf2ag3ta
|
|
7
|
+
* [Interactive graph](https://www.desmos.com/calculator/lkyf2ag3ta)
|
|
9
8
|
*
|
|
10
9
|
* @param thresh - fold threshold
|
|
11
10
|
* @param amp - post amplifier
|
package/osc-additive.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import type { StatelessOscillator } from "./api.js";
|
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* The `freqFn` and `ampFn` functions are used to compute respective frequency
|
|
9
|
-
* and amplitude factors for each of the `n` requested harmonics (given in
|
|
10
|
-
* range).
|
|
9
|
+
* and amplitude factors for each of the `n` requested harmonics (given in
|
|
10
|
+
* `[i,n]` range).
|
|
11
11
|
*
|
|
12
12
|
* @param osc -
|
|
13
13
|
* @param freqFn -
|
|
@@ -21,8 +21,7 @@ export declare const additive: (osc: StatelessOscillator, freqFn: Fn<number, num
|
|
|
21
21
|
* each partial.
|
|
22
22
|
*
|
|
23
23
|
* @remarks
|
|
24
|
-
* Interactive graph of this oscillator
|
|
25
|
-
* https://www.desmos.com/calculator/irugw6gnhy
|
|
24
|
+
* [Interactive graph of this oscillator](https://www.desmos.com/calculator/irugw6gnhy)
|
|
26
25
|
*
|
|
27
26
|
* @param n - number of partials
|
|
28
27
|
* @param useGibbs -
|
|
@@ -34,8 +33,7 @@ export declare const squareAdditive: (n?: number, useGibbs?: boolean) => Statele
|
|
|
34
33
|
* {@link gibbs} to each partial.
|
|
35
34
|
*
|
|
36
35
|
* @remarks
|
|
37
|
-
* Interactive graph of this oscillator
|
|
38
|
-
* https://www.desmos.com/calculator/irugw6gnhy
|
|
36
|
+
* [Interactive graph of this oscillator](https://www.desmos.com/calculator/irugw6gnhy)
|
|
39
37
|
*
|
|
40
38
|
* @param n - number of partials
|
|
41
39
|
* @param useGibbs -
|
package/osc-dsf.d.ts
CHANGED
|
@@ -5,19 +5,18 @@ import type { StatelessOscillator } from "./api.js";
|
|
|
5
5
|
* `y(t) = (1-a^2) * sin(2πt) / (1 + a^2 - 2a * cos(b * 2πt))`
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* `alpha` should be in [0
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* result is a pure sine.
|
|
8
|
+
* `alpha` should be in `[0,1)` interval, `beta` is used as factor for the base
|
|
9
|
+
* `freq` and used for the cosine modulation term. The default config for both
|
|
10
|
+
* params is 0.5, 1.0 respectively, creating a waveform similar to a bandlimited
|
|
11
|
+
* sawtooth. If both params are zero, the result is a pure sine.
|
|
13
12
|
*
|
|
14
|
-
* Note: Higher `alpha` values cause an increasing number (and
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* values.
|
|
13
|
+
* Note: Higher `alpha` values cause an increasing number (and amplitude) of
|
|
14
|
+
* spikes in the waveform. Therefore, the higher the `alpha`, the lower `amp`
|
|
15
|
+
* should be to avoid excessive out-of-range values.
|
|
18
16
|
*
|
|
19
17
|
* References:
|
|
20
|
-
*
|
|
18
|
+
*
|
|
19
|
+
* - [Interactive graph](https://www.desmos.com/calculator/klvl9oszfm)
|
|
21
20
|
* - https://ccrma.stanford.edu/files/papers/stanm5.pdf
|
|
22
21
|
*
|
|
23
22
|
* @param phase -
|
package/osc-mix.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import type { StatelessOscillator } from "./api.js";
|
|
2
2
|
/**
|
|
3
|
-
* HOF oscillator. Takes 2 stateless oscillator fns and returns new
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* ratio).
|
|
3
|
+
* HOF oscillator. Takes 2 stateless oscillator fns and returns new oscillator
|
|
4
|
+
* function which produces an interpolated result of both. The returned function
|
|
5
|
+
* takes an additional `mix` arg (`[0,1]` range) control contributions of either
|
|
6
|
+
* oscillator (default: 0.5 aka 50/50 ratio).
|
|
8
7
|
*
|
|
9
8
|
* @param osc1 -
|
|
10
9
|
* @param osc2 -
|
|
11
10
|
*/
|
|
12
11
|
export declare const mixOsc: (osc1: StatelessOscillator, osc2: StatelessOscillator) => StatelessOscillator;
|
|
13
12
|
/**
|
|
14
|
-
* Similar to {@link mixOsc}, but with `mix` arg ([0
|
|
15
|
-
*
|
|
13
|
+
* Similar to {@link mixOsc}, but with `mix` arg (`[0,1]` range) directly given
|
|
14
|
+
* to HOF and not changeable after.
|
|
16
15
|
*
|
|
17
16
|
* @param osc1 -
|
|
18
17
|
* @param osc2 -
|
package/osc-parabolic.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ import type { StatelessOscillator } from "./api.js";
|
|
|
3
3
|
* Parabolic waveform oscillator.
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
|
-
*
|
|
7
|
-
* - https://www.desmos.com/calculator/gsobpc8hsy
|
|
6
|
+
* [Interactive graph](https://www.desmos.com/calculator/gsobpc8hsy)
|
|
8
7
|
*
|
|
9
8
|
* @param phase -
|
|
10
9
|
* @param freq -
|
package/osc-rect.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { StatelessOscillator } from "./api.js";
|
|
2
2
|
export declare const rect: StatelessOscillator;
|
|
3
3
|
/**
|
|
4
|
-
* Higher order version of {@link rect} with pre-configured `duty` width
|
|
5
|
-
* (
|
|
4
|
+
* Higher order version of {@link rect} with pre-configured `duty` width (in the
|
|
5
|
+
* `(0,1)` range).
|
|
6
6
|
*
|
|
7
7
|
* @param duty -
|
|
8
8
|
*/
|
package/osc-square-sin.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { StatelessOscillator } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Returns a {@link StatelessOscillator} function with adjustable waveform based
|
|
4
|
-
* on given `squareness` param (in [0
|
|
4
|
+
* on given `squareness` param (in `[0,1)` interval). If `squareness = 0` the
|
|
5
5
|
* waveform will be a perfect sine. Higher values morph the waveform
|
|
6
6
|
* increasingly into a square wave.
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* Interactive graph
|
|
9
|
+
* [Interactive graph](https://www.desmos.com/calculator/nbvd97m3kl)
|
|
10
10
|
*
|
|
11
11
|
* @param squareness
|
|
12
12
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/dsp",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.63",
|
|
4
4
|
"description": "Composable signal generators, oscillators, filters, FFT, spectrum, windowing & related DSP utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.11.
|
|
44
|
-
"@thi.ng/checks": "^3.6.
|
|
45
|
-
"@thi.ng/errors": "^2.5.
|
|
46
|
-
"@thi.ng/math": "^5.11.
|
|
47
|
-
"@thi.ng/random": "^4.1.
|
|
48
|
-
"@thi.ng/transducers": "^9.2.
|
|
43
|
+
"@thi.ng/api": "^8.11.21",
|
|
44
|
+
"@thi.ng/checks": "^3.6.24",
|
|
45
|
+
"@thi.ng/errors": "^2.5.27",
|
|
46
|
+
"@thi.ng/math": "^5.11.21",
|
|
47
|
+
"@thi.ng/random": "^4.1.12",
|
|
48
|
+
"@thi.ng/transducers": "^9.2.19"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"esbuild": "^0.
|
|
52
|
-
"typedoc": "^0.27.
|
|
51
|
+
"esbuild": "^0.25.0",
|
|
52
|
+
"typedoc": "^0.27.7",
|
|
53
53
|
"typescript": "^5.7.3"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
@@ -292,5 +292,5 @@
|
|
|
292
292
|
"year": 2015,
|
|
293
293
|
"screenshot": "dsp/dsf-allpass1.png"
|
|
294
294
|
},
|
|
295
|
-
"gitHead": "
|
|
295
|
+
"gitHead": "bee617702ac61d093465b967f8f973dc566faa6b\n"
|
|
296
296
|
}
|
package/pan.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { AProc } from "./aproc.js";
|
|
|
3
3
|
import type { NumericArray } from "@thi.ng/api";
|
|
4
4
|
/**
|
|
5
5
|
* Positions and converts a mono signal into a stereo signal using given `pos`
|
|
6
|
-
* in the [-1
|
|
6
|
+
* in the `[-1,1]` range to control the panning (-1 = left, +1 = right).
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
9
|
* Reference:
|
package/pink-noise.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type PNoiseCoeffs = Tuple<number, 5>;
|
|
|
17
17
|
* is scale relative to the sum of given `amp` values.
|
|
18
18
|
*
|
|
19
19
|
* References:
|
|
20
|
+
*
|
|
20
21
|
* - http://web.archive.org/web/20160513114217/http://home.earthlink.net/~ltrammell/tech/newpink.htm
|
|
21
22
|
* - http://web.archive.org/web/20160515145318if_/http://home.earthlink.net/~ltrammell/tech/pinkalg.htm
|
|
22
23
|
* - https://www.musicdsp.org/en/latest/Synthesis/220-trammell-pink-noise-c-class.html
|
package/power.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare const invPowerScale: (scale: number | NumericArray, base?: number
|
|
|
43
43
|
*
|
|
44
44
|
* @remarks
|
|
45
45
|
* References:
|
|
46
|
+
*
|
|
46
47
|
* - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
|
|
47
48
|
* - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
|
|
48
49
|
*
|
|
@@ -54,6 +55,7 @@ export declare const powerSumSquared: (window: NumericArray | ComplexArray) => n
|
|
|
54
55
|
*
|
|
55
56
|
* @remarks
|
|
56
57
|
* References:
|
|
58
|
+
*
|
|
57
59
|
* - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
|
|
58
60
|
* - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
|
|
59
61
|
*
|
|
@@ -66,6 +68,7 @@ export declare const powerMeanSquared: (window: NumericArray | ComplexArray) =>
|
|
|
66
68
|
*
|
|
67
69
|
* @remarks
|
|
68
70
|
* References:
|
|
71
|
+
*
|
|
69
72
|
* - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
|
|
70
73
|
* - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
|
|
71
74
|
*
|
package/sincos.d.ts
CHANGED
|
@@ -2,16 +2,16 @@ import type { ICopy, IReset } from "@thi.ng/api";
|
|
|
2
2
|
import { AGen } from "./agen.js";
|
|
3
3
|
/**
|
|
4
4
|
* Generator of sine & cosine values of given frequency in the form of
|
|
5
|
-
* [sin,cos] tuples. Start phase always zero.
|
|
5
|
+
* `[sin,cos]` tuples. Start phase always zero.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* Implementation based on a self-oscillating SVF (state-variable
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* for higher frequencies.
|
|
8
|
+
* Implementation based on a self-oscillating SVF (state-variable filter)
|
|
9
|
+
* without using any trig functions. Therefore, ~30% faster, but precision only
|
|
10
|
+
* useful for very low (< ~2Hz) frequencies. Due to floating point error
|
|
11
|
+
* accumulation, phase & amplitude drift will occur for higher frequencies.
|
|
13
12
|
*
|
|
14
13
|
* References:
|
|
14
|
+
*
|
|
15
15
|
* - http://www.earlevel.com/main/2003/03/02/the-digital-state-variable-filter/
|
|
16
16
|
*
|
|
17
17
|
* @param freq - normalized freq
|
package/svf.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const svfAllpass: (fc: number, q?: number) => SVF;
|
|
|
11
11
|
* Multi-type state variable filter w/ trapezoidal integration, after
|
|
12
12
|
* Andrew Simper.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* References:
|
|
15
15
|
*
|
|
16
16
|
* - https://cytomic.com/files/dsp/SvfLinearTrapOptimised2.pdf
|
|
17
17
|
* - https://en.wikipedia.org/wiki/Trapezoidal_rule
|
package/waveshaper.d.ts
CHANGED
|
@@ -2,16 +2,14 @@ import type { Fn2 } from "@thi.ng/api";
|
|
|
2
2
|
import { AProc } from "./aproc.js";
|
|
3
3
|
export type WaveShaperFn = Fn2<number, number, number>;
|
|
4
4
|
/**
|
|
5
|
-
* Customizable wave shaper for user defined shaping function supporting
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* value (see remarks).
|
|
5
|
+
* Customizable wave shaper for user defined shaping function supporting one
|
|
6
|
+
* (optional, implementation specific) adjustable curve parameter. By default
|
|
7
|
+
* uses {@link waveshapeTan} and supports configurable curvature.
|
|
8
|
+
* Post-amplification is applied to the transformed result value (see remarks).
|
|
10
9
|
*
|
|
11
10
|
* @remarks
|
|
12
|
-
* If `amp` is `true` (default), the curve will be normalized such that
|
|
13
|
-
*
|
|
14
|
-
* interval.
|
|
11
|
+
* If `amp` is `true` (default), the curve will be normalized such that input
|
|
12
|
+
* values in the `[-1,1]` range will be mapped to the same output interval.
|
|
15
13
|
*
|
|
16
14
|
* The following wave shaping functions are supplied by default:
|
|
17
15
|
*
|
|
@@ -19,8 +17,7 @@ export type WaveShaperFn = Fn2<number, number, number>;
|
|
|
19
17
|
* - {@link waveshapeSigmoid}
|
|
20
18
|
* - {@link waveshapeSin}
|
|
21
19
|
*
|
|
22
|
-
* Interactive graph
|
|
23
|
-
* - https://www.desmos.com/calculator/hg4i7o836i
|
|
20
|
+
* [Interactive graph](https://www.desmos.com/calculator/hg4i7o836i)
|
|
24
21
|
*
|
|
25
22
|
* @param thresh - fold threshold
|
|
26
23
|
* @param amp - post amplifier / autogain flag
|