graphic eq + cleanup

This commit is contained in:
Boof2015
2026-07-02 23:12:58 -04:00
parent 0003c7d778
commit 9ce825b673
474 changed files with 765 additions and 187 deletions
+9
View File
@@ -11,6 +11,15 @@ export function formatFreq(hz: number): string {
return `${Math.round(hz)}`;
}
/** Frequency with unit, for the graphic-band captions ("60 Hz", "12 kHz"). */
export function formatFreqHz(hz: number): string {
if (hz >= 1000) {
const k = hz / 1000;
return `${Number.isInteger(k) ? k : k.toFixed(1)} kHz`;
}
return `${Math.round(hz)} Hz`;
}
export function formatGain(db: number): string {
if (Math.abs(db) < 0.05) return '0';
return `${db > 0 ? '+' : ''}${db.toFixed(1)}`;