synth
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
synth
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2synth — the PCM primitives First Light's sound is built from. Everything here writes interleaved mono f32 into a `buffer`, ready for `audio.encodePcm`. The looping material (the night bed, the ember crackle, the well hum, the two tend loops) is built so the last sample meets the first: every partial completes a whole number of cycles over the loop, and every noise filter is run once around the loop to converge its state before the pass that writes. That is what makes a loop seamless without loop points, which no playback surface reads anyway.
rng(seed: number) → void
A deterministic generator, so a re-bake produces the same bytes.
| arg | type | description |
|---|---|---|
| seed | number |
frames(seconds: number) → number
| arg | type | description |
|---|---|---|
| seconds | number |
lockHz(hz: number, seconds: number) → number
A frequency snapped to a whole number of cycles over `seconds` — the one rule that makes a partial loop.
| arg | type | description |
|---|---|---|
| hz | number | |
| seconds | number |
poleAt(hz: number) → number
One-pole coefficient for a cutoff in Hz.
| arg | type | description |
|---|---|---|
| hz | number |
white(n: number, seed: number) → buffer
White noise, one f32 per frame.
| arg | type | description |
|---|---|---|
| n | number | |
| seed | number |
noiseBand(n: number, seed: number, loHz: number, hiHz: number?) → buffer
Band-limited noise that meets itself end to end. `loHz` is the top of the band (a lowpass); `hiHz`, when given, is the bottom (the lowpass that gets subtracted). Both filters are wrapped twice: pass 1 converges the state across the loop point, pass 2 writes.
| arg | type | description |
|---|---|---|
| n | number | |
| seed | number | |
| loHz | number | |
| hiHz | number? |
add(dst: buffer, i: number, v: number) → void
| arg | type | description |
|---|---|---|
| dst | buffer | |
| i | number | |
| v | number |
normalise(b: buffer, n: number, target: number) → number
Peak-normalise to `target`, and report what the gain was.
| arg | type | description |
|---|---|---|
| b | buffer | |
| n | number | |
| target | number |
softClip(b: buffer, n: number, drive: number) → void
A soft saturator — takes the corners off a summed bed without clipping.
| arg | type | description |
|---|---|---|
| b | buffer | |
| n | number | |
| drive | number |
nightBed(seconds: number) → buffer
The night bed. A low modal drone (a fifth and its octave over a 55 Hz fundamental), a wide band of wind above it, and a thin shimmer that comes and goes — all locked to whole cycles over `seconds`.
| arg | type | description |
|---|---|---|
| seconds | number |
emberLoop(seconds: number, seed: number) → buffer
Ember crackle for a fire, seamless: a low breathing bed of filtered noise plus short ticks that all begin and end inside the loop.
| arg | type | description |
|---|---|---|
| seconds | number | |
| seed | number |
wellHum(seconds: number) → buffer
The Eternal Well: a struck-bronze hum. Inharmonic partials, each locked to the loop, with a slow beat between the two closest.
| arg | type | description |
|---|---|---|
| seconds | number |
drawLoop(seconds: number) → buffer
The censer drinking at the well: a rising airy draw, seamless.
| arg | type | description |
|---|---|---|
| seconds | number |
feedLoop(seconds: number) → buffer
Pouring heat into an altar: fuller, lower, a roar rather than a hiss.
| arg | type | description |
|---|---|---|
| seconds | number |
blip(seconds: number, hz: number, decay: number, harmonics: number?) → buffer
A struck tone with a decay — the shape behind every UI sound here.
| arg | type | description |
|---|---|---|
| seconds | number | |
| hz | number | |
| decay | number | |
| harmonics | number? |
whoosh(seconds: number, fromHz: number, toHz: number, seed: number) → buffer
A sweep of air with a body under it — the flare leaving the censer.
| arg | type | description |
|---|---|---|
| seconds | number | |
| fromHz | number | |
| toHz | number | |
| seed | number |
gutter(seconds: number, seed: number) → buffer
A body of low noise that falls away — something guttering out.
| arg | type | description |
|---|---|---|
| seconds | number | |
| seed | number |
chord(seconds: number, hzs: { number }, decay: number, attack: number?) → buffer
A chord struck and left to ring. `hzs` are the voices; `seconds` the tail.
| arg | type | description |
|---|---|---|
| seconds | number | |
| hzs | { number } | |
| decay | number | |
| attack | number? |
swell(seconds: number, hzs: { number }) → buffer
A chord that swells in rather than being struck — the dawn.
| arg | type | description |
|---|---|---|
| seconds | number | |
| hzs | { number } |
fall(seconds: number, seed: number) → buffer
A heavy fall with metal in it — the magus down, the censer spilling.
| arg | type | description |
|---|---|---|
| seconds | number | |
| seed | number |
arrive(seconds: number, seed: number) → buffer
Something cold arriving: a breath that rises out of nothing.
| arg | type | description |
|---|---|---|
| seconds | number | |
| seed | number |
dissolve(seconds: number, seed: number) → buffer
Something cold coming apart: a shriek that collapses into ash.
| arg | type | description |
|---|---|---|
| seconds | number | |
| seed | number |
sear(seconds: number, seed: number) → buffer
Skin against too much heat: a sear that stays on.
| arg | type | description |
|---|---|---|
| seconds | number | |
| seed | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.