hex/prototypes/sound-synth
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kit Langton a3b293c56c feat(feedback): procedural sound sets synthesized in code
Adds src/sound_synth.rs, a deterministic synth (pitch glide, raised-cosine
attack, exponential decay, band-passed noise breath, low-pass, saturation,
K-weighted loudness normalization) with six compiled recipes in
resources/sounds/presets.json. The feedback loader renders them at startup
alongside the bundled classic set, which stays the default. Settings gains a
Sound picker next to Sound volume that previews the start tone.

prototypes/sound-synth/synth.js is the reference implementation behind the
tuning prototype; tests compare Rust renders against its exported fixtures and
check onset, length, clipping, loudness and spectral centroid.
2026-10-21 12:09:15 -07:00
..
index.html feat(feedback): procedural sound sets synthesized in code 2026-10-21 12:09:15 -07:00
main.js feat(feedback): procedural sound sets synthesized in code 2026-10-21 12:09:15 -07:00
README.md feat(feedback): procedural sound sets synthesized in code 2026-10-21 12:09:15 -07:00
render.ts feat(feedback): procedural sound sets synthesized in code 2026-10-21 12:09:15 -07:00
style.css feat(feedback): procedural sound sets synthesized in code 2026-10-21 12:09:15 -07:00
synth.js feat(feedback): procedural sound sets synthesized in code 2026-10-21 12:09:15 -07:00

Sound synth

synth.js is the reference implementation of Hex's procedural feedback tones; src/sound_synth.rs mirrors it step for step. Recipes live in resources/sounds/presets.json; the tuner's "Copy preset" output is one entry.

  • bun prototypes/sound-synth/render.ts rewrites tests/fixtures/sound_synth after a change to the algorithm or the presets (the Rust parity test reads it).
  • bun prototypes/sound-synth/render.ts <dir> also writes WAVs for offline checks.

The tuner page (index.html, main.js) runs on the Problems viewer kit. To publish it, stage a folder with these files plus kit/ (copied from the team-board repo), presets.js (export default + presets.json) and sounds/classic/{start,stop,cancel}.mp3, then board.ts publish <dir> --include sounds.