cat _posts/2026-10-18-consculpta-a-sound-engine-that-reads-the-genome-sampled-instruments-and-a-genome-panel-that-opens-itself.md
consculpta: a sound engine that reads the genome, sampled instruments, and a genome panel that opens itself
A day after going public, consculpta grew a sound engine instead of a soundtrack: src/audio/score.js maps a genome to key, mode, pace, swing, timbre and texture, scan.js reads the melody off the specimen’s own silhouette by marching inward along directions swept across the side facing the camera — the outermost inside radius sets the pitch, empty directions rest — and synth.js voices it with Web Audio pads, plucks, bells and a membrane thump for the drum block (10d9949). Because it follows Spin and Morph, the music moves when the sculpture does.
The second pass replaced the oscillators with samples: a CC0 subset of the Versilian Community Sample Library, 87 MP3s and about 4.3 MB vendored from a pinned commit — vibraphone, marimba, glockenspiel, hand chimes, wine glasses, kalimba, harp, pipe organ, frame drum, slit drum, gong, mark trees — driven by Tone.js 15.1.22, with ensemble.js picking the band from the block (marimba and organ for cubes, chimes for spheres) and arrange.js laying out a bed chord per bar, a sparse lead, a counter line and percussion, gonging on a new parent (6bf185c). The bundle stays lazy — nothing audio-related loads until Sound is used — and the scheduler falls back to the oscillator synth on the same clock if the samples fail.
Sound is now on by default without breaking the browser’s autoplay rule: the button starts armed and dimmed, and the first click, tap or key press resumes the AudioContext synchronously, with the choice kept in nsb.sound and respected on reload (41ca4ee). The genome panel opens by default so a first-time visitor sees the formula behind a specimen without hunting for it, with the close remembered in nsb.genomeOpen (6f09bae), and the layout now uses the width it is given — max-width raised from 1280 px to 2400 px with fluid padding, and three columns from 1500 px, the litter sticky beside the stage and the shelf, genome and AI breeder on the right (550a085).