A browser-based, audio-reactive 3D laser stage simulator built with Three.js and the Web Audio API. Load your music, hit play, and watch the stage erupt.
This project is for private / personal use only.
- โ You may run, study, and modify this project for personal, non-commercial use.
- โ You may not use this project, its visuals, recordings, or any derivative work for commercial purposes, public performances, social media content (TikTok, YouTube, Instagram, Twitchโฆ), or any monetised platform without explicit written permission from the author.
- โ You may not redistribute or re-publish this project or any part of it without permission.
To request permission โ for content creation or live events, say โ open a GitHub Issue or contact the author directly.
See the LICENSE file for full terms.
Videos and photos of the simulator in action are on TikTok: ๐ @strikerlulu1
| Feature | Description |
|---|---|
| ๐ต Full Song Analysis | Uploaded tracks are analysed offline with AI stem separation โ bass, drums, melody and vocals each drive different visual elements. A fast FFT-only mode is available when you don't want to wait. |
| ๐ง Musical Structure Detection | The analyser labels the song structure โ intro, verse, build-up, drop, outro โ and each section triggers its own lighting choreography. |
| โก Peak Drop Chaos | When the bass drops, the lasers go wide and erratic, strobes flicker and the COโ jets fire on the beat. |
| ๐ค Live Pattern Engine | A pattern decider picks from 14+ choreographies (fan, wave, scatter, tunnel, strobe, salvo, zigzag, chase, sparkleโฆ) from the real-time audio signal. |
| ๐ฅ Manual BPM Tap | Tap the beat by hand when the automatic detection disagrees with you. |
| Feature | Description |
|---|---|
| ๐๏ธ Custom Stage Builder | Top-down orthographic editor with a 0.5 m snapping grid. Place trusses, screens, lasers, moving heads, COโ jets and up-lights, then compile the layout into a live show. Saved to localStorage. |
| ๐๏ธ Four Venue Presets | Berghain (concrete bunker, dense haze), Open-Air Festival (procedural starfield, grass, rain), Arena (in-the-round, 360ยฐ rig, 200-strong crowd) and Basement Club (8ร8ร3 m, neon signs, max haze). |
| ๐ก Instanced Laser Fixtures | Front, twin, side, surround, corner, aerial and dancefloor formations with zone-aware choreography. |
| ๐ฆ Instanced Moving Heads | Spring-physics pan/tilt with an ADSR envelope and gobo textures. |
| ๐ Real-Time Shadows | A pool of shadow-casting spotlights is re-aimed each frame at the brightest active heads, so structures block light instead of glowing through it. Resolution scales down automatically when the frame rate drops. |
| ๐ Up-Lights & Wash | Stage wash lights react to mix energy and section type. |
| ๐ฅ Pyrotechnics | Curl-noise flame and spark particles, simulated in a Web Worker over SharedArrayBuffer so the physics never blocks the render loop. |
| ๐ซ๏ธ Haze & COโ Jets | Volumetric haze plus cryo-jet bursts that fire on drops. |
| ๐ง๏ธ Weather Effects | 2,000โ8,000 GPU rain streaks with wind drift, floor splash bursts, laser-tinted droplets, and a procedural rain sound synthesised from filtered white noise. |
| ๐บ Live Crowd | Animated festival crowd that jumps and raises hands in time with the BPM and song sections. |
| ๐ฅ Volumetric Crowd Lighting | When a beam sweeps over a crowd member they light up in that beam's exact colour; overlapping beams blend (red + blue = magenta) and fade out on a glow trail. |
| ๐ง Procedural DJ Avatar | Low-poly rig at the booth โ head nod on the BPM, arms working the mixer on bass/mid, shoulder bounce on the kick, fist pump on the drop. |
| Feature | Description |
|---|---|
| ๐ฌ TV Mode / Auto-Camera | Cinematic cuts and orbit sweeps synced to beats and section changes. |
| ๐ฎ VJ Camera Drone | Free-flight first-person camera with inertia, aerodynamic banking and spring-damped bass rumble on every kick. |
| ๐ค Audience POV | Eye-level camera (1.75 m) attached to a crowd member, with beat-synced head bob, kick shake, and a hop to a new person every fourth beat. Portrait 9:16 supported. |
| ๐ธ Photo Mode | Freezes the show and audio, gives you a free-look camera with FOV/roll/depth-of-field, six creative filters (Raw, VHS, Film, Analog, Neon, Hologram) and a high-resolution PNG export. |
| ๐น Web MIDI | Connect a Launchpad, APC40 or any controller. Default CC and note mappings plus an interactive MIDI Learn dialog, persisted to localStorage. |
| ๐ฎ Laser Text & SVG Projection | Type text or upload an SVG and a dedicated array projects it with simulated galvo-scanner physics โ mechanical inertia, corner dwell flicker and beam blanking between glyphs. |
| ๐จ Colour Themes & Video Sync | Dynamic, RGB, Cyberpunk, Warm, Matrix and more. Upload a background video and the lasers and screens mirror its colours. |
| ๐น Video Recording | Capture the show as WebM/MKV straight from the browser at up to 35 Mbps. |
| ๐น๏ธ TikTok Mode | Jumps to the highest-energy drop and formats the capture for 9:16, with optional muted export to avoid Content-ID matches. |
| ๐ฑ Offline PWA | Installable web app with a service worker: network-first navigation, cache-first hashed assets, and an offline fallback. |
| ๐ Multiplayer | Host or join a room over PeerJS to share a session. |
| Control | Function |
|---|---|
| ๐ฅ Auto-Cam | Cinematic camera movement synced to the music |
| ๐บ TV Mode | Broadcast-style cuts between preset angles |
| ๐ฎ Drone Cam | Fly the camera freely |
| ๐ก Heads | Toggle moving head fixtures |
| ๐บ Crowd | Toggle the animated crowd |
| ๐ฅ Dynamic Light | Volumetric per-person crowd lighting vs. flat silhouettes |
| ๐ Up-Lights | Toggle wash up-lights |
| ๐ช Bounce | Ray-bounce reflections off the mirror floor |
| ๐ผ VHS FX | RGB chromatic shift + film grain |
| ๐ช๏ธ Blur FX | After-image motion trail |
| โจ Flares | Lens flares on bright sources |
| ๐ฎ Laser Writing | Toggle the galvo-scanner text/SVG projector |
| Key | Action |
|---|---|
Space |
Play / pause |
F |
Fullscreen (or double-click the 3D view) |
C |
Toggle Auto-Cam |
T |
Toggle TV Mode |
H |
Show / hide the UI panels |
| Key | Action |
|---|---|
W / S |
Forward / backward |
A / D |
Strafe left / right |
Space |
Ascend |
Shift |
Descend |
| Arrow keys | Pan / tilt |
| Mouse drag | Look around |
- Three.js (WebGL renderer) โ 3D rendering and instanced fixtures
- EffectComposer โ bloom, after-image, film grain and RGB shift, with music-reactive bloom strength
- Vite โ dev server and build
- Web Audio API โ real-time FFT plus offline full-song stem analysis
- Web Workers โ audio analysis and pyro particle physics off the main thread
- Web MIDI API โ hardware controller input
- Vanilla JavaScript โ no framework, plain ES modules
On WebGPU: earlier versions attempted a WebGPU/TSL post-processing pipeline. It never actually ran โ the show is built on raw GLSL
ShaderMaterial(beams, volumetric haze, fog, LED wall), whichWebGPURenderercannot compile, so the code path was disabled by an unconditionalthrowand the renderer always fell back to WebGL. That dead path has been removed and post-processing now runs throughEffectComposeron WebGL. Porting the shaders to TSL would be a prerequisite for revisiting WebGPU.
- Node.js v18 or newer
- npm (ships with Node.js)
- A modern browser with WebGL 2 โ Chrome or Edge recommended (Web MIDI and file-system recording are Chromium-only)
git clone https://github.com/StrikerLUL/LaserRave.git
cd LaserRave
npm install
npm run devThen open the URL shown in the terminal (usually http://localhost:5173).
Windows / PowerShell: if you hit a script execution error, run
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
| Command | What it does |
|---|---|
npm run dev |
Start the Vite dev server |
npm run build |
Production build into dist/ |
npm run preview |
Serve the production build locally |
npm test |
Run the test suite (Node's built-in test runner) |
- Click ๐ต Load Audio (MP3/WAV) in the left panel and pick a file.
- Wait for the analysis to finish (progress bar at the bottom). Tick โก Fast Analysis (No AI) to skip stem separation.
- Hit โถ Play.
- Optionally upload a background video โ screens and lasers will follow its colours.
- Drag to orbit the camera, scroll to zoom.
- Tune the show live: stage size, formation, intensity, speed, spread, angle, haze, beams per laser, colour theme, FX toggles.
- Switch camera with Auto-Cam, TV Mode, Drone Cam or Audience POV.
- Hit ๐ด Record Video to capture, or open Photo Mode for a still.
LaserRave/
โโโ index.html # App entry point and UI layout
โโโ src/
โ โโโ main.js # Simulator core: render loop, fixtures, camera, UI wiring
โ โโโ config.js # Global parameters, presets, colour themes
โ โโโ State.js # Runtime state store
โ โโโ StageBuilder.js # Builder maths, schema, serialisation, compilation
โ โโโ StagePresets.js # The four venue presets and their procedural props
โ โโโ WeatherEffects.js # Rain physics, splashes, laser reflections
โ โโโ AudiencePOV.js # Crowd-level camera, head bob, hop transitions
โ โโโ PhotoMode.js # Freeze-frame, free-look camera, filters, PNG export
โ โโโ DJAvatar.js # Procedural DJ rig and audio-reactive animation
โ โโโ MIDIController.js # Web MIDI access, mappings, MIDI Learn
โ โโโ AudioProcessor.js # Web Audio graph and procedural rain synth
โ โโโ LaserEngine.js # Laser generation and choreography
โ โโโ NewFixtures.js # Additional fixture types
โ โโโ Multiplayer.js # PeerJS session sharing
โ โโโ PWA.js # Service worker registration and manifest validation
โ โโโ ai-worker.js # Stem separation / structure analysis worker
โ โโโ pyro-worker.js # Pyro particle physics worker
โ โโโ style.css # Glassmorphism UI styles
โ
โ # Currently unreferenced โ kept for reference, not part of the build:
โ โโโ PostProcessing.js # Old WebGPU/TSL post chain, superseded by EffectComposer
โ โโโ UIManager.js # Superseded once main.js absorbed the UI wiring
โ โโโ CameraManager.js
โ โโโ LaserFont.js
โโโ public/
โ โโโ manifest.json # Web app manifest
โ โโโ sw.js # Service worker
โ โโโ icons/ # PWA icons
โโโ tests/ # Test suite (node --test)
โโโ vite.config.js
โโโ package.json
songs/(personal audio),node_modules/,dist/and local scratch files are excluded from the repository.
npm testThe suite runs on Node's built-in test runner and covers the stage builder, venue presets, weather effects, audience POV, photo mode, DJ avatar, MIDI controller, the real service worker, and cross-feature scenarios.
Tests import the modules under src/ directly. Several suites previously carried a private copy of the implementation inside the test file and asserted against that copy, which meant they stayed green no matter what the shipped code did; those have been rewired to the real modules. tests/serviceWorker.real.test.js goes further and executes the actual public/sw.js inside a service-worker-shaped sandbox.
The app exposes a small read-mostly handle on window for performance work. In the browser console:
__laserrave.info // draw calls, triangles, programs, geometries, textures
__laserrave.fps // smoothed frame rate
__laserrave.shadows // shadow state: enabled, map size, casters in use
__laserrave.setShadows(false) // A/B shadow cost in a single session
__laserrave.setBeamBrightness(1.4) // live trim for additive beam brightnessrenderer.info resets itself on every render() call, and the post chain issues several per frame โ so the renderer is put into manual reset mode and cleared once per frame. Without that, the counters only ever report the last fullscreen pass.
- Crowd rendering โ the crowd is currently one
THREE.Meshper person with two cloned materials each. At the Arena preset's 200 people that is 200 draw calls and 400 material instances, and it is the largest remaining performance item. Converting it to a singleInstancedMeshis the planned fix. - Crowd shadows โ crowd members use
MeshBasicMaterial, which ignores lighting entirely, soreceiveShadowhas no effect on them yet. The flag is already set so they start receiving as soon as the material changes. - Floor albedo โ the floor is nearly black (
0x050505), so shadow-cast light pools barely register on it. Lifting the albedo makes them visible but changes the overall look, so it has been left as an explicit choice. - Unreferenced modules โ
PostProcessing.js,UIManager.js,CameraManager.jsandLaserFont.jsare no longer imported by anything. They are left in place for reference but are not part of the build;PostProcessing.jsin particular is the old TSL pipeline and would pullthree/tslback in if it were ever wired up again. - AI analysis payload โ the ONNX runtime WASM used by the stem separator is around 22 MB. It ships with the build even though Fast Analysis is the default; making it a genuine lazy load is planned.
- Anamorphic lens flares and streaks
- Depth-aware soft beams (no hard intersection edges with geometry)
- Volumetric raymarched haze
- Real fixture profiles with motor inertia (ยฐ/s limits)
- Beam occlusion against stage geometry
- DMX / Art-Net output for real hardware
- Microphone / line-in live input
- Cue list and scene stack for live operation
- Offline 4K render with accumulated motion blur
- WebXR (VR) mode
StrikerLUL GitHub: @StrikerLUL
ยฉ 2025 StrikerLUL โ All rights reserved. Private use only. See LICENSE for full terms.