/ proof-of-concept / toy-instruments
Sign in
proof-of-concept / toy-instruments
toy-instruments / src / instruments / registry.ts
35 lines · 1.4 KBCodeBlameHistory
2import { CONFIGS } from './configs';
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
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.',
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.',
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.',
4a8abcfString of beads: 3D bead-spring solver, control panel, waveform, spectrogram, wav, displacement viewerJeremy Magland 34 { id: 'bead-bar', name: 'Bar', blurb: 'A stiff chain with bending springs, free ends: xylophone-like overtones.' },
35];
↑↓ move↵openescclose