@audio/effect-wah 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.
Files changed (2) hide show
  1. package/audio-module.js +32 -0
  2. package/package.json +7 -4
@@ -0,0 +1,32 @@
1
+ // audio-module manifest — wraps the wah-wah atom; envelope-free swept/static bandpass,
2
+ // no sizing params — every param stays live. `mode` picks LFO-swept ('auto') vs a
3
+ // fixed pedal position ('manual', freq pinned at fc).
4
+
5
+ import wahFn from './wah.js'
6
+
7
+ export const wah = (ctx) => {
8
+ const chP = []
9
+ for (let c = 0, N = ctx.maxChannels ?? 8; c < N; c++) chP.push({ fs: ctx.sampleRate })
10
+ return (inputs, outputs, params) => {
11
+ const inp = inputs[0], out = outputs[0]
12
+ if (!inp || !inp.length) return
13
+ for (let c = 0; c < inp.length; c++) {
14
+ const p = chP[c]
15
+ p.rate = params.rate[0]
16
+ p.depth = params.depth[0]
17
+ p.fc = params.fc[0]
18
+ p.Q = params.Q[0]
19
+ p.mode = params.mode
20
+ out[c].set(inp[c])
21
+ wahFn(out[c], p)
22
+ }
23
+ }
24
+ }
25
+ wah.channels = 'any'
26
+ wah.params = {
27
+ rate: { type: 'number', min: 0.05, max: 10, default: 1.5, unit: 'Hz', curve: 'log' },
28
+ depth: { type: 'number', min: 0, max: 3, default: 0.8, unit: 'oct' },
29
+ fc: { type: 'number', min: 200, max: 3000, default: 1000, unit: 'Hz', curve: 'log' },
30
+ Q: { type: 'number', min: 0.5, max: 20, default: 5 },
31
+ mode: { type: 'enum', values: ['auto', 'manual'], default: 'auto' },
32
+ }
package/package.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "name": "@audio/effect-wah",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Wah-wah — swept resonant bandpass filter",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "wah.js",
8
8
  "exports": {
9
9
  ".": "./wah.js",
10
- "./package.json": "./package.json"
10
+ "./package.json": "./package.json",
11
+ "./audio-module": "./audio-module.js"
11
12
  },
12
13
  "files": [
13
- "wah.js"
14
+ "wah.js",
15
+ "audio-module.js"
14
16
  ],
15
17
  "keywords": [
16
18
  "audio",
@@ -34,5 +36,6 @@
34
36
  },
35
37
  "publishConfig": {
36
38
  "access": "public"
37
- }
39
+ },
40
+ "audio-module": "./audio-module.js"
38
41
  }