This page looks best with JavaScript enabled

๐Ÿง๐Ÿšดโ€โ™‚๏ธ๐Ÿ‡ฎ๐Ÿ‡น Drawing an Italian Puffin in a Google-Colored Tri-Suit with 2,049 Fourier Epicycles & Lyria 3.5

 ·  โ˜• 8 min read
๐ŸŽฌ Full 1080p 60fps Slow-Reveal Video (Turn Sound ON ๐Ÿ”Š): 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)

1
2
3
Make a slow-reveal Fourier epicycle video of an Italian Puffin in a tri-suit riding a bycicle, make the video in the style of the attached reference image, add a cinematic soundtrack using Lyria 3.5 and sync the music. The colors of the trisuit should appear after the epicycles are done, and remind of the four Google colors.

You can use https://x.com/fofrAI/status/2110045963951956250 for inspiration. Create a folder and add artifacts to that folder togethe rwith what you do and all -> I'll use this for a demo / article to show how powerful Gemini is.

2๏ธโƒฃ Part 2 โ€” The Prompt “To Write This Article & Generate the Public GitHub Repo”

1
2
3
4
5
6
7
8
Metti l'articolo in ricc.rocks con il video finale in cima :)
ricc.rocks supporta mp4 o solo gif? Aiutami. il video su YT che ho creato uier e' sgranatissimo, low q

puoi creare un demo GH repo pubblico tipo: public-demos-fourier-epicycle-italian-puffin/ ? dove travasi quel codice in/out ma non article e un readme che punti all'articolo?

il prompt che ti ho dato va messo nella sua gloria nel readme e nell'articolo: in due parti:
1. necessario to get job done
2. necessario per scrivere <>quetso articolo e generare <>questo GH 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

  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.
  2. 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 = 2 circles) down to 0.12% (M = 2,049 circles), complete with a 4.5ร— Tip Harmonic Microscope Loupe.
  3. 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 (#4285F4 Blue, #EA4335 Red, #FBBC05 Yellow, #34A853 Green) and the Italian Tricolore (๐Ÿ‡ฎ๐Ÿ‡น) accents (t = 20.0s โ†’ 30.77s).
  4. 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.

Reference Blueprint Illustration of the Italian Puffin in a Google-Colored Tri-Suit


๐Ÿงฎ 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:

1
z[n] = x[n] + i * y[n],    for n in {0, 1, ..., N - 1}

Using the Discrete Fourier Transform (DFT) across symmetric frequencies k in [-1024, +1024], we compute each complex harmonic coefficient X[k]:

1
X[k] = (1 / N) * sum_{n=0..N-1} z[n] * exp(-i * 2*pi * k * n / N) = A[k] * exp(i * phi[k])

where:

  • A[k] = |X[k]| is the radius of the k-th epicycle circle,
  • phi[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 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:

1
z_M(t) = sum_{m=1..M} X[k_m] * exp(i * 2*pi * k_m * t),    for t in [0, 1)

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:

1
Error(M) = sqrt( sum_{m=M+1..2049} |X[k_m]|^2  /  sum_{m=2..2049} |X[k_m]|^2 ) * 100%

Convergence Table Across the Slow-Reveal

Harmonic Tier (M Circles)Video Timestamp (t)Relative L2 ErrorVisual Milestone
2 circles0.0s60.20%Single elliptical orbit
5 circles2.8s46.29%Cosmic figure-eight loop
16 circles6.0s31.12%Front & rear wheel lobes separate from torso
50 circles9.5s14.16%Bicycle frame & hunched Puffin silhouette emerge
165 circles13.0s2.35%Helmet, iconic beak, handlebars & spokes lock in
580 circles16.0s0.33%Tri-suit geometric panel seams & crankset sharpen
2,049 circles19.6s0.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 1: Act I Coarse Epicycles (M = 5 Circles)

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 2: Act II Mid-Harmonic Convergence (M = 43 Circles)

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 3: Full 2,049 Harmonics & Monochrome Blueprint Lock

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:

Stage 4: Post-Epicycle Google 4-Color Tri-Suit & ITALIA Reveal


๐ŸŽต 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:

๐ŸŽง Standalone 30.77s Google Lyria 3.5 Instrumental Score (120 BPM, 3-Act Progressive Electronic & Orchestral Brass Finale)
  • Act I (0.0s โ€“ 8.0s, RMS 0.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, RMS 0.25 โ†’ 0.71): Driving Juno-60 16th-Note Arpeggios & Rising Strings โ€” Harmonic density accelerates from M = 50 to M = 2,049 circles, peaking at t = 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, RMS 0.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:
    1. ๐Ÿ”ต Google Blue (#4285F4) (t = 20.0s) โ€” Shoulder & aero sleeve panel
    2. ๐Ÿ”ด Google Red (#EA4335) (t = 21.1s) โ€” Core torso & upper thigh panel
    3. ๐ŸŸก Google Yellow (#FBBC05) (t = 22.2s) โ€” Diagonal chest wedge & trim
    4. ๐ŸŸข Google Green (#34A853) (t = 23.3s) โ€” Rear hip & compression shorts panel
    5. ๐Ÿ‡ฎ๐Ÿ‡น Italian Tricolore & Puffin Beak Accents (t = 24.4s) โ€” The "ITALIA" helmet flag, striped Puffin beak, and cycling shoes bloom into full color!

๐Ÿ’ก 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?

  1. YouTube’s 1080p Bitrate Starvation on Thin Vector Lines: Glowing 1.7px cyan and white vector circles moving at 60fps across a deep #07080c black background have extreme high-frequency spatial gradients. YouTube’s standard 1080p60 transcode crushes video down to ~2.5โ€“3.5 Mbps using 4:2:0 chroma subsampling, creating mosquito noise and macroblocking around thin moving lines.
  2. Fix #1 โ€” Native HTML5 <video> Hosting on ricc.rocks (-tune animation): Because ricc.rocks serves static assets directly over Netlify CDN without re-transcoding, embedding a <video> MP4 encoded with libx264 -crf 19 -tune animation -movflags +faststart preserves 100% razor-sharp 1080p60 vector edges AND the 192 kbps stereo soundtrack in just 16.8 MB (whereas an equivalent 1080p60 .gif would have no audio, only 256 colors, and weigh over 80 MB!).
  3. Fix #2 โ€” Upscale to 4K (3840ร—2160) Before Uploading to YouTube: If you upload to YouTube, upscale the 1080p master to 3840ร—2160 (-vf "scale=3840:2160:flags=lanczos" -crf 17 -tune animation). Uploading a 4K60 file forces YouTube to allocate its 2160p60 VP9 / AV1 profile (~25โ€“35 Mbps)โ€”nearly 10ร— the bitrate of 1080p!
  4. 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, just 48 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!

Share on

Riccardo
WRITTEN BY
Riccardo
Developer Advocate, Google Cloud