DeepPi: Dive Into Π. Visualize and Hear the Digits of Pi , in Real Time, in 3D, and With Music No One Has Ever Heard Before.

by shredermann in Design > Software

140 Views, 2 Favorites, 0 Comments

DeepPi: Dive Into Π. Visualize and Hear the Digits of Pi , in Real Time, in 3D, and With Music No One Has Ever Heard Before.

DeepPiMenu.gif
DeepPiArcade.gif
suite.gif

What does infinity look like?


Pi goes on forever. You've heard that before. But have you ever actually watched it? Digit by digit, streaming onto a rotating 3D sphere, lighting up in neon green, each number finding its place in an infinite constellation?

And what if you could hear it, not mapped to a piano like everyone else does, but played on a microtonal scale whose very intervals are generated by powers of π itself? A scale that has never existed before.

DeepPi is a single HTML file that does exactly that. No installation. No server. No account. Open it and explore one of the most fascinating numbers in mathematics , visually, sonically, mathematically.

There are four modes. Each one reveals a different face of π.


Supplies

A computer : desktop, laptop, or even a Raspberry Pi.

A modern browser : Chrome or Firefox , I used Safari on Mac.

An internet connection : to stream π digits from api.pi.delivery.

10 minutes you weren't doing anything important.

Raspberry Pi users

DeepPi runs perfectly on a Raspberry Pi 4 or 5 with an HDMI display. Open it in Chromium fullscreen (F11) for a proper installation experience. The 3D sphere runs smoothly at native resolution.

How to Run It

  1. Download DeepPi.txt , or DeepPi.html
  2. Name it in .html.
  3. Opens it in your browser.
  4. Choose a mode. Press the start button. That's it.

No sound?

Browsers block audio until you interact with a page, it's a security feature. Just click any button and audio activates automatically.

Suggested First Journey

If you've never used DeepPi before, here's a path through all four modes that takes about 10 minutes and covers everything worth seeing:


  1. Open PLAY in Arcade mode. Let it run for one minute. Feel the rhythm of π appearing digit by digit. Don't try to read the numbers, just watch the sphere fill.
  2. Jump to the Feynman Point. Select it from the anomaly dropdown. Watch the six 9s explode. Read the tooltip. Wonder why it happens at position 762.
  3. Switch to EXPLORE. Watch the pattern counters. Ask yourself: does this look random? What does random actually look like?
  4. Switch to SOUND. Put on headphones. Close your eyes for 30 seconds. Open them and watch the piano roll. π is composing itself.
  5. In SOUND mode, change the starting position. Try position 100,000 or 314,159. Each region of π sounds completely different, same scale, different melody, infinite variations.
  6. Open RESEARCH if you're curious. Enable φ-correlation. Go down the rabbit hole.

Four Ways to Experience Pi

DeepPiExplorer.gif
suite1.gif
explore.gif
sound2.gif
research.gif


PLAY : Watch Pi Come Alive

This is where you start. Every decimal digit of π appears live on a rotating 3D sphere, positioned using the golden angle. The sphere fills slowly, organically, like a galaxy being born.

Two visual styles:

  1. Arcade, neon green on black. Fast, electric, hypnotic. Like watching the universe compute itself in real time.
  2. Observatory, deep purple, slow and meditative. Feels like a planetarium dedicated to a single number.


And then, at decimal position 762, six nines appear in a row. 999999. The Feynman Point. The digit explodes in gold (Arcade view), halos cascade across the sphere, and for a moment you understand why mathematicians have been obsessed with this number for millennia.

Try this first

Select "Feynman Point (762)" from the anomaly dropdown and jump straight to it. The visual reaction alone is worth it.

The Feynman Point, The Most Famous Anomaly In Pi

At decimal position 762, something strange happens: six nines in a row. ...999999... In a sequence that should be uniformly random, this is deeply improbable, roughly a one-in-a-million shot at any given position.


Richard Feynman, Nobel Prize physicist, legendary eccentric, joked that he wanted to memorize π to that point so he could recite: "...nine, nine, nine, nine, nine, nine, and so on," implying π was rational. The joke was the opposite of the truth. π is transcendental, more irrational than irrational.


