Skip to content

feat: widen the tick spec and ship the cuelume palette as a preset kit - #4

Merged
peetzweg merged 1 commit into
mainfrom
feat/cuelume-preset-kit
Aug 18, 2026
Merged

peetzweg merged 1 commit into
mainfrom
feat/cuelume-preset-kit

Conversation

@peetzweg

Copy link
Copy Markdown
Owner

Teaches the tick spec to describe more than a struck resonator, and adds sonics/presets — the seventeen cuelume sounds by Daniel Belyi (MIT), ported to plain sonics specs.

Why: a tick was noise-burst-into-a-band-pass and nothing else. Great for clicks and knocks, but with no way to say "60 ms swell", "pitch glide", "low-passed noise bed" or "reverb tail" — so most designed UI palettes were simply inexpressible. Only 4 of cuelume's 17 sounds could be ported before this.

How: six optional fields on Tick (attack, curve, wave, filter, glideTo/glideTime, ring) plus shimmer on Sound. All default to the old behaviour, so existing specs, encoded strings and presets are untouched. The kit ships on its own subpath rather than in presets, so the core only grows for people who import it — engine 2.74 → 3.25 KB gzipped, kit a separate 2.8 KB. register()/registered() let play() answer to names beyond the built-ins.

One judgment call worth a look: curve defaults to "linear" and the ports opt into "exp". I originally made the exponential rise global to match cuelume, but the regression harness showed it moved the existing click (tones-only correlation 0.90), so it became explicit instead.

Verification: every recipe was rendered through a copy of cuelume's own engine and A/B'd offline — envelope correlation 0.979–0.999, RMS within ~1 dB. The noise-burst sounds differ more, but cuelume varies 2.6–3.7 dB against itself across renders, so those deltas are inside the source's own noise. Existing presets come out bit-identical (tones-only correlation 1.00000, 0.00 dB). New tests cover the kit, register, and that the built-in presets never set the new fields; consume smoke tests exercise the subpath under ESM and CJS.

Sound design is Daniel Belyi's — MIT notice kept intact in src/presets/cuelume.ts, credited in both READMEs and in the playground.

The tick model could only describe a struck resonator — noise burst into a
band-pass that rings and decays. That covers clicks and knocks, but it has no
vocabulary for a slow swell, a pitch glide, a low-passed noise bed or a
reverb tail, which is why most designed UI palettes were inexpressible.

Add six optional fields to Tick — attack, curve, wave, filter,
glideTo/glideTime, ring — plus shimmer on Sound, a short low-passed feedback
delay. Every field defaults to the previous behaviour, so existing specs,
encoded strings and presets are untouched; the built-in presets render
bit-identically (tones-only correlation 1.00000, 0.00 dB RMS).

Add register()/registered() so play() can answer to names beyond the
built-ins, and a sonics/presets subpath carrying the seventeen cuelume
sounds by Daniel Belyi (MIT), ported to plain specs. Keeping them on their
own entry point costs the core nothing: 2.74 -> 3.25 KB gzipped for the
engine, with the kit a separate 2.8 KB paid only on import.

The ports were verified by rendering each recipe through a copy of cuelume's
own engine and A/B-ing it offline: envelope correlation 0.979-0.999, RMS
within ~1 dB. The noise-burst sounds differ more, but cuelume varies 2.6-3.7
dB against itself across renders, so those deltas sit inside the source's
own noise.
@peetzweg
peetzweg merged commit ec8b587 into main Aug 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant