adj resonance

This commit is contained in:
Jade (Rose) Rowland
2025-05-02 22:50:00 -04:00
parent 8d02d4270a
commit 525f5d87d1
2 changed files with 12 additions and 4 deletions
+11 -3
View File
@@ -123,9 +123,9 @@ const defaultDefaultValues = {
density: '.03',
ftype: '12db',
fanchor: 0,
resonance: 1,
hresonance: 1,
bandq: 1,
resonance: .183,
hresonance: .183,
bandq: .183,
channels: [1, 2],
phaserdepth: 0.75,
shapevol: 1,
@@ -182,6 +182,10 @@ export const getAudioContext = () => {
export function getAudioContextCurrentTime() {
return getAudioContext().currentTime;
}
function applyResonanceCurve(res) {
return Math.min(30.03, Math.pow(res * 5.48, 2))
}
let workletsLoading;
function loadWorklets() {
@@ -526,6 +530,10 @@ export const superdough = async (value, t, hapDuration) => {
compressorRelease,
} = value;
resonance = applyResonanceCurve(resonance)
hresonance = applyResonanceCurve(hresonance)
bandq = applyResonanceCurve(bandq)
gain = applyGainCurve(nanFallback(gain, 1));
postgain = applyGainCurve(postgain);
shapevol = applyGainCurve(shapevol);
+1 -1
View File
@@ -295,7 +295,7 @@ class LadderProcessor extends AudioWorkletProcessor {
cutoff = (cutoff * 2 * _PI) / sampleRate;
cutoff = cutoff > 1 ? 1 : cutoff;
const k = Math.min(8, resonance * 0.4);
const k = Math.min(8, resonance * 0.13);
// drive makeup * resonance volume loss makeup
let makeupgain = (1 / drive) * Math.min(1.75, 1 + k);