I could not listen, so I measured the waveform: building Japanese instruments with WebAudio for Sushi Stack

日本語版

Development log of Sushi Stack / October 2026

The sound of Sushi Stack uses not a single audio file. Japanese instruments are synthesized on the spot with the browser’s audio feature (WebAudio). The problem was that I had no way to listen while I was building it. So I measured the waveform and adjusted the volume. This is written with the numbers left in my commits.

Why no audio files

Using external libraries or audio files would break the form where the game is delivered as one file (and works offline). So I synthesized the koto (plucked), taiko, hyoshigi (wooden clappers) and kane (gong) from WebAudio parts and composed the music in the yo scale (a Japanese scale).

I cannot listen, so I measure the waveform

The balance of volume is something you would normally decide by ear. But in this work I could not listen. So I swapped the same synthesis functions onto a render-only audio part (OfflineAudioContext), wrote the sound out as a waveform, and measured the maximum amplitude (peak).

The initial state was this:

After adjusting, the sound effects lined up like stairs below the BGM peak of 0.179.

SoundPeak
BGM (reference)0.179
Merge0.16
3-chain0.48
Otoro0.49
Golden0.85
Jackpot0.81

The distortion is gone, and I can confirm with numbers the order “the more rewarding the sound, the louder.” But whether it sounds pleasant to the ear cannot be told by this method.

I re-drew the ranks from measurements, too

The same day I reviewed the rank thresholds. I ran auto-play 12 times and took the score distribution:

ModeScore rangeMoves placed
Omakase12,532 to 22,413172 to 267
Menu20,992 to 46,395171 to 306

With the earlier criterion (legend = 30,000 points), an auto-play with no strategy reached the top rank. So I moved the thresholds above that (0 / 4,000 / 10,000 / 18,000 / 30,000 / 50,000 / 85,000). Menu scores come out about 1.8 times higher, so I stretched them by the same ratio. Both auto-plays now stop at “journeyman,” and from head chef up, it depends on skill.

The next day I ran 120 games and measured the distribution (apprentice 6%, journeyman 32%, head chef 40%, master 14%, legend 8%). Auto-play is better than people, so it does not fall into the bottom two ranks. Those two are a layout meant to matter when humans play.

I also changed how chains are shown

What I learned

Even if you cannot listen, you can measure.

The numbers in this article come from my commit record (September 7 and 8, 2026). The sizes of the pieces changed after those days (the conger eel article, in Japanese), so the current score ranges and thresholds differ from what is written here.

This is the English version of the original Japanese article.

More in English