mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-30 08:23:18 -04:00
adj resonance
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user