fix: render error on input

This commit is contained in:
2026-09-30 21:14:08 +02:00
parent a5669805c8
commit e68e73d3d5
2 changed files with 15 additions and 16 deletions
+3
View File
@@ -10,5 +10,8 @@ This template should help get you started developing with Tauri, React and Types
- Move meters polling logic outside dsp state because it causes re-render of everything tied to dsp constantly
- Check render to improve perfoormances
- Check in meter if clip bool is limit instead
- On close disconenct all ds^p
- Ma-trix gain block sometimes
- Q out of range
- Check end to end behavioour
+12 -16
View File
@@ -139,16 +139,14 @@ function peqBandResponseDb(
/** Sum of all bands' contributions at a given frequency. */
function peqTotalCurveDb(
freq: number,
bands: Record<PEQBand, PEQ>,
bands: Partial<Record<PEQBand, PEQ>>,
sampleRate: number = DEFAULT_SAMPLE_RATE
): number {
let sum = 0;
for (const band of Object.values(PEQBand)) {
sum += peqBandResponseDb(freq, bands[band], sampleRate);
}
return sum;
return Object.values(bands).reduce(
(sum, band) =>
band ? sum + peqBandResponseDb(freq, band, sampleRate) : sum,
0
);
}
/**
@@ -307,16 +305,14 @@ function peqBandPhaseDeg(
function peqTotalPhaseDeg(
freq: number,
bands: Record<PEQBand, PEQ>,
bands: Partial<Record<PEQBand, PEQ>>,
sampleRate: number = DEFAULT_SAMPLE_RATE
): number {
let sum = 0;
for (const band of Object.values(PEQBand)) {
sum += peqBandPhaseDeg(freq, bands[band], sampleRate);
}
return sum;
return Object.values(bands).reduce(
(sum, band) =>
band ? sum + peqBandPhaseDeg(freq, band, sampleRate) : sum,
0
);
}
export function getPeqPhasePoints({