@audio/effect-flanger 1.1.1 → 1.1.3

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/flanger.js CHANGED
@@ -20,6 +20,7 @@ export default function flanger (data, params) {
20
20
  params._phase = 0
21
21
  }
22
22
  let buf = params.buffer, ptr = params.ptr, phase = params._phase
23
+ if (ptr >= maxDelay) ptr = 0 // delay shrank live — re-enter the active ring
23
24
  let inc = 2 * PI * rate / fs
24
25
 
25
26
  for (let i = 0, l = data.length; i < l; i++) {
@@ -28,8 +29,8 @@ export default function flanger (data, params) {
28
29
  if (phase > 2 * PI) phase -= 2 * PI
29
30
 
30
31
  let d = delaySamples * (1 + depth * lfo)
31
- let readPos = ptr - d
32
- if (readPos < 0) readPos += maxDelay
32
+ // total wrap — d may reach/exceed maxDelay (depth ≈ 1 vs floored buffer size)
33
+ let readPos = ((ptr - d) % maxDelay + maxDelay) % maxDelay
33
34
 
34
35
  let idx = floor(readPos)
35
36
  let frac = readPos - idx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audio/effect-flanger",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Flanger — modulated short delay with feedback",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -8,11 +8,11 @@
8
8
  "exports": {
9
9
  ".": "./flanger.js",
10
10
  "./package.json": "./package.json",
11
- "./atom": "./atom.js"
11
+ "./audio": "./audio.js"
12
12
  },
13
13
  "files": [
14
14
  "flanger.js",
15
- "atom.js"
15
+ "audio.js"
16
16
  ],
17
17
  "keywords": [
18
18
  "audio",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "atom": "./atom.js"
40
+ "audio": "./audio.js"
41
41
  }
File without changes