@audio/effect-subbass 1.0.0 → 1.1.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.
Files changed (2) hide show
  1. package/atom.js +29 -0
  2. package/package.json +7 -4
package/atom.js ADDED
@@ -0,0 +1,29 @@
1
+ // atom manifest — wraps the subbass atom; SVF filter state, no sizing params —
2
+ // every param stays live, per-channel state is just the running filter integrators.
3
+
4
+ import subbassFn from './subbass.js'
5
+
6
+ export const subbass = (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.freq = params.freq[0]
15
+ p.amount = params.amount[0]
16
+ p.drive = params.drive[0]
17
+ p.keep = params.keep[0]
18
+ out[c].set(inp[c])
19
+ subbassFn(out[c], p)
20
+ }
21
+ }
22
+ }
23
+ subbass.channels = 'any'
24
+ subbass.params = {
25
+ freq: { type: 'number', min: 30, max: 200, default: 80, unit: 'Hz', curve: 'log' },
26
+ amount: { type: 'number', min: 0, max: 1, default: 0.5 },
27
+ drive: { type: 'number', min: 0, max: 1, default: 0.5 },
28
+ keep: { type: 'number', min: 0, max: 1, default: 1 },
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audio/effect-subbass",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Psychoacoustic bass enhancer — harmonic synthesis below cutoff (MaxxBass/RBass class)",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -18,12 +18,15 @@
18
18
  "main": "subbass.js",
19
19
  "exports": {
20
20
  ".": "./subbass.js",
21
- "./package.json": "./package.json"
21
+ "./package.json": "./package.json",
22
+ "./atom": "./atom.js"
22
23
  },
23
24
  "files": [
24
- "subbass.js"
25
+ "subbass.js",
26
+ "atom.js"
25
27
  ],
26
28
  "publishConfig": {
27
29
  "access": "public"
28
- }
30
+ },
31
+ "atom": "./atom.js"
29
32
  }