# Spinning Vinyl Record — `vinyl-record@1.0.0`

A vinyl record turning on a turntable at 33⅓ rpm, light running across its grooves, your title on the label. Loops perfectly.

A long-player turning on a turntable in a studio: the grooves catch the light in a bright wedge as real records do, the label is printed with your title, the metal platter's rim is dotted for the strobe, and a chrome tonearm rests in the groove, rising a fraction with the record's warp while its shadow falls across the disc. Choose the vinyl (black, red, mustard, marbled or gold), the deck (walnut, black or brushed silver), the label colour and its two lines, the camera angle (three-quarter, from above or low) and the backdrop.

- Kind: object; status: published; digest sha256:0ef58e862373c92019254196ef74746b8bbde208b7cbaf529cf3aa47aa7fae95
- Role: Hero object (Three.js 3D): a turntable for music, podcast and nostalgia content.
- Implementation: three; entry `src/vinyl-record.js`
- Files: https://aipixelwizard.com/registry/vinyl-record/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/vinyl-record.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/vinyl-record/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/vinyl-record/1.0.0/index.html (open over http; it imports sibling packages by relative path)
- Dependencies (exact): `three@0.185.1` (source) — Renderer, geometry and physical materials (anisotropic grooves).; `chrome-material@1.1.0` (demo) — Studio environment light, backdrop, floor and contact shadow.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createTurntable({ vinyl?, deck?, labelColor?, inkColor?, title?, subtitle?, seed?, anisotropy? }) => { group, turning, recordCentre, stylus, surfaceY, update(time), dispose() }` — The turntable with its record as a THREE.Group (1 unit = 10 cm, standing on y = 0). update(time) turns it at 33⅓ rpm.
- `RPM = 33⅓` — Turns per minute: five turns take exactly 9 seconds.
- `VINYLS: { black, red, yellow, marble, gold }` — The record finishes.
- `DECKS: { walnut, black, silver }` — The turntable finishes.

## Parameters
- `vinyl` (select one of black | red | yellow | marble | gold, default "black") — Vinyl
- `deck` (select one of walnut | black | silver, default "walnut") — Turntable
- `label` (color, default "#efe4cf") — Label colour
- `title` (text, default "Midnight Session") — Label title
- `subtitle` (text, default "Side one, long play") — Label second line
- `angle` (select one of hero | top | low, default "hero") — Camera
- `background` (color, default "#241a15") — Backdrop
- `orbit` (boolean, default true) — Camera drift
- `seed` (integer 1–999, default 3) — Seed: Changes the wood grain, the dust on the record and the marbling.

## Composition
- Inputs: Time in seconds; the vinyl, deck, label colour and texts.
- Outputs: A THREE.Group: the turntable with its platter, record and tonearm, standing on y = 0.
- Coordinates: 1 unit = 10 cm. The deck is 4.5 wide and 3.55 deep; the record (radius 1.52) turns about recordCentre, left of the deck's centre.
- Lighting: Physical materials: needs scene.environment for the groove sheen and the chrome; a shadow-casting key light lays the tonearm's shadow on the record.
- Timing: update(time) is a pure function of time; frames render in any order.
- Works with: chrome-material, orbit-camera, kinetic-title
- Label texts are treated as private: not stored in shared packs unless you choose to include them.
- The label uses the system's Helvetica or Arial; the record's maps are drawn in code, no image files.

## Output and loop
- 1080×1080, 30 fps, 9 s, procedural
- Seamless loop: yes — At 33⅓ rpm the record makes exactly five turns in 9 seconds; the arm's warp motion follows the turns and the camera drift is a sine of the loop, so the last frame meets the first.
- Verified 2026-10-06 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)); deterministic: yes; loop check: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.

## Use it
New project: Set scene.environment (createStudioEnvironment from Chrome Material works), add createTurntable().group, add a shadow-casting light, and call update(time) each frame.

Existing project: Copy src/vinyl-record.js. Add the group to your scene, scale it, and call update(seconds) every frame; use turning if you only want the record.

Reuse ideas:
- Song release: the default with the song title on the label, and the artist name on the second line.
- Podcast background: Red vinyl from above, camera drift off, behind your episode title.
- Milestone: Gold record with your number on the second line.

## Limitations
- Plays at 33⅓ rpm only (45 rpm would not loop in a short clip).
- The tonearm stays in one groove; it does not cue up or lift off.

## License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.
- three.js 0.185.1: MIT (https://github.com/mrdoob/three.js)

Provenance: Adapted from the owner's threejs-sketches/audio-musical/webgpu-vinyl-groove (MIT), rebuilt for AI Pixel Wizard in October 2026 in WebGL as a full turntable: anisotropic grooves, a printed label, a strobe-dotted platter, a modelled tonearm, studio light and shadows, a true 33⅓ rpm loop and the frame/time contract.

