# Bitcrusher

> Reduces bit depth and sample rate: 2^bits levels, sample-and-hold with jitter, optional triangular dither.

Source: https://docs.tune.toys/nodes/std.crush/

Bitcrusher makes a sound lo-fi by quantizing it to fewer levels and sampling it less often, the grit of early samplers and game consoles.

## What it does

A sample-and-hold clock running at Rate captures every channel at once, like the converter of an old sampler. Each capture is rounded to a two's-complement grid of 2^Bits levels from -1 up to one step below full scale, and the held value plays until the next capture. Silence stays silent at any bit depth. Jitter varies each hold period randomly, from a generator seeded by the node's path so every host and replay agrees. Dither adds triangular noise of one step before rounding, which trades the harsh, signal-dependent distortion of a coarse grid for a steady hiss.

### Graphical preview

The screen compares a quiet 1 kHz sine with its crushed output over 4 ms, including Mix. Drag the inner right rail for Bits and the outer rail for Rate, or focus either handle and use the arrow keys (Shift for fine adjustment). This is an example of the nominal clock and quantizer; Jitter and Dither are not drawn. The same face is available in node cards, Properties and Frames.

## When to use it

Use it for lo-fi drums, chiptune leads and aliased, metallic textures. For smooth saturation use [Drive](https://docs.tune.toys/nodes/std.drive/); follow the crusher with a [State-variable filter](https://docs.tune.toys/nodes/std.svf/) low-pass to tame the aliasing.

## Ports

<!-- ports:start -->

| Port    | Direction | Signal | Lanes                   |
| ------- | --------- | ------ | ----------------------- |
| `audio` | Input     | Audio  | Inferred from the cable |
| `audio` | Output    | Audio  | Inferred from the cable |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter | Label  | Range       | Default | Unit | Scale  | Notes                                                                                                                               |
| --------- | ------ | ----------- | ------- | ---- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| `bits`    | Bits   | 1 to 24     | 8       |      | linear | Quantizer resolution: 2^bits levels across full scale, silence stays silent. Fractional values give intermediate steps.             |
| `rate_hz` | Rate   | 50 to 96000 | 12000   | Hz   | log    | Sample-and-hold rate. At or above the engine rate every sample passes.                                                              |
| `jitter`  | Jitter | 0 to 1      | 0       |      | linear | Random variation of each hold period, up to half a period either way at 1.                                                          |
| `dither`  | Dither | 0 to 1      | 0       |      | linear | Adds triangular dither of one step before quantizing. It sounds as noise on silence, so its tail is infinite. Choices: 0 Off, 1 On. |
| `mix`     | Mix    | 0 to 1      | 1       |      | linear | Dry/wet blend.                                                                                                                      |

<!-- parameters:end -->

### Bits (`bits`)

The quantizer resolution, from 1 to 24. Whole values give exactly 2^bits levels: 1 bit is two levels, 8 bits is 256. Fractional values give intermediate step sizes, so the depth can be swept smoothly.

### Rate (`rate_hz`)

The sample-and-hold rate, from 50 Hz to 96 kHz. Each held value lasts the engine rate divided by Rate samples; at or above the engine rate every sample passes.

### Jitter (`jitter`)

Random variation of each hold period, up to half a period either way at 1. It blurs the pitched whine that a steady low Rate adds.

### Dither (`dither`)

Off or On. On adds triangular dither of one step before rounding. Quiet details below one step survive as a noisy version of themselves instead of vanishing, and the dither keeps sounding on silence, so the node then reports an infinite tail.

### Mix (`mix`)

Dry and crushed blend.

## Tips

- Lower Rate first for the aliasing character, then lower Bits for grit.
- Very low bit depths are loud and harsh; turn Mix down or follow with a filter.

## See also

[Drive](https://docs.tune.toys/nodes/std.drive/), [State-variable filter](https://docs.tune.toys/nodes/std.svf/), [Noise](https://docs.tune.toys/nodes/std.noise/).
