Skip to content

Latest commit

ย 

History

141 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ›๏ธ LaserRave โ€” Real-Time 3D Laser Show Simulator

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.


โš ๏ธ License & Usage Restrictions

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.


๐ŸŽฅ See it in Action

Videos and photos of the simulator in action are on TikTok: ๐Ÿ‘‰ @strikerlulu1


โœจ Features

Audio & Show Logic

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.

Stage & Fixtures

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.

Camera, Capture & Control

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.

๐Ÿ•น๏ธ VJ Console Controls

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

Keyboard

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

Drone Cam

Key Action
W / S Forward / backward
A / D Strafe left / right
Space Ascend
Shift Descend
Arrow keys Pan / tilt
Mouse drag Look around

๐Ÿ› ๏ธ Tech Stack

  • 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), which WebGPURenderer cannot compile, so the code path was disabled by an unconditional throw and the renderer always fell back to WebGL. That dead path has been removed and post-processing now runs through EffectComposer on WebGL. Porting the shaders to TSL would be a prerequisite for revisiting WebGPU.


๐Ÿš€ Getting Started

Prerequisites

  • 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)

Installation

git clone https://github.com/StrikerLUL/LaserRave.git
cd LaserRave
npm install
npm run dev

Then 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

Scripts

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)

๐ŸŽฎ How to Use

  1. Click ๐ŸŽต Load Audio (MP3/WAV) in the left panel and pick a file.
  2. Wait for the analysis to finish (progress bar at the bottom). Tick โšก Fast Analysis (No AI) to skip stem separation.
  3. Hit โ–ถ Play.
  4. Optionally upload a background video โ€” screens and lasers will follow its colours.
  5. Drag to orbit the camera, scroll to zoom.
  6. Tune the show live: stage size, formation, intensity, speed, spread, angle, haze, beams per laser, colour theme, FX toggles.
  7. Switch camera with Auto-Cam, TV Mode, Drone Cam or Audience POV.
  8. Hit ๐Ÿ”ด Record Video to capture, or open Photo Mode for a still.

๐Ÿ“ Project Structure

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.


๐Ÿงช Tests

npm test

The 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.


๐Ÿ”ง Debug Handle

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 brightness

renderer.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.


๐Ÿ› Notes & Known Limitations

  • Crowd rendering โ€” the crowd is currently one THREE.Mesh per 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 single InstancedMesh is the planned fix.
  • Crowd shadows โ€” crowd members use MeshBasicMaterial, which ignores lighting entirely, so receiveShadow has 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.js and LaserFont.js are no longer imported by anything. They are left in place for reference but are not part of the build; PostProcessing.js in particular is the old TSL pipeline and would pull three/tsl back 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.

๐Ÿ”ฎ 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

๐Ÿ‘ค Author

StrikerLUL GitHub: @StrikerLUL


ยฉ 2025 StrikerLUL โ€” All rights reserved. Private use only. See LICENSE for full terms.

About

A browser-based, audio-reactive 3D laser stage simulator built with Three.js (WebGPU) and the Web Audio API. Load your music, hit play, and watch the stage erupt.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages