← playground
Interactive · Web Audio

Make a sound
from scratch.

Every sound in Skyhop comes from one small function, beep(): an oscillator, a pitch slide and a volume fade. Shape one yourself, then hear what the waveform type actually changes.

01  beep() playground

Move the sliders, then press Play or hit Space. The graph and the code follow as you go.

Starting pitch in Hz. Higher is higher.

Length in seconds. Fade and slide both end here.

type

Waveform shape, which sets the tone colour.

Starting volume. Keep it low, oscillators are loud.

Hz to shift by the end. Negative sweeps down, 0 stays flat.

Sound shape
PitchVolume
The call
Sounds from Skyhop

Gem, checkpoint and win are several beeps in a row. Clicking one plays it and loads its first beep into the sliders.

02  Waveform types

OscillatorNode.type sets the shape of the wave the oscillator outputs, which changes the tone you hear. Press Play on any card to listen.

mode

sine is the default value. An oscillator can also take a custom shape through setPeriodicWave(), which sets the type to custom.

03  Overtones

Why square and sawtooth sound buzzier than sine and triangle. Every shape is a sine at the main pitch plus quieter sines at whole-number multiples of it, called overtones. Add them one at a time and watch each shape build up.

shape
Overtones used:
How fast they fade:
Sound:
Perfect shapeMain pitch plus overtones so farThe overtones themselves