A 32-step NES-style source table reconstructed as a 24-harmonic
PeriodicWave is a different audio artifact from the
browser's native triangle oscillator. The contrast is audible
when both are played as bare oscillator tones at a synced pitch.
- Native uses the browser's built-in
oscillator.type = 'triangle'. - NES-style uses a Web Audio
PeriodicWavebuilt bycreateNesTriangleWavefrom a 32-step NES-style source table, projected onto 24 cosine/sine harmonics with the DC offset removed.
Audio dormant. Click either button to arm and play.
The page shows two buttons. Each click shuts off the current oscillator and sustains the selected source at the current synced note. The note advances after both sources have been heard at that pitch, or after one source is clicked twice successively.
The chewgum-dsp library exists because the NES-style PeriodicWave has a different audible character from the browser's native triangle oscillator. This page is the proof: synced pitch, same sustain path, no filter or effects, only the wave differs.
- Library: chewgum-dsp v0.1.0 on GitHub. Source for
createNesTriangleWaveandmidiToFrequency. - NES-style PeriodicWave deployed in Dead Beat (bell tones) and Falling Hall (wall-strike chimes).
- Native triangle oscillator deployed in Phosphor, used here as the contrast point.
- Implementation note: this page vendors the chewgum-dsp v0.1.0 wave code inline and uses the same sustained tone path for both buttons; the only difference is whether
setPeriodicWavereceives the NES-style wave.
ChewGum Animation
Shane Curry, "Native Triangle vs. NES-Style Triangle," https://shanecurry.com/lab/toys/triangle-engines/, published 2026-04-29.
The point is to listen before any bell-making gets involved. Same
synced pitch, same sustain path. One button uses a 24-harmonic
NES-style PeriodicWave; the other uses the browser's
native triangle. That is the smallest honest A/B.