Questing · 2026-06-20 · Generative Music · Web Audio · Zero Dependencies

PLUCK

Every day has its own melody. Today's date seeds a unique 16-beat phrase — then plays it on an animated antique music box. Same day, same song. Always.

Open Pluck →

What is Pluck?

Pluck is a browser-based daily music box that derives a unique 16-beat melody from the current date and plays it on an animated antique brass cylinder. The date seed (year × 10000 + month × 100 + day) drives an xorshift32 generator to assign A-minor-pentatonic notes (220–659 Hz) to 16 beat slots at 80–110 BPM — producing 365 distinct melodies per year with no server, no AI, and no text input. Open it at midnight and the song changes; share the link with a friend and you both hear the same thing.

How the Melody Is Derived

The date is converted to a single integer seed:

seed = year × 10000 + month × 100 + day

// e.g. 20 June 2026 → 20260620

That seed initialises an xorshift32 pseudorandom number generator — a shift-register sequence used in hardware RNGs for its speed and full-period guarantee. The generator fills 16 beat slots: each slot has a 28 % chance of silence; otherwise the generator picks one of eight tines (0–7). A final draw sets the tempo between 80 and 110 BPM. Because the RNG is seeded from the date alone, the melody is completely deterministic: no server, no database, no AI.

// xorshift32
let x = seed >>> 0 || 1;
rng = () => { x ^= x << 13; x ^= x >>> 17; x ^= x << 5; return (x >>> 0) / 4294967296; }

// melody
for i in 0..16:
  melody[i] = rng() < 0.28 ? null : floor(rng() × 8)

bpm = 80 + floor(rng() × 30)

The Scale — A Minor Pentatonic

The eight tines are tuned to the A minor pentatonic scale across two octaves:

A3  C4  D4  E4  G4  A4  C5  E5
220 262 294 330 392 440 523 659  Hz

The pentatonic minor is chosen deliberately: any subset of its five pitch classes sounds harmonious together, so random pin placement never produces a clashing melody. This is the same scale used in folk music from West Africa to East Asia — the intervals are culturally universal precisely because they avoid the dissonant half-steps of the diatonic scale.

The Visual — Cylinder and Tines

Pluck's visual is a barrel cylinder — the rotating drum at the heart of a 19th-century mechanical music box. In real instruments, pins are soldered to the brass barrel; as the drum turns, each pin lifts and releases a tuned metal tine (the “comb”), producing the characteristic ping. Pluck renders this in Canvas 2D: the drum body is a warm bronze gradient (specular highlight at top, deep shadow at base); the 16 beat columns scroll right to left at the generated BPM. When a gold pin reaches the left edge — aligned with its tine row — the tine flares silver-white and the note sounds.

Three additional visual layers frame the mechanism:

  • Eight faint horizontal “staff” lines extend full-width, one per tine — the cylinder reads from an invisible score.
  • A row of 16 small dots below the cylinder marks the current beat position; the active dot brightens gold.
  • The left end-cap pulses with a warm ring on each struck beat, synchronised to the Web Audio note.

The Sound — Bell Synthesis

Each note is synthesised with two OscillatorNodes connected through GainNodes to the Web Audio destination:

Fundamental:  sine, target freq,       attack 4 ms, decay → 0 over 1.1 s
Overtone:     sine, freq × 2.756,      attack 2 ms, decay → 0 over 0.38 s

The 2.756× inharmonic ratio is characteristic of struck metal tines;
it produces the short, bell-like metallic ping distinct from a pure sine.

How to Use Pluck

  1. Open the toy and click anywhere on the canvas to start audio.
  2. The melody begins: an animated bronze cylinder rotates left-to-right, carrying gold pins at positions that encode today's unique tune.
  3. As each pin reaches the left edge of the cylinder, it plucks the corresponding tine — a steel prong tuned to one of eight notes in A minor pentatonic.
  4. The tine glows bright silver-white for a moment; a bell-like tone rings from the Web Audio API.
  5. The 16-beat melody loops continuously. The beat-indicator row below the cylinder shows which beat is currently sounding.
  6. Click again to pause and resume. The exact melody depends only on today's date — June 20, 2026 always plays the same 16-beat phrase.

What Makes It Different

Pluck is the first browser-based music box toy that derives its melody deterministically from the calendar date rather than from user text input or random generation. The date seed produces 365 distinct 16-beat melodies per year — each at a BPM drawn from a 31-value range (80–110) — with no server, no AI, and no randomness at runtime. Unlike other Web Audio instruments (piano keyboards, drum pads, sequencers), Pluck's composition is entirely automatic: the input is ambient, universal, and requires no decision from the user beyond clicking Play. The daily-renewal mechanic rewards return visits without requiring any interaction — a machine that composes faithfully but never identically.

Open Pluck →