Music Galaxy is an interactive 3D browser-based visualization of over 70,000 Spotify artists, positioning them so that artists with similar audiences appear closer together. The project uses node2vec graph embeddings (4D, projected to 3D via PCA) derived from Spotify's artist relationship API. Key technical decisions include tuning node2vec hyperparameters p and q for cluster quality, using Three.js with instanced rendering and BufferGeometry for GPU-efficient rendering of 200,000+ connections, offloading work to a Rust/WebAssembly web worker, spatializing audio via the Web Audio API, and solving a GPU memory bandwidth bottleneck by switching color buffers from floats to unsigned bytes. The result loads in a few seconds and runs on both desktop and mobile.

23m read timeFrom cprimozic.net
Post cover image
Table of contents
Background + Past WorkGenerating the Galaxy EmbeddingBuilding the VisualizationVisual DesignPerformance Tuning

Sort: