Bitcrusher: a lo-fi audio effect

Hit play to start a song and listen to the distortive effect of modifying the bit depth and sample rate reduction parameters.

The bit depth slider controls the number of bits used to represent a given sample. The sample rate reduction slider affects the number of distinct samples in the signal. Increasing this value simulates sample rate reduction by making intervals of consecutive samples equal.

If your browser supports the AudioWorklet node, you can switch between the ScriptProcessor and AudioWorklet Bitcrusher implementations, but if switching occurs as audio is played, there may be an audible glitch, resulting from the ScriptProcessor's delay.

Script Processor
Audio Worklet