Arrangement
Transport and mixer
EQ and filters
Modulation
Utility
Instruments
Audio UI
Roughens the sound like an early sampler. It keeps only some bits of each sample and holds each sample for several. It is a device: a state, a panel, an engine and tools, each its own file.
Installation
pnpm dlx shadcn@latest add @audio-ui/redux
It installs the device's state, its engine and its panel to components/audio-ui/devices/redux/. The demo above, which wires them to a loop, is @audio-ui/block-redux.
Controls
Controls · 4
Panel
The panel draws the stairs the bits make against the straight line of a clean sound. quantize(input, bits) is one step of the quantizer.
import { ReduxPanel } from "@/components/audio-ui/devices/redux/panel";
import { reduxDevice } from "@/components/audio-ui/devices/redux/device";
const [state, setState] = useState(() => reduxDevice.defaults());
<ReduxPanel onValueChange={setState} value={state} />;Engine
Create it, connect it and update it as for any device: see The engine.
The bits are a quantizer table in a WaveShaperNode, rebuilt only when they change. The sample hold is an AudioWorklet (REDUX_WORKLET is its source). Until it is ready the bits are already crushed and the rate is not yet reduced, and engine.ready resolves to false in a context that cannot run worklets. The hold takes whole samples, not a filtered resampling, so it aliases, which is the sound.