2,049 spinning Fourier epicycles converge from a single ellipse (M = 2, 60.20% error) to sub-pixel precision (M = 2,049, 0.12% error), synced to a 120 BPM Google Lyria 3.5 soundtrack, before the 4 Google Colors and Italian Tricolore ๐ฎ๐น illuminate the Puffin's tri-suit.๐ Launch the Interactive HTML5 Canvas Studio (Scrub M = 2..2,049 Harmonics Live in Your Browser) โ | ๐ป Source Code & Assets on GitHub (
palladius/public-demos-fourier-epicycle-italian-puffin) โ๐ฏ The Two Prompts Behind This Demo (In All Their Unedited Glory)
Recently, my colleague Franรงois Beaufort (@fofrAI) shared a viral showcase (๐ฆ x.com/fofrAI/status/2110045963951956250
) demonstrating how Gemini can bridge pure mathematics, high-precision Python & HTML5 code generation, and multimodal synthesis from a single prompt.
Instead of taking Simon Willison’s classic “Pelican on a Bicycle” benchmark at face value, I decided to raise the bar with an Italian Twist. Here are the exact, unedited prompts I gave the agentโcomplete with bilingual Italian/English flow and typosโsplit into the two phases of the workflow:
1๏ธโฃ Part 1 โ The Prompt “To Get the Job Done” (Multimodal Generation + 2,049-Circle Fourier Math + Lyria 3.5 Audio Sync)
| |
2๏ธโฃ Part 2 โ The Prompt “To Write This Article & Generate the Public GitHub Repo”
| |
๐ฆ Explore the full open-source code, DFT coefficients, and assets:
๐ github.com/palladius/public-demos-fourier-epicycle-italian-puffin
๐ง๐ดโโ๏ธ๐ฎ๐น What the Agent Built From Part 1
- Subject: An aerodynamic Italian Puffin (Pulcinella di mare) wearing an
"ITALIA" ๐ฎ๐นaero cycling helmet and a geometric triathlon tri-suit riding a road racing bicycle. - Mathematical Engine: A true 2,049-harmonic Discrete Fourier Transform (DFT) ($k \in [-1024, +1024]$) tracing the entire closed complex curve tip-to-tail, with live L2 approximation error dropping from
60.20%(M = 2circles) down to0.12%(M = 2,049circles), complete with a 4.5ร Tip Harmonic Microscope Loupe. - Post-Epicycle Color Choreography: Strictly monochrome blueprint during the epicycle convergence (
t = 0.0s โ 19.6s), followed by a sequential laser-wavefront reveal of the Four Google Colors across the tri-suit panels (#4285F4Blue,#EA4335Red,#FBBC05Yellow,#34A853Green) and the Italian Tricolore (๐ฎ๐น) accents (t = 20.0s โ 30.77s). - Cinematic Audio Synchronization: A custom 3-Act, 120 BPM instrumental progressive electronic & orchestral soundtrack generated by Google Lyria 3.5, decomposed at 60 Hz into RMS, sub-bass (
< 260 Hz), and high-frequency onset envelopes to drive the harmonic transitions and visual pulse.

๐งฎ How the Math Works: 2,049 Spinning Circles
Any closed 2D contour sampled at $N = 2049$ uniform arc-length points (centered on its exact geometric centroid so the $k = 0$ DC offset vanishes) can be represented as a discrete complex signal:
Using the Discrete Fourier Transform (DFT) across symmetric frequencies $k \in [-1024, +1024]$, we compute each complex harmonic coefficient $X_k$:
where:
- $A_k = |X_k|$ is the radius of the $k$-th epicycle circle,
- $\varphi_k = \arg(X_k)$ is its initial phase angle, and
- $k$ is the angular velocity (in revolutions per cycle, spinning counterclockwise for $k > 0$ and clockwise for $k < 0$).
Sorting all $2049$ harmonics by descending amplitude ($A_{k_1} \ge A_{k_2} \ge \dots \ge A_{k_{2049}}$) allows us to reconstruct a partial contour $z_M(t)$ using only the top $M$ circles:
By Parseval’s Theorem, the relative $L_2$ reconstruction error at harmonic truncation $M$ is simply the energy fraction residing in the unrendered tail harmonics $m > M$:
Convergence Table Across the Slow-Reveal
Harmonic Tier (M Circles) | Video Timestamp (t) | Relative L2 Error | Visual Milestone |
|---|---|---|---|
2 circles | 0.0s | 60.20% | Single elliptical orbit |
5 circles | 2.8s | 46.29% | Cosmic figure-eight loop |
16 circles | 6.0s | 31.12% | Front & rear wheel lobes separate from torso |
50 circles | 9.5s | 14.16% | Bicycle frame & hunched Puffin silhouette emerge |
165 circles | 13.0s | 2.35% | Helmet, iconic beak, handlebars & spokes lock in |
580 circles | 16.0s | 0.33% | Tri-suit geometric panel seams & crankset sharpen |
2,049 circles | 19.6s | 0.12% | Sub-pixel convergence across all 2,049 harmonics |
๐ผ๏ธ The 4 Visual Stages of the Slow-Reveal
Stage 1 โ Act I: Coarse Harmonics (M = 5 Circles, 46.29% Error)
At t = 2.8s, only the 5 largest Fourier epicycles are active, tracing a sweeping figure-eight orbit while the 4.5ร Tip Harmonic Microscope in the top-right corner magnifies the tip vector chain:

