Skip to content

Repository files navigation

Spatialyx — Immersive Spatial Audio Laboratory

GitHub License Live Studio

Spatialyx is an open-source, browser-native spatial audio studio and digital signal processing (DSP) laboratory. It enables users to create, visualize, process, analyze, and export 3D immersive audio experiences directly within the browser using modern Web Audio APIs.

Spatialyx is NOT a simple 8D audio converter — it is a complete digital signal processing laboratory designed for real-time spatial experimentation, binaural HRTF simulation, effect chain customization, and 16-bit PCM WAV exporting.


🚀 Key Features

  • HRTF 3D Spatial Panning Engine: Implements Web Audio's Head-Related Transfer Function (HRTF) panning model with distance attenuation, dynamic proximity absorption sweeps, and head-shadowing pinna EQ emulation for realistic binaural depth ($Y < 0$ high-shelf attenuation).
  • Dynamics Safeguard & Safety Limiter: Brickwall compressor stage (DynamicsCompressorNode at -1.0 dB threshold, 20:1 ratio) inserted before output to prevent digital clipping or distortion during heavy EQ boosts or delay feedback loops.
  • Warm Analog Tape Delay Filter: Integrated lowpass Biquad filter (2.5 kHz) within the delay feedback loop. Echoes become progressively darker and warmer, eliminating cluttered overlap with dry signals.
  • Clickless Reverb Convolver Crossfading: Crossfades convolver wet gains over 50ms during decay or impulse response buffer updates, eliminating pops, clicks, or thread glitches.
  • Transient Pre-Delayed Reverb Impulse Generator: Synthesizes algorithmic room impulse responses with a 20ms silence pre-delay (keeping dry transients crisp) and frequency-dependent exponential decay damping.
  • Interactive Timeline Seeking: Playhead seek bar with real-time DOM synchronization across WaveSurfer timeline markers and Web Audio buffer positions.
  • 8D Trajectory Sweeps & Presets: Built-in 3D automation patterns:
    • Stereo Sweep (L to R)
    • Circular Rotation
    • Figure Eight Path
    • Orbital Path
    • Random Wander
    • 3D Helical Spiral
    • Front-Back Pendulum
    • Cardioid Heart
  • Virtual Room Dimensions: Customizable Binaural Ref Distance and Distance Decay Rolloff controls to adjust physical ear spacing and sound field boundaries.
  • Client-Side WAV Exporter: Offline Audio Context scheduler (OfflineAudioContext) with 16-bit stereo PCM WAV encoding, running 75% faster via linear-ramp interpolation.
  • Zero-Render Visual Pipeline: Direct-DOM pointer tracking and meter updates keep React renders at 0 Hz during active playback for maximum performance.

🎛️ Audio Signal Routing Graph

[ Audio Buffer Source / Test Synth ]
                │
                ▼
[ 3-Band Biquad Equalizer ] (Lowshelf ➔ Peaking ➔ Highshelf)
                │
                ▼
[ Tape Delay Sub-Chain ] (Dry/Wet Split ➔ Lowpass Filter (2.5kHz) Feedback)
                │
                ▼
[ Convolver Reverb Sub-Chain ] (Pre-Delayed Damped Impulse Response)
                │
                ▼
[ HRTF 3D PannerNode ] (3D Coordinates & Pinna Damping)
                │
                ▼
[ Dynamics Safeguard Limiter ] (-1dB Threshold / Hard Knee)
                │
                ▼
[ AnalyserNode ] (128-band Frequency & Peak Level Tracking)
                │
                ▼
[ Master Volume GainNode ] ➔ [ AudioContext Destination ]

📁 Workspace Monorepo Structure

Spatialyx is managed as a pnpm monorepo workspace:

  • apps/web: Vite React TypeScript application. Features glassmorphic UI, custom controls, WaveSurfer waveform renderer, and Zustand state store.
  • packages/audio-engine: Core Web Audio engine library. Manages node graphs, offline WAV rendering, automation tick loops, and peak meters.
  • packages/shared: Shared core interfaces, parameter types, and motion constants.

🛠️ Getting Started

Prerequisites

Installation

Clone the repository and install workspace dependencies:

git clone https://github.com/matorverse/Spatialyx.git
cd Spatialyx
pnpm install

Running Locally

Start the Vite development server:

pnpm dev

Open http://localhost:3000 in your browser.

Production Build

Type-check and build all workspace packages:

pnpm build

🌐 Deployment (Netlify)

Spatialyx is configured with zero-config Netlify Deployment using netlify.toml:

  • Live Studio URL: spatialyx.netlify.app
  • Includes automated COOP/COEP headers (Cross-Origin-Opener-Policy, Cross-Origin-Embedder-Policy) for maximum Web Audio performance and precision.

📄 License

MIT License. Open-source audio DSP laboratory built for developers, sound engineers, and spatial audio enthusiasts.

About

Spatialyx is an open-source browser-based spatial audio studio for creating immersive audio experiences through real-time DSP, spatial effects, waveform visualization, and modular plugins. Privacy-first and fully local, it enables audio enhancement, experimentation, and spatial audio creation directly in the browser.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages