@audio/amp-cabinet 1.0.0 → 1.2.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.
Files changed (3) hide show
  1. package/atom.js +20 -0
  2. package/cabinet.js +1 -1
  3. package/package.json +8 -5
package/atom.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/cabinet.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // closed-back 12" cab: 70 Hz highpass, low bump, presence peak, steep rolloff above ~4.5 kHz.
4
4
 
5
5
  import convolve from '@audio/reverb-convolution'
6
- import { lowpass, highpass, peaking } from 'digital-filter/iir/biquad.js'
6
+ import { lowpass, highpass, peaking } from '@audio/biquad'
7
7
 
8
8
  function biquadRun (data, c) {
9
9
  let x1 = 0, x2 = 0, y1 = 0, y2 = 0
package/package.json CHANGED
@@ -1,20 +1,22 @@
1
1
  {
2
2
  "name": "@audio/amp-cabinet",
3
- "version": "1.0.0",
4
- "description": "Cabinet simulation \u2014 measured-IR convolution (pair with @audio/measure-ir) or classical speaker-sim biquads",
3
+ "version": "1.2.0",
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
+ "./atom": "./atom.js",
10
11
  "./package.json": "./package.json"
11
12
  },
12
13
  "files": [
13
- "cabinet.js"
14
+ "cabinet.js",
15
+ "atom.js"
14
16
  ],
15
17
  "dependencies": {
16
18
  "@audio/reverb-convolution": "^1.0.0",
17
- "digital-filter": "^2.0.0"
19
+ "@audio/biquad": "^1.1.0"
18
20
  },
19
21
  "keywords": [
20
22
  "audio",
@@ -30,5 +32,6 @@
30
32
  },
31
33
  "publishConfig": {
32
34
  "access": "public"
33
- }
35
+ },
36
+ "atom": "./atom.js"
34
37
  }