Rebel against the anti-intellectual world around us! Forget the traumas of math classes past! Instead, enter a hypnotic trance as your screen vibrates and headphones ring with the sight and sound of Pi’s approximations. Our friends over at VDMX would like to introduce you to the wonders of … bad Pi.

Honestly, this is what Vidvox and VDMX were made to do. Math me until I’m in another world!

This comes at a nice time, too, because lately I’ve been on a “let’s actually learn shader coding” venture. Sure, now you can prompt shaders with LLMs, but then you don’t learn anything in the process — plus you miss out on the visual results of your own magnificant mistakes.

So this is several layers to explore at once. If, like me, you had a vague sense of the history of approximations of Pi, but never really grasped how those differ, now you can see and hear them. And they’re also a great chance to learn about the math involved and how to code shaders. Vidvox’s open ISF / “Interactive Shader Format” lets you move those shaders around between tools.

Watch and hear what happens, as it’s mesmerizing. Vidvox are proposing that you could even incorporate these shaders and visualizers and sound into a performance. Please do. I’ll drop by.

You don’t have to get too technical here — you can also just follow the basic sound and image of the numbers and their approximations. Or you can really go Pythagorean and eat an all-legume diet (or legume-free — listen the history is really vague on the Pythogorean cult) and just sit around thinking about Pi and numbers and the cosmos all day.

When Good Pi Goes Bad [Vidvox]

Another slice of Pi

The inimitable Dan Shiffman has tackled Pi approximations in his insanely-friendly, yes-even-if-you-tried-to-fail-high-school-math, Coding Train. And Dan’s a mathematician! These bits with Leibniz…

More sound

So, why don’t our sine wave oscillators on computers use some of these approximations for sonic variety? Good question! Apparently someone on the MetaSounds team at Epic, makers of the modular environment inside Unreal Engine, had the same thought:

MetaSound Function Nodes reference: Sine

Their sine generator has multiple modes:

  • 2D Rotation: Rotates around the unit circle to generate the sine wave.
  • Pure Math: Uses the standard math library to generate the sine wave (most expensive method).
  • Bhaskara: Uses the Bhaskara technique to approximate the sine wave.
  • Wave Table: Uses a wave table to generate the sine wave.

Indian math was way ahead of its time — even a lot of the developments we attribute to Arabic and Persian sources are themselves indebted to Indian prior art. So you get Bhāskara I’s sine approximation formula in the 7th century. And it does sound different than your more mathematically accurate sine wave does.

What you’ll notice is that math you think was developed in Europe was… yeah, this guy, like a thousand years earlier. And Bhāskara goes deep.

Yeah, your parents may have worried about your future or who you were marrying, but did they go as far as trying to calculate how to gain control of the space-time continuum and control the future?

Let’s make some Bhāskara-based synthesizers and see if we can shape the future.

And now not only does Bhāskara not get enough credit but … his daughter?!

More shaders

I’ll share some resources on learning shaders — but here’s one lovely place to start, which you can even run on a RasPi:

The Book of Shaders by Patricio Gonzalez Vivo & Jen Lowe

And this nice, narrative commentary on how to approach this — not just links, but practical advice (like “break things on purpose”):

How to learn shaders: a beginner’s guide

And now you can learn with p5.js, for fans of Processing and JavaScript — stuff that works really well for all of us (like me!) who struggle with coding and math but want to develop those parts of our minds.

I guess I appreciate now more than I did even in school that the purpose of math is not to accomplish a technical task, but to break your own mind, to see things in a different way.

Okay, I now want a “BAD π” t-shirt.