fix(linebed): scale smoothing and power-law for 190-bin resolution
musicvid.org uses 1024 visual bins from 647 FFT bins — 5.4x our resolution. The 9-point 3-pass smoothing spread each peak to ~25 bins (13% of our width), creating fat mountains. And power-law 2.5 stretched 33 bass bins to 50% width, creating uniform plateaus the exponential can't sharpen. Fix: smoothing 5-point 2-pass (peaks spread ~9 bins = 4.7% width), power-law 1.5 (67 bass bins to 50% width, more frequency diversity).
This commit is contained in:
1 file changed
+9
-4
@@ -46,10 +46,15 @@
|
||||
const NUM_LINES = 120; // Dense terrain (musicvid.org uses 200 with WebGL, 120 is Canvas 2D safe)
|
||||
const SMOOTHING = 0.03; // Temporal smoothing (musicvid: smoothingTimeConstant 0.03)
|
||||
|
||||
// Spectrum processing params (from musicvid.org SpectrumAnalyser settings)
|
||||
const SMOOTHING_PASSES = 3;
|
||||
const SMOOTHING_POINTS = 9;
|
||||
const SPECTRUM_POWER = 2.5; // Power-law bin mapping (spectrumScale: 2.5)
|
||||
// Spectrum processing params — scaled for 190 bins (musicvid uses 1024 visual bins)
|
||||
// musicvid: 9 points / 1024 bins = 0.88% width per pass
|
||||
// ours: 5 points / 190 bins = 2.6% width per pass (comparable ratio)
|
||||
const SMOOTHING_PASSES = 2;
|
||||
const SMOOTHING_POINTS = 5;
|
||||
// Power-law reduced: musicvid maps 647→1024 bins (upsampling) at 2.5.
|
||||
// We map 190→190 (no upsampling) — 2.5 stretches 33 bass bins to 50% width
|
||||
// creating a uniform plateau. 1.5 keeps more frequency diversity visible.
|
||||
const SPECTRUM_POWER = 1.5;
|
||||
|
||||
// Variable exponential transform (musicvid: Exponential settings)
|
||||
// Bass gets higher exponent = sharper peaks; treble gets lower = softer
|
||||
|
||||
Reference in new issue
Block a user