Repository navigation
feat: widen the tick spec and ship the cuelume palette as a preset kit - #4
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) plusshimmeronSound. All default to the old behaviour, so existing specs, encoded strings and presets are untouched. The kit ships on its own subpath rather than inpresets, 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()letplay()answer to names beyond the built-ins.One judgment call worth a look:
curvedefaults 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 existingclick(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.