Chip-synth sound: music and effects without audio files

We build browser sound from oscillators, notes and envelopes, then connect it to game events and measure the mix. No audio files to download.

Our games ship without audio files. The music and effects are synthesised live in the browser, using Web Audio. Kaiju Snack and Neon Eclipse are live; Stompkin and Rust Rook are coming soon. All follow that approach.

We started with Kaiju Snack's synth, then extracted and generalised it into our shared kit. Kaiju keeps its own copy. The other games supply songs, cues and mix settings to the kit, which turns those instructions into sound. Here is how that works, from a note to the moment it reaches the speaker.

A waveform needs a shape

An oscillator produces a repeating waveform at a chosen frequency. Our kit offers pulse, triangle and sine voices. Pulse waves provide the chip character; changing their duty cycle changes the waveform. Triangle and sine voices give us other starting points for pitched sounds.

We write pitches as note names or numbers. A name such as C#5 becomes a MIDI note number, then a frequency. A voice can hold that pitch, glide along a path of notes or cycle through an arpeggio. These are instructions for the oscillator, rather than separate recordings of each variation.

The envelope controls the voice's volume over time: attack, decay, sustain and release. We start the gain at zero, ramp to the attack level, let it decay towards the sustain level, then release it towards silence. The waveform supplies the pitch and texture; the envelope gives it a beginning and an end.

For unpitched textures we generate noise into a buffer locally. Filters shape it into cracks, swishes and percussion. A bell combines sine partials with their own decays and a strike click. We can layer those ingredients inside a cue.

Songs are note data

The sequencer reads songs as sections and bars, with channels for melody, bass, chords, arpeggios and drums. Its tracker grid has 16 rows per bar. Note tokens carry the pitch, while holds extend a note and rests leave space. The song also supplies tempo and instrument settings.

The player compiles that data into events and schedules voices against the audio clock with a short lookahead. Intensity can gate extra layers and change the music's filter and level. We keep the composition and the instrument settings in the game's data, while the kit handles scheduling.

Rust Rook's base music uses a D Dorian wire motif and a rail pulse. Its Night Shift music shares that identity, with layers across five intensities. The game director chooses the track and intensity; its effect cues do not switch tracks themselves.

A cue belongs to an event

A cue gives a game event a name the audio system can recognise. In Stompkin, the scene sends the stomp event on Jack's contact frame, with the number of groups involved. The audio contract expresses the call as sound.play('jack_stomp', { groups: step.groups.length });.

That cue layers a descending sine body, a triangle voice, a knock and filtered noise. Multiple groups add another crack inside the same cue. The cue also asks the music to dip briefly, leaving room for the impact. We connect the sound to contact, so the movement and its sound share a timing point.

The dispatcher handles the request before scheduling those voices. It checks repeat limits, manages simultaneous cue instances by category and priority, and can align a cue after another cue. It also merges requests to lower the music, so a lighter request cannot undo a deeper dip already in progress.

The music deck handles which song plays and how it hands over. It can crossfade, or let a song with an ending section reach its next bar and play that ending as it hands over to the next track. A normal request for the current track leaves it running. Effects and music therefore have separate scheduling jobs within the same runtime.

We measure the rendered mix

We render the game's sound into a sample buffer with an OfflineAudioContext. Scripted sequences use the same synth, dispatcher and music deck as live playback, including repeat limits, overlapping cues and transitions.

We inspect peak amplitude and RMS, the square root of average squared sample values. We also measure loudness with K weighting: integrated loudness with quiet passages gated out, momentary loudness over 400 milliseconds and short-term loudness over three seconds. Those measurements let us compare a brief cue with the music underneath it.

We run the loudness analysis again through a phone-speaker model, a high-pass filter at 400 Hz. It shows how much a cue depends on low frequencies. We also check audible onset, tails, gaps and isolated clicks. These are signal checks; the speaker model remains a model. We still need to listen on speakers and headphones.

Less to fetch, more tied to state

The download carries synthesis code and note data, with no recorded soundtrack or effect files to fetch. We enforce that claim in the site build: it scans every listed game's public and source folders for audio file extensions and stops if it finds one.

Sound can also follow the state directly. Stompkin passes the new flame rung into its rising cue, changing the noise sweep, pitched glide and bell note. Its flame stage selects the music intensity too. We can change the sound from those values without loading another recording.

For the rules and probabilities behind the presentation, we have a separate post on how we test a slot's math. Here, our job is to make each event audible at the right moment and keep the mix readable as the scene changes.

18+ only. Stake.com is not available in every country, including the US, UK and Australia. Gambling can be addictive, so play responsibly. Responsible gambling on Stake

The games in this post

Live on Stake

Mogu the kaiju eats your winning clusters in a harbour city at sunset. In Rampage free spins every snack makes him bigger, up to a ×10 multiplier.

Grid
6×5 cluster tumble
Max win
10,000×
RTP
96.50%
Bonus
Rampage free spins
Play on Stake

Coming soon to Stake

Jack, a living jack-o'-lantern, stomps every winning group flat in a midnight pumpkin patch. Each stomp stokes his flame from ×1 to ×100, and in Hallow Night free spins it never resets.

Grid
6×5 cluster tumble
Max win
15,000×
RTP
96.50%
Bonus
Hallow Night free spins

Coming soon to Stake

A weathered raven pecks winning scrap apart in a night salvage yard. Scrap magnets from ×2 to ×100 multiply the spin, and in Night Shift free spins the raven hoards them for good.

Grid
6×5 cluster tumble
Max win
15,000×
RTP
96.50%
Bonus
Night Shift free spins

Live on Stake

Rei, a spirit hunter, cuts winning clusters apart in a neon city under an eclipse. Each cleared cell gains a Moon Ward that doubles with every clear up to ×128, and in Total Eclipse free spins the wards stay for the whole feature.

Grid
6×6 cluster tumble
Max win
10,000×
RTP
96.50%
Bonus
Total Eclipse free spins
Play on Stake

More from the devlog