@audio/amp-cabinet 1.1.0 → 1.2.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/audio.js +20 -0
- package/package.json +6 -3
package/audio.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// atom manifest — speaker cabinet sim. Without an IR the kernel runs its classical
|
|
2
|
+
// closed-back 12" biquad chain — that scalar form is what this atom exposes.
|
|
3
|
+
// A captured IR is an array argument: use the kernel via direct import for that.
|
|
4
|
+
// streaming: false: the kernel builds its filter state inside each call.
|
|
5
|
+
|
|
6
|
+
import cabinetFn from './cabinet.js'
|
|
7
|
+
|
|
8
|
+
export const cabinet = (ctx) => (inputs, outputs, params) => {
|
|
9
|
+
const inp = inputs[0], out = outputs[0]
|
|
10
|
+
if (!inp || !inp.length) return
|
|
11
|
+
for (let c = 0; c < inp.length; c++) {
|
|
12
|
+
out[c].set(inp[c])
|
|
13
|
+
cabinetFn(out[c], { fs: ctx.sampleRate, mix: params.mix[0] })
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
cabinet.channels = 'any'
|
|
17
|
+
cabinet.streaming = false
|
|
18
|
+
cabinet.params = {
|
|
19
|
+
mix: { type: 'number', min: 0, max: 1, default: 1 },
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audio/amp-cabinet",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Cabinet simulation — measured-IR convolution (pair with @audio/measure-ir) or classical speaker-sim biquads",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "cabinet.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./cabinet.js",
|
|
10
|
+
"./audio": "./audio.js",
|
|
10
11
|
"./package.json": "./package.json"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
|
-
"cabinet.js"
|
|
14
|
+
"cabinet.js",
|
|
15
|
+
"audio.js"
|
|
14
16
|
],
|
|
15
17
|
"dependencies": {
|
|
16
18
|
"@audio/reverb-convolution": "^1.0.0",
|
|
@@ -30,5 +32,6 @@
|
|
|
30
32
|
},
|
|
31
33
|
"publishConfig": {
|
|
32
34
|
"access": "public"
|
|
33
|
-
}
|
|
35
|
+
},
|
|
36
|
+
"audio": "./audio.js"
|
|
34
37
|
}
|