Cymatics Simulator

Cymatics Simulator


About the Cymatics Simulator

I have always been fascinated by cymatics, the study of wave phenomena in physical systems. This is a simple simulator that I created to learn more about it and visualize sound waves and their patterns. The calculations are very loosely based on reality but mainly provide an engaging visual effect.

Cymatics Simulator Screenshot

How the Simulator Works

The simulator's core lies in its implementation of a function based on Chladni patterns. Chladni patterns are visual representations of vibrational modes on a surface, typically generated by sound waves. In this project, a mathematical approximation of the Chladni function is used:

function chladniFunction(x, y, a, b, m, n) {
    const pi = Math.PI;
    x = (x + 1) / 2;
    y = (y + 1) / 2;
    return a * Math.sin(pi * n * x) * Math.sin(pi * m * y) + b * Math.sin(pi * m * x) * Math.sin(pi * n * y);
}

This function computes the combination of sine waves along the x and y axes, controlled by parameters π‘š and 𝑛 , to simulate the wave patterns. These parameters are influenced by the frequency of notes being played.

Visualizing Multiple Notes

When multiple notes are played simultaneously, the simulator calculates a weighted average of several Chladni functions. This averaging process creates complex, layered visual patterns that change dynamically based on which notes are active. The result is a mesmerizing display of shapes that react in real-time to musical input.

Development Approach

The project was developed using a simple setup: just an HTML file and a JavaScript file. The main code leverages the Three.js library to render the particles and animations in the browser. The use of basic web technologies keeps the project lightweight and easy to extend.

A Note on Realism

It’s important to note that this project does not attempt to be a fully accurate simulation of physical wave behavior. Instead, the focus was on creating an engaging visual effect inspired by real-world cymatics. The patterns generated are loosely based on physics but are primarily aimed at aesthetic appeal rather than scientific precision.

This simulator serves as an example of how visual representations of mathematical functions can provide both educational and artistic experiences, showcasing the intersection between technology, music, and visual art.