Some merge cleanup

This commit is contained in:
Aria
2025-10-14 21:47:59 -05:00
parent d07134dc5f
commit 837b87e13a
4 changed files with 23 additions and 18 deletions
+2 -2
View File
@@ -796,7 +796,7 @@ describe('Pattern', () => {
});
});
describe('apply', () => {
(it('Can apply a function', () => {
it('Can apply a function', () => {
expect(sequence('a', 'b').apply(fast(2)).firstCycle()).toStrictEqual(sequence('a', 'b').fast(2).firstCycle());
}),
it('Can apply a pattern of functions', () => {
@@ -804,7 +804,7 @@ describe('Pattern', () => {
expect(sequence('a', 'b').apply(fast(2), fast(3)).firstCycle()).toStrictEqual(
sequence('a', 'b').fast(2, 3).firstCycle(),
);
}));
});
});
describe('layer', () => {
it('Can layer up multiple functions', () => {
+18 -13
View File
@@ -7,9 +7,18 @@ This program is free software: you can redistribute it and/or modify it under th
import './feedbackdelay.mjs';
import './reverb.mjs';
import './vowel.mjs';
import { _mod, cycleToSeconds } from './util.mjs';
import { _mod, clamp, cycleToSeconds } from './util.mjs';
import workletsUrl from './worklets.mjs?audioworklet';
import { createFilter, gainNode, getCompressor, getDistortion, getLfo, getWorklet, effectSend } from './helpers.mjs';
import {
createFilter,
gainNode,
getCompressor,
getDistortion,
getLfo,
getWorklet,
effectSend,
webAudioTimeout,
} from './helpers.mjs';
import { map } from 'nanostores';
import { logger } from './logger.mjs';
import { loadBuffer } from './sampler.mjs';
@@ -296,22 +305,19 @@ function getPhaser(time, end, frequency = 1, depth = 0.5, centerFrequency = 1000
const ac = getAudioContext();
const lfoGain = getLfo(ac, time, end, { frequency, depth: sweep * 2 });
// filters
const numStages = 8; // num of filters in series
//filters
const numStages = 2; //num of filters in series
let fOffset = 0;
const filterChain = [];
const fMin = centerFrequency * 0.5,
fMax = centerFrequency;
const ratio = Math.pow(fMax / fMin, 1 / numStages);
for (let i = 0; i < numStages; i++) {
const filter = ac.createBiquadFilter();
filter.type = 'allpass';
filter.type = 'notch';
filter.gain.value = 1;
filter.frequency.value = fMin * Math.pow(ratio, i + 0.5);
filter.Q.value = 2 - clamp(depth * 2, 0, 1.9);
filter.frequency.value = centerFrequency + fOffset;
filter.Q.value = 2 - Math.min(Math.max(depth * 2, 0), 1.9);
lfoGain.connect(filter.detune);
fOffset += 4;
fOffset += 282;
if (i > 0) {
filterChain[i - 1].connect(filter);
}
@@ -617,8 +623,7 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
fx.coarse !== undefined && chain.push(getWorklet(ac, 'coarse-processor', { coarse: fx.coarse }));
fx.crush !== undefined && chain.push(getWorklet(ac, 'crush-processor', { crush: fx.crush }));
fx.shape !== undefined && chain.push(getWorklet(ac, 'shape-processor', { shape: fx.shape, postgain: shapevol }));
fx.distort !== undefined &&
chain.push(getWorklet(ac, 'distort-processor', { distort: fx.distort, postgain: distortvol }));
fx.distort !== undefined && chain.push(getDistortion(fx.distort, distortvol, fx.distorttype));
let tremolo = fx.tremolo;
if (fx.tremolosync != null) {
+1 -1
View File
@@ -322,6 +322,6 @@ export async function onTriggerSynth(t, value, tables, cps, frameLen) {
node.disconnect();
wtPosModulators?.disconnect();
wtWarpModulators?.disconnect();
}
};
return handle;
}
+2 -2
View File
@@ -18,8 +18,8 @@
--docsearch-modal-background: var(--background);
--docsearch-muted-color: color-mix(in srgb, var(--foreground), #fff 30%);
--docsearch-key-gradient: var(--foreground);
--docsearch-key-shadow:
inset 0 -2px 0 0 var(--gutterForeground), inset 0 0 1px 1px var(--foreground), 0 1px 2px 1px var(--gutterBackground);
--docsearch-key-shadow: inset 0 -2px 0 0 var(--gutterForeground), inset 0 0 1px 1px var(--foreground),
0 1px 2px 1px var(--gutterBackground);
}
.dark {
--docsearch-muted-color: color-mix(in srgb, var(--foreground), #000 30%);