In DeepPi, the Feynman Point is a visual event. The sphere lights up gold. Halos cascade. The sound shifts. It's the closest thing to a dramatic moment that a mathematical constant can have.

In SOUND mode

The Feynman Point means six consecutive digit-9s, six Major Sevenths in a row. On the π scale, the Major Seventh sits at 1090.77 cents (π^6). Six of them back to back create a tonal tension that never quite resolves. It sounds exactly as unsettling as it should.


EXPLORE : Hunt for Hidden Patterns

The big question about π: is it truly random? Nobody knows for certain. EXPLORE mode lets you look for yourself.

As digits stream, DeepPi detects four types of patterns in real time, each highlighted in a different color:

  1. Repetitions : the same digit twice or more in a row (red)
  2. Sequences : consecutive runs like 1,2,3,4 (green)
  3. Palindromes : windows that read the same forwards and backwards (blue)
  4. Dominant digits : when one digit appears far more than chance would predict (orange)


Watch the counters climb. Watch the sphere change color. After a few minutes, you start to feel the texture of π, not random noise, but something wilder. Something that almost has patterns, then doesn't, then almost does again.


SOUND : Hear Pi Play Itself

This is the heart of the project. And it's where DeepPi does something genuinely new.


Every existing "pi music" project does the same thing: map digit 1 to C, digit 2 to D, and so on. It sounds vaguely melodic. It's fine. But it has nothing to do with π. The scale is arbitrary.


DeepPi builds the scale from π itself. Each musical interval, the second, the third, the fourth, the fifth, is calculated as the power of π (π^n mod 1200 cents) that comes closest to that interval in just intonation. The result is a microtonal scale that has never existed before. π generates its own frequencies. Then plays itself on them.


But pure π rhythm would be chaotic, random durations, unlistenable. So the timing uses the Fibonacci sequence, which converges to φ (the golden ratio). This gives the music its organic pulse, its sense of breathing.


π for the substance. φ for the structure. The two most celebrated constants in mathematics, each doing what it does best. The ancient Greeks called it harmonia mundi, the music of the spheres. DeepPi makes you hear it.

Close your eyes

Put on headphones. Start SOUND mode. Close your eyes for the first 30 seconds. The microtonal intervals are subtle, let your brain adjust. What you hear after that is unlike any music that exists.

The piano roll shows each note as it plays, 9 rows, one per scale degree, scrolling left as π unfolds. Watch the melody trace itself: no composer, no intention, just a number doing what numbers do.


RESEARCH : Go Deeper

For the mathematically curious. RESEARCH mode analyzes π at three simultaneous scales, windows of 10, 100, and 1,000 digits, tracking statistical deviations from uniform randomness in real time.

Enable φ-correlation to look for positions where π's digit distribution correlates with multiples of the golden ratio. This was the original research question that led to the entire project.

Warning: this mode is a rabbit hole. You have been notified.

THE CODE

Under the Hood : How DeepPi Works

DeepPi is a single HTML file. No build step, no framework, no dependencies to install. Open it in a browser and everything runs: 3D graphics, sound synthesis, real-time digit analysis. Here's how.


Architecture : One File, Three Engines

The entire application lives in one self-contained HTML file, roughly 3,800 lines of vanilla JavaScript. Three engines run simultaneously:


  1. Three.js (r128) : handles the 3D sphere, digit sprites, trails, bloom halos, and camera animation. Loaded from a CDN, no local install needed.
  2. WebAudio API : built into every modern browser. Generates tones in real time using oscillators tuned to the π-scale. No audio files, no samples, pure synthesis.
  3. Fetch API : pulls π's digits on demand from api.pi.delivery, a free public API that serves up to ~1 billion verified decimals.


Why no framework?

Vanilla JS keeps the file truly self-contained. A React or Vue build would require a bundler, a node_modules folder, a build step. Instead, DeepPi opens with a double-click, on any machine, any OS, with no installation. The tradeoff is verbosity. The gain is simplicity.


Getting Pi's Digits : The API and the Cache

DeepPi fetches π's decimals from api.pi.delivery, a free REST API. A request looks like this:


GET https://api.pi.delivery/v1/pi?start=1&numberOfDigits=1000


