audio/ui
Toggle Mode D
Audio UI
Play a sound through it
Copy Registry URL
Sets the level and the stereo image of a signal. It has no display, so its panel is only as tall as its controls. It is a device: a state, a panel, an engine and tools, each its own file.
Installation
Copy to Clipboardpnpm dlx shadcn@latest add @audio-ui/utility
It installs the device's state, its engine and its panel to components/audio-ui/devices/utility/. The demo above, which wires them to a loop, is @audio-ui/block-utility.
Controls
Controls · 6
Turns the device on. Off, the signal passes through unchanged.
The level of the signal.
Moves the signal between the left and the right.
The width of the stereo image. 0 is mono, 100 % is the input as it is and 200 % is twice as wide.
Sums the two channels to one.
Flips the phase of the signal.
Panel
The panel is the controls and nothing else. utilitySettings(state) gives the numbers that go on the nodes.
Copy to Clipboardimport { UtilityPanel } from "@/components/audio-ui/devices/utility/panel"; import { utilityDevice } from "@/components/audio-ui/devices/utility/device"; const [state, setState] = useState(() => utilityDevice.defaults()); <UtilityPanel onValueChange={setState} value={state} />;
Engine
Create it, connect it and update it as for any device: see The engine.
The signal is split into mid and side, and the width scales the side. A mono input is spread to both sides first. Off, the signal passes unchanged.