Orbit-based UI component for Faust-style parameter control, driven by JSON metadata and callbacks.
faust-orbit-ui renders and manages an interactive Orbit control panel from Faust-like UI JSON.
You provide:
- a DOM root element,
- a UI JSON description,
- a callback
paramChangeByUI(path, value).
- No DSP/audio engine.
- No WebAudio integration.
- No Faust compiler/runtime dependency.
It is a UI layer only.
Run commands from the repository root.
- Install dependencies:
npm install- Build package:
npm run build- Start demo server:
npm run demo:serve- Open:
http://localhost:4173/demo/index.html
<div id="orbit-root" style="height: 480px"></div>
<link rel="stylesheet" href="./dist/faust-orbit-ui.css" />
<script type="module">
import { FaustOrbitUI } from './dist/index.js';
const ui = [
{
type: 'vgroup',
label: 'synth',
items: [
{ type: 'hslider', label: 'frequency', address: '/synth/frequency', min: 20, max: 2000, step: 1 },
{ type: 'hslider', label: 'pressure', address: '/synth/pressure', min: 0, max: 1, step: 0.01 },
{ type: 'button', label: 'trigger', address: '/synth/trigger' }
]
}
];
const root = document.getElementById('orbit-root');
const orbit = new FaustOrbitUI(root, (path, value) => {
console.log('paramChangeByUI', path, value);
});
const state = orbit.buildControlsFromUnknown(ui);
orbit.setOrbitState(state);
</script>new FaustOrbitUI(root, paramChangeByUI, options?)root: HTMLElementparamChangeByUI: (path: string, value: number) => voidoptions?: FaustOrbitUIOptions
buildControlsFromUnknown(input: unknown): OrbitStatesetOrbitState(state: OrbitState): voidgetOrbitState(): OrbitStatesetParamValue(path: string, value: number): voidrandom(c: number): voidcenter(): voidbeginUpdate(): voidendUpdate(): voiddestroy(): void
Main options in FaustOrbitUIOptions:
title?: stringdisabledPaths?: string[]onOrbitStateChange?: (state) => voidonInteractionStart?: () => voidonInteractionEnd?: () => voidtooltips?: { ... }
Input should follow the common Faust UI metadata shape:
- groups:
vgroup,hgroup,tgroup - active widgets:
hslider,vslider,nentry,button,checkbox - passive widgets are parsed but not interactive controls in Orbit.
Unknown nodes are ignored. Invalid top-level input (not an array) throws.
The package exposes Orbit stylesheet at:
faust-orbit-ui/faust-orbit-ui.css
No automatic style injection is done by JS.
You must include the CSS in your host app.
demo/is only an example app.src/+dist/are the package itself.
Port 4173 is already used.
Use another port:
python3 -m http.server 4174 -d .Then open http://localhost:4174/demo/index.html.
Check both:
- CSS is loaded (
faust-orbit-ui.css). - Root element has explicit height (or parent layout gives it height).
src/: package sourcedist/: build outputdemo/: browser demo app
Before publishing to npm:
- Remove
"private": truefrompackage.json. - Bump
version. - Build with
npm run build. - Publish with
npm publish --access public.
