Behind the scenes
Music with no audio files
Hexapulso has no music file and no sound-effect file at all. Everything you hear is computed by the browser while you play, note by note.
Why do it this way
- The game stays small. It is a single page. Thirteen recorded tracks would weigh several times more than the whole game; as a recipe, each takes a few lines.
- The music can react to the run. A recording always plays the same way. Music built on the spot can gain or lose instruments from one bar to the next.
- It works offline. There is nothing to download.
What a sound is made of
Browsers have a built-in synthesiser. With it the game uses two ingredients:
- Oscillators: simple waves (sine, square, triangle, sawtooth) at a chosen frequency. Each shape has a timbre: the sine is clean, the square recalls old video games, the sawtooth is harsh.
- Filtered noise: hiss that, run through a filter and cut very short, becomes a snare, a hi-hat or a clap.
Every note gets an envelope: the volume rises quickly and falls right after. The envelope is what turns a continuous beep into a played note.
The structure all tracks share
The 13 tracks run on the same beat: 16 steps per bar, a kick on every beat and four chords that loop round. Each track is a set of parameters on top of that base: which chords, which wave shape for the bass and the lead, which arpeggio pattern, whether there is echo, what stands in for the snare.
That is why switching tracks doesn’t change the tempo of the run, only the mood. The list with a description of each one is in Music.
Layers that come in with intensity
The music has four intensity levels, and the stage of the run is what drives them. With each new stage the game goes up one level, until the fourth:
| Stage | What plays |
|---|---|
| Spark | Kick, bass and the chord pad |
| Flame | The snare and the melody come in |
| Ember | The hi-hat doubles |
| Blaze onwards | In the second half of the bar, the melody goes up an octave |
The tempo rises too: a run starts at 124 beats per minute and gains 4 with each stage, up to 144 at Singularity. On the menu the music plays slower, at 112, and muffled by a filter that opens when the run starts.
The effects
The sounds for collecting a spark, grazing a wall, turning focus on, breaking the shield and crashing are made the same way. The graze sounds sold in the shop (bell, laser, coin, droplet and the others) are different recipes for the same event.
One detail: the game’s core, which decides the rules, knows nothing about sound. It only reports "collected a spark" or "changed stage", and the part of the game that handles screen and audio decides what to play. So sound never interferes with the result of a run.
When the music shows on screen
Because the game knows which step of the bar the music is on, the drawing can follow along. The Beating heart core cosmetic, for example, beats to the pulse of the music.
Limits
Music synthesised like this has a sound of its own, an electronic one. There can be no voice and no recorded instrument. And browsers only unlock audio after the first tap or click on the page, which is why the game starts silent until you press something.