bakekit
The instrument that makes every sound in *The Emperor's Noon*. Twenty clips — seven score stems and thirteen sounds the palace makes — synthesised out of arithmetic in Luau and handed to `asset.create("soundClip", …)` as interleaved f32 PCM. Nothing here is sampled and nothing is…
bakekit
The instrument that makes every sound in The Emperor's Noon. Twenty clips —
seven score stems and thirteen sounds the palace makes — synthesised out of
arithmetic in Luau and handed to asset.create("soundClip", …) as interleaved
f32 PCM. Nothing here is sampled and nothing is downloaded.
local kit = require("noon.sound.bakekit")
kit.bake("drone") -- one clip
kit.bakeAll() -- all twenty
kit.render("cascade") -- the raw buffer, without writing an asset
Bake from edit mode: asset.create writes source, and a /source write
while play is running lands on the play shadow.
What is in it
A wavetable oscillator (one table read per sample however many partials the timbre has), a struck-bell bank of inharmonic partials with per-partial decays, a Karplus-Strong plucked string, a filtered-noise burst, a gliding decaying sine, and a cross-faded continuous bed. The score is 60 BPM in D minor: four seconds to the bar, sixteen-second loops for the slow stems and eight for the fast ones so they stay locked to each other.
How the loops are made seamless
Two ways, and neither uses loopStart / loopEnd, which are stored and read by
nothing.
- A stem that sustains holds only partials whose frequency completes a whole
number of cycles inside the loop —
snap()rounds every frequency and every LFO rate onto that grid — so the last sample meets the first exactly. - Everything else is an event written with wraparound. A bell struck at 0:14 of a sixteen-second loop decays across the seam into the head of the same buffer; a noise bed is generated one fade longer than the loop and cross-faded head into tail.
The encoder refuses a buffer carrying a NaN or an infinity, so render()
sweeps for both before it normalises.
The clips
drone bells pulse strings pluck clock brass — the score, 22050 Hz.
wind cascade channel pour lap wheel rings sluice hinge boom
fire ignite birds — the palace, 16000 Hz.
They land in noon/sound/clips/ as noon_<name>.soundClip, PCM-coded so the
Opus encoder — which runs on the frame loop — is never entered.
Scoped to this part · feeds back into the world's score.