1import { mountInstrumentPage } from '../ui/instrumentPage';
2import { CONFIGS } from './configs';
4// the app loads the solver worker from its own file (the embedded widget inlines it)
5const makeWorker = () => new Worker(new URL('../sim/worker.ts', import.meta.url), { type: 'module' });
6const mount = (id: string) => (root: HTMLElement) => mountInstrumentPage(root, CONFIGS[id], { makeWorker });
8export interface Instrument {
9 id: string;
10 name: string;
11 blurb: string;
12 mount?: (root: HTMLElement) => void; // absent = not built yet
13}
15export const INSTRUMENTS: Instrument[] = [
16 {
17 id: 'bead-string',
18 name: 'String of beads',
19 blurb: 'Point masses joined by pre-tensioned springs, moving in 3D. Pluck, strike or hammer it; clamp, slide or free the ends; pin beads.',
20 mount: mount('bead-string'),
21 },
22 {
23 id: 'bead-drum',
24 name: 'Bead drum',
25 blurb: 'A round drumhead: a tensioned hex net of beads in a clamped rim. Hit it with a felt mallet, strike, push or press it.',
26 mount: mount('bead-drum'),
27 },
28 {
29 id: 'bead-cymbal',
30 name: 'Cymbal',
31 blurb: 'A thin bronze plate on felts at its centre, flat or with bow and bell. Hit it with a stick or mallet, at any angle; listen through a microphone.',
32 mount: mount('bead-cymbal'),
33 },
34 { id: 'bead-bar', name: 'Bar', blurb: 'A stiff chain with bending springs, free ends: xylophone-like overtones.' },
35];