// Returns: { content: '1415926535897932384...' }
// start=1 → first decimal after the '3'
// start=N → decimal number N (1-indexed)


Fetching one digit at a time would be impossibly slow at 90 digits per second. Instead, DeepPi maintains a rolling cache, it pre-fetches blocks of 1,000 digits ahead of the current position, so the scan never has to wait for the network.


The RESEARCH mode maintains a separate cache for the main scan and two additional caches for the correlation lookups, one centered around N×φ, one around N×π. All three are pre-loaded before the scan begins.


The offset of the '3'

Pi = 3.14159265... The '3' is the integer part, not a decimal. The API returns only the decimals, starting at position 1 = '1', position 2 = '4', position 3 = '1'... DeepPi's embedded digit string starts with '3', so there is a systematic offset of +1 between the embedded string and the API. The RESEARCH mode always uses the API indexing (decimals only), which is why the correlation at position 57,514 via the API corresponds to index 57,515 in the embedded string. Getting this offset right was the most subtle bug in the project.


The RESEARCH Mode : What the Code Actually Does

Three sliding windows

At every new digit, RESEARCH mode updates three sliding windows and runs a pattern detector on each:


win10 → last 10 digits → detects: rep ≥3, seq ≥3, palindrome ≥5
win100 → last 100 digits → detects: rep ≥4, seq ≥4, palindrome ≥5 (SENSITIVE)
win1k → last 1000 digits → detects: rep ≥5, seq ≥5, palindrome ≥5 (SENSITIVE)


// STRICT raises the bar:
win100 → minLen = 11
win1k → minLen = 101


A MULTI-SCALE event fires when at least 2 windows are active simultaneously, with at least 2 different pattern types (in SENSITIVE mode). This filters out cases where the same palindrome is simply visible in both the ×100 and ×1000 windows, which would be the trivial case. In practice, a MULTI requires a sequence on ×10 coinciding with a palindrome on ×100 and ×1000.


Correlation detection

Every digit, DeepPi also checks for φ and π correlations:


// φ-correlation
pos_phi = Math.floor(pos * 1.6180339887)
seqA = digits at pos // 5 digits
seqB = digits at pos_phi // 5 digits
if (seqA === seqB) → φ-CORR event


// π-correlation
pos_pi = Math.floor(pos * 3.14159265358979)
seqC = digits at pos_pi // 5 digits
if (seqA === seqC) → π-CORR event


This runs independently of the Sensitive/Strict switch, the correlation engine always uses 5-digit sequences, regardless of mode. The switch only affects the sliding window thresholds.


How to Modify the Code

Since everything is in one file, modifications are straightforward. Open the HTML in any text editor and look for these sections:


  1. Change the scan speed: search for FIXED_SPEED (default: 90ms per digit). Lower = faster scan.
  2. Change the correlation sequence length: search for CORR_SEQ_LEN (default: 5). Set to 4 for more hits, 6 for stricter matching.
  3. Change detection thresholds: find analyzeScales() and edit the minLen values for each window.
  4. Add a new musical scale: find the SCALES object and add a new array of 12 frequencies.
  5. Add a known anomaly: find REAL_DATA and add a new entry with the position as key and the digit sequence as value.


The embedded digits

DeepPi embeds the first 100,000 verified decimals of π directly in the HTML as a fallback, so RESEARCH mode works even without an internet connection, and finds all verified events (3 MULTI-SCALE, 1 φ-correlation, 1 π-correlation) without any API call. The embedded digits were generated with mpmath at 100,000+ digit precision and verified against the API.

The whole thing is one file. Read it. Change it. Break it. That's the point.



The Π Scale : a New Tuning System?

GammePi.png
sound.gif
sound1.gif

The Pythagorean scale is built from powers of 3. Just intonation from small integer ratios. The Golden Ratio scale (Heinz Bohlen, 1970s) from powers of φ. No published tuning system has ever used powers of π.


Here's how each degree of the DeepPi scale is calculated: look at the first image.

Why the π Scale Is Both New and Ancient

Every tuning system in history is built on a generator, a single interval that, stacked repeatedly, produces all the notes of the scale.

