Spiro

What it is

Spiro draws Spirograph-style rosettes by chaining 2 to 5 rotating arms. Each arm pivots at the tip of the previous one, and the pen sits at the tip of the last arm. The pen's path is the pattern.

The math

Each arm's lab-frame rate is the product of its own N and all parent Ns. So N₁ is "rotations of arm 1 per pattern" and every later Nᵢ is "rotations of arm i per rotation of arm i−1". Position is summed across arms:

rateᵢ = N₁ · N₂ · ... · Nᵢ
angleᵢ = 2π · rateᵢ · t
pos    += ( aᵢ·cos(angleᵢ), bᵢ·sin(angleᵢ) )

where Lᵢ is arm length, eᵢ is eccentricity (with aᵢ=Lᵢ, bᵢ=Lᵢ(1-eᵢ)), and t goes from 0 to 1 over the duration.

Why integer rates

Every lab-frame rate is a product of integers, so every arm returns to its start at t = 1 and the pen returns home with no visible seam. The pen retraces the pattern |N₁| times within the duration — click Simplify to drop N₁ to ±1 and trace once.

Color

In rainbow mode the hue cycles K = max |Nᵢ| times per pattern, so the rainbow stripes line up with the petals.

Sound

Each arm contributes one sine/triangle oscillator at frequency 110 Hz · |Nᵢ|, so the rotation ratios become a chord. Coprime Nᵢ sound dissonant, rationally related ones sound consonant.