TETERI
How TETERI is built
Every Sound Is Generated, Not Recorded
Oscillators, filtered noise and a reverb impulse built from decaying random numbers. No audio files anywhere.
There are no sound files in TETERI. Every blip, thud, chime and explosion is constructed at the moment you hear it from Web Audio primitives.
The basic voice
Almost everything is one function: create an oscillator, give it a waveform and a frequency, optionally glide that frequency somewhere else, run it through a filter whose cutoff also moves, and shape the whole thing with an amplitude envelope.
That single primitive, with different parameters, produces the move blip, the rotate chirp, the lock thud, the level-up run and the game-over descent.
Noise
The other primitive is filtered noise: a buffer of random samples played on loop, run through a filter whose frequency sweeps. That gives you the snare, the hi-hat, the hard-drop impact and the whoosh under a line clear.
Sweeping a bandpass filter upward over noise is a rising hiss. Sweeping a lowpass down is an impact. The same generator, different filter motion.
Reverb without a file
Convolution reverb normally needs a recorded impulse response. Here the impulse is generated: a couple of seconds of random samples multiplied by a decaying curve. That is, in effect, a synthetic room, and it costs nothing to ship.
Why bother
Size. A set of decent sound effects is a few hundred kilobytes. This is a few kilobytes of code.
Parameterisation. The hard-drop sound takes the drop distance and gets punchier for a longer fall. A recorded sample cannot do that without shipping several variants.
No loading. Nothing to fetch, nothing to decode, no first-play stutter.
The catch
It is harder to make it sound good. A recorded sample is whatever the recording was; a synthesised sound is a set of numbers you have to tune by ear. Getting a convincing kick drum out of a sine wave and an envelope takes real fiddling.
The trade is worth it for a game this size, and would not be for a game with a composer and a sound designer.
Read next
- The Soundtrack Is a Sequencer, Not a FileA four-bar progression with drums, bass, arpeggio and a lead, whose tempo and arrangement climb with your level.
- Online Play With No Server At AllWebRTC connects the two browsers directly; a public relay handles only the introduction.
- Seeded Randomness: Why Both Players Get the Same PiecesA small deterministic generator, one shared number, and two identical bags on different machines.
- How the CPU Opponent SearchesEnumerate every placement, score the resulting board on four weighted features, take the best.
- How the Hold Slot WorksPark one piece for later, but only once per piece, which is what makes it a decision rather than an undo button.
- Keep the Stack Flat: The One Habit That Matters MostA flat surface accepts every piece. A jagged one accepts a few. Most runs end because the board stopped accepting what the bag offered.