Rhythmic Mandala — the living symmetry of your music
The Rhythmic Mandala scene generates in real time an interactive geometric mandala entirely driven by the analysis of your YouTube music. Unlike classic visualizers, every element of the mandala — branch count, petal shape, ring oscillations — changes dynamically according to the detected frequencies.
Symmetry and rhythm
The mandala is built from rose curves, a family of polar curves with equation r = R × (1 + A × cos(n × θ)), where n is the number of lobes and A their amplitude. Bass frequencies control the number of radial branches (from 4 to 16 branches depending on energy), mids influence the number of lobes per petal (from 2 to 6), and treble adds oscillating filigree to the outer edges.
When a beat is detected in the bass, the mandala receives a rotational impulse — its rotation speed suddenly increases then progressively dissipates, like a spinning top given a fresh kick. Simultaneously, a particle burst in a ring shape emerges from the center and expands outward before fading.
Real-time evolution
The mandala's overall hue evolves slowly and continuously, accelerating slightly with musical energy. Each branch receives a slightly shifted hue to create an iridescent rainbow effect. The 5 concentric rings at the center oscillate radially with the treble, giving the impression of a membrane that breathes.
In the absence of audio, the mandala continues to evolve autonomously using sinusoidal values derived from the internal clock — allowing it to be enjoyed even without active music.
Technology
Rose curves r = R(1 + A·cos(nθ)) with n lobes (2-6) controlled by mids. Branches 4-16 driven by bass. 5 concentric rings with radial oscillation of ±0.45·treble·sin(6θ). Beat detection: (bass - prevBass > 0.10) AND (bass > 0.28), 14-frame cooldown. Bursts: ring of 48 points expanding at 0.08-0.22 units/frame over 42 frames. DynamicDrawUsage BufferGeometry, AdditiveBlending, 64×64 Gaussian halo CanvasTexture. Total: ~2,320 points.