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 = 2,049 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 thek-th epicycle circle,phi[k] = arg(X[k])is its initial phase angle, andkis the angular velocity (in revolutions per cycle, spinning counterclockwise fork > 0and clockwise fork < 0).
Sorting all 2,049 harmonics by descending amplitude (A[k_1] >= A[k_2] >= ... >= 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 L2 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 (
๐ก Pro-Tip: Why Fourier Epicycle Videos Look Pixelated on YouTube (and How to Fix It)
When I first uploaded the 1080p render to YouTube yesterday, the video looked surprisingly pixelated and blocky (sgranatissimo). Why does that happen?
- YouTube’s 1080p Bitrate Starvation on Thin Vector Lines: Glowing
1.7pxcyan and white vector circles moving at 60fps across a deep#07080cblack background have extreme high-frequency spatial gradients. YouTube’s standard1080p60transcode crushes video down to ~2.5โ3.5 Mbps using 4:2:0 chroma subsampling, creating mosquito noise and macroblocking around thin moving lines. - Fix #1 โ Native HTML5
<video>Hosting onricc.rocks(-tune animation): Becausericc.rocksserves static assets directly over Netlify CDN without re-transcoding, embedding a<video>MP4 encoded withlibx264 -crf 19 -tune animation -movflags +faststartpreserves 100% razor-sharp 1080p60 vector edges AND the 192 kbps stereo soundtrack in just16.8 MB(whereas an equivalent 1080p60.gifwould have no audio, only 256 colors, and weigh over80 MB!). - Fix #2 โ Upscale to 4K (
3840ร2160) Before Uploading to YouTube: If you upload to YouTube, upscale the 1080p master to3840ร2160(-vf "scale=3840:2160:flags=lanczos" -crf 17 -tune animation). Uploading a 4K60 file forces YouTube to allocate its2160p60VP9 / AV1 profile (~25โ35 Mbps)โnearly 10ร the bitrate of 1080p! - Fix #3 โ Run the Math Live in an HTML5
<canvas>: Better yet, why stream pixels when you can ship the 2,049 complex numbers (fourier_2049_coeffs.json, just48 KB) and let the browser’s GPU render the epicycles at native Retina/4K resolution?
๐ ๐ชจ 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!