Desktop-friendly live audio-reactive visualizer built with TypeScript, Vite, React, Web Audio API, and Three.js.
- Rendering path: Three.js + custom ShaderMaterial scenes.
- Audio analysis: Web Audio
AnalyserNode(fftSize=2048) + rolling beat detector (energy + spectral flux blend). - Input layer: mouse position, velocity, click/drag states, double-click lock.
npm install
npm run dev
npm run build- Open app in browser (
npm run dev). - In Audio section, choose source:
MicrophoneDevice Input+ specific input selectorSine + Noise TestLoad Audio File(looped playback)
- Click Start Audio (required by browser autoplay policy).
- Switch scenes with
1/2/3and tune intensity/sensitivity. - Use
Ffor fullscreen andHto hide/show UI.
Device Inputmode lists audio interfaces fromnavigator.mediaDevices.enumerateDevices().- If a device disconnects, the app surfaces an error and allows re-selection/restart.
- Fluid Warp
- Audio drives warp flow and color movement.
- Cursor controls local swirl center + distortion force.
- Particle Field
- Bass drives velocity and spread.
- Beat triggers bursts.
- Cursor acts as magnet/repulsor (stronger while mouse button is held).
- Tunnel / Kaleidoscope
- Beat creates pulse/zoom kick.
- Cursor steers center/rotation axis.
Scene switches crossfade for smooth transitions.
Emits:
x,ynormalizedvx,vysmoothed velocityspeeddowndragDistance- double-click toggles cursor influence lock
UI control: Cursor Influence = Off / Subtle / Strong.
1 / 2 / 3: switch scenesF: fullscreen toggleB: blackout toggleSpace: freeze/unfreeze animationH: hide/show UIR: reset active scene
- Render scale options:
0.5,0.75,1.0. - If FPS drops below 45 for ~3s, app auto-reduces render scale one step and shows a notice.
- Projection mode hides UI and attempts pointer lock for focused control.
- Use
Render Scale 1.0first, then drop to0.75if thermals rise. - For aggressive environments, use
Cursor Influence: Subtleto avoid oversteer. - Keep
Beat Sensitivityaround1.3–1.6as a starting point. - Use
Blackoutfor quick stage transitions while audio analysis continues.
src/
main.tsx
app/App.tsx
audio/
AudioEngine.ts
AudioFeatures.ts
BeatDetector.ts
input/
CursorController.ts
visuals/
VisualEngine.ts
SceneTypes.ts
scenes/
FluidWarpScene.ts
ParticleFieldScene.ts
TunnelScene.ts
shaders/
fluidWarp.frag
tunnel.frag
common.vert
ui/
Overlay.tsx
ControlsPanel.tsx
utils/
math.ts
smoothing.ts
fps.ts
styles/
main.css