Formatting and tests
This commit is contained in:
parent
51b150b829
commit
9848740e18
6 changed files with 85 additions and 8 deletions
|
|
@ -15,4 +15,4 @@ export const getAudioContext = () => {
|
|||
|
||||
export function getAudioContextCurrentTime() {
|
||||
return getAudioContext().currentTime;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { getAudioContext } from './audioContext.mjs';
|
||||
import { clamp, ffloor, nanFallback } from './util.mjs';
|
||||
import { clamp, nanFallback } from './util.mjs';
|
||||
import { getNoiseBuffer } from './noise.mjs';
|
||||
import { logger } from './logger.mjs';
|
||||
|
||||
export const noises = ['pink', 'white', 'brown', 'crackle'];
|
||||
|
||||
|
|
@ -365,7 +366,7 @@ const _chebyshev = (x, k) => {
|
|||
tnm2 = tnm1;
|
||||
tnm1 = tn;
|
||||
if (i % 2 === 0) {
|
||||
y += Math.min(1.3 * kl / i, 2) * tn;
|
||||
y += Math.min((1.3 * kl) / i, 2) * tn;
|
||||
}
|
||||
}
|
||||
// Soft clip
|
||||
|
|
|
|||
|
|
@ -77,4 +77,4 @@ export function secondsToCycle(t, cps) {
|
|||
return t * cps;
|
||||
}
|
||||
|
||||
export const ffloor = (x) => x | 0; // fast floor for positive numbers
|
||||
export const ffloor = (x) => x | 0; // fast floor for positive numbers
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
import OLAProcessor from './ola-processor';
|
||||
import FFT from './fft.js';
|
||||
import { getDistortionAlgorithm } from './helpers.mjs';
|
||||
import { getDistortionAlgorithm } from './helpers.mjs';
|
||||
|
||||
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||
const _mod = (n, m) => ((n % m) + m) % m;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue