clips
Seventeen synthesised clips and the code that bakes them into `.soundClip` assets in this folder. Nothing here plays anything; `carrington/parts/sound` does that.
clips — every sound in Carrington Night, as a recipe
Seventeen synthesised clips and the code that bakes them into .soundClip
assets in this folder. Nothing here plays anything; carrington/parts/sound
does that.
local clips = require("carrington.sound.clips")
clips.bake("cn_arc") -- one recipe → /source/carrington/sound/cn_arc.soundClip
clips.bakeMissing() -- everything this world has not baked yet
clips.render("cn_arc") -- the samples, without writing anything
Nine beds, looped by the Audio component
cn_wind · cn_drone · cn_shimmer · cn_pulse · cn_unease · cn_hum ·
cn_whine · cn_corona · cn_fire
A bed closes on itself. Every partial in it is snapped onto the clip's own
harmonic grid, every filter is primed by running the buffer once before it
keeps anything, and every crackle grain wraps past the end into the head. That
is the only way a loop is seamless here — loopStart / loopEnd are accepted,
stored, reported back and read by no playback surface, so the clip itself has
to be the loop and Audio.looping has to carry it.
Measured on the baked bytes: the step across the loop point is smaller than the largest step inside every bed, and for the tonal ones it is smaller than the average step.
Eight one-shots, fired by playOneShot
cn_arc · cn_flashover · cn_deton · cn_debris · cn_relay ·
cn_powerdown · cn_spark · cn_creak
Each starts and ends in silence so it can be fired at any moment. The detonation is built in five layers — the crack, a bright blast, a dark blast, a falling sub sweep and the tank ringing — with debris ticks scattered through its tail.
Rates and codec
Beds run at 22 050 Hz, hits at 44 100 Hz, everything mono, everything written
with codec = "pcm". PCM rather than Opus because an Opus clip loses its first
few milliseconds on decode, which a bed would click on at every loop. Both
rates were checked playing back at their true length in this engine before the
set was baked.
The four generated cues (cn_cue1 … cn_cue4) live beside these but are not
made here — they come from audio_gen and are kept as Opus, which is fine
because they never loop.
Scoped to this part · feeds back into the world's score.