FX INTRODUCTION / 04 / DRAFT
Bitcrusher: reduce precision
Turn sample values into coarse steps, then hold each value for several samples. Explore these two kinds of roughness separately.
This article is a work in progress. The examples will be refined through listening. Run starts playback; Stop ends it. Use Apply after editing values. Stop the playing iframe before trying another one.
Listen with the built-in FX
| Setting | Meaning |
|---|---|
| bitDepth | Bit depth controlling the amplitude steps |
| holdFrames | Number of samples to hold each value |
| mix | Wet signal proportion |
Select none in FX Monitor to see the waveform after the built-in FX. This pass-through effect makes input and output overlap; it does not compare the signal before and after the built-in FX.
How the PCM is processed
Amplitude quantization makes the value steps coarser. Sample holding reduces updates over time. Both can sound rough, but for different reasons. This example rounds the value, then repeats it for hold samples. Each audio channel has its own held value and counter.
input[ch][i] is one input sample. ch identifies a left or right audio channel, not a physical FM voice. Store values carried between blocks in state. Since process cannot access outer variables, put settings in context.
Try it with liveFx
Open in a separate Playground tab ↗
Select bitcrusher-lab in FX Monitor to compare the input and output of this process.
- Set hold to 1, then lower bits from 12 to 4.
- Restore bits to 16, then increase only hold from 1 to 16.
- Compare vertical steps in the waveform with horizontal flat sections.
Scope of this example
The quantization boundaries may differ from the built-in version. This learning example uses evenly spaced levels including the endpoints. An even number of levels also produces a small DC bias near zero. Holding samples is different from resampling with anti-aliasing.
The waveform shows changes over time; Spectrum shows the strength of frequency components. A short display window or smoothing can hide some changes. Listen while changing one setting at a time.