Hacker News new | ask | show | jobs
by fg6hr 2258 days ago
Cymatics. It's sound interference drawing some peculiarly complex, but cool looking patterns. Edit: I've tried to find actual math behind those pictures and only found piles of pseudoscience. There's a CymaScope app that draws them, but they are super secretive about it. I suspect that it's just the interference pattern in a tibetian bowl or a cup of tea. It's almost suspicious that wikipedia has detailed scientific articles with hardcore math on dumb topics, but not only wikipedia, but the entire math community seems to carefully avoid this topic. Edit2: I think the math behind this is https://en.wikipedia.org/wiki/Normal_mode. In this case, the picture can likely be derived by numerically solving the diff equation of a sound wave with a boundary condition on a circle. Edit3: This lead me to https://en.wikipedia.org/wiki/Vibrations_of_a_circular_membr... with Bessel equations and all the good stuff. Solving it (numerically) would supposedly create the cool picture of the 432 Hz note. Edit4: And I've returned to where I began: cymatics, cymaglyphs and that cymascope. It gives an impression of a lazy pseudoscience at first, because of the somewhat sloppy language they use, but after watching a John Stuart Reid's presentation (watch it, it's only 40 mins), I had to change my opinion. The indeed capture the interference patterns created by sound in a bowl of water and a picture of that rapidly moving pattern is called a "cymaglyphs". I'd say, visualizing sound and music is a solved problem and the solution is called cymaglyphs. Obviously, an app can't use a bowl of water to solve the diff equations, but it can do that numerically with a decent precision, and apply some smoothing techniques to deal with the rapid evolution of these cymaglyphs.
1 comments

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!
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.