# Cymbal Crash — `cymbal-crash@1.0.0`

A brass cymbal struck by a drumstick: the metal ripples in vibration modes and rings down to stillness. Loops perfectly.

A brass cymbal on a stand in studio light, struck once per loop by a drumstick. Its rim ripples in the lobed patterns of real vibration modes (two, three, four and five lobes around the edge and a rippling bowl), each oscillating a whole number of times per loop while the whole ring fades to nothing before the next strike. Choose the metal (brass, bronze or silver), how violently it rings, the pitch of the vibration, the backdrop colour and whether the camera sways.

- Kind: object; status: published; digest sha256:c317f3ccbc0731a08287e70a9bf481fbb009c26f59170c64948ad948897f6faa
- Role: Object (3D, three.js): a musical, rhythmic showpiece that makes impact and sound visible.
- Implementation: three; entry `src/cymbal-crash.js`
- Files: https://aipixelwizard.com/registry/cymbal-crash/1.0.0/<path> (`LICENSE`, `asset.json`, `demo.js`, `index.html`, `src/cymbal-crash.js`)
- Manifest JSON: https://aipixelwizard.com/api/v1/visuals/cymbal-crash/versions/1.0.0
- Runnable demo: https://aipixelwizard.com/registry/cymbal-crash/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 shader materials.; `chrome-material@1.1.0` (demo) — Studio environment light, backdrop and contact shadow.; `apw-runtime@1.0.0` (demo) — Demo harness.

## Exports
- `createCymbal({ metal?, ring?, speed? }) => { group, setProgress(progress), dispose() }` — The cymbal with its stand and drumstick as a group of radius 3; the strike lands at progress 0.5; needs an environment map.
- `METALS: { brass, bronze, silver }` — Metal finishes with colour and roughness.

## Parameters
- `metal` (select one of brass | bronze | silver, default "brass") — Metal
- `ring` (number 0.2–2, default 1) — Ring strength
- `pitch` (integer 1–3, default 1) — Pitch: Multiplies the vibration frequencies.
- `background` (color, default "#14151f") — Backdrop
- `orbit` (boolean, default true) — Camera sway

## Composition
- Inputs: Time within the loop; the metal, ring strength, pitch, backdrop and camera sway.
- Outputs: A full frame rendered in 3D with a studio environment.
- Coordinates: The cymbal is centred on the origin with radius 3, lying nearly flat (tilted 0.28 rad towards the camera); the stick strikes at (1.9, ·, 0.7).
- Lighting: A warm key light with a shadow map and the studio environment.
- Timing: setProgress(progress) rewrites the surface from a closed form; frames render in any order.
- Works with: chrome-material, orbit-camera, kinetic-title, number-reveal
- Vertices are rewritten on the CPU each frame (about 9 000) and normals recomputed.

## Output and loop
- 1080×1080, 30 fps, 10 s, procedural
- Seamless loop: yes — The strike lands halfway through the loop; each vibration mode oscillates a whole number of times in the time since the strike and the ring-down envelope fades to zero before the next strike, 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: Create a WebGLRenderer with a studio environment, add createCymbal().group and call cymbal.setProgress(progress) each frame.

Existing project: Copy src/cymbal-crash.js; add the group to your scene with an environment map and a shadow-casting light.

Reuse ideas:
- Music title: Brass, one strike.
- Soft intro: Silver, soft ring.
- Beat drop: Violent crash.

## Limitations
- The vibration is a closed-form sum of modes, not a physical simulation.
- The stick pivots about its tip and does not bounce off the metal.

## License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder.

Provenance: Adapted from the owner's threejs-sketches/objects-scenes/cymbal-crash (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original studio object: a lathed-profile cymbal whose surface is a closed-form sum of lobed vibration modes after a strike, on an exact loop.

