Consistency
This commit is contained in:
parent
ac582b4d40
commit
99e14dae5c
1 changed files with 3 additions and 2 deletions
|
|
@ -1235,10 +1235,11 @@ class WavetableOscillatorProcessor extends AudioWorkletProcessor {
|
|||
const len = frame.length;
|
||||
const pos = phase * len;
|
||||
let i = pos | 0;
|
||||
if (i >= len) i = 0;
|
||||
if (i >= len) i = 0; // fast wrap
|
||||
const frac = pos - i;
|
||||
const a = frame[i];
|
||||
const i1 = i + 1 < len ? i + 1 : 0; // fast wrap
|
||||
let i1 = i + 1;
|
||||
if (i1 >= len) i1 = 0;
|
||||
const b = frame[i1];
|
||||
return a + (b - a) * frac;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue