Hacker News new | ask | show | jobs
by avaku 2251 days ago
Hi! Thanks for your comment! It’s interesting. I don’t think there is any magic about cymatics per se: it depends on how sound interacts with physical objects, and these objects have certain resonant frequencies, which is when the start to vibrate “interestingly”. I like it as a potential visualisation idea though!
1 comments

That above isn't just an idea, it's the idea of sound visualization. It's a bijective projection between sound and shape that turns nice sound into nice shapes and vice versa. The analog sound visualizer would be an air filled glass sphere put next to speakers, if only we could see air. All you need is a performant software simulation of it. The only problem to solve here is visualizing the rapidly changing patterns in a comprehensible way. P.S. actually, we can see air patterns if we fill that glass sphere with dust. Edit: In fact, that's been done already. Find the "Yantara Jiro voice made visible". They used a cymascope (a water bowl in lab conditions) and captured the formed patterns with a fast camera. A water bowl is indeed a great music visualizer.
One could imagine making a “fake” cymatic visualisation while still looking interesting!
Some kind stranger has explained the numerical solution and even provided code in Python:

http://hplgit.github.io/wavebc/doc/pub/._wavebc_cyborg001.ht...

We only need to apply it to a circle and rewrite the solver in C. This will give us a visualizer for a single frequency.

Then we run FFT, run the solver for all frequencies, observe that the final solution is a linear combination of the individual solutions and apply the rainbow coloring to corresponding frequencies.

This solver needs to be kinda fast to run at 15 fps, but luckily, different frequencies can be solved in parallel. Most likely, changing the input frequency a bit will change the solution only a little, and so we could pre-solve the frequency range with sufficient density, cache them and rapidly derive actual solutions by interpolation.

Bonus points for using complex numbers. The boundary condition in a singing bowl is u(x0, t) = A sin(Bt) where x0 denotes the circular boundary. Since real numbers are boring, we could expand the problem into the complex plane: u(x0, t) = A exp(iBt). In this case the solution u(x, t) would be in complex plane also, where the absolute value |u| is the amplitude, or pixel opacity on our visualization, and the angular coordinate arg u would be maybe color of that pixel?

This seems certainly possible. But I don't know how would you display all of the frequencies that are present in music at the same time. Usually, they only play one or two frequencies and look at the result. Mash them all together? Maybe can be tried in the future. I was thinking to do something "inspired by" this cymatics instead (when I get around to it). Thanks for all the interesting thoughts!!
I'm pretty sure that interference pattern from a sum of two waves is the sum of individual interference patterns. This should follow from how the wave equation looks.

The real physical solver doesn't do FFT, though. It makes the boundary circle vibrate with the input sound wave and effectively solves the wave equation where the boundary condition is u(0,t)=f(t) - the input sound.

I've run some calculations that solving the wave equation in real time would be infeasible. The convergence depends on the Courant number, which basically says that the grid step dx must be c*dt, i.e. the sound must travel on grid step per one time step. Since sound travels at 1.5 km/s in water, the grid needs to be super dense and 1 second of sound would need around 1 petaflops of calculations.