@audio/effect-sbr 1.0.0 → 1.1.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/audio-module.js +27 -0
- package/package.json +7 -4
package/audio-module.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// audio-module manifest — wraps the sbr atom; SVF filter state, no sizing params —
|
|
2
|
+
// every param stays live, per-channel state is just the running filter integrators.
|
|
3
|
+
|
|
4
|
+
import sbrFn from './sbr.js'
|
|
5
|
+
|
|
6
|
+
export const sbr = (ctx) => {
|
|
7
|
+
const chP = []
|
|
8
|
+
for (let c = 0, N = ctx.maxChannels ?? 8; c < N; c++) chP.push({ fs: ctx.sampleRate })
|
|
9
|
+
return (inputs, outputs, params) => {
|
|
10
|
+
const inp = inputs[0], out = outputs[0]
|
|
11
|
+
if (!inp || !inp.length) return
|
|
12
|
+
for (let c = 0; c < inp.length; c++) {
|
|
13
|
+
const p = chP[c]
|
|
14
|
+
p.cutoff = params.cutoff[0]
|
|
15
|
+
p.amount = params.amount[0]
|
|
16
|
+
p.drive = params.drive[0]
|
|
17
|
+
out[c].set(inp[c])
|
|
18
|
+
sbrFn(out[c], p)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
sbr.channels = 'any'
|
|
23
|
+
sbr.params = {
|
|
24
|
+
cutoff: { type: 'number', min: 2000, max: 16000, default: 8000, unit: 'Hz', curve: 'log' },
|
|
25
|
+
amount: { type: 'number', min: 0, max: 1, default: 0.5 },
|
|
26
|
+
drive: { type: 'number', min: 0, max: 1, default: 0.5 },
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audio/effect-sbr",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Spectral band replication — extend HF from midband harmonics (aural exciter family; De-Slop bandwidth recovery)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -18,12 +18,15 @@
|
|
|
18
18
|
"main": "sbr.js",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": "./sbr.js",
|
|
21
|
-
"./package.json": "./package.json"
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
"./audio-module": "./audio-module.js"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
|
-
"sbr.js"
|
|
25
|
+
"sbr.js",
|
|
26
|
+
"audio-module.js"
|
|
25
27
|
],
|
|
26
28
|
"publishConfig": {
|
|
27
29
|
"access": "public"
|
|
28
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"audio-module": "./audio-module.js"
|
|
29
32
|
}
|