Pythagoras used the perfect fifth (frequency ratio 3:2). Stack twelve fifths, fold them back into one octave, and you get the twelve notes of Western music. The generator is the ratio 3:2, or equivalently, a power of 3.

Just intonation extends this to powers of 5. The golden ratio scale (Heinz Bohlen, 1970s) uses φ ≈ 1.618 as generator, producing the famous 833-cent interval. Each system has its own mathematical DNA.

Now consider π ≈ 3.14159265...

π is extraordinarily close to 3. Which means the first powers of π produce intervals very similar to Pythagorean tuning, but not identical. The difference lives entirely in the decimals: 0.14159265... That fraction shifts every interval by a few cents, creating a scale that is recognizably tonal but microtonally displaced from everything that exists.

Pythagoras rounded π down to 3 and built a civilization's worth of music from it. DeepPi keeps the decimals.

There is a deeper strangeness here. π is transcendental, it cannot be the root of any polynomial equation with rational coefficients. This places it in a different mathematical category from φ (which satisfies x² = x + 1) or the square root of 2. A scale built on π is, in a precise mathematical sense, more irrational than any scale built before it. Its intervals cannot be approximated by simple fractions. They don't close. They don't repeat. Like π itself, the scale is infinite in its complexity.

What you hear in DeepPi SOUND mode is not just a curiosity. It is the sonic signature of transcendence.

The deviations are between 0.5 and 14 cents, well within microtonal territory, and enough to give the music a color that no equal-tempered instrument can produce. The Minor Seventh is essentially exact (0.5 cents off). The Major Third has the most character (+13¢). The Fifth lands a little wide. It sounds like something you've almost heard before.

RESEARCH MODE

corrpi.gif
corrphi.png
corrmlti1.png

φ-Correlation and π-Correlation: What DeepPi Is Really Looking For


What is a φ-correlation?

DeepPi takes a position N in the decimals of π, reads the 5 digits starting there, then jumps to position N × φ and reads 5 digits there too. If both sequences are identical, that's a φ-correlation.


Concrete example: at position 57,514, the sequence 74488 appears. At position 57,514 × 1.618... = 93,059, the sequence 74488 appears again. Two very distant locations in π, linked by the golden ratio, containing the exact same sequence.


Why 5 digits?

With 1 or 2 digits, coincidences are trivial, there are only 10 or 100 possible combinations. With 5 digits, there are 100,000 possible combinations, so the probability of randomly landing on the same sequence at two positions linked by φ is 1 in 100,000. That's the threshold where a coincidence becomes statistically meaningful.


What is a π-correlation?

Same principle, but instead of multiplying the position by φ, DeepPi multiplies it by π itself. It takes position N, reads 5 digits, then looks at position N × π.


Example: at position 27,187, the sequence 15741 appears. At position 27,187 × 3.14159... = 85,410, the sequence 15741 appears again.


This is where it gets vertigo-inducing: π is citing itself. The position is multiplied by π to find another position containing the same digits. Does π contain echoes of itself in its own distribution?


The real question, and why it matters

Behind both searches lies the same deep question: is π normal? A normal number is one where every digit sequence appears with the exact frequency that pure randomness would predict, no bias, no structure, no hidden pattern.


If π is normal, then over 100,000 positions we'd expect to find approximately one φ-correlation of length 5, and approximately one π-correlation. DeepPi finds exactly that: one of each. Neither more nor less.


That's not proof that φ and π are secretly linked. It's actually the opposite, π shows no preference for φ, and no memory of itself. It behaves as randomly as randomness itself.


Has this been proven before?

The normality of π, the conjecture that its digits behave like uniform random draws, remains unproven. It is widely believed, and calculations up to 100 trillion digits show no anomaly, but no formal mathematical proof exists.


More specifically: searching for correlations between positions N and N×φ, or N and N×π, appears to be an original approach. The published literature on π's normality addresses digit frequency and sequence distribution, but not this type of structural relationship between positions linked by mathematical constants.

DeepPi runs a real experiment

By asking 'does multiplying a position by φ or by π itself reveal hidden structure in π's decimals?', it explores territory with no known published answer. The result, exactly one correlation of each type across 100,000 positions, is consistent with normality. But confirming it rigorously would require millions of positions and formal statistical analysis. DeepPi doesn't just show you π. It asks an open mathematical question, and lets you watch π answer it, one digit at a time.