Stage 2 โ Act II: Mid-Harmonic Acceleration (M = 43 Circles, 16.57% Error)
By t = 8.5s, as the 120 BPM Juno-60 synth arpeggio kicks in, 43 spinning circles carve out both bicycle wheels, the frame triangle, and the aerodynamic posture of the Puffin:

Stage 3 โ Act II Climax: Full 2,049-Circle Lock & Stealth Monochrome Blueprint (0.12% Error)
At t = 19.6s, all 2,049 harmonics lock in at 0.12% L2 error, revealing the crisp monochrome vector blueprint of the Puffin and racing bikeโstill strictly devoid of color:

Stage 4 โ Act III Finale: Post-Epicycle Google 4-Color Tri-Suit & "ITALIA" ๐ฎ๐น Reveal
Only after the epicycle convergence completes (t > 20.0s), four laser wavefronts sweep across the Puffin’s tri-suit synchronized to the orchestral brass fanfare, illuminating Google Blue (#4285F4), Google Red (#EA4335), Google Yellow (#FBBC05), and Google Green (#34A853), followed by the Italian Tricolore (๐ฎ๐น) helmet flag and striped Puffin beak:

๐ต 3-Act Musical Synchronization with Google Lyria 3.5
We prompted Google Lyria 3.5 for a 120 BPM instrumental score structured in three acts matching our visual storyboard:
- Act I (
0.0s โ 8.0s, RMS0.11 โ 0.16): Clockwork Kalimba & Orchestral Harp Plucks โ Delicate, mechanical arpeggios accompany the coarse low-harmonic circles (M = 2 โ 36). - Act II (
8.0s โ 19.6s, RMS0.25 โ 0.71): Driving Juno-60 16th-Note Arpeggios & Rising Strings โ Harmonic density accelerates fromM = 50toM = 2,049circles, peaking att = 19.5s(RMS = 0.709) right as the 2,049th circle closes the contour and the monochrome stealth wireframe locks in. - Act III (
19.6s โ 30.77s, RMS0.40 โ 0.69): Triumphant Brass Fanfare & Synthwave Supersaw Finale โ After the epicycles finish, a laser wavefront sweeps across the Puffin’s stealth tri-suit, sequentially illuminating the Four Google Colors:- ๐ต Google Blue (
#4285F4) (t = 20.0s) โ Shoulder & aero sleeve panel - ๐ด Google Red (
#EA4335) (t = 21.1s) โ Core torso & upper thigh panel - ๐ก Google Yellow (
#FBBC05) (t = 22.2s) โ Diagonal chest wedge & trim - ๐ข Google Green (
#34A853) (t = 23.3s) โ Rear hip & compression shorts panel - ๐ฎ๐น Italian Tricolore & Puffin Beak Accents (
t = 24.4s) โ The"ITALIA"helmet flag, striped Puffin beak, and cycling shoes bloom into full color!
- ๐ต Google Blue (
๐ ๐ชจ Open the Full-Screen Interactive HTML5 Canvas Fourier Studio (/demos/fourier-italian-puffin/)
or clone the GitHub Repository (palladius/public-demos-fourier-epicycle-italian-puffin)
to run and customize the renderer yourself!