Sensitive vs Strict : Two Ways to Listen to Pi


RESEARCH mode offers two detection thresholds, selectable with the MODE button.


SENSITIVE is the default. It detects patterns as soon as they become statistically meaningful, a palindrome of 6 digits, a sequence of 3 or 4 consecutive digits. It's designed to find events within a reasonable exploration range. On the first 100,000 decimals, it finds exactly three multi-scale events: palindromes 234432, 210012, and 321123, each detected simultaneously across the ×100 and ×1000 windows, with a short sequence firing on ×10 at the same moment.


STRICT raises the bar dramatically. A pattern on the ×100 window must span at least 11 digits. A pattern on the ×1000 window must span at least 101 digits. At those thresholds, a repeating sequence of 11 identical digits is expected to appear roughly once every 90 billion decimals. A run of 11 consecutive digits once every 12 billion.


The public pi API reaches about 1 billion decimals. STRICT mode will likely find nothing there.

That's not a bug. That's the point.

STRICT mode is a meditation on scale. It runs, it watches, it waits, and its silence is itself a statement about how rare true anomalies are in pi. The three events that SENSITIVE finds in the first 100,000 decimals are not anomalies in the deep sense. They are the ordinary texture of a normal number. STRICT is looking for something else entirely: the kind of structure that would genuinely challenge pi's presumed normality. So far, no one has found it.


Why correlations still work in Strict mode

The φ-correlation and π-correlation are independent of the Sensitive/Strict switch. They don't use sliding windows, they compare two isolated 5-digit sequences at positions N and N×φ (or N×π). The detection threshold doesn't change: it's always 5 digits, always the same logic, regardless of mode.


The Sensitive/Strict switch only affects the three scale windows (×10, ×100, ×1000) and their minimum pattern lengths. It has no effect on the correlation engine.


So in Strict mode, DeepPi is simultaneously running two very different experiments:


  1. The correlation search : sensitive by design, always looking for 5-digit matches across the full range, and finds exactly one φ-correlation (#57,514) and one π-correlation (#27,187) in the first 100,000 decimals.
  2. The multi-scale analysis : set to extreme thresholds, watching for patterns so rare they may not appear in any range accessible to a public API.


Two instruments. Two different silences. The correlations speak. The multi-scale windows wait.

FAQ

is the π scale really new?

I've searched the Xenharmonic Wiki, the Huygens-Fokker Foundation archive, and academic papers on algebraic tunings. The golden ratio has a famous scale (Bohlen's 833-cent scale, 1970s). Powers of 3 give Pythagorean tuning. But a scale built from powers of π appears to be unpublished?. You're hearing something genuinely new.


Why does the music sometimes feel almost melodic?

Because the scale uses familiar harmonic degrees, tonic, second, third, fourth, fifth, just tuned to microtonal π-derived frequencies. Your brain recognizes the grammar even as the tuning surprises it. It's like hearing a language you know spoken with an accent you've never encountered.


Why use φ for the rhythm if this is about π?

Pure π rhythm would be as chaotic as its digits, random durations, unlistenable. The Fibonacci sequence (which converges to φ) gives the music an organic, breathing pulse. π provides the substance. φ provides the structure. Two constants, two roles, one piece of music. The ancient Greeks called it the harmony of the spheres. I call it DeepPi.


Does it work offline?

The 3D sphere, all four modes, and the full interface work offline. The digits of π are fetched from api.pi.delivery as you explore, so you need a connection to go beyond the first cached block. The first 1,000 digits load instantly on startup.


One Last Thing

Mathematicians believe, but cannot yet prove, that every possible sequence of digits appears somewhere in π. Your phone number is in there. The first chapter of any book ever written is in there, encoded in ASCII. The complete genome of every living species, in binary, is in there but not prove.


Pi is not just a number. It's a universe hiding inside a circle.


DeepPi doesn't explain that. It just gives you a window, something you can see, and something you can hear.


Download it. Open it. Press play. Let π show you what infinite sounds like.


3.14159265358979323846264338327950288...

and so on, forever.

Thank you!